"Fossies" - the Fresh Open Source Software Archive

Member "Module-Build-0.4224/t/bundled/Software/License.pm" (30 May 2017, 1129 Bytes) of package /linux/privat/Module-Build-0.4224.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 # Modified from the original as a "mock" version for testing
    2 use strict;
    3 use warnings;
    4 use 5.006; # warnings
    5 package Software::License;
    6 our $VERSION = 9999;
    7 
    8 sub new {
    9   my ($class, $arg) = @_;
   10 
   11   # XXX changed from Carp::croak to die
   12   die "no copyright holder specified" unless $arg->{holder};
   13 
   14   bless $arg => $class;
   15 }
   16 
   17 
   18 sub year   { defined $_[0]->{year} ? $_[0]->{year} : (localtime)[5]+1900 }
   19 sub holder { $_[0]->{holder} }
   20 
   21 sub version  {
   22   my ($self) = @_;
   23   my $pkg = ref $self ? ref $self : $self;
   24   $pkg =~ s/.+:://;
   25   my (undef, @vparts) = split /_/, $pkg;
   26 
   27   return unless @vparts;
   28   return join '.', @vparts;
   29 }
   30 
   31 
   32 # sub meta1_name    { return undef; } # sort this out later, should be easy
   33 sub meta_name     { return undef; }
   34 sub meta_yml_name { $_[0]->meta_name }
   35 
   36 sub meta2_name {
   37   my ($self) = @_;
   38   my $meta1 = $self->meta_name;
   39 
   40   return undef unless defined $meta1;
   41 
   42   return $meta1
   43     if $meta1 =~ /\A(?:open_source|restricted|unrestricted|unknown)\z/;
   44 
   45   return undef;
   46 }
   47 
   48 # XXX these are trivial mocks of the real thing
   49 sub notice { 'NOTICE' }
   50 sub license { 'LICENSE' }
   51 sub fulltext { 'FULLTEXT' }
   52 
   53 1;
   54 
   55 
   56