String::License(3pm)

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

πŸ’– String::License πŸ’–

okay bestie, so this is String::License, a page from the User Contributed Perl Documentation (3pm section, iykyk). And before you ask β€” yes, it does exactly what it says on the tin, and it's giving main character energy for license detection. Let's get into it ✨


🌸 NAME 🌸

String::License β€” it detects source code license statements in a text string. fr fr, that's the whole vibe. You hand it a string, it tells you what license is hiding in there. πŸ’…


✨ VERSION ✨

This is Version v0.0.11. Iconic. Number noted. 🌟


πŸŽ€ SYNOPSIS πŸŽ€

here's the whole thing in action, bestie:

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

my $string = 'Licensed under same terms as Perl itself';

my $expressed  = String::License->new( string => $string );
my $expression = $expressed->as_text;  # => "Perl"

my $desc        = String::License::Naming::Custom->new;
my $described   = String::License->new( string => $string, naming => $desc );
my $description = $described->as_text;  # => "The Perl 5 License"

see that? same string, two different naming schemes, two different outputs. the range. 😌


πŸ¦‹ DESCRIPTION πŸ¦‹

String::License goes through a string, finds the license statements chillin' in there, and then serializes them into a normalized format. So like β€” no more messy freeform license prose, everything comes out looking tidy and consistent. obsessed. πŸ’–


πŸ’œ CONSTRUCTOR πŸ’œ

<div></div>

🌈 new 🌈

my $licensed = String::License->new( string => 'Licensed under GPLv2' );

This bad boy takes named arguments, builds you a String::License object, and hands it right back. easy peasy. 🫢

Here's everything it recognizes:

  • string => STRING β€” the scalar string you want it to go parse for licensing info. this is the one you actually care about. πŸ’…
  • naming => OBJ β€” a String::License::Naming object, which is what defines your license naming conventions.

By default it uses String::License::Naming::SPDX.

ngl, this is the important bit: instantiating naming schemes is expensive 😭. so if you're processing multiple strings, passing in a pre-initialized naming object can give you a significant speed boost. do yourself a favor and reuse it, bestie. it's giving efficiency. πŸ”₯

πŸ‘‘ METHODS πŸ‘‘

<div></div>

⭐ as_text ⭐

Returns the identified licensing patterns as a string β€” either structured as SPDX License Expressions, or with scheme-less naming as a short description. depends on your naming vibe, yk? 🌸


πŸ’€ AUTHOR πŸ’€

Jonas Smedegaard "<dr@jones.dk>"

(the legend themselves. bow down. πŸ™‡β€β™€οΈ)


okay this part matters, don't skip it:

This program is based on the script licensecheck from the KDE SDK, originally introduced by Stefan Westerfeld "<stefan@space.twc.de>".

Copyright Β© 2007, 2008 Adam D. Barratt

Copyright Β© 2016-2023 Jonas Smedegaard

Copyright Β© 2017-2022 Purism SPC

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, 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.

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


🫢 okay that's a wrap, bestie. this page was served up by perl v5.40.0 on 2024-11-05, and it's the String::License(3pm) manual page. now go detect some licenses, you gorgeous genius. πŸ’–πŸŽ€βœ¨πŸ‘‘
πŸ“¦ where this page comes from