Load XML-Feed-0.09 into trunk. v0.09
Simon Wistow [Tue, 22 Apr 2008 18:00:46 +0000 (18:00 +0000)]
20 files changed:
Changes
META.yml
inc/ExtUtils/AutoInstall.pm
inc/HTML/TokeParser.pm
inc/LWP.pm
inc/Module/AutoInstall.pm
inc/Module/Install.pm
inc/Module/Install/AutoInstall.pm
inc/Module/Install/Base.pm
inc/Module/Install/Build.pm
inc/Module/Install/Can.pm
inc/Module/Install/Fetch.pm
inc/Module/Install/Include.pm
inc/Module/Install/Makefile.pm
inc/Module/Install/Metadata.pm
inc/Module/Install/Win32.pm
inc/Module/Install/WriteAll.pm
lib/XML/Feed.pm
lib/XML/Feed/RSS.pm
t/02-create.t

diff --git a/Changes b/Changes
index 90e63a9..6867c96 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,7 +1,13 @@
-# $Id: Changes 1924 2006-03-03 17:34:15Z btrott $
+# $Id: Changes 1945 2006-07-11 03:31:58Z btrott $
 
 Revision history for XML::Feed
 
+0.09  2006.07.10
+    - Fixed date format errors with XML::Feed::RSS. Thanks to Tatsuhiko
+      Miyagawa for the patch.
+    - Use add_module to properly add namespaces to the RSS document. Thanks
+      to Tatsuhiko Miyagawa for the patch.
+
 0.08  2006.03.03
     - $feed->author wasn't being converted properly by Feed->convert. Thanks
       to Tatsuhiko Miyagawa for the patch.
index ebad772..eb071bd 100644 (file)
--- a/META.yml
+++ b/META.yml
@@ -4,7 +4,7 @@ build_requires:
   HTML::TokeParser: 0
   LWP: 0
 distribution_type: module
-generated_by: Module::Install version 0.57
+generated_by: Module::Install version 0.61
 license: perl
 name: XML-Feed
 no_index:
@@ -22,4 +22,4 @@ requires:
   URI::Fetch: 0
   XML::Atom: 0.08
   XML::RSS: 1.01
-version: 0.08
+version: 0.09
index e014565..fa43c34 100644 (file)
@@ -1,4 +1,4 @@
-#line 1 "inc/ExtUtils/AutoInstall.pm - /Library/Perl/5.8.1/ExtUtils/AutoInstall.pm"
+#line 1
 # $File: //member/autrijus/ExtUtils-AutoInstall/lib/ExtUtils/AutoInstall.pm $ 
 # $Revision: #9 $ $Change: 9532 $ $DateTime: 2004/01/01 06:47:30 $ vim: expandtab shiftwidth=4
 
index b248383..cb27ecf 100644 (file)
@@ -1,11 +1,11 @@
-#line 1 "inc/HTML/TokeParser.pm - /System/Library/Perl/Extras/5.8.6/darwin-thread-multi-2level/HTML/TokeParser.pm"
+#line 1
 package HTML::TokeParser;
 
-# $Id: TokeParser.pm,v 2.28 2003/10/14 10:11:05 gisle Exp $
+# $Id: TokeParser.pm,v 2.35 2005/12/02 16:08:17 gisle Exp $
 
 require HTML::PullParser;
 @ISA=qw(HTML::PullParser);
-$VERSION = sprintf("%d.%02d", q$Revision: 2.28 $ =~ /(\d+)\.(\d+)/);
+$VERSION = sprintf("%d.%02d", q$Revision: 2.35 $ =~ /(\d+)\.(\d+)/);
 
 use strict;
 use Carp ();
@@ -20,6 +20,9 @@ my %ARGS =
  process     => "'PI',token0,text",
  comment     => "'C',text",
  declaration => "'D',text",
+
+ # options that default on
+ unbroken_text => 1,
 );
 
 
@@ -152,4 +155,4 @@ sub get_phrase {
 
 __END__
 
-#line 341
+#line 367
index c87431d..9eac6b4 100644 (file)
@@ -1,4 +1,4 @@
-#line 1 "inc/LWP.pm - /Library/Perl/5.8.6/LWP.pm"
+#line 1
 #
 # $Id: LWP.pm,v 1.149 2005/12/08 12:06:22 gisle Exp $
 
index 3b71fbb..c1d151f 100644 (file)
@@ -1,12 +1,14 @@
-#line 1 "inc/Module/AutoInstall.pm - /Library/Perl/5.8.6/Module/AutoInstall.pm"
+#line 1
 package Module::AutoInstall;
-$Module::AutoInstall::VERSION = '1.01';
 
 use strict;
 use Cwd                 ();
 use ExtUtils::MakeMaker ();
 
-#line 218
+use vars qw{$VERSION};
+BEGIN {
+       $VERSION = '1.02';
+}
 
 # special map on pre-defined feature sets
 my %FeatureMap = (
@@ -19,7 +21,8 @@ my ( @Missing, @Existing,  %DisabledTests, $UnderCPAN,     $HasCPANPLUS );
 my ( $Config,  $CheckOnly, $SkipInstall,   $AcceptDefault, $TestOnly );
 my ( $PostambleActions, $PostambleUsed );
 
-_accept_default( !-t STDIN );      # see if it's a non-interactive session
+# See if it's a testing or non-interactive session
+_accept_default( $ENV{AUTOMATED_TESTING} or ! -t STDIN ); 
 _init();
 
 sub _accept_default {
@@ -92,7 +95,7 @@ sub import {
     my $core_all;
 
     print "*** $class version " . $class->VERSION . "\n";
-    print "*** Checking for dependencies...\n";
+    print "*** Checking for Perl dependencies...\n";
 
     my $cwd = Cwd::cwd();
 
@@ -690,7 +693,7 @@ sub _make_args {
     $PostambleActions = (
         $missing
         ? "\$(PERL) $0 --config=$config --installdeps=$missing"
-        : "\@\$(NOOP)"
+        : "\$(NOECHO) \$(NOOP)"
     );
 
     return %args;
@@ -731,7 +734,7 @@ sub postamble {
     return << ".";
 
 config :: installdeps
-\t\@\$(NOOP)
+\t\$(NOECHO) \$(NOOP)
 
 checkdeps ::
 \t\$(PERL) $0 --checkdeps
@@ -747,4 +750,4 @@ installdeps ::
 
 __END__
 
-#line 979
+#line 988
index a61b80b..b9c4207 100644 (file)
@@ -1,6 +1,22 @@
-#line 1 "/Users/btrott/devel/cpan/xml-feed/inc/Module/Install.pm - /Library/Perl/5.8.6/Module/Install.pm"
+#line 1
 package Module::Install;
 
+# For any maintainers:
+# The load order for Module::Install is a bit magic.
+# It goes something like this...
+#
+# IF ( host has Module::Install installed, creating author mode ) {
+#     1. Makefile.PL calls "use inc::Module::Install"
+#     2. $INC{inc/Module/Install.pm} set to installed version of inc::Module::Install
+#     3. The installed version of inc::Module::Install loads
+#     4. inc::Module::Install calls "require Module::Install"
+#     5. The ./inc/ version of Module::Install loads
+# } ELSE {
+#     1. Makefile.PL calls "use inc::Module::Install"
+#     2. $INC{inc/Module/Install.pm} set to ./inc/ version of Module::Install
+#     3. The ./inc/ version of Module::Install loads
+# }
+
 use 5.004;
 use strict 'vars';
 
@@ -12,11 +28,17 @@ BEGIN {
     # 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.57';
+    $VERSION = '0.61';
 }
 
-# inc::Module::Install must be loaded first
-unless ( $INC{join('/', inc => split(/::/, __PACKAGE__)).'.pm'} ) {
+# Whether or not inc::Module::Install is actually loaded, the
+# $INC{inc/Module/Install.pm} is what will still get set as long as
+# the caller loaded module this in the documented manner.
+# If not set, the caller may NOT have loaded the bundled version, and thus
+# they may not have a MI version that works with the Makefile.PL. This would
+# result in false errors or unexpected behaviour. And we don't want that.
+my $file = join( '/', 'inc', split /::/, __PACKAGE__ ) . '.pm';
+unless ( $INC{$file} ) {
     die <<"END_DIE";
 Please invoke ${\__PACKAGE__} with:
 
@@ -35,21 +57,20 @@ use File::Path ();
 use FindBin;
 
 *inc::Module::Install::VERSION = *VERSION;
-@inc::Module::Install::ISA     = 'Module::Install';
+@inc::Module::Install::ISA     = __PACKAGE__;
 
 sub autoload {
-    my $self   = shift;
-    my $caller = $self->_caller;
-    my $cwd    = Cwd::cwd();
-    my $sym    = "$caller\::AUTOLOAD";
-
+    my $self = shift;
+    my $who  = $self->_caller;
+    my $cwd  = Cwd::cwd();
+    my $sym  = "${who}::AUTOLOAD";
     $sym->{$cwd} = sub {
         my $pwd = Cwd::cwd();
         if ( my $code = $sym->{$pwd} ) {
             # delegate back to parent dirs
             goto &$code unless $cwd eq $pwd;
         }
-        $$sym =~ /([^:]+)$/ or die "Cannot autoload $caller - $sym";
+        $$sym =~ /([^:]+)$/ or die "Cannot autoload $who - $sym";
         unshift @_, ($self, $1);
         goto &{$self->can('call')} unless uc($1) eq $1;
     };
@@ -58,18 +79,18 @@ sub autoload {
 sub import {
     my $class = shift;
     my $self  = $class->new(@_);
+    my $who   = $self->_caller;
 
     unless ( -f $self->{file} ) {
         require "$self->{path}/$self->{dispatch}.pm";
         File::Path::mkpath("$self->{prefix}/$self->{author}");
-        $self->{admin} = 
-          "$self->{name}::$self->{dispatch}"->new(_top => $self);
+        $self->{admin} = "$self->{name}::$self->{dispatch}"->new( _top => $self );
         $self->{admin}->init;
         @_ = ($class, _self => $self);
         goto &{"$self->{name}::import"};
     }
 
-    *{$self->_caller . "::AUTOLOAD"} = $self->autoload;
+    *{"${who}::AUTOLOAD"} = $self->autoload;
     $self->preload;
 
     # Unregister loader and worker packages so subdirs can use them again
@@ -95,18 +116,18 @@ sub preload {
     my %seen;
     foreach my $obj ( @exts ) {
         while (my ($method, $glob) = each %{ref($obj) . '::'}) {
-            next unless defined *{$glob}{CODE};
+            next unless exists &{ref($obj).'::'.$method};
             next if $method =~ /^_/;
             next if $method eq uc($method);
             $seen{$method}++;
         }
     }
 
-    my $caller = $self->_caller;
+    my $who = $self->_caller;
     foreach my $name ( sort keys %seen ) {
-        *{"${caller}::$name"} = sub {
-            ${"${caller}::AUTOLOAD"} = "${caller}::$name";
-            goto &{"${caller}::AUTOLOAD"};
+        *{"${who}::$name"} = sub {
+            ${"${who}::AUTOLOAD"} = "${who}::$name";
+            goto &{"${who}::AUTOLOAD"};
         };
     }
 }
@@ -124,30 +145,26 @@ sub new {
 
     $args{dispatch} ||= 'Admin';
     $args{prefix}   ||= 'inc';
-    $args{author}   ||= '.author';
+    $args{author}   ||= ($^O eq 'VMS' ? '_author' : '.author');
     $args{bundle}   ||= 'inc/BUNDLES';
     $args{base}     ||= $base_path;
-
     $class =~ s/^\Q$args{prefix}\E:://;
     $args{name}     ||= $class;
     $args{version}  ||= $class->VERSION;
-
     unless ( $args{path} ) {
         $args{path}  = $args{name};
         $args{path}  =~ s!::!/!g;
     }
     $args{file}     ||= "$args{base}/$args{prefix}/$args{path}.pm";
 
-    bless(\%args, $class);
+    bless( \%args, $class );
 }
 
 sub call {
-    my $self   = shift;
-    my $method = shift;
-    my $obj    = $self->load($method) or return;
-
-    unshift @_, $obj;
-    goto &{$obj->can($method)};
+       my ($self, $method) = @_;
+       my $obj = $self->load($method) or return;
+        splice(@_, 0, 2, $obj);
+       goto &{$obj->can($method)};
 }
 
 sub load {
@@ -173,13 +190,13 @@ END_DIE
 }
 
 sub load_extensions {
-    my ($self, $path, $top_obj) = @_;
+    my ($self, $path, $top) = @_;
 
-    unshift @INC, $self->{prefix}
-        unless grep { $_ eq $self->{prefix} } @INC;
+    unless ( grep { lc $_ eq lc $self->{prefix} } @INC ) {
+        unshift @INC, $self->{prefix};
+    }
 
-    local @INC = ($path, @INC);
-    foreach my $rv ($self->find_extensions($path)) {
+    foreach my $rv ( $self->find_extensions($path) ) {
         my ($file, $pkg) = @{$rv};
         next if $self->{pathnames}{$pkg};
 
@@ -190,7 +207,7 @@ sub load_extensions {
             next;
         }
         $self->{pathnames}{$pkg} = delete $INC{$file};
-        push @{$self->{extensions}}, &{$new}($pkg, _top => $top_obj );
+        push @{$self->{extensions}}, &{$new}($pkg, _top => $top );
     }
 
     $self->{extensions} ||= [];
@@ -203,10 +220,32 @@ sub find_extensions {
     File::Find::find( sub {
         my $file = $File::Find::name;
         return unless $file =~ m!^\Q$path\E/(.+)\.pm\Z!is;
-        return if $1 eq $self->{dispatch};
+        my $subpath = $1;
+        return if lc($subpath) eq lc($self->{dispatch});
+
+        $file = "$self->{path}/$subpath.pm";
+        my $pkg = "$self->{name}::$subpath";
+        $pkg =~ s!/!::!g;
+
+        # If we have a mixed-case package name, assume case has been preserved
+        # correctly.  Otherwise, root through the file to locate the case-preserved
+        # version of the package name.
+        if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) {
+            open PKGFILE, "<$subpath.pm" or die "find_extensions: Can't open $subpath.pm: $!";
+            my $in_pod = 0;
+            while ( <PKGFILE> ) {
+                $in_pod = 1 if /^=\w/;
+                $in_pod = 0 if /^=cut/;
+                next if ($in_pod || /^=cut/);  # skip pod text
+                next if /^\s*#/;               # and comments
+                if ( m/^\s*package\s+($pkg)\s*;/i ) {
+                    $pkg = $1;
+                    last;
+                }
+            }
+            close PKGFILE;
+        }
 
-        $file = "$self->{path}/$1.pm";
-        my $pkg = "$self->{name}::$1"; $pkg =~ s!/!::!g;
         push @found, [ $file, $pkg ];
     }, $path ) if -d $path;
 
@@ -214,15 +253,13 @@ sub find_extensions {
 }
 
 sub _caller {
-    my $depth  = 0;
-    my $caller = caller($depth);
-
-    while ($caller eq __PACKAGE__) {
+    my $depth = 0;
+    my $call  = caller($depth);
+    while ( $call eq __PACKAGE__ ) {
         $depth++;
-        $caller = caller($depth);
+        $call = caller($depth);
     }
-
-    $caller;
+    return $call;
 }
 
 1;
index 26626dd..7a5b6bf 100644 (file)
@@ -1,10 +1,10 @@
-#line 1 "inc/Module/Install/AutoInstall.pm - /Library/Perl/5.8.6/Module/Install/AutoInstall.pm"
+#line 1
 package Module::Install::AutoInstall;
 
 use Module::Install::Base;
 @ISA = qw{Module::Install::Base};
 
-$VERSION = '0.57';
+$VERSION = '0.61';
 
 use strict;
 
index bcc3966..d003728 100644 (file)
@@ -1,7 +1,7 @@
-#line 1 "inc/Module/Install/Base.pm - /Library/Perl/5.8.6/Module/Install/Base.pm"
+#line 1
 package Module::Install::Base;
 
-$VERSION = '0.57';
+$VERSION = '0.61';
 
 # Suspend handler for "redefined" warnings
 BEGIN {
index 579474a..0b94be8 100644 (file)
@@ -1,10 +1,10 @@
-#line 1 "inc/Module/Install/Build.pm - /Library/Perl/5.8.6/Module/Install/Build.pm"
+#line 1
 package Module::Install::Build;
 
 use Module::Install::Base;
 @ISA = qw(Module::Install::Base);
 
-$VERSION = '0.57';
+$VERSION = '0.61';
 
 use strict;
 
index ad18784..f2034db 100644 (file)
@@ -1,75 +1,82 @@
-#line 1 "inc/Module/Install/Can.pm - /Library/Perl/5.8.6/Module/Install/Can.pm"
+#line 1
 package Module::Install::Can;
 
-use Module::Install::Base;
-@ISA = qw(Module::Install::Base);
-
-$VERSION = '0.57';
-
 use strict;
+use Module::Install::Base;
 use Config ();
+### This adds a 5.005 Perl version dependency.
+### This is a bug and will be fixed.
+use File::Spec ();
 use ExtUtils::MakeMaker ();
 
-# This may introduce a 5.005 dependency, or at the very least it may
-# not bootstrap properly under 5.004.
-use File::Spec ();
+use vars qw{$VERSION @ISA};
+BEGIN {
+       $VERSION = '0.61';
+       @ISA     = qw{Module::Install::Base};
+}
+
+
 # check if we can load some module
+### Upgrade this to not have to load the module if possible
 sub can_use {
-    my ($self, $mod, $ver) = @_;
-    $mod =~ s{::|\\}{/}g;
-    $mod .= ".pm" unless $mod =~ /\.pm$/i;
+       my ($self, $mod, $ver) = @_;
+       $mod =~ s{::|\\}{/}g;
+       $mod .= '.pm' unless $mod =~ /\.pm$/i;
 
-    my $pkg = $mod;
-    $pkg =~ s{/}{::}g;
-    $pkg =~ s{\.pm$}{}i;
+       my $pkg = $mod;
+       $pkg =~ s{/}{::}g;
+       $pkg =~ s{\.pm$}{}i;
 
-    local $@;
-    eval { require $mod; $pkg->VERSION($ver || 0); 1 };
+       local $@;
+       eval { require $mod; $pkg->VERSION($ver || 0); 1 };
 }
 
 # check if we can run some command
 sub can_run {
-    my ($self, $cmd) = @_;
+       my ($self, $cmd) = @_;
 
-    my $_cmd = $cmd;
-    return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd));
+       my $_cmd = $cmd;
+       return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd));
 
-    for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
-        my $abs = File::Spec->catfile($dir, $_[1]);
-        return $abs if (-x $abs or $abs = MM->maybe_command($abs));
-    }
+       for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
+               my $abs = File::Spec->catfile($dir, $_[1]);
+               return $abs if (-x $abs or $abs = MM->maybe_command($abs));
+       }
 
-    return;
+       return;
 }
 
+# can we locate a (the) C compiler
 sub can_cc {
-    my $self = shift;
-    my @chunks = split(/ /, $Config::Config{cc}) or return;
+       my $self   = shift;
+       my @chunks = split(/ /, $Config::Config{cc}) or return;
 
-    # $Config{cc} may contain args; try to find out the program part
-    while (@chunks) {
-        return $self->can_run("@chunks") || (pop(@chunks), next);
-    }
+       # $Config{cc} may contain args; try to find out the program part
+       while (@chunks) {
+               return $self->can_run("@chunks") || (pop(@chunks), next);
+       }
 
-    return;
+       return;
 }
 
 # Fix Cygwin bug on maybe_command();
-if ($^O eq 'cygwin') {
-    require ExtUtils::MM_Cygwin;
-    require ExtUtils::MM_Win32;
-    if ( ! defined(&ExtUtils::MM_Cygwin::maybe_command) ) {
-        *ExtUtils::MM_Cygwin::maybe_command = sub {
-            my ($self, $file) = @_;
-            if ($file =~ m{^/cygdrive/}i and ExtUtils::MM_Win32->can('maybe_command')) {
-                ExtUtils::MM_Win32->maybe_command($file);
-            }
-            else {
-                ExtUtils::MM_Unix->maybe_command($file);
-            }
-        }
-    }
+if ( $^O eq 'cygwin' ) {
+       require ExtUtils::MM_Cygwin;
+       require ExtUtils::MM_Win32;
+       if ( ! defined(&ExtUtils::MM_Cygwin::maybe_command) ) {
+               *ExtUtils::MM_Cygwin::maybe_command = sub {
+                       my ($self, $file) = @_;
+                       if ($file =~ m{^/cygdrive/}i and ExtUtils::MM_Win32->can('maybe_command')) {
+                               ExtUtils::MM_Win32->maybe_command($file);
+                       } else {
+                               ExtUtils::MM_Unix->maybe_command($file);
+                       }
+               }
+       }
 }
 
 1;
+
+__END__
+
+#line 157
index 811204c..09ed284 100644 (file)
@@ -1,10 +1,14 @@
-#line 1 "inc/Module/Install/Fetch.pm - /Library/Perl/5.8.6/Module/Install/Fetch.pm"
+#line 1
 package Module::Install::Fetch;
 
+use strict;
 use Module::Install::Base;
-@ISA = qw(Module::Install::Base);
 
-$VERSION = '0.57';
+use vars qw{$VERSION @ISA};
+BEGIN {
+       $VERSION = '0.61';
+       @ISA     = qw{Module::Install::Base};
+}
 
 sub get_file {
     my ($self, %args) = @_;
@@ -55,14 +59,14 @@ sub get_file {
             chdir $dir; return;
         }
 
-        my @dialog = split(/\n/, << ".");
+        my @dialog = split(/\n/, <<"END_FTP");
 open $host
 user anonymous anonymous\@example.com
 cd $path
 binary
 get $file $file
 quit
-.
+END_FTP
         foreach (@dialog) { $fh->print("$_\n") }
         $fh->close;
     } }
index a722a02..526e8c8 100644 (file)
@@ -1,10 +1,10 @@
-#line 1 "inc/Module/Install/Include.pm - /Library/Perl/5.8.6/Module/Install/Include.pm"
+#line 1
 package Module::Install::Include;
 
 use Module::Install::Base;
 @ISA = qw(Module::Install::Base);
 
-$VERSION = '0.57';
+$VERSION = '0.61';
 
 use strict;
 
index c2cb32a..d0206aa 100644 (file)
@@ -1,4 +1,4 @@
-#line 1 "inc/Module/Install/Makefile.pm - /Library/Perl/5.8.6/Module/Install/Makefile.pm"
+#line 1
 package Module::Install::Makefile;
 
 use strict 'vars';
@@ -7,15 +7,30 @@ use ExtUtils::MakeMaker ();
 
 use vars qw{$VERSION @ISA};
 BEGIN {
-       $VERSION = '0.57';
+       $VERSION = '0.61';
        @ISA     = qw{Module::Install::Base};
 }
 
 sub Makefile { $_[0] }
 
+my %seen = ();
+
 sub prompt {
     shift;
-    goto &ExtUtils::MakeMaker::prompt;
+
+    # Infinite loop protection
+    my @c = caller();
+    if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) {
+        die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])";
+    }
+
+    # In automated testing, always use defaults
+    if ( $ENV{AUTOMATED_TESTING} and ! $ENV{PERL_MM_USE_DEFAULT} ) {
+        local $ENV{PERL_MM_USE_DEFAULT} = 1;
+        goto &ExtUtils::MakeMaker::prompt;
+    } else {
+        goto &ExtUtils::MakeMaker::prompt;
+    }
 }
 
 sub makemaker_args {
@@ -53,6 +68,15 @@ sub clean_files {
     );
 }
 
+sub realclean_files {
+    my $self  = shift;
+    my $realclean = $self->makemaker_args->{realclean} ||= {};
+    %$realclean = (
+        %$realclean, 
+        FILES => join(' ', grep length, $realclean->{FILES}, @_),
+    );
+}
+
 sub libs {
     my $self = shift;
     my $libs = ref $_[0] ? shift : [ shift ];
@@ -69,25 +93,26 @@ sub write {
     die "&Makefile->write() takes no arguments\n" if @_;
 
     my $args = $self->makemaker_args;
-
     $args->{DISTNAME} = $self->name;
-    $args->{NAME} = $self->module_name || $self->name || $self->determine_NAME($args);
-    $args->{VERSION} = $self->version || $self->determine_VERSION($args);
-    $args->{NAME} =~ s/-/::/g;
-
-    $args->{test} = {TESTS => $self->tests} if $self->tests;
-
+    $args->{NAME}     = $self->module_name || $self->name || $self->determine_NAME($args);
+    $args->{VERSION}  = $self->version || $self->determine_VERSION($args);
+    $args->{NAME}     =~ s/-/::/g;
+    if ( $self->tests ) {
+        $args->{test} = { TESTS => $self->tests };
+    }
     if ($] >= 5.005) {
         $args->{ABSTRACT} = $self->abstract;
-        $args->{AUTHOR} = $self->author;
+        $args->{AUTHOR}   = $self->author;
     }
     if ( eval($ExtUtils::MakeMaker::VERSION) >= 6.10 ) {
         $args->{NO_META} = 1;
     }
-    if ( eval($ExtUtils::MakeMaker::VERSION) > 6.17 ) {
-        $args->{SIGN} = 1 if $self->sign;
+    if ( eval($ExtUtils::MakeMaker::VERSION) > 6.17 and $self->sign ) {
+        $args->{SIGN} = 1;
+    }
+    unless ( $self->is_admin ) {
+        delete $args->{SIGN};
     }
-    delete $args->{SIGN} unless $self->is_admin;
 
     # merge both kinds of requires into prereq_pm
     my $prereq = ($args->{PREREQ_PM} ||= {});
@@ -104,49 +129,51 @@ sub write {
         }
     }
 
-    if (my $perl_version = $self->perl_version) {
+    if ( my $perl_version = $self->perl_version ) {
         eval "use $perl_version; 1"
-            or die "ERROR: perl: Version $] is installed, ".
-                   "but we need version >= $perl_version";
+            or die "ERROR: perl: Version $] is installed, "
+                . "but we need version >= $perl_version";
     }
 
-    my %args = map {($_ => $args->{$_})} grep {defined($args->{$_})} keys %$args;
-
+    my %args = map { ( $_ => $args->{$_} ) } grep {defined($args->{$_})} keys %$args;
     if ($self->admin->preop) {
         $args{dist} = $self->admin->preop;
     }
 
-    ExtUtils::MakeMaker::WriteMakefile(%args);
-
-    $self->fix_up_makefile();
+    my $mm = ExtUtils::MakeMaker::WriteMakefile(%args);
+    $self->fix_up_makefile($mm->{FIRST_MAKEFILE} || 'Makefile');
 }
 
 sub fix_up_makefile {
-    my $self = shift;
-    my $top_class = ref($self->_top) || '';
-    my $top_version = $self->_top->VERSION || '';
+    my $self          = shift;
+    my $makefile_name = shift;
+    my $top_class     = ref($self->_top) || '';
+    my $top_version   = $self->_top->VERSION || '';
 
     my $preamble = $self->preamble 
-       ? "# Preamble by $top_class $top_version\n" . $self->preamble
-       : '';
-    my $postamble = "# Postamble by $top_class $top_version\n" . 
-                    ($self->postamble || '');
+        ? "# Preamble by $top_class $top_version\n"
+            . $self->preamble
+        : '';
+    my $postamble = "# Postamble by $top_class $top_version\n"
+        . ($self->postamble || '');
 
     local *MAKEFILE;
-    open MAKEFILE, '< Makefile' or die $!;
+    open MAKEFILE, "< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
     my $makefile = do { local $/; <MAKEFILE> };
     close MAKEFILE or die $!;
 
     $makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /;
     $makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g;
     $makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g;
+    $makefile =~ s/^(FULLPERL = .*)/$1 "-Iinc"/m;
+    $makefile =~ s/^(PERL = .*)/$1 "-Iinc"/m;
 
-    $makefile =~ s/^(FULLPERL = .*)/$1 -Iinc/m;
-    $makefile =~ s/^(PERL = .*)/$1 -Iinc/m;
+    # XXX - This is currently unused; not sure if it breaks other MM-users
+    # $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg;
 
-    open MAKEFILE, '> Makefile' or die $!;
-    print MAKEFILE "$preamble$makefile$postamble" or die $!;
-    close MAKEFILE or die $!;
+    open  MAKEFILE, "> $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+    print MAKEFILE  "$preamble$makefile$postamble" or die $!;
+    close MAKEFILE  or die $!;
 
     1;
 }
@@ -168,4 +195,4 @@ sub postamble {
 
 __END__
 
-#line 295
+#line 324
index cc1dc9e..0c47548 100644 (file)
@@ -1,10 +1,10 @@
-#line 1 "inc/Module/Install/Metadata.pm - /Library/Perl/5.8.6/Module/Install/Metadata.pm"
+#line 1
 package Module::Install::Metadata;
 
 use Module::Install::Base;
 @ISA = qw{Module::Install::Base};
 
-$VERSION = '0.57';
+$VERSION = '0.61';
 
 use strict 'vars';
 
@@ -161,7 +161,9 @@ sub features {
     while ( my ( $name, $mods ) = splice( @_, 0, 2 ) ) {
         $self->feature( $name, @$mods );
     }
-    return @{ $self->{values}{features} };
+    return $self->{values}->{features}
+       ? @{ $self->{values}->{features} }
+       : ();
 }
 
 sub no_index {
index 4897485..6483b03 100644 (file)
@@ -1,42 +1,44 @@
-#line 1 "inc/Module/Install/Win32.pm - /Library/Perl/5.8.6/Module/Install/Win32.pm"
+#line 1
 package Module::Install::Win32;
 
+use strict;
 use Module::Install::Base;
-@ISA = qw(Module::Install::Base);
-
-$VERSION = '0.57';
 
-use strict;
+use vars qw{$VERSION @ISA};
+BEGIN {
+       $VERSION = '0.61';
+       @ISA     = qw{Module::Install::Base};
+}
 
 # determine if the user needs nmake, and download it if needed
 sub check_nmake {
-    my $self = shift;
-    $self->load('can_run');
-    $self->load('get_file');
-
-    require Config;
-    return unless (
-        $Config::Config{make}                   and
-        $Config::Config{make} =~ /^nmake\b/i    and
-        $^O eq 'MSWin32'                        and
-        !$self->can_run('nmake')
-    );
-
-    print "The required 'nmake' executable not found, fetching it...\n";
-
-    require File::Basename;
-    my $rv = $self->get_file(
-        url         => 'http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe',
-        ftp_url     => 'ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe',
-        local_dir   => File::Basename::dirname($^X),
-        size        => 51928,
-        run         => 'Nmake15.exe /o > nul',
-        check_for   => 'Nmake.exe',
-        remove      => 1,
-    );
-
-    if (!$rv) {
-        die << '.';
+       my $self = shift;
+       $self->load('can_run');
+       $self->load('get_file');
+       
+       require Config;
+       return unless (
+               $^O eq 'MSWin32'                     and
+               $Config::Config{make}                and
+               $Config::Config{make} =~ /^nmake\b/i and
+               ! $self->can_run('nmake')
+       );
+
+       print "The required 'nmake' executable not found, fetching it...\n";
+
+       require File::Basename;
+       my $rv = $self->get_file(
+               url       => 'http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe',
+               ftp_url   => 'ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe',
+               local_dir => File::Basename::dirname($^X),
+               size      => 51928,
+               run       => 'Nmake15.exe /o > nul',
+               check_for => 'Nmake.exe',
+               remove    => 1,
+       );
+
+       if (!$rv) {
+        die <<'END_MESSAGE';
 
 -------------------------------------------------------------------------------
 
@@ -55,11 +57,8 @@ that directory, and run "Nmake15.exe" from there; that will create the
 You may then resume the installation process described in README.
 
 -------------------------------------------------------------------------------
-.
-    }
+END_MESSAGE
+       }
 }
 
 1;
-
-__END__
-
index 7b289be..586cae2 100644 (file)
@@ -1,10 +1,10 @@
-#line 1 "inc/Module/Install/WriteAll.pm - /Library/Perl/5.8.6/Module/Install/WriteAll.pm"
+#line 1
 package Module::Install::WriteAll;
 
 use Module::Install::Base;
 @ISA = qw(Module::Install::Base);
 
-$VERSION = '0.57';
+$VERSION = '0.61';
 
 use strict;
 
index 0ddd074..864d2b5 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: Feed.pm 1920 2006-02-28 00:00:56Z btrott $
+# $Id: Feed.pm 1927 2006-03-07 02:29:25Z btrott $
 
 package XML::Feed;
 use strict;
@@ -8,7 +8,7 @@ use Feed::Find;
 use URI::Fetch;
 use Carp;
 
-our $VERSION = '0.08';
+our $VERSION = '0.09';
 
 sub new {
     my $class = shift;
index 7ecd02a..4009c9a 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: RSS.pm 1917 2006-02-07 07:11:44Z btrott $
+# $Id: RSS.pm 1934 2006-04-22 05:13:55Z btrott $
 
 package XML::Feed::RSS;
 use strict;
@@ -13,6 +13,8 @@ sub init_empty {
     my $feed = shift;
     eval "use $PREFERRED_PARSER"; die $@ if $@;
     $feed->{rss} = $PREFERRED_PARSER->new( version => '2.0' );
+    $feed->{rss}->add_module(prefix => "content", uri => 'http://purl.org/rss/1.0/modules/content/');
+    $feed->{rss}->add_module(prefix => "dcterms", uri => 'http://purl.org/rss/1.0/modules/dcterms/');
     $feed;
 }
 
@@ -81,12 +83,16 @@ sub modified {
         ## this date is formatted for an RSS 1.0 feed. So it's commented out.
         #$rss->channel->{dc}{date} =
         #    DateTime::Format::W3CDTF->format_datetime($_[0]);
-    } else { 
-        if (my $ts = $rss->channel('pubDate')) {
-            return DateTime::Format::Mail->parse_datetime($ts);
-        } elsif ($ts = $rss->channel->{dc}{date}) {
-            return DateTime::Format::W3CDTF->parse_datetime($ts);
-        }
+    } else {
+        my $date;
+        eval {
+            if (my $ts = $rss->channel('pubDate')) {
+                $date = DateTime::Format::Mail->parse_datetime($ts);
+            } elsif ($ts = $rss->channel->{dc}{date}) {
+                $date = DateTime::Format::W3CDTF->parse_datetime($ts);
+            }
+        };
+        return $date;
     }
 }
 
@@ -140,9 +146,9 @@ sub summary {
         ## Because of the logic below, we need to add some dummy content,
         ## so that we'll properly recognize the description we enter as
         ## the summary.
-        if (!$item->{'http://purl.org/rss/1.0/modules/content/'}{encoded} &&
+        if (!$item->{content}{encoded} &&
             !$item->{'http://www.w3.org/1999/xhtml'}{body}) {
-            $item->{'http://purl.org/rss/1.0/modules/content/'}{encoded} = ' ';
+            $item->{content}{encoded} = ' ';
         }
     } else {
         ## Some RSS feeds use <description> for a summary, and some use it
@@ -152,7 +158,7 @@ sub summary {
         ## typically used for the full content, use <description> as summary.
         my $txt;
         if ($item->{description} &&
-            ($item->{'http://purl.org/rss/1.0/modules/content/'}{encoded} ||
+            ($item->{content}{encoded} ||
              $item->{'http://www.w3.org/1999/xhtml'}{body})) {
             $txt = $item->{description};
         }
@@ -164,10 +170,10 @@ sub content {
     my $item = shift->{entry};
     if (@_) {
         my $c = ref($_[0]) eq 'XML::Feed::Content' ? $_[0]->body : $_[0];
-        $item->{'http://purl.org/rss/1.0/modules/content/'}{encoded} = $c;
+        $item->{content}{encoded} = $c;
     } else {
         my $body =
-            $item->{'http://purl.org/rss/1.0/modules/content/'}{encoded} ||
+            $item->{content}{encoded} ||
             $item->{'http://www.w3.org/1999/xhtml'}{body} ||
             $item->{description};
         XML::Feed::Content->wrap({ type => 'text/html', body => $body });
@@ -227,10 +233,10 @@ sub issued {
 sub modified {
     my $item = shift->{entry};
     if (@_) {
-        $item->{'http://purl.org/rss/1.0/modules/dcterms/'}{modified} =
+        $item->{dcterms}{modified} =
             DateTime::Format::W3CDTF->format_datetime($_[0]);
     } else {
-        if (my $ts = $item->{'http://purl.org/rss/1.0/modules/dcterms/'}{modified}) {
+        if (my $ts = $item->{dcterms}{modified}) {
             return eval { DateTime::Format::W3CDTF->parse_datetime($ts) };
         }
     }
index a55b41b..56fe137 100644 (file)
@@ -1,7 +1,7 @@
 # $Id$
 
 use strict;
-use Test::More tests => 66;
+use Test::More tests => 69;
 use XML::Feed;
 use XML::Feed::Entry;
 use XML::Feed::Content;
@@ -71,4 +71,9 @@ for my $format (qw( Atom RSS )) {
     my @e = $feed->entries;
     is(scalar @e, 1, 'One post in the feed');
     is($e[0]->title, 'Foo Bar', 'Correct post');
+    is($e[0]->content->body, 'This is the content (again).', 'content is still correct');
+
+    if ($format eq 'Atom') {
+        like $feed->as_xml, qr/This is the content/;
+    }
 }