Class: Repokeeper::SimpleTextFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/repokeeper/simple_text_formatter.rb

Instance Method Summary collapse

Constructor Details

#initialize(out_stream = $stdout) ⇒ SimpleTextFormatter

Returns a new instance of SimpleTextFormatter.



3
4
5
# File 'lib/repokeeper/simple_text_formatter.rb', line 3

def initialize(out_stream = $stdout)
  @out_stream = out_stream
end

Instance Method Details

#branches_analyzer_results(analyzer_name, offenses) ⇒ Object



16
17
18
# File 'lib/repokeeper/simple_text_formatter.rb', line 16

def branches_analyzer_results(analyzer_name, offenses)
  @branches[analyzer_name].concat(Array(offenses))
end

#commits_analyzer_results(analyzer_name, offenses) ⇒ Object



12
13
14
# File 'lib/repokeeper/simple_text_formatter.rb', line 12

def commits_analyzer_results(analyzer_name, offenses)
  @commits[analyzer_name].concat(Array(offenses))
end

#finishedObject



20
21
22
23
# File 'lib/repokeeper/simple_text_formatter.rb', line 20

def finished
  write_results(@commits, :commit_offense_message)
  write_results(@branches, :branch_offense_message)
end

#startedObject



7
8
9
10
# File 'lib/repokeeper/simple_text_formatter.rb', line 7

def started
  @commits = Hash.new { |h, k| h[k] = [] }
  @branches = Hash.new { |h, k| h[k] = [] }
end