class GitLeadTime::LeadTimeCommand

Attributes

branch[R]
output[R]

Public Class Methods

new(ref="HEAD", output: $stdout) click to toggle source
# File lib/git_lead_time/lead_time_command.rb, line 8
def initialize(ref="HEAD", output: $stdout)
  @branch = Branch.new(ref)
  @output = output
end

Public Instance Methods

format_merge(merge) click to toggle source
# File lib/git_lead_time/lead_time_command.rb, line 21
def format_merge(merge)
  LeadTimeFormat.new(merge).to_s
end
run() click to toggle source
# File lib/git_lead_time/lead_time_command.rb, line 13
def run
  branch.each_merge do |merge|
    output.puts format_merge(merge)
  end
rescue Errno::EPIPE
  # Our buffer got closed by `head` or the like.
end