Codex

Software::License::Custom

Section: User Contributed Perl Documentation (3pm)

Updated: 2014-09-27

Index?action=index Return to Main Contents


NAME

Software::License::Custom - custom license handler

VERSION

version 0.103010

DESCRIPTION

This module extends Software::License to give the possibility of specifying all aspects related to a software license in a custom file. This allows for setting custom dates, notices, etc. while still preserving compatibility with all places where Software::License is used, e.g. Dist::Zilla.

In this way, you should be able to customise some aspects of the licensing messages that would otherwise be difficult to tinker, e.g. adding a note in the notice, setting multiple years for the copyright notice or set multiple authors and/or copyright holders.

The license details should be put inside a file that contains different sections. Each section has the following format:

header line
This is a line that begins and ends with two underscores . The string between the begin and the end of the line is first depured of any non-word character, then used as the name of the section;:
body
a Text::Template (possibly a plain text file) where items to be expanded are enclosed between double braces:

Each section is terminated by the header of the following section or by the end of the file. Example:

__[ NAME ]__ The Foo-Bar License __URL__ http://www.example.com/foo-bar.txt __[ META_NAME ]__ foo_bar_meta __{ META2_NAME }__ foo_bar_meta2 __[ NOTICE ]__ Copyright (C) 2000-2002 by P.R. Evious Copyright (C) {{$self->year}} by {{$self->holder}}.

This is free software, licensed under {{$self->name}}.

__[ LICENSE ]__ The Foo-Bar License

Well... this is only some sample text. Verily... only sample text!!!

Yes, spanning more lines and more paragraphs.

@]

The different formats for specifying the section name in the example above are only examples, you're invited to use a consistent approach.

METHODS

new

Create a new object. Arguments are passed through an anonymous hash, the following keys are allowed:

load_sections_from

Loads the different sections of the license from the provided filename.

Returns the input object.

section_data

Returns a reference to a textual template that can be fed to Text::Template (it could be simple text), according to what is currently loaded in the object.

MORE METHODS

The following methods, found in all software license classes, look up and render the template with the capitalized form of their name. In other words, the method looks in the template.
For now, the and methods return if called on the class. This may become fatal in the future.
name:
url:
meta_name:
meta2_name:
license:
notice:
fulltext:
version:

AUTHOR

Ricardo Signes <[email protected]>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Ricardo Signes.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.


Index

NAME

VERSION

DESCRIPTION

METHODS

new

load_sections_from

section_data

MORE METHODS

AUTHOR

COPYRIGHT AND LICENSE