r47612 - in /trunk/libxml-feedpp-perl: Changes MANIFEST META.yml Makefile.PL README debian/changelog debian/control debian/copyright lib/XML/FeedPP.pm t/17_multi_category.t t/43_indent_atom.t t/44_cdata.t t/45_cdata_multi.t
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Sun Nov 22 04:06:20 UTC 2009
Author: jawnsy-guest
Date: Sun Nov 22 04:06:13 2009
New Revision: 47612
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=47612
Log:
* New upstream release
* Add myself to Uploaders and Copyright
* Update dependencies
* Drop perl version dep (as permitted by S-V 3.8.3)
Added:
trunk/libxml-feedpp-perl/t/43_indent_atom.t
- copied unchanged from r47611, branches/upstream/libxml-feedpp-perl/current/t/43_indent_atom.t
trunk/libxml-feedpp-perl/t/44_cdata.t
- copied unchanged from r47611, branches/upstream/libxml-feedpp-perl/current/t/44_cdata.t
trunk/libxml-feedpp-perl/t/45_cdata_multi.t
- copied unchanged from r47611, branches/upstream/libxml-feedpp-perl/current/t/45_cdata_multi.t
Modified:
trunk/libxml-feedpp-perl/Changes
trunk/libxml-feedpp-perl/MANIFEST
trunk/libxml-feedpp-perl/META.yml
trunk/libxml-feedpp-perl/Makefile.PL
trunk/libxml-feedpp-perl/README
trunk/libxml-feedpp-perl/debian/changelog
trunk/libxml-feedpp-perl/debian/control
trunk/libxml-feedpp-perl/debian/copyright
trunk/libxml-feedpp-perl/lib/XML/FeedPP.pm
trunk/libxml-feedpp-perl/t/17_multi_category.t
Modified: trunk/libxml-feedpp-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-feedpp-perl/Changes?rev=47612&op=diff
==============================================================================
--- trunk/libxml-feedpp-perl/Changes (original)
+++ trunk/libxml-feedpp-perl/Changes Sun Nov 22 04:06:13 2009
@@ -1,4 +1,11 @@
# XML::FeedPP Changes
+
+2009/11/21 (0.41)
+ * supports generating CDATA section by setting SCALAR ref value like XML::TreePP.
+ (thanks to Mario Domgoergen)
+ * pod added to create an empty Atom 1.0 instance intended:
+ XML::FeedPP::Atom::Atom10->new()
+ (thanks to Andy Piper)
2009/04/07 (0.40)
* fixed #44082: parse method refuses feeds with UTF-8 BOM
Modified: trunk/libxml-feedpp-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-feedpp-perl/MANIFEST?rev=47612&op=diff
==============================================================================
--- trunk/libxml-feedpp-perl/MANIFEST (original)
+++ trunk/libxml-feedpp-perl/MANIFEST Sun Nov 22 04:06:13 2009
@@ -45,3 +45,6 @@
t/40_xml_deref.t
t/41_utf8_flag.t
t/42_indent.t
+t/43_indent_atom.t
+t/44_cdata.t
+t/45_cdata_multi.t
Modified: trunk/libxml-feedpp-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-feedpp-perl/META.yml?rev=47612&op=diff
==============================================================================
--- trunk/libxml-feedpp-perl/META.yml (original)
+++ trunk/libxml-feedpp-perl/META.yml Sun Nov 22 04:06:13 2009
@@ -1,20 +1,22 @@
--- #YAML:1.0
name: XML-FeedPP
-version: 0.40
+version: 0.41
abstract: ~
author: []
license: perl
distribution_type: module
configure_requires:
ExtUtils::MakeMaker: 0
+build_requires:
+ ExtUtils::MakeMaker: 0
requires:
Test::More: 0
- XML::TreePP: 0.38
+ XML::TreePP: 0.39
no_index:
directory:
- t
- inc
-generated_by: ExtUtils::MakeMaker version 6.46
+generated_by: ExtUtils::MakeMaker version 6.54
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
Modified: trunk/libxml-feedpp-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-feedpp-perl/Makefile.PL?rev=47612&op=diff
==============================================================================
--- trunk/libxml-feedpp-perl/Makefile.PL (original)
+++ trunk/libxml-feedpp-perl/Makefile.PL Sun Nov 22 04:06:13 2009
@@ -6,7 +6,7 @@
VERSION_FROM => 'lib/XML/FeedPP.pm',
PREREQ_PM => {
'Test::More' => '0',
- 'XML::TreePP' => '0.38',
+ 'XML::TreePP' => '0.39',
},
};
Modified: trunk/libxml-feedpp-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-feedpp-perl/README?rev=47612&op=diff
==============================================================================
--- trunk/libxml-feedpp-perl/README (original)
+++ trunk/libxml-feedpp-perl/README Sun Nov 22 04:06:13 2009
@@ -80,12 +80,18 @@
The first argument is optional, but must be an Atom source if specified.
This method returns an empty instance when $source is undefined.
- Atom 1.0 feed is supported since "XML::FeedPP" version 0.30. Atom 0.3 is
- still default however.
+ Atom 1.0 feed is also supported since "XML::FeedPP" version 0.30. Atom
+ 0.3 is still default, however, future version of this module would
+ create Atom 1.0 as default.
+
+ $feed = XML::FeedPP::Atom::Atom03->new();
+ This creates an empty Atom 0.3 instance obviously.
+
+ $feed = XML::FeedPP::Atom::Atom10->new();
+ This creates an empty Atom 1.0 instance intended.
$feed = XML::FeedPP::RSS->new( link => $link, title => $tile, ... );
- This constructor method creates an instance which has "link", "title"
- elements etc.
+ This creates a RSS instance which has "link", "title" elements etc.
$feed->load( $source );
This method loads an RSS/RDF/Atom file, much like "new()" method does.
Modified: trunk/libxml-feedpp-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-feedpp-perl/debian/changelog?rev=47612&op=diff
==============================================================================
--- trunk/libxml-feedpp-perl/debian/changelog (original)
+++ trunk/libxml-feedpp-perl/debian/changelog Sun Nov 22 04:06:13 2009
@@ -1,3 +1,12 @@
+libxml-feedpp-perl (0.41-1) UNRELEASED; urgency=low
+
+ * New upstream release
+ * Add myself to Uploaders and Copyright
+ * Update dependencies
+ * Drop perl version dep (as permitted by S-V 3.8.3)
+
+ -- Jonathan Yu <jawnsy at cpan.org> Sat, 21 Nov 2009 19:37:55 -0500
+
libxml-feedpp-perl (0.40-1) unstable; urgency=low
[ Damyan Ivanov ]
Modified: trunk/libxml-feedpp-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-feedpp-perl/debian/control?rev=47612&op=diff
==============================================================================
--- trunk/libxml-feedpp-perl/debian/control (original)
+++ trunk/libxml-feedpp-perl/debian/control Sun Nov 22 04:06:13 2009
@@ -2,9 +2,10 @@
Section: perl
Priority: optional
Build-Depends: debhelper (>= 7)
-Build-Depends-Indep: libxml-treepp-perl (>= 0.38), perl (>= 5.8.8-12)
+Build-Depends-Indep: perl, libxml-treepp-perl (>= 0.39)
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
-Uploaders: Ernesto Hernández-Novich (USB) <emhn at usb.ve>
+Uploaders: Ernesto Hernández-Novich (USB) <emhn at usb.ve>,
+ Jonathan Yu <jawnsy at cpan.org>
Standards-Version: 3.8.3
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libxml-feedpp-perl/
Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libxml-feedpp-perl/
@@ -12,10 +13,8 @@
Package: libxml-feedpp-perl
Architecture: all
-Depends: ${misc:Depends}, ${perl:Depends}, libxml-treepp-perl (>= 0.38)
+Depends: ${misc:Depends}, ${perl:Depends}, libxml-treepp-perl (>= 0.39)
Description: module to parse/write/merge/edit RSS/RDF/Atom syndication feeds
XML::FeedPP is an all-purpose syndication utility that parses and publishes
- RSS 2.0, RSS 1.0 (RDF), Atom 0.3 and 1.0 feeds. It allows you to add new
- content, merge feeds, and convert among these various formats. It is a
- pure Perl implementation and does not require any other module except for
- XML::TreePP.
+ RSS 2.0, RSS 1.0 (RDF), Atom 0.3 and 1.0 feeds. It allows you to add new
+ content, merge feeds, and convert among these various formats.
Modified: trunk/libxml-feedpp-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-feedpp-perl/debian/copyright?rev=47612&op=diff
==============================================================================
--- trunk/libxml-feedpp-perl/debian/copyright (original)
+++ trunk/libxml-feedpp-perl/debian/copyright Sun Nov 22 04:06:13 2009
@@ -5,14 +5,15 @@
Upstream-Name: XML-FeedPP
Files: *
-Copyright: 2006-2009, Yusuke Kawasaki
+Copyright: 2006-2009, Yusuke Kawasaki <u-suke at kawa.net>
License-Alias: Perl
License: Artistic | GPL-1+
Files: debian/*
-Copyright: 2008, Adrian von Bidder <cmot at debian.org>
+Copyright: 2009, Jonathan Yu <jawnsy at cpan.org>
2009, Ernesto Hernández-Novich (USB) <emhn at usb.ve>
2009, gregor herrmann <gregoa at debian.org>
+ 2008, Adrian von Bidder <cmot at debian.org>
License: Artistic | GPL-1+
License: Artistic
Modified: trunk/libxml-feedpp-perl/lib/XML/FeedPP.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-feedpp-perl/lib/XML/FeedPP.pm?rev=47612&op=diff
==============================================================================
--- trunk/libxml-feedpp-perl/lib/XML/FeedPP.pm (original)
+++ trunk/libxml-feedpp-perl/lib/XML/FeedPP.pm Sun Nov 22 04:06:13 2009
@@ -93,13 +93,21 @@
The first argument is optional, but must be an Atom source if specified.
This method returns an empty instance when $source is undefined.
-Atom 1.0 feed is supported since C<XML::FeedPP> version 0.30.
-Atom 0.3 is still default however.
+Atom 1.0 feed is also supported since C<XML::FeedPP> version 0.30.
+Atom 0.3 is still default, however, future version of this module
+would create Atom 1.0 as default.
+
+=head2 $feed = XML::FeedPP::Atom::Atom03->new();
+
+This creates an empty Atom 0.3 instance obviously.
+
+=head2 $feed = XML::FeedPP::Atom::Atom10->new();
+
+This creates an empty Atom 1.0 instance intended.
=head2 $feed = XML::FeedPP::RSS->new( link => $link, title => $tile, ... );
-This constructor method creates an instance
-which has C<link>, C<title> elements etc.
+This creates a RSS instance which has C<link>, C<title> elements etc.
=head2 $feed->load( $source );
@@ -392,7 +400,7 @@
$XMLNS_ATOM10
);
-$VERSION = "0.40";
+$VERSION = "0.41";
$RSS20_VERSION = '2.0';
$ATOM03_VERSION = '0.3';
@@ -2211,25 +2219,36 @@
# multiple elements
if ( UNIVERSAL::isa( $value, 'ARRAY' )) {
if ( wantarray ) {
- return map { ref $_ && exists $_->{'#text'}
- ? $_->{'#text'} : $_ } @$value;
+ return map { &get_avalue($_) } @$value;
} else {
- return ref $value->[0] && exists $value->[0]->{'#text'}
- ? $value->[0]->{'#text'} : $value->[0];
- }
- }
-
- # text node of an element with attributes
- return $value->{'#text'} if exists $value->{'#text'};
+ return &get_avalue($value->[0]);
+ }
+ }
# a hack for atom: <content type="xhtml"><div>...</div></content>
- my $child = [ grep { /^[^\-\#]/ } keys %$value ];
- if ( exists $value->{'-type'}
- && ($value->{'-type'} eq "xhtml")
- && scalar @$child == 1) {
- return &get_value( $value, $child->[0] );
- }
- return;
+ if ( UNIVERSAL::isa( $value, 'HASH' )
+ && exists $value->{'-type'}
+ && ($value->{'-type'} eq "xhtml")) {
+ my $child = [ grep { /^[^_-_#]/ } keys %$value ];
+ if (scalar @$child == 1) {
+ return &get_value( $value, $child->[0] );
+ }
+ }
+ return &get_avalue($value);
+}
+
+sub get_avalue {
+ my $value = shift;
+
+ if ( UNIVERSAL::isa( $value, 'HASH' )) {
+ # text node of an element with attributes
+ return &get_avalue($value->{'#text'}) if exists $value->{'#text'};
+ } elsif ( UNIVERSAL::isa( $value, 'SCALAR' )) {
+ # CDATA section as a scalar reference
+ return $$value;
+ }
+
+ return $value;
}
sub set_value {
@@ -2262,7 +2281,9 @@
my $elem = shift;
my $attr = \@_;
if ( defined $self->{$elem} ) {
- if ( !ref $self->{$elem} ) {
+ my $scalar = ref $self->{$elem};
+ $scalar = undef if ($scalar eq 'SCALAR');
+ if (! $scalar) {
$self->{$elem} = { '#text' => $self->{$elem} };
}
}
@@ -2273,6 +2294,7 @@
my $key = shift @$attr;
my $val = shift @$attr;
if ( defined $val ) {
+# $val = $$val if (ref $val eq 'SCALAR');
$self->{$elem}->{ '-' . $key } = $val;
}
else {
Modified: trunk/libxml-feedpp-perl/t/17_multi_category.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-feedpp-perl/t/17_multi_category.t?rev=47612&op=diff
==============================================================================
--- trunk/libxml-feedpp-perl/t/17_multi_category.t (original)
+++ trunk/libxml-feedpp-perl/t/17_multi_category.t Sun Nov 22 04:06:13 2009
@@ -1,6 +1,6 @@
# ----------------------------------------------------------------
use strict;
- use Test::More tests => 32;
+ use Test::More tests => 26;
BEGIN { use_ok('XML::FeedPP') };
# ----------------------------------------------------------------
my $url = "http://www.kawa.net/";
@@ -23,7 +23,7 @@
my $feeds = [
XML::FeedPP::RDF->new(),
XML::FeedPP::RSS->new(),
- XML::FeedPP::RDF->new(),
+ XML::FeedPP::Atom::Atom10->new(),
];
# ----------------------------------------------------------------
foreach my $feed1 ( @$feeds ) {
@@ -31,22 +31,22 @@
$feed1->merge( $source );
my $item1 = $feed1->get_item(0);
my $icate = $item1->category();
- ok( ref $icate, "$type load ref" );
- is( scalar @$icate, $caten, "$type load count" );
+ my $icatn = scalar @$icate if ref $icate;
+ is( $icatn, $caten, "$type load count" );
$item1->category( $cate1 );
is( $item1->category(), $cate1, "$type one" );
- ok( $feed1->to_string() =~ />\s*\Q$cate1\E\s*</s, "$type one source" );
+ ok( $feed1->to_string() =~ /\W\Q$cate1\E\W/s, "$type one source" );
$item1->category( $catem );
my $jcate = $item1->category();
- ok( ref $jcate, "$type multi ref" );
- is( scalar @$jcate, $caten, "$type multi count" );
+ my $jcatn = scalar @$jcate if ref $jcate;
+ is( $jcatn, $caten, "$type multi count" );
$source = $feed1->to_string();
- like( $source, qr/>\s*\Q$cate1\E\s*</s, "$type multi 1/3" );
- like( $source, qr/>\s*\Q$cate2\E\s*</s, "$type multi 2/3" );
- like( $source, qr/>\s*\Q$cate3\E\s*</s, "$type multi 3/3" );
+ like( $source, qr/\W\Q$cate1\E\W/s, "$type multi 1/3" );
+ like( $source, qr/\W\Q$cate2\E\W/s, "$type multi 2/3" );
+ like( $source, qr/\W\Q$cate3\E\W/s, "$type multi 3/3" );
}
# ----------------------------------------------------------------
;1;
More information about the Pkg-perl-cvs-commits
mailing list