License::Software - provides templated software licenses
NAME
License::Software - provides templated software licenses
SYNOPSIS
use License::Software;
my $author = 'Max Musterman';
my $license = License::Software.get('gpl').new($author);
say $license.name; # Full license name
say $license.short-name; # Short name like 'GPLv3'
say $license.alias; # List of license alias
say $license.url; # License url
say $license.header; # License header
⋮ # ⋮
=output The GNU General Public License, Version 3, 29 June 2007
USAGE
Getting the license class
License::Software::get-all
Return all supported licenses.
license
sub license(Str:D $alias)
Return the software license class for the given alias. I.e alias for the General Public License 3 are 'GPLv3', 'GPL3' & 'GPL'.
license-from-url
sub license-from-url(Str:D $url)
Return the software license class for the given url. I.e http://www.apache.org/licenses/LICENSE-2.0 is the url for Apache2 license.
License class methods
method new
multi new(Str:D $name, $year?)
Expects a copyright holder name and an optional year. The license will use
'This program' as $works-name.
multi method new(Str:D $works-name, %h)
multi method new(%h)
%h is a hash where keys are the copyright holders names and values the
copyright year. If no $works-name is provided it uses 'This program' by
default.
method header
method header returns Str:D
Returns a Str which should be added to each licensed file (source code) at
the top. I.e. GPL expects to have “This program is free software: you
can redistribute it and/or modify…” header at the top of each file.
method files
method files returns Hash:D
Returns a Hash where keys are file names and the value the file contents.
This is useful for licenses which dictate to have multiple different files. I.e.
Apache2 generates a 'LICENSE' and a 'NOTICE' file.
method full-text
method full-text returns Str:D
Returns the full text of the license.
method name
method name returns Str:D
Returns the full license name as Str. I.e. for GPLv3 this would be “The GNU
General Public License, Version 3, 29 June 2007”
method short-name
method short-name returns Str:D
Returns the short name for a license. I.e. 'GPLv3'.
method spdx
method spdx returns Str:D
Returns the license https://spdx.org/ identifier as Str.
method note
method note returns Str:D
Returns a short license text which can be used in README and Co.
submethod aliases
submethod aliases returns Array[Str]
Returns all known alias' for the license.
submethod url
submethod url returns Str:D
Returns the license url.
COPYRIGHT
Copyright © 2016 Bahtiar `kalkin-` Gadimov <[email protected]>
LICENSE
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation version 3 of the License.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.se v6;