1
0
mirror of https://github.com/github/choosealicense.com synced 2024-12-22 04:40:09 +01:00

Merge pull request #562 from github/self-test

Test this project's license
This commit is contained in:
Mike Linksvayer 2017-12-31 09:43:53 -08:00 committed by GitHub
commit 47920250b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 29 additions and 16 deletions

View File

@ -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/).

View File

@ -70,7 +70,7 @@ permalink: /
<li>
<h3>I dont want to choose a license.</h3>
<p>
<a href="no-license">You dont have to</a>.
<a href="no-permission">You dont have to</a>.
</p>
</li>
</ul>

View File

@ -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."
---

View File

@ -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|

11
spec/self_license_spec.rb Normal file
View File

@ -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

View File

@ -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