Merge pull request #263 from wwahammy/correct_notice_task

Correct output bug in the NOTICE-ruby generator
This commit is contained in:
Eric Schultz 2020-06-05 13:10:47 -05:00 committed by GitHub
commit ee93afea6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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