Sha256: de4ec20a3b3ad8e738974f3844f9bb4975fef2d10e74566010d0e3582fdfc0b9
Contents?: true
Size: 591 Bytes
Versions: 15
Compression:
Stored size: 591 Bytes
Contents
Dir.glob("#{__dir__}/*.rb").each { |file| require file } require 'json' class JsonFileValidator < ValidationStrategy def initialize(json_files) @json_files = json_files end def validate(project_path = nil) @json_files.each do |json_file| begin path = json_file JSON.parse(File.read(path)) Solara.logger.passed("Valid JSON: #{path}") rescue JSON::ParserError => e raise ValidationError, "Not valid JSON: #{path}. Error: #{e.message}" end end end end
Version data entries
15 entries across 15 versions & 1 rubygems