r34334 - in /trunk/libclass-c3-adopt-next-perl: ./ debian/ inc/Module/ inc/Module/Install/ lib/Class/C3/Adopt/
eloy at users.alioth.debian.org
eloy at users.alioth.debian.org
Wed Apr 29 19:20:07 UTC 2009
Author: eloy
Date: Wed Apr 29 19:20:01 2009
New Revision: 34334
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=34334
Log:
new upstream version
Removed:
trunk/libclass-c3-adopt-next-perl/README
Modified:
trunk/libclass-c3-adopt-next-perl/Changes
trunk/libclass-c3-adopt-next-perl/MANIFEST
trunk/libclass-c3-adopt-next-perl/META.yml
trunk/libclass-c3-adopt-next-perl/debian/changelog
trunk/libclass-c3-adopt-next-perl/inc/Module/Install.pm
trunk/libclass-c3-adopt-next-perl/inc/Module/Install/Base.pm
trunk/libclass-c3-adopt-next-perl/inc/Module/Install/Can.pm
trunk/libclass-c3-adopt-next-perl/inc/Module/Install/Fetch.pm
trunk/libclass-c3-adopt-next-perl/inc/Module/Install/Makefile.pm
trunk/libclass-c3-adopt-next-perl/inc/Module/Install/Metadata.pm
trunk/libclass-c3-adopt-next-perl/inc/Module/Install/Win32.pm
trunk/libclass-c3-adopt-next-perl/inc/Module/Install/WriteAll.pm
trunk/libclass-c3-adopt-next-perl/lib/Class/C3/Adopt/NEXT.pm
Modified: trunk/libclass-c3-adopt-next-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-c3-adopt-next-perl/Changes?rev=34334&op=diff
==============================================================================
--- trunk/libclass-c3-adopt-next-perl/Changes (original)
+++ trunk/libclass-c3-adopt-next-perl/Changes Wed Apr 29 19:20:01 2009
@@ -1,3 +1,8 @@
+0.09 Tue, 28 Apr 2009 23:14:58 +0100
+ * Rewrite a chunk of the documentation to be more clear, and also to beter
+ cater for our primary audience (people being linked from Catalyst).
+ Based on feeback from kiffin.
+
0.08 Wed, 22 Apr 2009 05:19:48 +0200
* Add additional example for doc for converting from NEXT, to help out
lazy people who only read the verbatim sections (abraxxa).
Modified: trunk/libclass-c3-adopt-next-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-c3-adopt-next-perl/MANIFEST?rev=34334&op=diff
==============================================================================
--- trunk/libclass-c3-adopt-next-perl/MANIFEST (original)
+++ trunk/libclass-c3-adopt-next-perl/MANIFEST Wed Apr 29 19:20:01 2009
@@ -12,7 +12,6 @@
Makefile.PL
MANIFEST This list of files
META.yml
-README
t/basic.t
t/disable.t
t/disable_regex.t
Modified: trunk/libclass-c3-adopt-next-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-c3-adopt-next-perl/META.yml?rev=34334&op=diff
==============================================================================
--- trunk/libclass-c3-adopt-next-perl/META.yml (original)
+++ trunk/libclass-c3-adopt-next-perl/META.yml Wed Apr 29 19:20:01 2009
@@ -3,12 +3,9 @@
author:
- 'Florian Ragwitz C<rafl at debian.org>'
build_requires:
- ExtUtils::MakeMaker: 6.42
Test::Exception: 0
-configure_requires:
- ExtUtils::MakeMaker: 6.42
distribution_type: module
-generated_by: 'Module::Install version 0.85'
+generated_by: 'Module::Install version 0.80'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -24,4 +21,4 @@
NEXT: 0
resources:
license: http://dev.perl.org/licenses/
-version: 0.08
+version: 0.09
Modified: trunk/libclass-c3-adopt-next-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-c3-adopt-next-perl/debian/changelog?rev=34334&op=diff
==============================================================================
--- trunk/libclass-c3-adopt-next-perl/debian/changelog (original)
+++ trunk/libclass-c3-adopt-next-perl/debian/changelog Wed Apr 29 19:20:01 2009
@@ -1,3 +1,9 @@
+libclass-c3-adopt-next-perl (0.09-1) unstable; urgency=low
+
+ * New upstream release
+
+ -- Krzysztof Krzyżaniak (eloy) <eloy at debian.org> Wed, 29 Apr 2009 21:18:03 +0200
+
libclass-c3-adopt-next-perl (0.08-1) UNRELEASED; urgency=low
NB: The upstream release was just a documentation update, no need to upload it.
Modified: trunk/libclass-c3-adopt-next-perl/inc/Module/Install.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-c3-adopt-next-perl/inc/Module/Install.pm?rev=34334&op=diff
==============================================================================
--- trunk/libclass-c3-adopt-next-perl/inc/Module/Install.pm (original)
+++ trunk/libclass-c3-adopt-next-perl/inc/Module/Install.pm Wed Apr 29 19:20:01 2009
@@ -17,10 +17,12 @@
# 3. The ./inc/ version of Module::Install loads
# }
-use 5.005;
+BEGIN {
+ require 5.004;
+}
use strict 'vars';
-use vars qw{$VERSION $MAIN};
+use vars qw{$VERSION};
BEGIN {
# All Module::Install core packages now require synchronised versions.
# This will be used to ensure we don't accidentally load old or
@@ -28,10 +30,7 @@
# This is not enforced yet, but will be some time in the next few
# releases once we can make sure it won't clash with custom
# Module::Install extensions.
- $VERSION = '0.85';
-
- # Storage for the pseudo-singleton
- $MAIN = undef;
+ $VERSION = '0.80';
*inc::Module::Install::VERSION = *VERSION;
@inc::Module::Install::ISA = __PACKAGE__;
@@ -70,26 +69,15 @@
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
-if ( -f $0 ) {
- my $s = (stat($0))[9];
-
- # If the modification time is only slightly in the future,
- # sleep briefly to remove the problem.
- my $a = $s - time;
- if ( $a > 0 and $a < 5 ) { sleep 5 }
-
- # Too far in the future, throw an error.
- my $t = time;
- if ( $s > $t ) { die <<"END_DIE" }
-
-Your installer $0 has a modification time in the future ($s > $t).
+if ( -f $0 and (stat($0))[9] > time ) { die <<"END_DIE" }
+
+Your installer $0 has a modification time in the future.
This is known to create infinite loops in make.
Please correct this, then run $0 again.
END_DIE
-}
@@ -133,22 +121,14 @@
$sym->{$cwd} = sub {
my $pwd = Cwd::cwd();
if ( my $code = $sym->{$pwd} ) {
- # Delegate back to parent dirs
+ # delegate back to parent dirs
goto &$code unless $cwd eq $pwd;
}
$$sym =~ /([^:]+)$/ or die "Cannot autoload $who - $sym";
- my $method = $1;
- if ( uc($method) eq $method ) {
- # Do nothing
- return;
- } elsif ( $method =~ /^_/ and $self->can($method) ) {
- # Dispatch to the root M:I class
- return $self->$method(@_);
- }
-
- # Dispatch to the appropriate plugin
- unshift @_, ( $self, $1 );
- goto &{$self->can('call')};
+ unless ( uc($1) eq $1 ) {
+ unshift @_, ( $self, $1 );
+ goto &{$self->can('call')};
+ }
};
}
@@ -173,9 +153,6 @@
delete $INC{"$self->{file}"};
delete $INC{"$self->{path}.pm"};
- # Save to the singleton
- $MAIN = $self;
-
return 1;
}
@@ -189,7 +166,8 @@
my @exts = @{$self->{extensions}};
unless ( @exts ) {
- @exts = $self->{admin}->load_all_extensions;
+ my $admin = $self->{admin};
+ @exts = $admin->load_all_extensions;
}
my %seen;
@@ -272,7 +250,7 @@
sub load_extensions {
my ($self, $path, $top) = @_;
- unless ( grep { ! ref $_ and lc $_ eq lc $self->{prefix} } @INC ) {
+ unless ( grep { !ref $_ and lc $_ eq lc $self->{prefix} } @INC ) {
unshift @INC, $self->{prefix};
}
@@ -336,7 +314,7 @@
#####################################################################
-# Common Utility Functions
+# Utility Functions
sub _caller {
my $depth = 0;
@@ -350,68 +328,29 @@
sub _read {
local *FH;
- if ( $] >= 5.006 ) {
- open( FH, '<', $_[0] ) or die "open($_[0]): $!";
- } else {
- open( FH, "< $_[0]" ) or die "open($_[0]): $!";
- }
- my $string = do { local $/; <FH> };
+ open FH, "< $_[0]" or die "open($_[0]): $!";
+ my $str = do { local $/; <FH> };
close FH or die "close($_[0]): $!";
- return $string;
-}
-
-sub _readperl {
- my $string = Module::Install::_read($_[0]);
- $string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg;
- $string =~ s/(\n)\n*__(?:DATA|END)__\b.*\z/$1/s;
- $string =~ s/\n\n=\w+.+?\n\n=cut\b.+?\n+/\n\n/sg;
- return $string;
-}
-
-sub _readpod {
- my $string = Module::Install::_read($_[0]);
- $string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg;
- return $string if $_[0] =~ /\.pod\z/;
- $string =~ s/(^|\n=cut\b.+?\n+)[^=\s].+?\n(\n=\w+|\z)/$1$2/sg;
- $string =~ s/\n*=pod\b[^\n]*\n+/\n\n/sg;
- $string =~ s/\n*=cut\b[^\n]*\n+/\n\n/sg;
- $string =~ s/^\n+//s;
- return $string;
+ return $str;
}
sub _write {
local *FH;
- if ( $] >= 5.006 ) {
- open( FH, '>', $_[0] ) or die "open($_[0]): $!";
- } else {
- open( FH, "> $_[0]" ) or die "open($_[0]): $!";
- }
- foreach ( 1 .. $#_ ) {
- print FH $_[$_] or die "print($_[0]): $!";
- }
+ open FH, "> $_[0]" or die "open($_[0]): $!";
+ foreach ( 1 .. $#_ ) { print FH $_[$_] or die "print($_[0]): $!" }
close FH or die "close($_[0]): $!";
}
# _version is for processing module versions (eg, 1.03_05) not
# Perl versions (eg, 5.8.1).
+
sub _version ($) {
my $s = shift || 0;
- my $d =()= $s =~ /(\.)/g;
- if ( $d >= 2 ) {
- # Normalise multipart versions
- $s =~ s/(\.)(\d{1,3})/sprintf("$1%03d",$2)/eg;
- }
- $s =~ s/^(\d+)\.?//;
+ $s =~ s/^(\d+)\.?//;
my $l = $1 || 0;
- my @v = map {
- $_ . '0' x (3 - length $_)
- } $s =~ /(\d{1,3})\D?/g;
- $l = $l . '.' . join '', @v if @v;
+ my @v = map { $_ . '0' x (3 - length $_) } $s =~ /(\d{1,3})\D?/g;
+ $l = $l . '.' . join '', @v if @v;
return $l + 0;
-}
-
-sub _cmp ($$) {
- _version($_[0]) <=> _version($_[1]);
}
# Cloned from Params::Util::_CLASS
Modified: trunk/libclass-c3-adopt-next-perl/inc/Module/Install/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-c3-adopt-next-perl/inc/Module/Install/Base.pm?rev=34334&op=diff
==============================================================================
--- trunk/libclass-c3-adopt-next-perl/inc/Module/Install/Base.pm (original)
+++ trunk/libclass-c3-adopt-next-perl/inc/Module/Install/Base.pm Wed Apr 29 19:20:01 2009
@@ -1,11 +1,7 @@
#line 1
package Module::Install::Base;
-use strict 'vars';
-use vars qw{$VERSION};
-BEGIN {
- $VERSION = '0.85';
-}
+$VERSION = '0.80';
# Suspend handler for "redefined" warnings
BEGIN {
@@ -16,61 +12,51 @@
### This is the ONLY module that shouldn't have strict on
# use strict;
-#line 45
+#line 41
sub new {
- my ($class, %args) = @_;
+ my ($class, %args) = @_;
- foreach my $method ( qw(call load) ) {
- next if defined &{"$class\::$method"};
- *{"$class\::$method"} = sub {
- shift()->_top->$method(@_);
- };
- }
+ foreach my $method ( qw(call load) ) {
+ *{"$class\::$method"} = sub {
+ shift()->_top->$method(@_);
+ } unless defined &{"$class\::$method"};
+ }
- bless( \%args, $class );
+ bless( \%args, $class );
}
-#line 66
+#line 61
sub AUTOLOAD {
- my $self = shift;
- local $@;
- my $autoload = eval {
- $self->_top->autoload
- } or return;
- goto &$autoload;
+ my $self = shift;
+ local $@;
+ my $autoload = eval { $self->_top->autoload } or return;
+ goto &$autoload;
}
-#line 83
+#line 76
-sub _top {
- $_[0]->{_top};
+sub _top { $_[0]->{_top} }
+
+#line 89
+
+sub admin {
+ $_[0]->_top->{admin} or Module::Install::Base::FakeAdmin->new;
}
-#line 98
-
-sub admin {
- $_[0]->_top->{admin}
- or
- Module::Install::Base::FakeAdmin->new;
-}
-
-#line 114
+#line 101
sub is_admin {
- $_[0]->admin->VERSION;
+ $_[0]->admin->VERSION;
}
sub DESTROY {}
package Module::Install::Base::FakeAdmin;
-my $fake;
-
-sub new {
- $fake ||= bless(\@_, $_[0]);
-}
+my $Fake;
+sub new { $Fake ||= bless(\@_, $_[0]) }
sub AUTOLOAD {}
@@ -83,4 +69,4 @@
1;
-#line 162
+#line 146
Modified: trunk/libclass-c3-adopt-next-perl/inc/Module/Install/Can.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-c3-adopt-next-perl/inc/Module/Install/Can.pm?rev=34334&op=diff
==============================================================================
--- trunk/libclass-c3-adopt-next-perl/inc/Module/Install/Can.pm (original)
+++ trunk/libclass-c3-adopt-next-perl/inc/Module/Install/Can.pm Wed Apr 29 19:20:01 2009
@@ -3,13 +3,15 @@
use strict;
use Module::Install::Base;
-use Config ();
-use File::Spec ();
+use Config ();
+### This adds a 5.005 Perl version dependency.
+### This is a bug and will be fixed.
+use File::Spec ();
use ExtUtils::MakeMaker ();
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.85';
+ $VERSION = '0.80';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
@@ -78,4 +80,4 @@
__END__
-#line 156
+#line 158
Modified: trunk/libclass-c3-adopt-next-perl/inc/Module/Install/Fetch.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-c3-adopt-next-perl/inc/Module/Install/Fetch.pm?rev=34334&op=diff
==============================================================================
--- trunk/libclass-c3-adopt-next-perl/inc/Module/Install/Fetch.pm (original)
+++ trunk/libclass-c3-adopt-next-perl/inc/Module/Install/Fetch.pm Wed Apr 29 19:20:01 2009
@@ -6,7 +6,7 @@
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.85';
+ $VERSION = '0.80';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
Modified: trunk/libclass-c3-adopt-next-perl/inc/Module/Install/Makefile.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-c3-adopt-next-perl/inc/Module/Install/Makefile.pm?rev=34334&op=diff
==============================================================================
--- trunk/libclass-c3-adopt-next-perl/inc/Module/Install/Makefile.pm (original)
+++ trunk/libclass-c3-adopt-next-perl/inc/Module/Install/Makefile.pm Wed Apr 29 19:20:01 2009
@@ -7,7 +7,7 @@
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.85';
+ $VERSION = '0.80';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
@@ -114,32 +114,17 @@
my $self = shift;
die "&Makefile->write() takes no arguments\n" if @_;
- # Check the current Perl version
- my $perl_version = $self->perl_version;
- if ( $perl_version ) {
- eval "use $perl_version; 1"
- or die "ERROR: perl: Version $] is installed, "
- . "but we need version >= $perl_version";
- }
-
- # Make sure we have a new enough MakeMaker
+ # Make sure we have a new enough
require ExtUtils::MakeMaker;
- if ( $perl_version and $self->_cmp($perl_version, '5.006') >= 0 ) {
- # MakeMaker can complain about module versions that include
- # an underscore, even though its own version may contain one!
- # Hence the funny regexp to get rid of it. See RT #35800
- # for details.
- $self->build_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
- $self->configure_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
- } else {
- # Allow legacy-compatibility with 5.005 by depending on the
- # most recent EU:MM that supported 5.005.
- $self->build_requires( 'ExtUtils::MakeMaker' => 6.42 );
- $self->configure_requires( 'ExtUtils::MakeMaker' => 6.42 );
- }
-
- # Generate the MakeMaker params
+ # MakeMaker can complain about module versions that include
+ # an underscore, even though its own version may contain one!
+ # Hence the funny regexp to get rid of it. See RT #35800
+ # for details.
+
+ $self->configure_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
+
+ # Generate the
my $args = $self->makemaker_args;
$args->{DISTNAME} = $self->name;
$args->{NAME} = $self->module_name || $self->name;
@@ -148,7 +133,7 @@
if ( $self->tests ) {
$args->{test} = { TESTS => $self->tests };
}
- if ( $] >= 5.005 ) {
+ if ($] >= 5.005) {
$args->{ABSTRACT} = $self->abstract;
$args->{AUTHOR} = $self->author;
}
@@ -162,7 +147,7 @@
delete $args->{SIGN};
}
- # Merge both kinds of requires into prereq_pm
+ # merge both kinds of requires into prereq_pm
my $prereq = ($args->{PREREQ_PM} ||= {});
%$prereq = ( %$prereq,
map { @$_ }
@@ -265,4 +250,4 @@
__END__
-#line 394
+#line 379
Modified: trunk/libclass-c3-adopt-next-perl/inc/Module/Install/Metadata.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-c3-adopt-next-perl/inc/Module/Install/Metadata.pm?rev=34334&op=diff
==============================================================================
--- trunk/libclass-c3-adopt-next-perl/inc/Module/Install/Metadata.pm (original)
+++ trunk/libclass-c3-adopt-next-perl/inc/Module/Install/Metadata.pm Wed Apr 29 19:20:01 2009
@@ -4,17 +4,12 @@
use strict 'vars';
use Module::Install::Base;
-use vars qw{$VERSION @ISA $ISCORE};
+use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.85';
+ $VERSION = '0.80';
+ $ISCORE = 1;
@ISA = qw{Module::Install::Base};
- $ISCORE = 1;
-}
-
-my @boolean_keys = qw{
- sign
- mymeta
-};
+}
my @scalar_keys = qw{
name
@@ -42,43 +37,16 @@
repository
};
-my @array_keys = qw{
- keywords
-};
-
sub Meta { shift }
-sub Meta_BooleanKeys { @boolean_keys }
sub Meta_ScalarKeys { @scalar_keys }
sub Meta_TupleKeys { @tuple_keys }
sub Meta_ResourceKeys { @resource_keys }
-sub Meta_ArrayKeys { @array_keys }
-
-foreach my $key ( @boolean_keys ) {
- *$key = sub {
- my $self = shift;
- if ( defined wantarray and not @_ ) {
- return $self->{values}->{$key};
- }
- $self->{values}->{$key} = ( @_ ? $_[0] : 1 );
- return $self;
- };
-}
foreach my $key ( @scalar_keys ) {
*$key = sub {
my $self = shift;
- return $self->{values}->{$key} if defined wantarray and !@_;
- $self->{values}->{$key} = shift;
- return $self;
- };
-}
-
-foreach my $key ( @array_keys ) {
- *$key = sub {
- my $self = shift;
- return $self->{values}->{$key} if defined wantarray and !@_;
- $self->{values}->{$key} ||= [];
- push @{$self->{values}->{$key}}, @_;
+ return $self->{values}{$key} if defined wantarray and !@_;
+ $self->{values}{$key} = shift;
return $self;
};
}
@@ -87,12 +55,12 @@
*$key = sub {
my $self = shift;
unless ( @_ ) {
- return () unless $self->{values}->{resources};
+ return () unless $self->{values}{resources};
return map { $_->[1] }
grep { $_->[0] eq $key }
- @{ $self->{values}->{resources} };
- }
- return $self->{values}->{resources}->{$key} unless @_;
+ @{ $self->{values}{resources} };
+ }
+ return $self->{values}{resources}{$key} unless @_;
my $uri = shift or die(
"Did not provide a value to $key()"
);
@@ -101,19 +69,54 @@
};
}
-foreach my $key ( grep { $_ ne "resources" } @tuple_keys) {
- *$key = sub {
- my $self = shift;
- return $self->{values}->{$key} unless @_;
- my @added;
- while ( @_ ) {
- my $module = shift or last;
- my $version = shift || 0;
- push @added, [ $module, $version ];
- }
- push @{ $self->{values}->{$key} }, @added;
- return map {@$_} @added;
- };
+sub requires {
+ my $self = shift;
+ while ( @_ ) {
+ my $module = shift or last;
+ my $version = shift || 0;
+ push @{ $self->{values}{requires} }, [ $module, $version ];
+ }
+ $self->{values}{requires};
+}
+
+sub build_requires {
+ my $self = shift;
+ while ( @_ ) {
+ my $module = shift or last;
+ my $version = shift || 0;
+ push @{ $self->{values}{build_requires} }, [ $module, $version ];
+ }
+ $self->{values}{build_requires};
+}
+
+sub configure_requires {
+ my $self = shift;
+ while ( @_ ) {
+ my $module = shift or last;
+ my $version = shift || 0;
+ push @{ $self->{values}{configure_requires} }, [ $module, $version ];
+ }
+ $self->{values}{configure_requires};
+}
+
+sub recommends {
+ my $self = shift;
+ while ( @_ ) {
+ my $module = shift or last;
+ my $version = shift || 0;
+ push @{ $self->{values}{recommends} }, [ $module, $version ];
+ }
+ $self->{values}{recommends};
+}
+
+sub bundles {
+ my $self = shift;
+ while ( @_ ) {
+ my $module = shift or last;
+ my $version = shift || 0;
+ push @{ $self->{values}{bundles} }, [ $module, $version ];
+ }
+ $self->{values}{bundles};
}
# Resource handling
@@ -132,22 +135,29 @@
if ( $name eq lc $name and ! $lc_resource{$name} ) {
die("Unsupported reserved lowercase resource '$name'");
}
- $self->{values}->{resources} ||= [];
- push @{ $self->{values}->{resources} }, [ $name, $value ];
- }
- $self->{values}->{resources};
+ $self->{values}{resources} ||= [];
+ push @{ $self->{values}{resources} }, [ $name, $value ];
+ }
+ $self->{values}{resources};
}
# Aliases for build_requires that will have alternative
# meanings in some future version of META.yml.
-sub test_requires { shift->build_requires(@_) }
-sub install_requires { shift->build_requires(@_) }
+sub test_requires { shift->build_requires(@_) }
+sub install_requires { shift->build_requires(@_) }
# Aliases for installdirs options
-sub install_as_core { $_[0]->installdirs('perl') }
-sub install_as_cpan { $_[0]->installdirs('site') }
-sub install_as_site { $_[0]->installdirs('site') }
-sub install_as_vendor { $_[0]->installdirs('vendor') }
+sub install_as_core { $_[0]->installdirs('perl') }
+sub install_as_cpan { $_[0]->installdirs('site') }
+sub install_as_site { $_[0]->installdirs('site') }
+sub install_as_vendor { $_[0]->installdirs('vendor') }
+
+sub sign {
+ my $self = shift;
+ return $self->{values}{sign} if defined wantarray and ! @_;
+ $self->{values}{sign} = ( @_ ? $_[0] : 1 );
+ return $self;
+}
sub dynamic_config {
my $self = shift;
@@ -155,13 +165,13 @@
warn "You MUST provide an explicit true/false value to dynamic_config\n";
return $self;
}
- $self->{values}->{dynamic_config} = $_[0] ? 1 : 0;
+ $self->{values}{dynamic_config} = $_[0] ? 1 : 0;
return 1;
}
sub perl_version {
my $self = shift;
- return $self->{values}->{perl_version} unless @_;
+ return $self->{values}{perl_version} unless @_;
my $version = shift or die(
"Did not provide a value to perl_version()"
);
@@ -174,41 +184,20 @@
die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n";
}
- $self->{values}->{perl_version} = $version;
-}
-
-#Stolen from M::B
-my %license_urls = (
- perl => 'http://dev.perl.org/licenses/',
- apache => 'http://apache.org/licenses/LICENSE-2.0',
- artistic => 'http://opensource.org/licenses/artistic-license.php',
- artistic_2 => 'http://opensource.org/licenses/artistic-license-2.0.php',
- lgpl => 'http://opensource.org/licenses/lgpl-license.php',
- lgpl2 => 'http://opensource.org/licenses/lgpl-2.1.php',
- lgpl3 => 'http://opensource.org/licenses/lgpl-3.0.html',
- bsd => 'http://opensource.org/licenses/bsd-license.php',
- gpl => 'http://opensource.org/licenses/gpl-license.php',
- gpl2 => 'http://opensource.org/licenses/gpl-2.0.php',
- gpl3 => 'http://opensource.org/licenses/gpl-3.0.html',
- mit => 'http://opensource.org/licenses/mit-license.php',
- mozilla => 'http://opensource.org/licenses/mozilla1.1.php',
- open_source => undef,
- unrestricted => undef,
- restrictive => undef,
- unknown => undef,
-);
+ $self->{values}{perl_version} = $version;
+}
sub license {
my $self = shift;
- return $self->{values}->{license} unless @_;
+ return $self->{values}{license} unless @_;
my $license = shift or die(
'Did not provide a value to license()'
);
- $self->{values}->{license} = $license;
+ $self->{values}{license} = $license;
# Automatically fill in license URLs
- if ( $license_urls{$license} ) {
- $self->resources( license => $license_urls{$license} );
+ if ( $license eq 'perl' ) {
+ $self->resources( license => 'http://dev.perl.org/licenses/' );
}
return 1;
@@ -250,7 +239,7 @@
sub provides {
my $self = shift;
- my $provides = ( $self->{values}->{provides} ||= {} );
+ my $provides = ( $self->{values}{provides} ||= {} );
%$provides = (%$provides, @_) if @_;
return $provides;
}
@@ -279,7 +268,7 @@
sub feature {
my $self = shift;
my $name = shift;
- my $features = ( $self->{values}->{features} ||= [] );
+ my $features = ( $self->{values}{features} ||= [] );
my $mods;
if ( @_ == 1 and ref( $_[0] ) ) {
@@ -307,16 +296,16 @@
while ( my ( $name, $mods ) = splice( @_, 0, 2 ) ) {
$self->feature( $name, @$mods );
}
- return $self->{values}->{features}
- ? @{ $self->{values}->{features} }
+ return $self->{values}{features}
+ ? @{ $self->{values}{features} }
: ();
}
sub no_index {
my $self = shift;
my $type = shift;
- push @{ $self->{values}->{no_index}->{$type} }, @_ if $type;
- return $self->{values}->{no_index};
+ push @{ $self->{values}{no_index}{$type} }, @_ if $type;
+ return $self->{values}{no_index};
}
sub read {
@@ -469,18 +458,10 @@
return 'unknown';
}
-sub _extract_bugtracker {
- my @links = $_[0] =~ m#L<(\Qhttp://rt.cpan.org/\E[^>]+)>#g;
- my %links;
- @links{@links}=();
- @links=keys %links;
- return @links;
-}
-
sub bugtracker_from {
my $self = shift;
my $content = Module::Install::_read($_[0]);
- my @links = _extract_bugtracker($content);
+ my @links = $content =~ m/L\<(http\:\/\/rt\.cpan\.org\/[^>]+)\>/g;
unless ( @links ) {
warn "Cannot determine bugtracker info from $_[0]\n";
return 0;
@@ -493,17 +474,6 @@
# Set the bugtracker
bugtracker( $links[0] );
return 1;
-}
-
-sub requires_from {
- my $self = shift;
- my $content = Module::Install::_readperl($_[0]);
- my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg;
- while ( @requires ) {
- my $module = shift @requires;
- my $version = shift @requires;
- $self->requires( $module => $version );
- }
}
# Convert triple-part versions (eg, 5.6.1 or 5.8.9) to
@@ -529,7 +499,7 @@
# MYMETA.yml Support
sub WriteMyMeta {
- die "WriteMyMeta has been deprecated";
+ $_[0]->write_mymeta;
}
sub write_mymeta {
@@ -573,8 +543,7 @@
}
# Save as the MYMETA.yml file
- print "Writing MYMETA.yml\n";
- YAML::Tiny::DumpFile('MYMETA.yml', $meta);
+ YAML::Tiny::DumpFile('MYMETA.yml', $meta);
}
1;
Modified: trunk/libclass-c3-adopt-next-perl/inc/Module/Install/Win32.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-c3-adopt-next-perl/inc/Module/Install/Win32.pm?rev=34334&op=diff
==============================================================================
--- trunk/libclass-c3-adopt-next-perl/inc/Module/Install/Win32.pm (original)
+++ trunk/libclass-c3-adopt-next-perl/inc/Module/Install/Win32.pm Wed Apr 29 19:20:01 2009
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.85';
+ $VERSION = '0.80';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
Modified: trunk/libclass-c3-adopt-next-perl/inc/Module/Install/WriteAll.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-c3-adopt-next-perl/inc/Module/Install/WriteAll.pm?rev=34334&op=diff
==============================================================================
--- trunk/libclass-c3-adopt-next-perl/inc/Module/Install/WriteAll.pm (original)
+++ trunk/libclass-c3-adopt-next-perl/inc/Module/Install/WriteAll.pm Wed Apr 29 19:20:01 2009
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.85';
+ $VERSION = '0.80';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
@@ -22,6 +22,7 @@
);
$self->sign(1) if $args{sign};
+ $self->Meta->write if $args{meta};
$self->admin->WriteAll(%args) if $self->is_admin;
$self->check_nmake if $args{check_nmake};
@@ -29,22 +30,11 @@
$self->makemaker_args( PL_FILES => {} );
}
- # Until ExtUtils::MakeMaker support MYMETA.yml, make sure
- # we clean it up properly ourself.
- $self->realclean_files('MYMETA.yml');
-
if ( $args{inline} ) {
$self->Inline->write;
} else {
$self->Makefile->write;
}
-
- # The Makefile write process adds a couple of dependencies,
- # so write the META.yml files after the Makefile.
- $self->Meta->write if $args{meta};
- $self->Meta->write_mymeta if $self->mymeta;
-
- return 1;
}
1;
Modified: trunk/libclass-c3-adopt-next-perl/lib/Class/C3/Adopt/NEXT.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-c3-adopt-next-perl/lib/Class/C3/Adopt/NEXT.pm?rev=34334&op=diff
==============================================================================
--- trunk/libclass-c3-adopt-next-perl/lib/Class/C3/Adopt/NEXT.pm (original)
+++ trunk/libclass-c3-adopt-next-perl/lib/Class/C3/Adopt/NEXT.pm Wed Apr 29 19:20:01 2009
@@ -8,7 +8,7 @@
use List::MoreUtils qw/none/;
use warnings::register;
-our $VERSION = '0.08';
+our $VERSION = '0.09';
{
my %c3_mro_ok;
@@ -115,7 +115,7 @@
=head1 DESCRIPTION
-L<NEXT> sucks. I mean, it B<really really sucks>. It was a good solution a few
+L<NEXT> was a good solution a few
years ago, but isn't any more. It's slow, and the order in which it
re-dispatches methods appears random at times. It also encourages bad
programming practices, as you end up with code to re-dispatch methods when all
@@ -146,52 +146,28 @@
=head1 MIGRATING
-There are two main reasons for using NEXT:
-
-=over
-
-=item Providing plugins which run functionality before/after your methods.
-
-Use L<Moose> and make all of your plugins L<Moose::Roles|Moose::Role>, then use
-method modifiers to wrap methods.
-
-Example:
-
- package MyApp::Plugin::FooBar;
- use Moose::Role;
-
- before 'a_method' => {
- my ($self) = @_;
- # Do some stuff
- };
-
-You can then use something like L<MooseX::Traits> or
-L<MooseX::Object::Pluggable> to load plugins dynamically.
-
-=item A complex class hierarchy where you actually need multiple dispatch.
-
-Recommended strategy is to find the core class responsible for loading all the
-other classes in your application and add the following code:
-
- use MRO::Compat;
- Class::C3::initialize();
-
-after you have loaded all of your modules.
-
-You then add C<use mro 'c3'> to the top of a package as you start converting it,
+=head2 Current code using NEXT
+
+You add C<use MRO::Compat> to the top of a package as you start converting it,
and gradually replace your calls to C<NEXT::method()> with
C<maybe::next::method()>, and calls to C<NEXT::ACTUAL::method()> with
C<next::method()>.
Example:
- $self->NEXT::yourmethodname();
- becomes
- $self->maybe::next::method();
-
- $self->NEXT::ACTUAL::yourmethodname();
- becomes
- $self->next::method();
+ sub yourmethod {
+ my $self = shift;
+
+ # $self->NEXT::yourmethod(@_); becomes
+ $self->maybe::next::method();
+ }
+
+ sub othermethod {
+ my $self = shift;
+
+ # $self->NEXT::ACTUAL::yourmethodname(); becomes
+ $self->next::method();
+ }
On systems with L<Class::C3::XS> present, this will automatically be used to
speed up method re-dispatch. If you are running perl version 5.9.5 or greater
@@ -200,7 +176,34 @@
and backwards compatible, taking advantage of native versions if available,
but falling back to using pure perl C<Class::C3>.
-=back
+=head2 Writing new code
+
+Use L<Moose> and make all of your plugins L<Moose::Roles|Moose::Role>, then use
+method modifiers to wrap methods.
+
+Example:
+
+ package MyApp::Role::FooBar;
+ use Moose::Role;
+
+ before 'a_method' => sub {
+ my ($self) = @_;
+ # Do some stuff
+ };
+
+ around 'a_method' => sub {
+ my $orig = shift;
+ my $self = shift;
+ # Do some stuff before
+ my $ret = $self->$orig(@_); # Run wrapped method (or not!)
+ # Do some stuff after
+ return $ret;
+ };
+
+ package MyApp;
+ use Moose;
+
+ with 'MyApp::Role::FooBar';
=head1 CAVEATS
@@ -209,7 +212,8 @@
fall back to using C<NEXT>. In this case a warning will be emitted.
Because calculating the MRO of every class every time C<< ->NEXT::foo >> is used
-from within it is too expensive, runtime manipulations of C<@ISA> are prohibited.
+from within it is too expensive, runtime manipulations of C<@ISA> are
+prohibited.
=head1 FUNCTIONS
More information about the Pkg-perl-cvs-commits
mailing list