Class: Herodotus::Git
- Inherits:
-
Object
- Object
- Herodotus::Git
- Defined in:
- lib/herodotus/git.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
- #commits(since_ref = nil) ⇒ Object
-
#initialize(base_path = nil) ⇒ Git
constructor
A new instance of Git.
Constructor Details
#initialize(base_path = nil) ⇒ Git
Returns a new instance of Git.
4 5 6 7 |
# File 'lib/herodotus/git.rb', line 4 def initialize(base_path = nil) @base_path = base_path || Configuration.config.base_path @repo = Grit::Repo.new(guess_repo) end |
Instance Attribute Details
#base_path ⇒ Object
Returns the value of attribute base_path.
3 4 5 |
# File 'lib/herodotus/git.rb', line 3 def base_path @base_path end |
#repo ⇒ Object
Returns the value of attribute repo.
3 4 5 |
# File 'lib/herodotus/git.rb', line 3 def repo @repo end |
Instance Method Details
#commits(since_ref = nil) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/herodotus/git.rb', line 9 def commits(since_ref = nil) if since_ref output = repo.git.rev_list({'pretty' => 'raw'}, "#{since_ref}..") Grit::Commit.list_from_string(repo, output) else Grit::Commit.find_all(@repo, since_ref) end end |