class Herodot::Output

Constants

COLORS
EMPTY_WORKLOG_MESSAGE
HEADERS

Public Class Methods

convert_format(worklogs_totals_per_day, format) click to toggle source
# File lib/herodot/output.rb, line 26
def convert_format(worklogs_totals_per_day, format)
  case format
  when 'json'
    worklogs_totals_per_day.to_json
  end
end
format_time(time_is_seconds) click to toggle source
# File lib/herodot/output.rb, line 13
def format_time(time_is_seconds)
  total_seconds = time_is_seconds.to_i
  seconds = total_seconds % 60
  minutes = (total_seconds / 60) % 60
  hours = total_seconds / (60 * 60)
  "#{hours}:#{minutes.to_s.rjust(2, '0')}:#{seconds.to_s.rjust(2, '0')}"
end
print(worklogs_totals_per_day, opts) click to toggle source
print_table(worklogs_totals_per_day) click to toggle source

Private Class Methods

colorize(project) click to toggle source
# File lib/herodot/output.rb, line 48
def colorize(project)
  Rainbow(project).color(COLORS[project.chars.map(&:ord).reduce(:+) % COLORS.size])
end
print_day(times) click to toggle source
times_by_project_and_branch(times) click to toggle source
# File lib/herodot/output.rb, line 52
def times_by_project_and_branch(times)
  times.sort_by { |log| [log[:project], log[:branch]] }
end