From e630ac7f29b59ed2a73b4cab201e673556d8f66b Mon Sep 17 00:00:00 2001 From: Mike Linksvayer Date: Tue, 2 Jan 2018 14:24:52 -0800 Subject: [PATCH 1/3] project_url field --- README.md | 1 + _data/fields.yml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/README.md b/README.md index 87c5bb6..5cf6ebf 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,7 @@ The licenses on choosealicense.com are regularly imported to GitHub.com to be us * `project` - The repository name * `description` - The description of the repository * `year` - The current year +* `project_url` - The repository URL or other project website ## License properties diff --git a/_data/fields.yml b/_data/fields.yml index 0b5f45d..e239043 100644 --- a/_data/fields.yml +++ b/_data/fields.yml @@ -21,3 +21,6 @@ - name: year description: The current year + +- name: project_url + description: The repository URL or other project website From d7bf3ac98a8a0b1e52731539dd25fbe56c9ed91b Mon Sep 17 00:00:00 2001 From: Mike Linksvayer Date: Tue, 2 Jan 2018 14:25:04 -0800 Subject: [PATCH 2/3] Revert "rm no longer relevant test" This reverts commit 5e7b07f998e9264092b8e1274f99605ead412138. --- spec/license_fields_spec.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 spec/license_fields_spec.rb diff --git a/spec/license_fields_spec.rb b/spec/license_fields_spec.rb new file mode 100644 index 0000000..af0a177 --- /dev/null +++ b/spec/license_fields_spec.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'license fillable fields' do + licenses.each do |license| + context "The #{license['title']} license" do + it 'should only contain supported fillable fields' do + matches = license['content'][0, 1000].scan(/\[([a-z]+)\]/) + extra_fields = matches.flatten - (fields.map { |f| f['name'] }) + expect(extra_fields).to be_empty + end + end + end +end From 316bd0b828f90959475e58b423823bf1e342b27f Mon Sep 17 00:00:00 2001 From: Mike Linksvayer Date: Tue, 2 Jan 2018 14:35:04 -0800 Subject: [PATCH 3/3] match _ fields, require preceding space (ex CECILL-2.1) --- spec/license_fields_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/license_fields_spec.rb b/spec/license_fields_spec.rb index af0a177..4856f35 100644 --- a/spec/license_fields_spec.rb +++ b/spec/license_fields_spec.rb @@ -6,7 +6,7 @@ describe 'license fillable fields' do licenses.each do |license| context "The #{license['title']} license" do it 'should only contain supported fillable fields' do - matches = license['content'][0, 1000].scan(/\[([a-z]+)\]/) + matches = license['content'][1, 1000].scan(/\s+\[([a-z_]+)\]/) extra_fields = matches.flatten - (fields.map { |f| f['name'] }) expect(extra_fields).to be_empty end