Correct output bug in the NOTICE-ruby generator

This commit is contained in:
Eric 2020-06-05 12:56:20 -05:00
parent 578779ee90
commit 34a7282742
2 changed files with 5973 additions and 3 deletions

File diff suppressed because one or more lines are too long

View file

@ -19,18 +19,19 @@ namespace :notice do
:timeout => 120 :timeout => 120
} }
result = HTTParty.post("https://api.clearlydefined.io/notices", @options.merge(body:JSON::generate({coordinates: result}))) result = HTTParty.post("https://api.clearlydefined.io/notices", @options.merge(body:JSON::generate({coordinates: result})))
JSON::parse(result.body)['content']
end end
desc "generating NOTICE-ruby from ClearlyDefined.io" desc "generating NOTICE-ruby from ClearlyDefined.io"
task :update do task :update do
result = get_notice_ruby result = get_notice_ruby
File.write('NOTICE-ruby', result.body) File.write('NOTICE-ruby', result)
end end
desc "checking whether NOTICE-ruby matches the one on ClearlyDefined.io" desc "checking whether NOTICE-ruby matches the one on ClearlyDefined.io"
task :verify do task :verify do
result = get_notice_ruby result = get_notice_ruby
raise "NOTICE-ruby is not up to date. Run bin/rails notice:ruby:update to update the file." if result.body != File.read('NOTICE-ruby') raise "NOTICE-ruby is not up to date. Run bin/rails notice:ruby:update to update the file." if result != File.read('NOTICE-ruby')
end end
end end