r14679 - in /trunk/libxml-rss-perl: Changes META.yml debian/changelog lib/XML/RSS.pm lib/XML/RSS/Private/Output/Base.pm t/2.0-permalink.t t/items-are-0.t

gregoa-guest at users.alioth.debian.org gregoa-guest at users.alioth.debian.org
Sun Feb 10 02:51:55 UTC 2008


Author: gregoa-guest
Date: Sun Feb 10 02:51:54 2008
New Revision: 14679

URL: http://svn.debian.org/wsvn/?sc=1&rev=14679
Log:
New upstream release; incorporates joeyh's patch.

Modified:
    trunk/libxml-rss-perl/Changes
    trunk/libxml-rss-perl/META.yml
    trunk/libxml-rss-perl/debian/changelog
    trunk/libxml-rss-perl/lib/XML/RSS.pm
    trunk/libxml-rss-perl/lib/XML/RSS/Private/Output/Base.pm
    trunk/libxml-rss-perl/t/2.0-permalink.t
    trunk/libxml-rss-perl/t/items-are-0.t

Modified: trunk/libxml-rss-perl/Changes
URL: http://svn.debian.org/wsvn/trunk/libxml-rss-perl/Changes?rev=14679&op=diff
==============================================================================
--- trunk/libxml-rss-perl/Changes (original)
+++ trunk/libxml-rss-perl/Changes Sun Feb 10 02:51:54 2008
@@ -1,4 +1,21 @@
 Revision history for Perl module XML::RSS
+
+1.32 - February 8, 2008
+       - Fixed http://rt.cpan.org/Public/Bug/Display.html?id=25336 :
+           - made sure the namespace specified elements can have a hash
+           as a value in which case they'll be outputted as a standalone tag
+           with attributes.
+       - Fixed http://rt.cpan.org/Ticket/Display.html?id=25368 :
+           - changed pop() to shift() to remove the oldest item in the
+           example in lib/XML/RSS.pm, per the comments in the bug report.
+       - Fixed http://rt.cpan.org/Ticket/Display.html?id=24329#txn-296761 :
+           - updated the URLs for information about RSS mentioned under
+           "=head1 DESCRIPTION", based on a Google search. 
+           - (Shlomi Fish)
+       - Fixed http://rt.cpan.org/Ticket/Display.html?id=33001 :
+           - made sure that isPermalink is true if and only if the isPermalink
+           attribute is "true". Not if it is non-existent, etc.
+           - this modified the behaviour of the module.
 
 1.31 - June 29, 2007
        - Fixed the save() function to handle perl-5.6.x (and possibly below)

Modified: trunk/libxml-rss-perl/META.yml
URL: http://svn.debian.org/wsvn/trunk/libxml-rss-perl/META.yml?rev=14679&op=diff
==============================================================================
--- trunk/libxml-rss-perl/META.yml (original)
+++ trunk/libxml-rss-perl/META.yml Sun Feb 10 02:51:54 2008
@@ -1,10 +1,11 @@
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
-name:         XML-RSS
-version:      1.31
-version_from: lib/XML/RSS.pm
-installdirs:  site
-requires:
+--- #YAML:1.0
+name:                XML-RSS
+version:             1.32
+abstract:            ~
+license:             ~
+generated_by:        ExtUtils::MakeMaker version 6.36
+distribution_type:   module
+requires:     
     DateTime:                      0
     DateTime::Format::Mail:        0
     DateTime::Format::W3CDTF:      0
@@ -12,6 +13,6 @@
     Test::Manifest:                0.9
     Test::More:                    0
     XML::Parser:                   2.23
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.30
+meta-spec:
+    url:     http://module-build.sourceforge.net/META-spec-v1.2.html
+    version: 1.2

Modified: trunk/libxml-rss-perl/debian/changelog
URL: http://svn.debian.org/wsvn/trunk/libxml-rss-perl/debian/changelog?rev=14679&op=diff
==============================================================================
--- trunk/libxml-rss-perl/debian/changelog (original)
+++ trunk/libxml-rss-perl/debian/changelog Sun Feb 10 02:51:54 2008
@@ -1,4 +1,4 @@
-libxml-rss-perl (1.31-4) UNRELEASED; urgency=low
+libxml-rss-perl (1.32-1) UNRELEASED; urgency=low
 
   [ gregor herrmann ]
   * debian/rules: delete /usr/lib/perl5 only if it exists.
@@ -7,7 +7,10 @@
   * Fix handling of guid's isPermaLink attribute -- if it's not set,
     it's false, not true. Closes: #463774
 
- -- gregor herrmann <gregor+debian at comodo.priv.at>  Wed, 09 Jan 2008 21:19:29 +0100
+  [ gregor herrmann ]
+  * New upstream release; incorporates joeyh's patch.
+  
+ -- gregor herrmann <gregor+debian at comodo.priv.at>  Sun, 10 Feb 2008 03:49:08 +0100
 
 libxml-rss-perl (1.31-3) unstable; urgency=low
 

Modified: trunk/libxml-rss-perl/lib/XML/RSS.pm
URL: http://svn.debian.org/wsvn/trunk/libxml-rss-perl/lib/XML/RSS.pm?rev=14679&op=diff
==============================================================================
--- trunk/libxml-rss-perl/lib/XML/RSS.pm (original)
+++ trunk/libxml-rss-perl/lib/XML/RSS.pm Sun Feb 10 02:51:54 2008
@@ -14,7 +14,7 @@
 
 use vars qw($VERSION $AUTOLOAD @ISA $AUTO_ADD);
 
-$VERSION = '1.31';
+$VERSION = '1.32';
 
 $AUTO_ADD = 0;
 
@@ -786,12 +786,13 @@
             }
         }
 
-        # guid element is a permanent link IFF isPermaLink attribute is set
-        # to true
+        # guid element is a permanent link unless isPermaLink attribute is set to false
     }
     elsif ($el eq 'guid') {
         $self->{'items'}->[$self->{num_items} - 1]->{'isPermaLink'} =
-           (exists($attribs{'isPermaLink'}) && (lc($attribs{'isPermaLink'}) eq 'true'));
+          (exists($attribs{'isPermaLink'}) && 
+              (lc($attribs{'isPermaLink'}) eq 'true')
+          );
 
         # beginning of taxo li element in item element
         #'http://purl.org/rss/1.0/modules/taxonomy/' => 'taxo'
@@ -1294,7 +1295,7 @@
  # there are already 15 items
  my $rss = new XML::RSS;
  $rss->parsefile("fm.rdf");
- pop(@{$rss->{'items'}}) if (@{$rss->{'items'}} == 15);
+ shift(@{$rss->{'items'}}) if (@{$rss->{'items'}} == 15);
  $rss->add_item(title => "MpegTV Player (mtv) 1.0.9.7",
                 link  => "http://freshmeat.net/news/1999/06/21/930003958.html",
                 mode  => 'insert'
@@ -1320,13 +1321,13 @@
 examples that allow you to generate HTML from an RSS, convert between
 0.9, 0.91, and 1.0 version, and other nifty things.
 This might be helpful if you want to include news feeds on your Web
-site from sources like Slashot and Freshmeat or if you want to syndicate
+site from sources like Slashdot and Freshmeat or if you want to syndicate
 your own content.
 
 XML::RSS currently supports 0.9, 0.91, and 1.0 versions of RSS.
-See http://my.netscape.com/publish/help/mnn20/quickstart.html
-for information on RSS 0.91. See http://my.netscape.com/publish/help/
-for RSS 0.9. See http://purl.org/rss/1.0/ for RSS 1.0.
+See http://backend.userland.com/rss091 for information on RSS 0.91. 
+See http://www.purplepages.ie/RSS/netscape/rss0.90.html for RSS 0.9.
+See http://web.resource.org/rss/1.0/ for RSS 1.0.
 
 RSS was originally developed by Netscape as the format for
 Netscape Netcenter channels, however, many Web sites have since

Modified: trunk/libxml-rss-perl/lib/XML/RSS/Private/Output/Base.pm
URL: http://svn.debian.org/wsvn/trunk/libxml-rss-perl/lib/XML/RSS/Private/Output/Base.pm?rev=14679&op=diff
==============================================================================
--- trunk/libxml-rss-perl/lib/XML/RSS/Private/Output/Base.pm (original)
+++ trunk/libxml-rss-perl/lib/XML/RSS/Private/Output/Base.pm Sun Feb 10 02:51:54 2008
@@ -89,10 +89,38 @@
     return $self->_out("<$tag>" . $self->_encode($inner) . "</$tag>\n");
 }
 
+# Remove non-alphanumeric elements and return the modified string.
+# Useful for user-specified tags' attributes.
+
+sub _sanitize {
+    my ($self, $string) = @_;
+
+    $string =~ s{[^a-zA-Z_\-0-9]}{}g;
+    return $string;
+}
+
 sub _out_ns_tag {
     my ($self, $prefix, $tag, $inner) = @_;
 
-    return $self->_out_tag("${prefix}:${tag}", $inner);
+    if (ref($inner) eq "HASH")
+    {
+        $self->_out("<${prefix}:${tag}");
+        foreach my $attr (sort { $a cmp $b } keys(%{$inner}))
+        {
+            $self->_out(
+                  q{ } 
+                . $self->_sanitize($attr)
+                . q{="}
+                . $self->_encode($inner->{$attr})
+                . q{"}
+            );
+        }
+        $self->_out("/>\n");
+    }
+    else
+    {
+        return $self->_out_tag("${prefix}:${tag}", $inner);
+    }
 }
 
 sub _out_defined_tag {

Modified: trunk/libxml-rss-perl/t/2.0-permalink.t
URL: http://svn.debian.org/wsvn/trunk/libxml-rss-perl/t/2.0-permalink.t?rev=14679&op=diff
==============================================================================
--- trunk/libxml-rss-perl/t/2.0-permalink.t (original)
+++ trunk/libxml-rss-perl/t/2.0-permalink.t Sun Feb 10 02:51:54 2008
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 4;
+use Test::More tests => 5;
 
 use File::Spec;
 use XML::RSS;
@@ -26,6 +26,13 @@
 );
 
 # TEST
+is ($item_with_guid_missing->{"guid"}, 
+    "http://community.livejournal.com/lj_dev/713810.html",
+    "guid's isPermaLink is missing (implicitly false), so item->{guid}" . 
+    " should be equal to the contents of the guid element",
+);
+
+# TEST
 ok ((!$item_with_guid_false->{"permaLink"}),
     "guid's isPermaLink is false, so the permalink should be false"
 );

Modified: trunk/libxml-rss-perl/t/items-are-0.t
URL: http://svn.debian.org/wsvn/trunk/libxml-rss-perl/t/items-are-0.t?rev=14679&op=diff
==============================================================================
--- trunk/libxml-rss-perl/t/items-are-0.t (original)
+++ trunk/libxml-rss-perl/t/items-are-0.t Sun Feb 10 02:51:54 2008
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 166;
+use Test::More tests => 167;
 
 use XML::RSS;
 
@@ -3871,3 +3871,30 @@
     );
 }
 
+{
+    my $rss = create_item_rss(
+        {
+            version => "2.0",
+            item_params =>
+            [
+                media => {
+                    title    => "media title",
+                    text     => "media text",
+                    content  => {
+                        url    => "http://somrurl.org/img/foo.jpg",
+                        type   => "image/jpeg",
+                        height => "100",
+                        width  => "100",
+                    },
+                },
+            ],
+        }
+    );
+    $rss->add_module(prefix=>'media', uri=>'http://search.yahoo.com/mrss/');
+
+    # TEST
+    contains($rss, 
+        qq{<media:content height="100" type="image/jpeg" url="http://somrurl.org/img/foo.jpg" width="100"/>\n},
+        "namespaces with attributes are rendered correctly. (bug #25336)"
+    );
+}




More information about the Pkg-perl-cvs-commits mailing list