Class: Wlog::FetchGitCommits
- Inherits:
-
Commandable
- Object
- Commandable
- Wlog::FetchGitCommits
- Defined in:
- lib/wlog/commands/fetch_git_commits.rb
Overview
Instance Attribute Summary collapse
-
#commits ⇒ Object
Returns the value of attribute commits.
Instance Method Summary collapse
-
#execute ⇒ Object
Run the parser on the repo; yield commits.
-
#initialize(from, to, repo, author = nil) ⇒ FetchGitCommits
constructor
Configuration to query the git repo for the required commits.
Constructor Details
#initialize(from, to, repo, author = nil) ⇒ FetchGitCommits
Configuration to query the git repo for the required commits. You can specify a date range and an author. You need to provide a path to the git repository.
21 22 23 |
# File 'lib/wlog/commands/fetch_git_commits.rb', line 21 def initialize(from, to, repo, =nil) @from, @to, @repo, @author = from, to, repo, end |
Instance Attribute Details
#commits ⇒ Object
Returns the value of attribute commits.
31 32 33 |
# File 'lib/wlog/commands/fetch_git_commits.rb', line 31 def commits @commits end |
Instance Method Details
#execute ⇒ Object
Run the parser on the repo; yield commits
26 27 28 29 |
# File 'lib/wlog/commands/fetch_git_commits.rb', line 26 def execute result = `#{run_git_cmd}` @commits = GitCommitParser.parse(result) nil end |