diff --git a/lib/license_finder/license/definitions.rb b/lib/license_finder/license/definitions.rb index 65600907..ac2d6b80 100644 --- a/lib/license_finder/license/definitions.rb +++ b/lib/license_finder/license/definitions.rb @@ -26,6 +26,7 @@ def all python, ruby, simplifiedbsd, + unlicense, wtfpl, zerobsd, zlib @@ -339,6 +340,15 @@ def simplifiedbsd ) end + def unlicense + License.new( + short_name: 'Unlicense', + spdx_id: 'Unlicense', + pretty_name: 'The Unlicense', + url: 'https://unlicense.org/' + ) + end + def wtfpl License.new( short_name: 'WTFPL', diff --git a/lib/license_finder/license/templates/Unlicense.txt b/lib/license_finder/license/templates/Unlicense.txt new file mode 100644 index 00000000..68a49daa --- /dev/null +++ b/lib/license_finder/license/templates/Unlicense.txt @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to diff --git a/spec/lib/license_finder/license/definitions_spec.rb b/spec/lib/license_finder/license/definitions_spec.rb index becdbad5..0b545237 100644 --- a/spec/lib/license_finder/license/definitions_spec.rb +++ b/spec/lib/license_finder/license/definitions_spec.rb @@ -208,6 +208,13 @@ end end +describe LicenseFinder::License, 'Unlicense' do + it 'should be recognized' do + expect(described_class.find_by_name('Unlicense').name).to eq('The Unlicense') + expect(described_class.find_by_name('Unlicense').url).to be + end +end + describe LicenseFinder::License, 'WTFPL' do it 'should be recognized' do expect(described_class.find_by_name('WTFPL').name).to eq('WTFPL')