1
0
mirror of https://github.com/github/choosealicense.com synced 2024-11-05 11:18:50 +01:00

Merge pull request #579 from wking/update-fsf-api-structure

spec_helper: Adjust to new 'licenses' key in the FSF API
This commit is contained in:
Mike Linksvayer 2018-04-07 16:45:04 -07:00 committed by GitHub
commit 1c8e3d1439
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -104,7 +104,7 @@ def fsf_approved_licenses
url = 'https://wking.github.io/fsf-api/licenses-full.json'
object = JSON.parse(OpenURI.open_uri(url).read)
licenses = {}
object.each_value do |meta|
object['licenses'].each_value do |meta|
next unless (meta.include? 'identifiers') && (meta['identifiers'].include? 'spdx') && (meta.include? 'tags') && (meta['tags'].include? 'libre')
meta['identifiers']['spdx'].each do |identifier|
licenses[identifier.downcase] = meta['name']