Class: Inputs::CoffeeLintRaw
- Inherits:
-
Object
- Object
- Inputs::CoffeeLintRaw
- Defined in:
- lib/stash_pull_request_commenter/inputs/coffeelint_raw.rb
Instance Attribute Summary collapse
-
#filename ⇒ Object
Returns the value of attribute filename.
Instance Method Summary collapse
- #comments ⇒ Object
-
#initialize(filename = 'coffeelint_report.json') ⇒ CoffeeLintRaw
constructor
A new instance of CoffeeLintRaw.
Constructor Details
#initialize(filename = 'coffeelint_report.json') ⇒ CoffeeLintRaw
Returns a new instance of CoffeeLintRaw.
8 9 10 11 12 |
# File 'lib/stash_pull_request_commenter/inputs/coffeelint_raw.rb', line 8 def initialize(filename = 'coffeelint_report.json') self.filename = filename fail "#{filename} does not exist" unless File.exist?(filename) end |
Instance Attribute Details
#filename ⇒ Object
Returns the value of attribute filename.
6 7 8 |
# File 'lib/stash_pull_request_commenter/inputs/coffeelint_raw.rb', line 6 def filename @filename end |
Instance Method Details
#comments ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/stash_pull_request_commenter/inputs/coffeelint_raw.rb', line 14 def comments report.map do |file, problems| problems.map do |problem| Comment.new( file: file, line: problem['lineNumber'], text: "(#{problem['level']}) #{problem['message']}" ) end end.flatten end |