From 2459e4ff99b522850c106f74e1f990f8aaa4b057 Mon Sep 17 00:00:00 2001 From: Mike Linksvayer Date: Sat, 30 Dec 2017 15:38:31 -0800 Subject: [PATCH 1/4] add test that this project's license detected as MIT --- spec/license_meta_spec.rb | 12 ------------ spec/self_license_spec.rb | 11 +++++++++++ spec/spec_helper.rb | 12 ++++++++++++ 3 files changed, 23 insertions(+), 12 deletions(-) create mode 100644 spec/self_license_spec.rb diff --git a/spec/license_meta_spec.rb b/spec/license_meta_spec.rb index 37a123e..df2957c 100644 --- a/spec/license_meta_spec.rb +++ b/spec/license_meta_spec.rb @@ -1,6 +1,5 @@ # frozen_string_literal: true -require 'licensee' require 'spec_helper' describe 'license meta' do @@ -49,17 +48,6 @@ describe 'license meta' do end context 'licensee detects using examples' do - module Licensee - class License - class << self - def license_dir - dir = ::File.dirname(__FILE__) - ::File.expand_path '../_licenses', dir - end - end - end - end - slug = license['slug'] examples.each do |example| diff --git a/spec/self_license_spec.rb b/spec/self_license_spec.rb new file mode 100644 index 0000000..178c9be --- /dev/null +++ b/spec/self_license_spec.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +require 'spec_helper' + +context 'licensee detects this project' do + let(:detected) { Licensee::project('.').license } + + it "license as MIT" do + expect(detected.key).to eq('mit') + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 9912e62..e66a9a1 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,6 +2,7 @@ require 'jekyll' require 'json' +require 'licensee' require 'open-uri' require 'nokogiri' @@ -138,3 +139,14 @@ end def approved_licenses (osi_approved_licenses.keys + fsf_approved_licenses.keys + od_approved_licenses.keys).flatten.uniq.sort end + +module Licensee + class License + class << self + def license_dir + dir = ::File.dirname(__FILE__) + ::File.expand_path '../_licenses', dir + end + end + end +end From 28fa8ca52141e6d443297e0595d5434da1611dbe Mon Sep 17 00:00:00 2001 From: Mike Linksvayer Date: Sat, 30 Dec 2017 15:42:15 -0800 Subject: [PATCH 2/4] rename and redirect no-license to no-permission avodiing licensee false negative --- no-license.md => no-permission.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) rename no-license.md => no-permission.md (97%) diff --git a/no-license.md b/no-permission.md similarity index 97% rename from no-license.md rename to no-permission.md index 688f1d2..3b85c5e 100644 --- a/no-license.md +++ b/no-permission.md @@ -1,7 +1,9 @@ --- layout: default -permalink: no-license/ -redirect_from: /licenses/no-license/ +permalink: no-permission/ +redirect_from: + - /no-license/ + - /licenses/no-license/ title: No License description: "You're under no obligation to choose a license and it's your right not to include one with your code or project. But please note that opting out of open source licenses doesn't mean you're opting out of copyright law." --- From c3f9bea85262509abdf07a3092b4100793081081 Mon Sep 17 00:00:00 2001 From: Mike Linksvayer Date: Sat, 30 Dec 2017 15:46:13 -0800 Subject: [PATCH 3/4] change no-license internal links --- existing.md | 2 +- index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/existing.md b/existing.md index e6c6dc0..d4387b6 100644 --- a/existing.md +++ b/existing.md @@ -4,7 +4,7 @@ permalink: /existing/ title: Existing projects and communities --- -If you're contributing to or extending an existing project, it's almost always easiest to continue using that project's license. Look for a file called `LICENSE` or `COPYING`, or a notice in the project's `README` to find out what that license is. If you can't find a license, [ask](/no-license/#for-users). +If you're contributing to or extending an existing project, it's almost always easiest to continue using that project's license. Look for a file called `LICENSE` or `COPYING`, or a notice in the project's `README` to find out what that license is. If you can't find a license, [ask](/no-permission/#for-users). Depending on how you're building on an existing project and what its license is, using the existing project's license for your own might not just be the easiest thing to do, but a condition on which your permission to build on the existing project rests: see the "same license" condition of [some licenses](/licenses/). diff --git a/index.html b/index.html index 8f70441..a11992e 100644 --- a/index.html +++ b/index.html @@ -70,7 +70,7 @@ permalink: /
  • I don’t want to choose a license.

    - You don’t have to. + You don’t have to.

  • From a093c99d3c5b29004f21b2c1f6e5c834ac0f6c4b Mon Sep 17 00:00:00 2001 From: Mike Linksvayer Date: Sat, 30 Dec 2017 15:48:07 -0800 Subject: [PATCH 4/4] rubocop --- spec/self_license_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/self_license_spec.rb b/spec/self_license_spec.rb index 178c9be..83fe270 100644 --- a/spec/self_license_spec.rb +++ b/spec/self_license_spec.rb @@ -3,9 +3,9 @@ require 'spec_helper' context 'licensee detects this project' do - let(:detected) { Licensee::project('.').license } + let(:detected) { Licensee.project('.').license } - it "license as MIT" do + it 'license as MIT' do expect(detected.key).to eq('mit') end end