Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions lib/Software/License/Unlicense.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
use strict;
use warnings;
package Software::License::Unlicense;

use parent 'Software::License';
# ABSTRACT: Unlicense

sub name { q(Unlicense) }
sub url { q(http://unlicense.org/) }
sub meta_name { 'unrestricted' }
sub spdx_expression { 'Unlicense' }

1;
__DATA__
__NOTICE__
__LICENSE__
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 <https://unlicense.org>
1 change: 1 addition & 0 deletions lib/Software/LicenseUtils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ my @phrases = (
'apache(?: |-)2.0' => "Apache_2_0",
"Apache License(\\s)+Version 2.0" => "Apache_2_0",
'No license is granted to other entities' => 'None',
'free and unencumbered software' => 'Unlicense',
);

my %meta_keys = ();
Expand Down
36 changes: 36 additions & 0 deletions t/guess_license_from_pod.t
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,42 @@ LICENSE
}
};

subtest 'Unlicense' => sub {
my $license = << 'LICENSE';
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 <https://unlicense.org>
LICENSE

is_deeply(
[ Software::LicenseUtils->guess_license_from_pod( build_pod($license) ) ],
[ 'Software::License::Unlicense' ],
$license
);
};


done_testing;

sub build_pod { "=head1 LICENSE\n\n" . shift . "\n=cut\n" }