class Monolith::Repository
Attributes
path[R]
url[R]
Public Class Methods
new(path, url = nil)
click to toggle source
# File lib/monolith/repository.rb 11 def initialize(path, url = nil) 12 @path = path 13 @url = url 14 end
Public Instance Methods
branches()
click to toggle source
# File lib/monolith/repository.rb 16 def branches 17 BranchFinder.new(self) 18 end
clone()
click to toggle source
# File lib/monolith/repository.rb 20 def clone 21 git.clone(url) unless cloned? 22 end
name()
click to toggle source
# File lib/monolith/repository.rb 24 def name 25 @path.split("/").last 26 end
prepare(branch)
click to toggle source
# File lib/monolith/repository.rb 28 def prepare(branch) 29 BranchPreparer.new(self, branch).prepare 30 end
relative_path()
click to toggle source
# File lib/monolith/repository.rb 32 def relative_path 33 @path.split("/").tap(&:shift).join("/") 34 end
remote(repo)
click to toggle source
# File lib/monolith/repository.rb 36 def remote(repo) 37 Remote.new(self, repo) 38 end
Private Instance Methods
git()
click to toggle source
# File lib/monolith/repository.rb 42 def git 43 @git ||= Git.new(path) 44 end