mirror of
https://github.com/github/choosealicense.com
synced 2025-01-08 20:54:34 +01:00
Merge branch 'gh-pages' into patch-1
This commit is contained in:
commit
3c6df021c7
1
Gemfile
1
Gemfile
@ -17,7 +17,6 @@ end
|
|||||||
group :test do
|
group :test do
|
||||||
gem 'html-proofer', '~> 3.0'
|
gem 'html-proofer', '~> 3.0'
|
||||||
gem 'licensee'
|
gem 'licensee'
|
||||||
gem 'nokogiri'
|
|
||||||
gem 'rake'
|
gem 'rake'
|
||||||
gem 'rspec'
|
gem 'rspec'
|
||||||
gem 'rubocop'
|
gem 'rubocop'
|
||||||
|
@ -69,7 +69,7 @@ The licenses on choosealicense.com are regularly imported to GitHub.com to be us
|
|||||||
* `project` - The repository name
|
* `project` - The repository name
|
||||||
* `description` - The description of the repository
|
* `description` - The description of the repository
|
||||||
* `year` - The current year
|
* `year` - The current year
|
||||||
* `project_url` - The repository URL or other project website
|
* `projecturl` - The repository URL or other project website
|
||||||
|
|
||||||
## License properties
|
## License properties
|
||||||
|
|
||||||
|
@ -22,5 +22,5 @@
|
|||||||
- name: year
|
- name: year
|
||||||
description: The current year
|
description: The current year
|
||||||
|
|
||||||
- name: project_url
|
- name: projecturl
|
||||||
description: The repository URL or other project website
|
description: The repository URL or other project website
|
||||||
|
@ -34,7 +34,7 @@ Copyright (c) [year] [fullname]. All rights reserved.
|
|||||||
|
|
||||||
Developed by: [project]
|
Developed by: [project]
|
||||||
[fullname]
|
[fullname]
|
||||||
[project_url]
|
[projecturl]
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person
|
Permission is hereby granted, free of charge, to any person
|
||||||
obtaining a copy of this software and associated documentation files
|
obtaining a copy of this software and associated documentation files
|
||||||
|
@ -52,6 +52,7 @@ approvals.each do |approver, licenses|
|
|||||||
rows << ["#{approver} approved", licenses.include?(license)]
|
rows << ["#{approver} approved", licenses.include?(license)]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
license_ids = licenses.map { |l| l['id'] }
|
||||||
current = license_ids.include?(license)
|
current = license_ids.include?(license)
|
||||||
rows << ['Current license', current]
|
rows << ['Current license', current]
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@ require 'jekyll'
|
|||||||
require 'json'
|
require 'json'
|
||||||
require 'licensee'
|
require 'licensee'
|
||||||
require 'open-uri'
|
require 'open-uri'
|
||||||
require 'nokogiri'
|
|
||||||
|
|
||||||
module SpecHelper
|
module SpecHelper
|
||||||
class << self
|
class << self
|
||||||
@ -86,7 +85,7 @@ def spdx_ids
|
|||||||
end
|
end
|
||||||
|
|
||||||
def find_spdx(license)
|
def find_spdx(license)
|
||||||
spdx_list.find { |name, _properties| name == license }
|
spdx_list.find { |name, _properties| name.casecmp(license).zero? }
|
||||||
end
|
end
|
||||||
|
|
||||||
def osi_approved_licenses
|
def osi_approved_licenses
|
||||||
@ -102,23 +101,15 @@ end
|
|||||||
|
|
||||||
def fsf_approved_licenses
|
def fsf_approved_licenses
|
||||||
SpecHelper.fsf_approved_licenses ||= begin
|
SpecHelper.fsf_approved_licenses ||= begin
|
||||||
url = 'https://www.gnu.org/licenses/license-list.en.html'
|
url = 'https://wking.github.io/fsf-api/licenses-full.json'
|
||||||
doc = Nokogiri::HTML(open(url).read)
|
object = JSON.parse(open(url).read)
|
||||||
list = doc.css('.green dt')
|
|
||||||
licenses = {}
|
licenses = {}
|
||||||
list.each do |license|
|
object.each_value do |meta|
|
||||||
a = license.css('a').find { |link| !link.text.nil? && !link.text.empty? && link.attr('id') }
|
next unless (meta.include? 'identifiers') && (meta['identifiers'].include? 'spdx') && (meta.include? 'tags') && (meta['tags'].include? 'libre')
|
||||||
next if a.nil?
|
meta['identifiers']['spdx'].each do |identifier|
|
||||||
id = a.attr('id').downcase
|
licenses[identifier.downcase] = meta['name']
|
||||||
name = a.text.strip
|
|
||||||
licenses[id] = name
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# FSF approved the Clear BSD, but doesn't use its SPDX ID or Name
|
|
||||||
if licenses.keys.include? 'clearbsd'
|
|
||||||
licenses['bsd-3-clause-clear'] = licenses['clearbsd']
|
|
||||||
end
|
end
|
||||||
|
|
||||||
licenses
|
licenses
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user