Class: Repokeeper::SimpleTextFormatter
- Inherits:
-
Object
- Object
- Repokeeper::SimpleTextFormatter
- Defined in:
- lib/repokeeper/simple_text_formatter.rb
Instance Method Summary collapse
- #branches_analyzer_results(analyzer_name, offenses) ⇒ Object
- #commits_analyzer_results(analyzer_name, offenses) ⇒ Object
- #finished ⇒ Object
-
#initialize(out_stream = $stdout) ⇒ SimpleTextFormatter
constructor
A new instance of SimpleTextFormatter.
- #started ⇒ Object
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 |
#finished ⇒ Object
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 |
#started ⇒ Object
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 |