Class: GitLeadTime::LeadTimeCommand
- Inherits:
-
Object
- Object
- GitLeadTime::LeadTimeCommand
- Defined in:
- lib/git_lead_time/lead_time_command.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#first_commit_finder ⇒ Object
readonly
Returns the value of attribute first_commit_finder.
Instance Method Summary collapse
- #format_merge(merge) ⇒ Object
-
#initialize(ref = "HEAD") ⇒ LeadTimeCommand
constructor
A new instance of LeadTimeCommand.
- #merges ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize(ref = "HEAD") ⇒ LeadTimeCommand
Returns a new instance of LeadTimeCommand.
7 8 9 |
# File 'lib/git_lead_time/lead_time_command.rb', line 7 def initialize(ref="HEAD") @first_commit_finder = FirstCommitFinder.new(ref) end |
Instance Attribute Details
#first_commit_finder ⇒ Object (readonly)
Returns the value of attribute first_commit_finder.
6 7 8 |
# File 'lib/git_lead_time/lead_time_command.rb', line 6 def first_commit_finder @first_commit_finder end |
Instance Method Details
#format_merge(merge) ⇒ Object
19 20 21 |
# File 'lib/git_lead_time/lead_time_command.rb', line 19 def format_merge(merge) Format.new(Merge.new(merge, first_commit_finder)).to_s end |
#merges ⇒ Object
15 16 17 |
# File 'lib/git_lead_time/lead_time_command.rb', line 15 def merges `git rev-list --merges --first-parent HEAD | head -10`.lines.map(&:chomp) end |
#run ⇒ Object
11 12 13 |
# File 'lib/git_lead_time/lead_time_command.rb', line 11 def run merges.map { |merge| format_merge(merge) } end |