Zoom-Meeting

 view release on metacpan or  search on metacpan

local/lib/perl5/Software/License.pm  view on Meta::CPAN

use strict;
use warnings;
use 5.006; # warnings
package Software::License;
# ABSTRACT: packages that provide templated software licenses
$Software::License::VERSION = '0.104004';
use Data::Section -setup => { header_re => qr/\A__([^_]+)__\Z/ };
use Text::Template ();

#pod =head1 SYNOPSIS
#pod
#pod   my $license = Software::License::Discordian->new({
#pod     holder => 'Ricardo Signes',
#pod   });
#pod
#pod   print $output_fh $license->fulltext;
#pod
#pod =method new
#pod
#pod   my $license = $subclass->new(\%arg);
#pod
#pod This method returns a new license object for the given license class.  Valid
#pod arguments are:
#pod
#pod =for :list
#pod = holder
#pod the holder of the copyright; required
#pod = year
#pod the year of copyright; defaults to current year
#pod = program
#pod the name of software for use in the middle of a sentence
#pod = Program
#pod the name of software for use in the beginning of a sentence
#pod
#pod C<program> and C<Program> arguments may be specified both, either one or none.
#pod Each argument, if not specified, is defaulted to another one, or to properly
#pod capitalized "this program", if both arguments are omitted.
#pod
#pod =cut

sub new {
  my ($class, $arg) = @_;

  Carp::croak "no copyright holder specified" unless $arg->{holder};

  bless $arg => $class;
}

#pod =method year
#pod
#pod =method holder
#pod
#pod These methods are attribute readers.
#pod
#pod =cut

sub year   { defined $_[0]->{year} ? $_[0]->{year} : (localtime)[5]+1900 }
sub holder { $_[0]->{holder}     }

sub _dotless_holder {
  my $holder = $_[0]->holder;
  $holder =~ s/\.$//;
  return $holder;
}

#pod =method program
#pod
#pod Name of software for using in the middle of a sentence.
#pod
#pod The method returns value of C<program> constructor argument (if it evaluates as true, i. e.
#pod defined, non-empty, non-zero), or value of C<Program> constructor argument (if it is true), or
#pod "this program" as the last resort.
#pod
#pod =cut

sub program { $_[0]->{program} || $_[0]->{Program} || 'this program' }

#pod =method Program
#pod
#pod Name of software for using in the middle of a sentence.
#pod
#pod The method returns value of C<Program> constructor argument (if it is true), or value of C<program>
#pod constructor argument (if it is true), or "This program" as the last resort.
#pod
#pod =cut

sub Program { $_[0]->{Program} || $_[0]->{program} || 'This program' }

#pod =method name
#pod
#pod This method returns the name of the license, suitable for shoving in the middle
#pod of a sentence, generally with a leading capitalized "The."
#pod
#pod =method url
#pod
#pod This method returns the URL at which a canonical text of the license can be
#pod found, if one is available.  If possible, this will point at plain text, but it
#pod may point to an HTML resource.
#pod
#pod =method notice
#pod
#pod This method returns a snippet of text, usually a few lines, indicating the
#pod copyright holder and year of copyright, as well as an indication of the license
#pod under which the software is distributed.
#pod
#pod =cut

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.642 second using v1.00-cache-2.02-grep-82fe00e-cpan-2c419f77a38b )