String...:Custom(3pm)

πŸ“¦
version 0.0.11 Β· 6 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

okay bestie so you opened String...:Custom(3pm) and the actual star of the show is String::License::Naming β€” it's giving names of licenses and license naming schemes. that's the whole vibe. πŸ’…


🌸 VERSION 🌸

Version v0.0.11 πŸŽ€


✨ SYNOPSIS ✨

use String::License::Naming::Custom;

my $obj = String::License::Naming::Custom->new( schemes => [qw(spdx internal)] );

my $schemes = [ $obj->list_schemes ];  # => is_deeply [ 'spdx', 'internal' ]

my $license = [ grep { /^(Expat|Perl)$/ } $obj->list_licenses ];  # => is_deeply ['Perl']

# use and prefer Debian-specific identifiers
$schemes = [ $obj->add_scheme('debian') ];  # => is_deeply [ 'debian', 'spdx', 'internal' ]

$license = [ grep { /^(Expat|Perl)$/ } $obj->list_licenses ];  # => is_deeply [ 'Expat', 'Perl' ]

like look at that last line 😭 the same grep, a whole different answer. the glow-up is real.


πŸ¦‹ DESCRIPTION πŸ¦‹

so String::License::Naming does two things, and honestly both are iconic:

  • it lists out the supported licenses that match an ordered set of naming schemes, and
  • it lists out the names of the supported license naming schemes themselves.

Some licenses are literally known by more than one name. example: the license "MIT" according to SPDX is named "Expat" in Debian. same license, two name tags, no drama. 🌈

And some licenses aren't always represented at all. example: "Perl" is a (discouraged) license in Debian, while with SPDX it's a relationship of several licenses β€” and heads up, that expression is recommended in Debian as well. so it can be a license OR a relationship depending on who you ask. it's giving multitudes. πŸ¦‹

By default, licenses get matched using the naming schemes [ 'spdx', 'internal' ]. that combo lists all supported licenses, preferably by their SPDX name, or as a fallback by an internal name. bestie behavior honestly. 🫢


πŸŽ€ CONSTRUCTOR πŸŽ€

new

my $names = String::License::Naming->new;

my $spdx_names = String::License::Naming->new( schemes => ['spdx'] );

Constructs and returns a String::License::Naming object. ✨

It takes an optional array as the named argument schemes. that array does double duty: it sets both the ordering by which name licenses should be presented, and it limits which licenses get covered. two jobs, no complaints. πŸ’…

When you omit it, the default schemes array [ 'spdx', 'internal' ] is used β€” that includes all supported licenses, and they're presented by their SPDX name when one is defined, or otherwise by a semi-stable internal name. πŸŽ€

When you pass an empty array reference instead, all supported licenses are still included, but they're presented by a semi-stable internal description β€” and yes, that description can be potentially multi-word. no cap.


πŸ’… FUNCTIONS πŸ’…

  • add_scheme β€” takes a string representing a license naming scheme to use, and it gets favored over the schemes already in use. returns the array of schemes in use after the addition. so you hand it one name and get the whole updated roster back. πŸ‘‘
  • list_schemes β€” returns a list of the license naming schemes currently in use.
  • list_available_schemes β€” returns a list of every license naming scheme that's available. the full menu, not just what's on your plate. πŸ“
  • list_licenses β€” returns a list of the licensing patterns covered by this object instance, each one labeled by shortname according to the current set of schemes. literally the point of the whole module.

πŸ‘‘ AUTHOR πŸ‘‘

Jonas Smedegaard "<dr@jones.dk>" β€” the author himself, main character energy, we love to see it. 🫢


  Copyright Β© 2023 Jonas Smedegaard

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

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 Affero General Public License for more details.

⚠️ bestie read that middle paragraph again. NO WARRANTY, like none, zero, nada. don't come crying to the AGPL. 😭

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.


and that's the tea β˜• this was the String...:Custom(3pm) page from perl v5.40.0, dated 2024-11-05. go forth and name some licenses, you absolute icon. πŸ’–βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from