Class: Fasterer::Github::OutputComposer
- Inherits:
-
Object
- Object
- Fasterer::Github::OutputComposer
- Defined in:
- lib/fasterer/github/output_composer.rb
Constant Summary collapse
- CONFIG_FILE_NAME =
'.fasterer.yml'
- SPEEDUPS_KEY =
'speedups'
Instance Method Summary collapse
- #add_api_errors(new_api_errors) ⇒ Object
- #add_errors(path) ⇒ Object
- #add_offences(offences, path) ⇒ Object
-
#initialize(owner, repo, ignored_offences) ⇒ OutputComposer
constructor
A new instance of OutputComposer.
- #result ⇒ Object
Constructor Details
#initialize(owner, repo, ignored_offences) ⇒ OutputComposer
Returns a new instance of OutputComposer.
8 9 10 11 12 |
# File 'lib/fasterer/github/output_composer.rb', line 8 def initialize(owner, repo, ignored_offences) @repo_owner = owner @repo_name = repo @ignored_offences = ignored_offences end |
Instance Method Details
#add_api_errors(new_api_errors) ⇒ Object
26 27 28 |
# File 'lib/fasterer/github/output_composer.rb', line 26 def add_api_errors(new_api_errors) new_api_errors.each { |e| api_errors << e } end |
#add_errors(path) ⇒ Object
22 23 24 |
# File 'lib/fasterer/github/output_composer.rb', line 22 def add_errors(path) errors << { path: path } end |
#add_offences(offences, path) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/fasterer/github/output_composer.rb', line 14 def add_offences(offences, path) offences.each do |offence_name, lines| details = { path: path, lines: lines } next if ignored_offences.include?(offence_name) (fasterer_offences[offence_name] ||= []) << details end end |
#result ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'lib/fasterer/github/output_composer.rb', line 30 def result { repo_owner: repo_owner, repo_name: repo_name, fasterer_offences: fasterer_offences, errors: errors, api_errors: api_errors } end |