r30548 - in /trunk/libwww-freshmeat-perl: Build.PL Changes MANIFEST META.yml Makefile.PL README debian/changelog debian/control lib/WWW/Freshmeat.pm t/boilerplate.t t/nonexistingproject.t t/project.t

antonio-guest at users.alioth.debian.org antonio-guest at users.alioth.debian.org
Mon Feb 9 23:47:18 UTC 2009


Author: antonio-guest
Date: Mon Feb  9 23:47:15 2009
New Revision: 30548

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=30548
Log:
still unreleased, some changes, incorporating gregoa's changes from the unreleased version

Added:
    trunk/libwww-freshmeat-perl/t/nonexistingproject.t
      - copied unchanged from r30547, branches/upstream/libwww-freshmeat-perl/current/t/nonexistingproject.t
    trunk/libwww-freshmeat-perl/t/project.t
      - copied unchanged from r30547, branches/upstream/libwww-freshmeat-perl/current/t/project.t
Removed:
    trunk/libwww-freshmeat-perl/t/boilerplate.t
Modified:
    trunk/libwww-freshmeat-perl/Build.PL
    trunk/libwww-freshmeat-perl/Changes
    trunk/libwww-freshmeat-perl/MANIFEST
    trunk/libwww-freshmeat-perl/META.yml
    trunk/libwww-freshmeat-perl/Makefile.PL
    trunk/libwww-freshmeat-perl/README
    trunk/libwww-freshmeat-perl/debian/changelog
    trunk/libwww-freshmeat-perl/debian/control
    trunk/libwww-freshmeat-perl/lib/WWW/Freshmeat.pm

Modified: trunk/libwww-freshmeat-perl/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-freshmeat-perl/Build.PL?rev=30548&op=diff
==============================================================================
--- trunk/libwww-freshmeat-perl/Build.PL (original)
+++ trunk/libwww-freshmeat-perl/Build.PL Mon Feb  9 23:47:15 2009
@@ -1,3 +1,4 @@
+use 5.006;
 use strict;
 use warnings;
 use Module::Build;
@@ -7,10 +8,14 @@
     license             => 'perl',
     dist_author         => 'Cedric Bouvier <cbouvi at cpan.org>',
     dist_version_from   => 'lib/WWW/Freshmeat.pm',
+    requires => {
+        'LWP::UserAgent' => 0,
+        'XML::Simple' => 0,
+        'perl' => 5.006,
+    },
     build_requires => {
         'Test::More' => 0,
-        'LWP::UserAgent' => 0,
-        'XML::Simple' => 0,
+        'LWP::Online' => 1.06,
     },
     add_to_cleanup      => [ 'WWW-Freshmeat-*' ],
 );

Modified: trunk/libwww-freshmeat-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-freshmeat-perl/Changes?rev=30548&op=diff
==============================================================================
--- trunk/libwww-freshmeat-perl/Changes (original)
+++ trunk/libwww-freshmeat-perl/Changes Mon Feb  9 23:47:15 2009
@@ -1,4 +1,20 @@
 Revision history for WWW-Freshmeat
+
+0.03    2009-02-03
+        - retrieve_project for project that does not exist will return undef
+        - retrieve_project will die if it would not be able to fetch project record
+        - nonexistingproject.t to test this functionality
+        - method for returning id's of trove categories
+        - project_from_xml class method
+        - tests check for connection with LWP::Online
+        - Build.PL now lists modules in 'requires' section
+
+0.02    2009-01-25
+        new maintainer: Alexandr Ciornii
+        - distribution modernized
+        - "project.t" added, a live test
+        - "boilerplate.t" removed
+        - "all rights reserved" removed (by permission of Cedric Bouvier)
 
 0.01    Wed May 31 13:29:17 CEST 2006
         First version, only retrieval of known project entry.

Modified: trunk/libwww-freshmeat-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-freshmeat-perl/MANIFEST?rev=30548&op=diff
==============================================================================
--- trunk/libwww-freshmeat-perl/MANIFEST (original)
+++ trunk/libwww-freshmeat-perl/MANIFEST Mon Feb  9 23:47:15 2009
@@ -6,6 +6,7 @@
 META.yml			# Will be created by "make dist"
 README
 t/00-load.t
-t/boilerplate.t
 t/pod-coverage.t
 t/pod.t
+t/project.t
+t/nonexistingproject.t

Modified: trunk/libwww-freshmeat-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-freshmeat-perl/META.yml?rev=30548&op=diff
==============================================================================
--- trunk/libwww-freshmeat-perl/META.yml (original)
+++ trunk/libwww-freshmeat-perl/META.yml Mon Feb  9 23:47:15 2009
@@ -1,19 +1,24 @@
----
-name: WWW-Freshmeat
-version: 0.01
-author:
-  - 'Cedric Bouvier <cbouvi at cpan.org>'
-abstract: automates searches on Freshmeat.net
-license: perl
-build_requires:
-  LWP::UserAgent: 0
-  Test::More: 0
-  XML::Simple: 0
-provides:
-  WWW::Freshmeat:
-    file: lib/WWW/Freshmeat.pm
-    version: 0.01
-  WWW::Freshmeat::Project:
-    file: lib/WWW/Freshmeat.pm
-    version: 0.01
-generated_by: Module::Build version 0.26
+--- #YAML:1.0
+name:               WWW-Freshmeat
+version:            0.03
+abstract:           automates searches on Freshmeat.net
+author:
+    - Cedric Bouvier <cbouvi at cpan.org>
+license:            perl
+distribution_type:  module
+configure_requires:
+    ExtUtils::MakeMaker:  0
+requires:
+    LWP::Online:     1.06
+    LWP::UserAgent:  0
+    perl:            5.006
+    Test::More:      0
+    XML::Simple:     0
+no_index:
+    directory:
+        - t
+        - inc
+generated_by:       ExtUtils::MakeMaker version 6.48
+meta-spec:
+    url:      http://module-build.sourceforge.net/META-spec-v1.4.html
+    version:  1.4

Modified: trunk/libwww-freshmeat-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-freshmeat-perl/Makefile.PL?rev=30548&op=diff
==============================================================================
--- trunk/libwww-freshmeat-perl/Makefile.PL (original)
+++ trunk/libwww-freshmeat-perl/Makefile.PL Mon Feb  9 23:47:15 2009
@@ -1,3 +1,4 @@
+use 5.006;
 use strict;
 use warnings;
 use ExtUtils::MakeMaker;
@@ -12,7 +13,12 @@
         'Test::More' => 0,
         'LWP::UserAgent' => 0,
         'XML::Simple' => 0,
+        'LWP::Online' => 1.06,
     },
+    ($ExtUtils::MakeMaker::VERSION ge '6.31'? 
+     ('LICENSE'		=> 'perl', ) : ()),
+    ($ExtUtils::MakeMaker::VERSION ge '6.48'? 
+     ('MIN_PERL_VERSION' => 5.006,) : ()),
     dist                => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
     clean               => { FILES => 'WWW-Freshmeat-*' },
 );

Modified: trunk/libwww-freshmeat-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-freshmeat-perl/README?rev=30548&op=diff
==============================================================================
--- trunk/libwww-freshmeat-perl/README (original)
+++ trunk/libwww-freshmeat-perl/README Mon Feb  9 23:47:15 2009
@@ -45,6 +45,7 @@
 COPYRIGHT AND LICENCE
 
 Copyright (C) 2006 Cedric Bouvier
+Copyright (C) 2009 Alexandr Ciornii.
 
 This program is free software; you can redistribute it and/or modify it
 under the same terms as Perl itself.

Modified: trunk/libwww-freshmeat-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-freshmeat-perl/debian/changelog?rev=30548&op=diff
==============================================================================
--- trunk/libwww-freshmeat-perl/debian/changelog (original)
+++ trunk/libwww-freshmeat-perl/debian/changelog Mon Feb  9 23:47:15 2009
@@ -1,5 +1,6 @@
-libwww-freshmeat-perl (0.01-4) UNRELEASED; urgency=low
+libwww-freshmeat-perl (0.03-1) UNRELEASED; urgency=low
 
+  [ Gregor Herrmann ]
   * debian/control: Added: Vcs-Svn field (source stanza); Vcs-Browser
     field (source stanza); Homepage field (source stanza). Removed: XS-
     Vcs-Svn fields.
@@ -14,7 +15,12 @@
   * debian/control: Changed: Switched Vcs-Browser field to ViewSVN
     (source stanza).
 
- -- gregor herrmann <gregor+debian at comodo.priv.at>  Tue, 09 Oct 2007 22:33:17 +0200
+  [ Antonio Radici ]
+  * New upstream release
+  * debian/control: 
+    + adding myself to the Uploaders
+
+ -- Antonio Radici <antonio at dyne.org>  Mon, 09 Feb 2009 22:55:57 +0000
 
 libwww-freshmeat-perl (0.01-3) unstable; urgency=low
 

Modified: trunk/libwww-freshmeat-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-freshmeat-perl/debian/control?rev=30548&op=diff
==============================================================================
--- trunk/libwww-freshmeat-perl/debian/control (original)
+++ trunk/libwww-freshmeat-perl/debian/control Mon Feb  9 23:47:15 2009
@@ -4,7 +4,7 @@
 Build-Depends: debhelper (>= 5), libmodule-build-perl
 Build-Depends-Indep: perl (>= 5.8.0-7), libwww-perl, libxml-simple-perl, libtest-pod-perl, libtest-pod-coverage-perl
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
-Uploaders: gregor herrmann <gregoa at debian.org>
+Uploaders: gregor herrmann <gregoa at debian.org>, Antonio Radici <antonio at dyne.org>
 Standards-Version: 3.8.0
 Homepage: http://search.cpan.org/dist/WWW-Freshmeat/
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libwww-freshmeat-perl/

Modified: trunk/libwww-freshmeat-perl/lib/WWW/Freshmeat.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-freshmeat-perl/lib/WWW/Freshmeat.pm?rev=30548&op=diff
==============================================================================
--- trunk/libwww-freshmeat-perl/lib/WWW/Freshmeat.pm (original)
+++ trunk/libwww-freshmeat-perl/lib/WWW/Freshmeat.pm Mon Feb  9 23:47:15 2009
@@ -1,7 +1,8 @@
 package WWW::Freshmeat;
 
+use 5.006;
+use strict;
 use warnings;
-use strict;
 
 =head1 NAME
 
@@ -9,11 +10,11 @@
 
 =head1 VERSION
 
-Version 0.01
-
-=cut
-
-our $VERSION = '0.01';
+Version 0.03
+
+=cut
+
+our $VERSION = '0.03';
 
 use XML::Simple qw();
 
@@ -21,7 +22,7 @@
 
     use WWW::Freshmeat;
 
-    my $fm = new WWW::Freshmeat;
+    my $fm = WWW::Freshmeat->new;
 
     my $project = $fm->retrieve_project('project_id');
 
@@ -63,6 +64,7 @@
 sub name        { $_[0]->projectname_full(@_) || $_[0]->projectname_short(@_) } 
 sub description { $_[0]->desc_full(@_) || $_[0]->desc_short(@_) } 
 sub version     { $_[0]{latest_release}{latest_release_version} }
+sub trove_id    { $_[0]{descriminators}{trove_id} }
 
 sub url {
 
@@ -95,7 +97,7 @@
 
 Query the freshmeat.net site for the project I<STRING> (should be the Freshmeat
 ID of the requested project) and returns a C<WWW::Freshmeat::Project> object or
-dies if the project entry cannot be found.
+undef if the project entry cannot be found.
 
 =cut
 
@@ -105,8 +107,29 @@
     my $id   = shift;
 
     my $url = "http://freshmeat.net/projects-xml/$id/$id.xml";
-    my $res = $self->get($url) or die "Could not GET $url";
-    my $xml = $res->content();
+    my $response = $self->get($url);
+    if ($response->is_success) {
+      my $xml = $response->content();
+      return $self->project_from_xml($xml);
+    } else {
+      die "Could not GET $url";
+    }
+}
+
+=item B<project_from_xml> I<STRING>
+
+Receives Freshmeat project XML record and returns a C<WWW::Freshmeat::Project>
+object or undef if the project entry cannot be found.
+
+=cut
+
+sub project_from_xml {
+    my $self = shift;
+    my $xml  = shift;
+
+    if ($xml eq 'Error: project not found.') {
+      return undef;
+    }
 
     my $data = XML::Simple::XMLin($xml);
 
@@ -138,7 +161,7 @@
 
 =back
 
-Additionnally, it provides the following "higher-level" methods:
+Additionally, it provides the following "higher-level" methods:
 
 =over 4
 
@@ -212,7 +235,8 @@
 
 =head1 COPYRIGHT & LICENSE
 
-Copyright 2006 Cedric Bouvier, all rights reserved.
+Copyright 2006 Cedric Bouvier.
+Copyright 2009 Alexandr Ciornii.
 
 This program is free software; you can redistribute it and/or modify it
 under the same terms as Perl itself.




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