Class: GitPissed::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/git_pissed/cli.rb

Instance Method Summary collapse

Instance Method Details

#csvObject



16
17
18
# File 'lib/git_pissed/cli.rb', line 16

def csv
  @csv ||= CSV.new(words_by_date, options)
end

#executeObject



3
4
5
6
# File 'lib/git_pissed/cli.rb', line 3

def execute
  puts "Measuring #{options.words.join(', ')}..."
  puts "\n#{formatted_output}"
end

#formatted_outputObject



12
13
14
# File 'lib/git_pissed/cli.rb', line 12

def formatted_output
  send options.format
end

#htmlObject



20
21
22
# File 'lib/git_pissed/cli.rb', line 20

def html
  @html ||= HTML.new(words_by_date, options)
end

#optionsObject



8
9
10
# File 'lib/git_pissed/cli.rb', line 8

def options
  @options ||= Options.new.parse!
end

#words_by_dateObject



24
25
26
27
28
29
# File 'lib/git_pissed/cli.rb', line 24

def words_by_date
  WordFinder.new(
    Git.new(options).revisions,
    options
  ).by_date
end