r14677 - in /branches/upstream/libxml-rss-perl/current: Changes META.yml 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:47:43 UTC 2008
Author: gregoa-guest
Date: Sun Feb 10 02:47:42 2008
New Revision: 14677
URL: http://svn.debian.org/wsvn/?sc=1&rev=14677
Log:
[svn-upgrade] Integrating new upstream version, libxml-rss-perl (1.32)
Modified:
branches/upstream/libxml-rss-perl/current/Changes
branches/upstream/libxml-rss-perl/current/META.yml
branches/upstream/libxml-rss-perl/current/lib/XML/RSS.pm
branches/upstream/libxml-rss-perl/current/lib/XML/RSS/Private/Output/Base.pm
branches/upstream/libxml-rss-perl/current/t/2.0-permalink.t
branches/upstream/libxml-rss-perl/current/t/items-are-0.t
Modified: branches/upstream/libxml-rss-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libxml-rss-perl/current/Changes?rev=14677&op=diff
==============================================================================
--- branches/upstream/libxml-rss-perl/current/Changes (original)
+++ branches/upstream/libxml-rss-perl/current/Changes Sun Feb 10 02:47:42 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: branches/upstream/libxml-rss-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libxml-rss-perl/current/META.yml?rev=14677&op=diff
==============================================================================
--- branches/upstream/libxml-rss-perl/current/META.yml (original)
+++ branches/upstream/libxml-rss-perl/current/META.yml Sun Feb 10 02:47:42 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: branches/upstream/libxml-rss-perl/current/lib/XML/RSS.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libxml-rss-perl/current/lib/XML/RSS.pm?rev=14677&op=diff
==============================================================================
--- branches/upstream/libxml-rss-perl/current/lib/XML/RSS.pm (original)
+++ branches/upstream/libxml-rss-perl/current/lib/XML/RSS.pm Sun Feb 10 02:47:42 2008
@@ -14,7 +14,7 @@
use vars qw($VERSION $AUTOLOAD @ISA $AUTO_ADD);
-$VERSION = '1.31';
+$VERSION = '1.32';
$AUTO_ADD = 0;
@@ -790,7 +790,9 @@
}
elsif ($el eq 'guid') {
$self->{'items'}->[$self->{num_items} - 1]->{'isPermaLink'} =
- !(exists($attribs{'isPermaLink'}) && ($attribs{'isPermaLink'} eq 'false'));
+ (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'
@@ -1293,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'
@@ -1319,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: branches/upstream/libxml-rss-perl/current/lib/XML/RSS/Private/Output/Base.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libxml-rss-perl/current/lib/XML/RSS/Private/Output/Base.pm?rev=14677&op=diff
==============================================================================
--- branches/upstream/libxml-rss-perl/current/lib/XML/RSS/Private/Output/Base.pm (original)
+++ branches/upstream/libxml-rss-perl/current/lib/XML/RSS/Private/Output/Base.pm Sun Feb 10 02:47:42 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: branches/upstream/libxml-rss-perl/current/t/2.0-permalink.t
URL: http://svn.debian.org/wsvn/branches/upstream/libxml-rss-perl/current/t/2.0-permalink.t?rev=14677&op=diff
==============================================================================
--- branches/upstream/libxml-rss-perl/current/t/2.0-permalink.t (original)
+++ branches/upstream/libxml-rss-perl/current/t/2.0-permalink.t Sun Feb 10 02:47:42 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;
@@ -21,9 +21,15 @@
);
# TEST
-is ($item_with_guid_missing->{"permaLink"},
+ok ((!$item_with_guid_missing->{"permaLink"}),
+ "guid's isPermaLink is missing (implicitly false), so the item permalink property should not be set"
+);
+
+# TEST
+is ($item_with_guid_missing->{"guid"},
"http://community.livejournal.com/lj_dev/713810.html",
- "guid's isPermaLink is missing, so the item permalink property should be set to the value of the guid tag"
+ "guid's isPermaLink is missing (implicitly false), so item->{guid}" .
+ " should be equal to the contents of the guid element",
);
# TEST
Modified: branches/upstream/libxml-rss-perl/current/t/items-are-0.t
URL: http://svn.debian.org/wsvn/branches/upstream/libxml-rss-perl/current/t/items-are-0.t?rev=14677&op=diff
==============================================================================
--- branches/upstream/libxml-rss-perl/current/t/items-are-0.t (original)
+++ branches/upstream/libxml-rss-perl/current/t/items-are-0.t Sun Feb 10 02:47:42 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