Class: Canvas::ValidJsonCheck
- Defined in:
- lib/canvas/checks/valid_json_check.rb
Overview
:documented:
Instance Attribute Summary
Attributes inherited from Check
Instance Method Summary collapse
Methods inherited from Check
Constructor Details
This class inherits a constructor from Canvas::Check
Instance Method Details
#run ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/canvas/checks/valid_json_check.rb', line 6 def run json_files.each do |filename| file = File.read(filename) validator = Validator::Json.new(file) next if validator.validate validator.errors.each do || @offenses << Offense.new( message: "Invalid JSON: #{filename} - \n#{}" ) end end end |