diff --git a/Gemfile b/Gemfile index 6285dab..84fd12d 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,5 @@ # frozen_string_literal: true + source 'https://rubygems.org' require 'json' diff --git a/Rakefile b/Rakefile index 01734ae..360bfdf 100644 --- a/Rakefile +++ b/Rakefile @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'html-proofer' require 'rspec/core/rake_task' @@ -26,7 +27,7 @@ task :approved_licenses do puts approved.join(', ') puts "\n" - potential = approved - licenses.map { |l| l['id'] } + potential = approved - (licenses.map { |l| l['id'] }) puts "#{potential.count} potential additions:" puts potential.join(', ') end diff --git a/script/check-approval b/script/check-approval index 2e4c9d2..6b491db 100755 --- a/script/check-approval +++ b/script/check-approval @@ -1,5 +1,6 @@ #!/usr/bin/env ruby # frozen_string_literal: true + # Checks if a given license meets the approval criteria to be added to choosealicense.com # See https://github.com/github/choosealicense.com/blob/gh-pages/CONTRIBUTING.md#adding-a-license # Usage: script/check-approval [SPDX LICENSE ID] diff --git a/script/generate-docs b/script/generate-docs index b4edae4..4940d69 100755 --- a/script/generate-docs +++ b/script/generate-docs @@ -1,5 +1,6 @@ #!/usr/bin/env ruby # frozen_string_literal: true + # Usage: script/generate-docs # Reads in the fields, meta, and rules YAML files and produces markdown output # suitable for documenting in the project's README diff --git a/spec/ci_ruby_version_spec.rb b/spec/ci_ruby_version_spec.rb index b61c7c5..6809848 100644 --- a/spec/ci_ruby_version_spec.rb +++ b/spec/ci_ruby_version_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'json' require 'open-uri' require 'spec_helper' diff --git a/spec/license_bom_spec.rb b/spec/license_bom_spec.rb index a3e2798..bed1d1e 100644 --- a/spec/license_bom_spec.rb +++ b/spec/license_bom_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'spec_helper' describe 'byte order marks' do diff --git a/spec/license_fields_spec.rb b/spec/license_fields_spec.rb index bac33e9..4215f37 100644 --- a/spec/license_fields_spec.rb +++ b/spec/license_fields_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'spec_helper' describe 'license fillable fields' do @@ -6,7 +7,7 @@ describe 'license fillable fields' do context "The #{license['title']} license" do it 'should only contain supported fillable fields' do matches = license['content'].scan(/\[([a-z]+)\]/) - extra_fields = matches.flatten - fields.map { |f| f['name'] } + extra_fields = matches.flatten - (fields.map { |f| f['name'] }) expect(extra_fields).to be_empty end end diff --git a/spec/license_meta_spec.rb b/spec/license_meta_spec.rb index 60ea68b..2e5b8c3 100644 --- a/spec/license_meta_spec.rb +++ b/spec/license_meta_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'spec_helper' describe 'license meta' do @@ -8,7 +9,7 @@ describe 'license meta' do context "The #{license['title']} license" do it 'should only contain supported meta fields' do - extra_fields = raw_fields.keys - meta.map { |m| m['name'] } + extra_fields = raw_fields.keys - (meta.map { |m| m['name'] }) expect(extra_fields).to be_empty end diff --git a/spec/license_rules_spec.rb b/spec/license_rules_spec.rb index 83137c2..450c164 100644 --- a/spec/license_rules_spec.rb +++ b/spec/license_rules_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'spec_helper' describe 'license rules' do diff --git a/spec/license_shown_spec.rb b/spec/license_shown_spec.rb index d2b50e4..4ef3f8c 100644 --- a/spec/license_shown_spec.rb +++ b/spec/license_shown_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'spec_helper' describe 'shown licenses' do diff --git a/spec/license_spec.rb b/spec/license_spec.rb index 95e6f43..0fd8a96 100644 --- a/spec/license_spec.rb +++ b/spec/license_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'spec_helper' describe 'licenses' do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c99daf6..ab89492 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'jekyll' require 'open-uri' require 'json' @@ -42,7 +43,7 @@ def licenses end def shown_licenses - licenses.select { |l| !l['hidden'] } + licenses.reject { |l| l['hidden'] } end def site