Class: Leandocument::Repository
- Inherits:
-
Object
- Object
- Leandocument::Repository
- Defined in:
- lib/leandocument/repository.rb
Instance Attribute Summary collapse
-
#base_path ⇒ Object
Returns the value of attribute base_path.
-
#repo ⇒ Object
Returns the value of attribute repo.
Instance Method Summary collapse
- #branches(id = nil) ⇒ Object
- #commits(id = nil) ⇒ Object
-
#initialize(options = {}) ⇒ Repository
constructor
A new instance of Repository.
Constructor Details
#initialize(options = {}) ⇒ Repository
Returns a new instance of Repository.
5 6 7 8 |
# File 'lib/leandocument/repository.rb', line 5 def initialize( = {}) self.base_path = [:base_path] || Dir.pwd self.repo = Grit::Repo.new(self.base_path) end |
Instance Attribute Details
#base_path ⇒ Object
Returns the value of attribute base_path.
3 4 5 |
# File 'lib/leandocument/repository.rb', line 3 def base_path @base_path end |
#repo ⇒ Object
Returns the value of attribute repo.
3 4 5 |
# File 'lib/leandocument/repository.rb', line 3 def repo @repo end |
Instance Method Details
#branches(id = nil) ⇒ Object
14 15 16 |
# File 'lib/leandocument/repository.rb', line 14 def branches(id = nil) id.nil?? self.repo.branches : self.repo.branches(id).first end |
#commits(id = nil) ⇒ Object
10 11 12 |
# File 'lib/leandocument/repository.rb', line 10 def commits(id = nil) id.nil?? self.repo.commits : self.repo.commits(id) end |