New Upstream Release - libperlanet-perl
Ready changes
Summary
Merged new upstream version: 3.0.3 (was: 2.2.1).
Diff
diff --git a/Build.PL b/Build.PL
index 6024028..a205d7b 100644
--- a/Build.PL
+++ b/Build.PL
@@ -17,7 +17,8 @@ my $build = Module::Build->new(
'DateTime' => 0,
'DateTime::Duration' => 0,
'YAML' => 0,
- 'HTML::Tidy' => 0,
+ 'Alien::TidyHTML5' => 0,
+ 'HTML::T5' => 0,
'HTML::Scrubber' => 0,
'Moose' => 0,
'Try::Tiny' => 0,
@@ -36,8 +37,9 @@ my $build = Module::Build->new(
'Test::More' => 0,
'File::Path' => 0,
'MooseX::ConfigFromFile' => 0,
- 'Alien::Tidyp' => 0,
+ 'Alien::TidyHTML5' => 0,
'XML::OPML::SimpleGen' => 0,
+ 'Test::Warnings' => 0,
},
build_recommends => {
'Test::Pod' => 0,
diff --git a/Changes b/Changes
index d6cdb4f..450957a 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,20 @@
+2023-05-22 3.0.3 Dave Cross <dave@perlhacks.com>
+
+ * Fixed some old links (see https://github.com/davorg/perlanet/issues/22)
+
+2023-05-15 3.0.2 Dave Cross <dave@perlhacks.com>
+
+ * Removed a prereq that is no longer needed
+
+2023-05-14 3.0.1 Dave Cross <dave@perlhacks.com>
+
+ * Switch from using (unsupported) HTML::Tidy to HTML::T5
+
+2023-03-10 3.0.0 Dave Cross <dave@perlhacks.com>
+
+ * Change the name of the feed 'url' attribute to 'feed'
+ (the old name is still supported, but warns)
+
2023-01-03 2.2.1 Dave Cross <dave@perlhacks.com>
* Update the version requirement in Build.PL too
diff --git a/MANIFEST b/MANIFEST
index e157bff..17fd62b 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -27,6 +27,7 @@ t/06_youtube.t
t/07_page.t
t/08_opml.t
t/09_entries.t
+t/10_rename_url.t
t/pod.t
t/pod_coverage.t
t/testrc
@@ -38,8 +39,9 @@ t/youtuberc
t/youtube2rc
t/allentriesrc
t/5entriesrc
+t/oldurlrc
t/index.tt
-README
+README.md
Changes
t/data/davblog.xml
t/data/stevebaker.xml
diff --git a/META.json b/META.json
index 6cb22b0..b9609d7 100644
--- a/META.json
+++ b/META.json
@@ -25,10 +25,11 @@
"prereqs" : {
"build" : {
"requires" : {
- "Alien::Tidyp" : "0",
+ "Alien::TidyHTML5" : "0",
"File::Path" : "0",
"MooseX::ConfigFromFile" : "0",
"Test::More" : "0",
+ "Test::Warnings" : "0",
"XML::OPML::SimpleGen" : "0"
}
},
@@ -45,12 +46,13 @@
"XML::OPML::SimpleGen" : "0"
},
"requires" : {
+ "Alien::TidyHTML5" : "0",
"DateTime" : "0",
"DateTime::Duration" : "0",
"DateTime::Format::Strptime" : "0",
"Encode" : "0",
"HTML::Scrubber" : "0",
- "HTML::Tidy" : "0",
+ "HTML::T5" : "0",
"List::Util" : "0",
"Moose" : "0",
"MooseX::ConfigFromFile" : "0",
@@ -68,7 +70,7 @@
"provides" : {
"Perlanet" : {
"file" : "lib/Perlanet.pm",
- "version" : "v2.2.1"
+ "version" : "v3.0.3"
},
"Perlanet::Entry" : {
"file" : "lib/Perlanet/Entry.pm"
@@ -122,6 +124,6 @@
"web" : "https://github.com/davorg/perlanet"
}
},
- "version" : "v2.2.1",
+ "version" : "v3.0.3",
"x_serialization_backend" : "JSON::PP version 4.07"
}
diff --git a/META.yml b/META.yml
index b5aac2b..55b2872 100644
--- a/META.yml
+++ b/META.yml
@@ -3,10 +3,11 @@ abstract: 'A program for creating programs that aggregate web feeds (both'
author:
- 'Dave Cross <dave@perlhacks.com>'
build_requires:
- Alien::Tidyp: '0'
+ Alien::TidyHTML5: '0'
File::Path: '0'
MooseX::ConfigFromFile: '0'
Test::More: '0'
+ Test::Warnings: '0'
XML::OPML::SimpleGen: '0'
configure_requires:
Module::Build: '0.42'
@@ -28,7 +29,7 @@ name: Perlanet
provides:
Perlanet:
file: lib/Perlanet.pm
- version: v2.2.1
+ version: v3.0.3
Perlanet::Entry:
file: lib/Perlanet/Entry.pm
Perlanet::Feed:
@@ -59,12 +60,13 @@ recommends:
MooseX::ConfigFromFile: '0'
XML::OPML::SimpleGen: '0'
requires:
+ Alien::TidyHTML5: '0'
DateTime: '0'
DateTime::Duration: '0'
DateTime::Format::Strptime: '0'
Encode: '0'
HTML::Scrubber: '0'
- HTML::Tidy: '0'
+ HTML::T5: '0'
List::Util: '0'
Moose: '0'
MooseX::ConfigFromFile: '0'
@@ -81,5 +83,5 @@ resources:
homepage: http://perlanet.mag-sol.com/
license: http://dev.perl.org/licenses/
repository: git://github.com/davorg/perlanet.git
-version: v2.2.1
+version: v3.0.3
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff --git a/Makefile.PL b/Makefile.PL
index ba20389..2ee6679 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -6,20 +6,21 @@ WriteMakefile
'NAME' => 'Perlanet',
'VERSION_FROM' => 'lib/Perlanet.pm',
'PREREQ_PM' => {
- 'Alien::Tidyp' => 0,
+ 'Alien::TidyHTML5' => 0,
'DateTime' => 0,
'DateTime::Duration' => 0,
'DateTime::Format::Strptime' => 0,
'Encode' => 0,
'File::Path' => 0,
'HTML::Scrubber' => 0,
- 'HTML::Tidy' => 0,
+ 'HTML::T5' => 0,
'List::Util' => 0,
'Moose' => 0,
'MooseX::ConfigFromFile' => 0,
'MooseX::Traits' => 0,
'Template' => 0,
'Test::More' => 0,
+ 'Test::Warnings' => 0,
'Try::Tiny' => 0,
'URI::Fetch' => 0,
'XML::Feed' => '0.22',
diff --git a/README b/README
deleted file mode 100644
index cf12961..0000000
--- a/README
+++ /dev/null
@@ -1,66 +0,0 @@
-
-Perlanet
---------
-
-NAME
-
- Perlanet
-
-DESCRIPTION
-
-WHAT IS Perlanet?
-
- Perlanet is a Perl module for aggregating web feeds.
-
- It allows you to aggregate a number of web feeds (both Atom and RSS) and
- to publish a web page and another web feed containing the aggregated
- content.
-
-HOW DO I INSTALL IT?
-
- Perlanet uses the standard Perl module architecture and can therefore by
- installed using the standard Perl method which, in brief, goes something
- like this:
-
- gzip -cd Perlanet-X.XX.tar.gz | tar xvf -
- cd Perlanet-X.XX
- perl Build.PL
- ./Build
- ./Build test
- ./Build install
-
- Where X.XX is the version number of the module which you are installing.
-
- You can also install it using either the 'cpan' or 'cpanp' command line
- programs.
-
-WHERE IS THE DOCUMENTATION?
-
- All of the documentation is in POD format. The most useful documentation
- is included with the 'perlanet' program that is part of this
- distributions. If you install the module using the standard method you
- should be able to read it by typing
-
- perldoc perlanet
-
- at a comand prompt.
-
-LATEST VERSION
-
- The latest version of this module will always be available from CPAN.
-
-COPYRIGHT
-
- Copyright (C) 2008, Magnum Solutions Ltd. All Rights Reserved.
-
- This module is free software; you can redistribute it and/or modify it
- under the same terms as Perl itself.
-
-ANYTHING ELSE?
-
- If you have any further questions, please contact the author.
-
-AUTHOR
-
- Dave Cross <dave@perlhacks.com>
-
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..ad09246
--- /dev/null
+++ b/README.md
@@ -0,0 +1,65 @@
+
+# Perlanet
+
+## NAME
+
+Perlanet
+
+## DESCRIPTION
+
+### WHAT IS Perlanet?
+
+Perlanet is a Perl module for aggregating web feeds.
+
+It allows you to aggregate a number of web feeds (both Atom and RSS) and
+to publish a web page and another web feed containing the aggregated
+content.
+
+### HOW DO I INSTALL IT?
+
+Perlanet uses the standard Perl module architecture and can therefore by
+installed using the standard Perl method which, in brief, goes something
+like this:
+
+ gzip -cd Perlanet-X.XX.tar.gz | tar xvf -
+ cd Perlanet-X.XX
+ perl Build.PL
+ ./Build
+ ./Build test
+ ./Build install
+
+Where X.XX is the version number of the module which you are installing.
+
+You can also install it using either the 'cpan' or 'cpanm' command line
+programs.
+
+### WHERE IS THE DOCUMENTATION?
+
+All of the documentation is in POD format. The most useful documentation
+is included with the 'perlanet' program that is part of this
+distributions. If you install the module using the standard method you
+should be able to read it by typing
+
+ perldoc perlanet
+
+at a comand prompt.
+
+### LATEST VERSION
+
+The latest version of this module will always be available from CPAN.
+
+## COPYRIGHT
+
+Copyright (C) 2008, Magnum Solutions Ltd. All Rights Reserved.
+
+This module is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+
+## ANYTHING ELSE?
+
+If you have any further questions, please contact the author.
+
+## AUTHOR
+
+Dave Cross <dave@perlhacks.com>
+
diff --git a/bin/perlanet b/bin/perlanet
index 51600dd..49777d1 100755
--- a/bin/perlanet
+++ b/bin/perlanet
@@ -181,7 +181,7 @@ when they change.
This mandatory option gives details of the web feeds to be aggregated. Each
item on the list has one mandatory sub-option and two optional sub-options.
-The mandatory sub-option is C<url> which gives the URL of the feed. The
+The mandatory sub-option is C<feed> which gives the URL of the feed. The
optional sub-option C<title> gives a title to the feed which can be used
to identify the entries that originate from this feed. The optional C<web>
sub-option gives a web site URL associated with the feed (often the address
@@ -192,6 +192,10 @@ override the global C<entries_per_feed> setting. If this setting exists
and is set to zero, then the output feed will contain all of the entries
from this input feed.
+B<Note:> Until the release of version 3.0.0, the C<feed> sub-option was called
+C<url>. This name is still supported, but you will get a warning each time
+you parse a configuration file which uses this name.
+
=back
=head2 Example Configuration File
@@ -212,13 +216,13 @@ from this input feed.
format: Atom
cache_dir: /tmp/feeds
feeds:
- - url: http://blog.dave.org.uk/atom.xml
+ - feed: http://blog.dave.org.uk/atom.xml
title: Dave's Blog
web: http://blog.dave.org.uk/
- - url: http://use.perl.org/~davorg/journal/rss
+ - feed: http://use.perl.org/~davorg/journal/rss
title: Dave's use.perl Journal
web: http://use.perl.org/~davorg/journal/
- - url: http://www.oreillynet.com/pub/feed/31?au=2607
+ - feed: http://www.oreillynet.com/pub/feed/31?au=2607
title: Dave on O'Reillynet
web: http://www.oreillynet.com/pub/au/2607
@@ -271,15 +275,13 @@ of the aggregated feeds.
</body>
</html>
-In the future, the Perlanet wiki at L<http://wiki.github.com/davorg/perlanet>
+In the future, the Perlanet wiki at L<https://github.com/davorg/perlanet/wiki>
will contain a cookbook of useful ideas to include in the output template.
=head1 SUPPORT
-To report bugs in Perlanet, please use the CPAN request tracker. You can
-either use the web page at
-L<http://rt.cpan.org/Public/Bug/Report.html?Queue=Perlanet> or send an email
-to bug-Perlanet@rt.cpan.org.
+To report bugs in Perlanet, please use the ticket queue at
+L<https://github.com/davorg/perlanet/issues>.
=head1 SEE ALSO
diff --git a/debian/changelog b/debian/changelog
index f9931f0..40d79fb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+libperlanet-perl (3.0.3-1) UNRELEASED; urgency=low
+
+ * New upstream release.
+
+ -- Debian Janitor <janitor@jelmer.uk> Tue, 23 May 2023 01:45:38 -0000
+
libperlanet-perl (2.2.1-1) unstable; urgency=medium
* Team upload
diff --git a/examples/perlanetrc b/examples/perlanetrc
index a5edc17..8a50592 100644
--- a/examples/perlanetrc
+++ b/examples/perlanetrc
@@ -13,30 +13,30 @@ feed:
file: atom.xml
format: Atom
feeds:
- - url: http://www.badscience.net/?feed=atom
+ - feed: http://www.badscience.net/?feed=atom
title: Bad Science
web: http://www.badscience.net/
- - url: http://cectic.com/rss.xml
+ - feed: http://cectic.com/rss.xml
title: Cectic
web: http://cectic.com/
- - url: http://www.climate-resistance.org/feed
+ - feed: http://www.climate-resistance.org/feed
title: Climate Resistance
web: http://www.climate-resistance.org/
- - url: http://teenatheist.wordpress.com/feed/
+ - feed: http://teenatheist.wordpress.com/feed/
title: Diary of a Teenage Atheist
web: http://teenatheist.wordpress.com
- - url: http://www.mediawatchwatch.org.uk/wp-rss.php
+ - feed: http://www.mediawatchwatch.org.uk/wp-rss.php
title: Media Watch Watch
web: http://www.mediawatchwatch.org.uk/
- - url: http://blog.newhumanist.org.uk/feeds/posts/default
+ - feed: http://blog.newhumanist.org.uk/feeds/posts/default
title: New Humanist Blog
web: http://blog.newhumanist.org.uk/
- - url: http://feeds.feedburner.com/scienceblogs/pharyngula
+ - feed: http://feeds.feedburner.com/scienceblogs/pharyngula
title: Pharyngula
web: http://scienceblogs.com/pharyngula/
- - url: http://richarddawkins.net/feed.php
+ - feed: http://richarddawkins.net/feed.php
title: Richard Dawkins Foundation
web: http://richarddawkins.net/
- - url: http://feeds.feedburner.com/SamHarris
+ - feed: http://feeds.feedburner.com/SamHarris
title: Sam Harris
web: http://www.samharris.org/
diff --git a/lib/Perlanet.pm b/lib/Perlanet.pm
index 8ca0074..153c4ad 100755
--- a/lib/Perlanet.pm
+++ b/lib/Perlanet.pm
@@ -18,7 +18,7 @@ use XML::Feed;
use Perlanet::Types;
-our $VERSION = '2.2.1';
+our $VERSION = '3.0.3';
with 'MooseX::Traits';
@@ -203,16 +203,16 @@ sub fetch_feeds {
my @valid_feeds;
for my $feed (@$feeds) {
- my $response = $self->fetch_page($feed->url);
+ my $response = $self->fetch_page($feed->feed);
if ($response->is_error) {
- carp 'Error retrieving ' . $feed->url;
+ carp 'Error retrieving ' . $feed->feed;
carp $response->http_response->status_line;
next;
}
unless (length $response->content) {
- carp 'No data returned from ' . $feed->url;
+ carp 'No data returned from ' . $feed->feed;
next;
}
@@ -226,7 +226,7 @@ sub fetch_feeds {
push @valid_feeds, $feed;
}
catch {
- carp 'Errors parsing ' . $feed->url;
+ carp 'Errors parsing ' . $feed->feed;
carp $_ if defined $_;
};
}
@@ -362,11 +362,11 @@ sub build_feed {
my $self = shift;
my ($entries) = @_;
- my $self_url = $self->self_link;
-
- my $f = Perlanet::Feed->new( modified => DateTime->now );
+ my $f = Perlanet::Feed->new(
+ modified => DateTime->now,
+ feed => $self->config->{url},
+ );
$f->title($self->title) if defined $self->title;
- $f->url($self->url) if defined $self->url;
$f->description($self->description) if defined $self->description;
if (defined $self->{'author'} ) {
$f->author($self->author->{name}) if defined $self->author->{name};
@@ -466,14 +466,12 @@ __PACKAGE__->meta->make_immutable;
=head1 TO DO
-See L<http://wiki.github.com/davorg/perlanet/issues>
+See L<https://github.com/davorg/perlanet/issues>
=head1 SUPPORT
-To report bugs in Perlanet, please use the CPAN request tracker. You can
-either use the web page at
-L<http://rt.cpan.org/Public/Bug/Report.html?Queue=Perlanet> or send an email
-to bug-Perlanet@rt.cpan.org.
+To report bugs in Perlanet, please use the ticket queue at
+L<https://github.com/davorg/perlanet/issues>.
=head1 SEE ALSO
diff --git a/lib/Perlanet/Feed.pm b/lib/Perlanet/Feed.pm
index fd992be..1906f0b 100644
--- a/lib/Perlanet/Feed.pm
+++ b/lib/Perlanet/Feed.pm
@@ -6,6 +6,7 @@ use warnings;
use Moose;
use XML::Feed;
+use Carp;
=head1 NAME
@@ -18,9 +19,10 @@ has 'title' => (
is => 'rw',
);
-has 'url' => (
+has 'feed' => (
isa => 'Str',
is => 'rw',
+ required => 1,
);
has 'web' => (
@@ -76,6 +78,27 @@ has 'entries' => (
}
);
+# Handle the url -> feed renaming
+around BUILDARGS => sub {
+ my $orig = shift;
+ my $class = shift;
+
+ my $args;
+ if (@_ == 1) {
+ $args = $_[0];
+ } else {
+ $args = { @_ };
+ }
+
+ if ($args->{url} and ! $args->{feed}) {
+ warn "Your config file uses 'url' for the URL of the feed. ",
+ "Please update that to 'feed'.\n";
+ $args->{feed} = $args->{url};
+ }
+
+ return $args;
+};
+
=head1 METHODS
=head2 as_xml
@@ -90,7 +113,7 @@ sub as_xml {
my $feed = XML::Feed->new($format);
$feed->title($self->title);
- $feed->link($self->url);
+ $feed->link($self->feed);
$feed->description($self->description);
$feed->author($self->author);
if ($format eq 'Atom') {
@@ -103,6 +126,22 @@ sub as_xml {
return $feed->as_xml;
}
+=head2 url
+
+We've renamed the old 'url' attribute to 'feed'.
+
+This allows the old name to still work, but generates a warning.
+
+=cut
+
+sub url {
+ my $self = shift;
+
+ carp 'The url() method has been renamed to feed()';
+
+ return $self->feed;
+}
+
no Moose;
__PACKAGE__->meta->make_immutable;
1;
diff --git a/lib/Perlanet/Simple.pm b/lib/Perlanet/Simple.pm
index 00e24bf..78b4a69 100644
--- a/lib/Perlanet/Simple.pm
+++ b/lib/Perlanet/Simple.pm
@@ -44,7 +44,7 @@ planet working out of the box.
Perlanet::Simple takes the standard Perlanet module, and adds support for
caching, OPML feed generation, and L<Template> rendering support. It will
-also attempt to clean each post using both L<HTML::Scrubber> and L<HTML::Tidy>.
+also attempt to clean each post using both L<HTML::Scrubber> and L<HTML::T5>.
=head2 Configuration
diff --git a/lib/Perlanet/Trait/OPML.pm b/lib/Perlanet/Trait/OPML.pm
index 9199b31..035dd1e 100644
--- a/lib/Perlanet/Trait/OPML.pm
+++ b/lib/Perlanet/Trait/OPML.pm
@@ -97,8 +97,8 @@ sub update_opml {
$self->opml_generator->insert_outline(
title => $f->title,
text => $f->title,
- xmlUrl => $f->url,
- htmlUrl => $f->url,
+ xmlUrl => $f->feed,
+ htmlUrl => $f->feed,
);
}
diff --git a/lib/Perlanet/Trait/Tidy.pm b/lib/Perlanet/Trait/Tidy.pm
index 2abc95f..0ffaa87 100644
--- a/lib/Perlanet/Trait/Tidy.pm
+++ b/lib/Perlanet/Trait/Tidy.pm
@@ -8,11 +8,11 @@ use Moose::Role;
use namespace::autoclean;
use Encode;
-use HTML::Tidy;
+use HTML::T5;
=head1 NAME
-Perlanet::Trait::Tidy - run posts through HTML::Tidy
+Perlanet::Trait::Tidy - run posts through HTML::T5 (an HTML::Tidy replacement)
=head1 SYNOPSIS
@@ -25,18 +25,18 @@ Perlanet::Trait::Tidy - run posts through HTML::Tidy
=head1 DESCRIPTION
Before a post is added to the aggregated feed, it will be run through
-HTML::Tidy.
+HTML::T5.
=head2 Configuring
-To configure the HTML::Tidy instance, you should override the C<_build_tidy>
-method. This method takes no input, and returns a HTML::Tidy instance.
+To configure the HTML::T5 instance, you should override the C<_build_tidy>
+method. This method takes no input, and returns a HTML::T5 instance.
=head1 ATTRIBUTES
=head2 tidy
-An instance of L<HTML::Tidy> used to tidy the feed entry contents
+An instance of L<HTML::T5> used to tidy the feed entry contents
before outputting. For default settings see source..
=cut
@@ -61,7 +61,7 @@ sub _build_tidy {
show_warnings => 0,
);
- my $tidy = HTML::Tidy->new(\%tidy);
+ my $tidy = HTML::T5->new(\%tidy);
$tidy->ignore( type => TIDY_WARNING );
return $tidy;
@@ -86,10 +86,11 @@ around 'clean_html' => sub {
=head1 AUTHOR
Oliver Charles, <oliver.g.charles@googlemail.com>
+Dave Cross, <dave@perlhacks.com>
=head1 COPYRIGHT AND LICENSE
-Copyright (c) 2010 by Magnum Solutions Ltd.
+Copyright (c) 2010-2023 by Magnum Solutions Ltd.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.10.0 or,
diff --git a/lib/Perlanet/Trait/YAMLConfig.pm b/lib/Perlanet/Trait/YAMLConfig.pm
index 6ea1456..0542a1b 100644
--- a/lib/Perlanet/Trait/YAMLConfig.pm
+++ b/lib/Perlanet/Trait/YAMLConfig.pm
@@ -47,13 +47,13 @@ configuration file.
format: Atom
cache_dir: /tmp/feeds
feeds:
- - url: http://blog.dave.org.uk/atom.xml
+ - feed: http://blog.dave.org.uk/atom.xml
title: Dave's Blog
web: http://blog.dave.org.uk/
- - url: http://use.perl.org/~davorg/journal/rss
+ - feed: http://use.perl.org/~davorg/journal/rss
title: Dave's use.perl Journal
web: http://use.perl.org/~davorg/journal/
- - url: http://www.oreillynet.com/pub/feed/31?au=2607
+ - feed: http://www.oreillynet.com/pub/feed/31?au=2607
title: Dave on O'Reillynet
web: http://www.oreillynet.com/pub/au/2607
diff --git a/t/01_basic.t b/t/01_basic.t
index e650cb4..ded660d 100644
--- a/t/01_basic.t
+++ b/t/01_basic.t
@@ -47,9 +47,4 @@ if (-e $p->page->{file}) {
unlink $p->page->{file};
}
-# Test OPML
-ok($p = Perlanet->new_with_traits( traits => [ 'Perlanet::Trait::OPML' ] ), 'Object with traits created');
-isa_ok($p,'Perlanet');
-$p->run();
-
done_testing();
diff --git a/t/10_rename_url.t b/t/10_rename_url.t
new file mode 100644
index 0000000..126af0e
--- /dev/null
+++ b/t/10_rename_url.t
@@ -0,0 +1,28 @@
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Warnings 'warning';
+use FindBin qw($Bin);
+
+use lib qw( ../lib );
+use_ok('Perlanet::Simple');
+
+chdir $Bin;
+my $p;
+
+my $warning = warning {
+ $p = Perlanet::Simple->new_with_config(configfile => 'oldurlrc')
+};
+
+like $warning, qr[^Your config file uses],
+ 'Correct warning on parsing config';
+
+$warning = warning {
+ $p->feeds->[0]->url
+};
+
+like $warning, qr[^The url\(\) method has been renamed],
+ 'Correct warning on calling method';
+
+done_testing();
diff --git a/t/5entriesrc b/t/5entriesrc
index 57b4719..c4e5af7 100644
--- a/t/5entriesrc
+++ b/t/5entriesrc
@@ -15,7 +15,7 @@ feed:
file: rss.xml
format: Atom
feeds:
- - url: file:data/davblog.xml
+ - feed: file:data/davblog.xml
title: davblog
web: http://blogs.dave.org.uk/
max_entries: 5
diff --git a/t/allentriesrc b/t/allentriesrc
index 4f76f46..1536a2e 100644
--- a/t/allentriesrc
+++ b/t/allentriesrc
@@ -15,7 +15,7 @@ feed:
file: rss.xml
format: Atom
feeds:
- - url: file:data/davblog.xml
+ - feed: file:data/davblog.xml
title: davblog
web: http://blogs.dave.org.uk/
max_entries: 0
diff --git a/t/cacherc b/t/cacherc
index e9c7369..a7a59f4 100644
--- a/t/cacherc
+++ b/t/cacherc
@@ -16,7 +16,7 @@ feed:
file: rss.xml
format: RSS
feeds:
- - url: file:data/davblog.xml
+ - feed: file:data/davblog.xml
title: davblog
web: http://blogs.dave.org.uk/
diff --git a/t/mprc b/t/mprc
index eedfa74..ae4c7d2 100644
--- a/t/mprc
+++ b/t/mprc
@@ -16,8 +16,8 @@ feed:
format: Atom
feeds:
- title: 'con: Wycombe: Steve Baker'
- url: file:data/stevebaker.xml
+ feed: file:data/stevebaker.xml
web: http://www.stevebaker.info/
- title: 'co: Clacton: Douglas Carswell'
- url: file:data/talkcarswell.xml
+ feed: file:data/talkcarswell.xml
web: http://www.talkcarswell.com/
diff --git a/t/oldurlrc b/t/oldurlrc
new file mode 100644
index 0000000..d76e25b
--- /dev/null
+++ b/t/oldurlrc
@@ -0,0 +1,23 @@
+title: planet test
+description: Testing stuff
+url: http://theplanetarium.org/
+self_link: http://theplanetarium.org/
+agent: Testing Perlanet
+entries_per_feed: 1
+author:
+ name: Dave Cross
+ email: dave@dave.org.uk
+max_entries: 20
+opml_file: opml.xml
+page:
+ file: index.html
+ template: index.tt
+feed:
+ file: rss.xml
+ format: Atom
+feeds:
+ - url: file:data/davblog.xml
+ title: davblog
+ web: http://blogs.dave.org.uk/
+google_ga: HELLO_GOOGLE
+
diff --git a/t/perlanetrc b/t/perlanetrc
index 775a20a..04fbc52 100644
--- a/t/perlanetrc
+++ b/t/perlanetrc
@@ -12,7 +12,7 @@ feed:
file: atom.xml
format: Atom
feeds:
- - url: file:data/davblog.xml
+ - feed: file:data/davblog.xml
title: davblog
web: http://blogs.dave.org.uk/
diff --git a/t/testrc b/t/testrc
index d76e25b..e2deda1 100644
--- a/t/testrc
+++ b/t/testrc
@@ -16,7 +16,7 @@ feed:
file: rss.xml
format: Atom
feeds:
- - url: file:data/davblog.xml
+ - feed: file:data/davblog.xml
title: davblog
web: http://blogs.dave.org.uk/
google_ga: HELLO_GOOGLE
diff --git a/t/testrc_no_opml b/t/testrc_no_opml
index c0a9743..08ce25b 100644
--- a/t/testrc_no_opml
+++ b/t/testrc_no_opml
@@ -15,7 +15,7 @@ feed:
file: rss.xml
format: Atom
feeds:
- - url: file:data/davblog.xml
+ - feed: file:data/davblog.xml
title: davblog
web: http://blogs.dave.org.uk/
diff --git a/t/youtube2rc b/t/youtube2rc
index a8e125e..d1a647a 100644
--- a/t/youtube2rc
+++ b/t/youtube2rc
@@ -12,4 +12,4 @@ feed:
file: atom.xml
format: Atom
feeds:
- - url: file:data/youtube.xml
+ - feed: file:data/youtube.xml
diff --git a/t/youtuberc b/t/youtuberc
index cd9150a..79f7780 100644
--- a/t/youtuberc
+++ b/t/youtuberc
@@ -13,4 +13,4 @@ feed:
file: atom.xml
format: Atom
feeds:
- - url: file:data/youtube.xml
+ - feed: file:data/youtube.xml