232
233
234
235
236
237
238
239
240
241
|
# File 'lib/inspec_tools/plugin_cli.rb', line 232
def compliance
if options[:threshold_file].nil? && options[:threshold_inline].nil?
puts 'Please provide threshold as a yaml file or inline yaml'
exit(1)
end
threshold = YAML.load_file(options[:threshold_file]) unless options[:threshold_file].nil?
threshold = YAML.safe_load(options[:threshold_inline]) unless options[:threshold_inline].nil?
compliance = InspecTools::Summary.new(File.read(options[:inspec_json])).threshold(threshold)
compliance ? exit(0) : exit(1)
end
|