Add files

This commit is contained in:
Arpit Jalan 2014-06-29 01:15:26 +05:30
parent 11096e77fc
commit 9bcedfafb8
2 changed files with 5 additions and 2 deletions

View File

@ -15,7 +15,7 @@ module DockerManager
repos << DockerManager::GitRepo.new(File.dirname(p.path), p.name)
end
repos.map! do |r|
result = {name: r.name, path: r.path }
result = {name: r.name, path: r.path, branch: r.branch }
if r.valid?
result[:id] = r.name.downcase.gsub(/[^a-z]/, '_').gsub(/_+/, '_').sub(/_$/, '')
result[:version] = r.latest_local_commit

View File

@ -1,11 +1,14 @@
# like Grit just very very minimal
class DockerManager::GitRepo
attr_reader :path, :name
attr_reader :path, :name, :branch
def initialize(path, name=nil)
@path = path
@name = name
@memoize = {}
# For discourse proper, return tracking branch
@branch = (path == Rails.root.to_s) ? tracking_branch : 'master'
end
def start_upgrading