r54702 - in /branches/upstream/libnet-nationalrail-livedepartureboards-perl: ./ current/ current/examples/ current/lib/ current/lib/Net/ current/lib/Net/NationalRail/ current/t/

diocles at users.alioth.debian.org diocles at users.alioth.debian.org
Tue Mar 23 23:27:34 UTC 2010


Author: diocles
Date: Tue Mar 23 23:27:26 2010
New Revision: 54702

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=54702
Log:
[svn-inject] Installing original source of libnet-nationalrail-livedepartureboards-perl

Added:
    branches/upstream/libnet-nationalrail-livedepartureboards-perl/
    branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/
    branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/Changes
    branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/MANIFEST
    branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/META.yml
    branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/Makefile.PL
    branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/README
    branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/examples/
    branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/examples/arrivals_at_soton_from_winchester.pl   (with props)
    branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/examples/departures_from_rugby.pl   (with props)
    branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/lib/
    branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/lib/Net/
    branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/lib/Net/NationalRail/
    branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/lib/Net/NationalRail/LiveDepartureBoards.pm
    branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/t/
    branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/t/00-load.t
    branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/t/pod-coverage.t
    branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/t/pod.t

Added: branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/Changes?rev=54702&op=file
==============================================================================
--- branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/Changes (added)
+++ branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/Changes Tue Mar 23 23:27:26 2010
@@ -1,0 +1,15 @@
+Revision history for Net-NationalRail-LiveDepartureBoards
+
+0.02    Tue, 12 Jan 2010 23:03:03 +0000
+
+	Add support for filtering by destination, or getting arrivals
+	from a particular station.  Many thanks to Ian Dash for the
+	initial patch, which I then ruthlessly refactored - any
+	mistakes are my own. (RT bug #53629.)
+
+	Add examples/arrivals_at_soton_from_winchester.pl to
+	demonstrate the new feature.
+
+0.01    Thu, 08 Jan 2009 20:22:21 +0000
+        Release early, release often.
+

Added: branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/MANIFEST?rev=54702&op=file
==============================================================================
--- branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/MANIFEST (added)
+++ branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/MANIFEST Tue Mar 23 23:27:26 2010
@@ -1,0 +1,11 @@
+Changes
+MANIFEST
+Makefile.PL
+README
+examples/departures_from_rugby.pl
+examples/arrivals_at_soton_from_winchester.pl
+lib/Net/NationalRail/LiveDepartureBoards.pm
+t/00-load.t
+t/pod-coverage.t
+t/pod.t
+META.yml                                 Module meta-data (added by MakeMaker)

Added: branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/META.yml?rev=54702&op=file
==============================================================================
--- branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/META.yml (added)
+++ branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/META.yml Tue Mar 23 23:27:26 2010
@@ -1,0 +1,23 @@
+--- #YAML:1.0
+name:               Net-NationalRail-LiveDepartureBoards
+version:            0.02
+abstract:           Live Departure Boards information
+author:
+    - Tim Retout <diocles at cpan.org>
+license:            perl
+distribution_type:  module
+configure_requires:
+    ExtUtils::MakeMaker:  0
+build_requires:
+    ExtUtils::MakeMaker:  0
+requires:
+    SOAP::Lite:  0
+    Test::More:  0
+no_index:
+    directory:
+        - t
+        - inc
+generated_by:       ExtUtils::MakeMaker version 6.55_02
+meta-spec:
+    url:      http://module-build.sourceforge.net/META-spec-v1.4.html
+    version:  1.4

Added: branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/Makefile.PL?rev=54702&op=file
==============================================================================
--- branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/Makefile.PL (added)
+++ branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/Makefile.PL Tue Mar 23 23:27:26 2010
@@ -1,0 +1,18 @@
+use strict;
+use warnings;
+use ExtUtils::MakeMaker;
+
+WriteMakefile(
+    NAME                => 'Net::NationalRail::LiveDepartureBoards',
+    AUTHOR              => 'Tim Retout <diocles at cpan.org>',
+    VERSION_FROM        => 'lib/Net/NationalRail/LiveDepartureBoards.pm',
+    ABSTRACT_FROM       => 'lib/Net/NationalRail/LiveDepartureBoards.pm',
+    PL_FILES            => {},
+    LICENSE		=> 'perl',
+    PREREQ_PM => {
+        'Test::More' => 0,
+	'SOAP::Lite' => 0,
+    },
+    dist                => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
+    clean               => { FILES => 'Net-NationalRail-LiveDepartureBoards-*' },
+);

Added: branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/README?rev=54702&op=file
==============================================================================
--- branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/README (added)
+++ branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/README Tue Mar 23 23:27:26 2010
@@ -1,0 +1,44 @@
+Net-NationalRail-LiveDepartureBoards
+
+Provides an interface to the National Rail Enquiries Live Departure Boards
+SOAP API, as documented at http://www.livedepartureboards.co.uk/ldbws/.
+
+
+INSTALLATION
+
+To install this module, run the following commands:
+
+	perl Makefile.PL
+	make
+	make test
+	make install
+
+SUPPORT AND DOCUMENTATION
+
+After installing, you can find documentation for this module with the
+perldoc command.
+
+    perldoc Net::NationalRail::LiveDepartureBoards
+
+You can also look for information at:
+
+    RT, CPAN's request tracker
+        http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-NationalRail-LiveDepartureBoards
+
+    AnnoCPAN, Annotated CPAN documentation
+        http://annocpan.org/dist/Net-NationalRail-LiveDepartureBoards
+
+    CPAN Ratings
+        http://cpanratings.perl.org/d/Net-NationalRail-LiveDepartureBoards
+
+    Search CPAN
+        http://search.cpan.org/dist/Net-NationalRail-LiveDepartureBoards
+
+
+COPYRIGHT AND LICENCE
+
+Copyright (C) 2009, 2010 Tim Retout
+
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+

Added: branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/examples/arrivals_at_soton_from_winchester.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/examples/arrivals_at_soton_from_winchester.pl?rev=54702&op=file
==============================================================================
--- branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/examples/arrivals_at_soton_from_winchester.pl (added)
+++ branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/examples/arrivals_at_soton_from_winchester.pl Tue Mar 23 23:27:26 2010
@@ -1,0 +1,14 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use lib './lib';
+
+use Data::Dumper;
+use Net::NationalRail::LiveDepartureBoards;
+
+my $ldb = Net::NationalRail::LiveDepartureBoards->new();
+
+print Dumper($ldb->departures(rows => 10, crs => 'SOU', filtercrs => 'WIN', filtertype => 'from'));
+

Propchange: branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/examples/arrivals_at_soton_from_winchester.pl
------------------------------------------------------------------------------
    svn:executable = 

Added: branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/examples/departures_from_rugby.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/examples/departures_from_rugby.pl?rev=54702&op=file
==============================================================================
--- branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/examples/departures_from_rugby.pl (added)
+++ branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/examples/departures_from_rugby.pl Tue Mar 23 23:27:26 2010
@@ -1,0 +1,14 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use lib './lib';
+
+use Data::Dumper;
+use Net::NationalRail::LiveDepartureBoards;
+
+my $ldb = Net::NationalRail::LiveDepartureBoards->new();
+
+print Dumper($ldb->departures(rows => 10, crs => 'RUG'));
+

Propchange: branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/examples/departures_from_rugby.pl
------------------------------------------------------------------------------
    svn:executable = 

Added: branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/lib/Net/NationalRail/LiveDepartureBoards.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/lib/Net/NationalRail/LiveDepartureBoards.pm?rev=54702&op=file
==============================================================================
--- branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/lib/Net/NationalRail/LiveDepartureBoards.pm (added)
+++ branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/lib/Net/NationalRail/LiveDepartureBoards.pm Tue Mar 23 23:27:26 2010
@@ -1,0 +1,177 @@
+package Net::NationalRail::LiveDepartureBoards;
+
+use strict;
+use warnings;
+
+use SOAP::Lite
+    proxy => 'http://www.livedepartureboards.co.uk/ldbws/ldb2.asmx';
+
+use constant {
+    URI_PREFIX => 'http://thalesgroup.com/RTTI/2008-02-20/ldb/',
+};
+
+=head1 NAME
+
+Net::NationalRail::LiveDepartureBoards - Live Departure Boards information
+
+=head1 VERSION
+
+Version 0.02
+
+=cut
+
+our $VERSION = '0.02';
+
+
+=head1 SYNOPSIS
+
+Provides an interface to the National Rail Enquiries Live Departure Boards
+SOAP API, as documented at http://www.livedepartureboards.co.uk/ldbws/.
+
+    use Net::NationalRail::LiveDepartureBoards;
+
+    my $ldb = Net::NationalRail::LiveDepartureBoards->new();
+    my $hashref = $ldb->departures(rows => 10, crs => 'RUG');
+
+    # Or filter by trains going to another place
+    my $hashref = $ldb->departures(rows => 10, crs => 'RUG', filtercrs => 'SOU');
+
+    # Or get trains arriving from another place
+    my $hashref = $ldb->departures(rows => 10, crs => 'SOU',
+        filtercrs => 'RUG', filtertype => 'from');
+
+=head1 METHODS
+
+=head2 new
+
+=cut
+
+sub new {
+    my $class = shift;
+    my %args = @_;
+
+    bless \%args, $class;
+}
+
+=head2 departures
+
+=cut
+
+sub departures {
+    return _station_board_request('GetDepartureBoard', @_);
+}
+
+=head2 arrivals
+
+=cut
+
+sub arrivals {
+    return _station_board_request('GetArrivalBoard', @_);
+}
+
+=head2 arrivals_and_departures
+
+=cut
+
+sub arrivals_and_departures {
+    return _station_board_request('GetArrivalDepartureBoard', @_);
+}
+
+sub _station_board_request {
+    my $method = shift;
+    my $self = shift;
+    my %arg = @_;
+
+    my @opt_args;
+    if (exists($arg{filtercrs})) {
+        push @opt_args, SOAP::Data->name(filterCrs => $arg{filtercrs});
+
+	my $type = (exists $arg{filtertype} ? $arg{filtertype} : 'to');
+	push @opt_args, SOAP::Data->name(filterType => $type);
+    }
+
+    my $result = _soap_request(
+         $method,
+         URI_PREFIX . 'types',
+         SOAP::Data->name(numRows => $arg{'rows'}),
+         SOAP::Data->name(crs => $arg{'crs'}),
+         @opt_args
+    );
+
+    if ($result->fault) {
+         die join ', ', $result->faultcode, $result->faultstring;
+    } else {
+         return $result->result();
+    }
+}
+
+sub _soap_request {
+    my $method = shift;
+    my $target_namespace = shift;
+
+    return SOAP::Lite
+        ->on_action(sub { URI_PREFIX . $method })
+        ->call( SOAP::Data->name($method . 'Request')->attr(
+                    {xmlns => $target_namespace}),
+                @_,
+        );
+}
+
+=head1 AUTHOR
+
+Tim Retout, C<< <diocles at cpan.org> >>
+
+=head1 BUGS
+
+This is version 0.02. The API is probably not stable yet. There are
+probably bugs. The module could break at any time at the whim of ATOC.
+
+
+Please report any bugs or feature requests to C<bug-net-nationalrail-livedepartureboards at rt.cpan.org>, or through
+the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-NationalRail-LiveDepartureBoards>.  I will be notified, and then you'll
+automatically be notified of progress on your bug as I make changes.
+
+=head1 SUPPORT
+
+You can find documentation for this module with the perldoc command.
+
+    perldoc Net::NationalRail::LiveDepartureBoards
+
+
+You can also look for information at:
+
+=over 4
+
+=item * RT: CPAN's request tracker
+
+L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-NationalRail-LiveDepartureBoards>
+
+=item * AnnoCPAN: Annotated CPAN documentation
+
+L<http://annocpan.org/dist/Net-NationalRail-LiveDepartureBoards>
+
+=item * CPAN Ratings
+
+L<http://cpanratings.perl.org/d/Net-NationalRail-LiveDepartureBoards>
+
+=item * Search CPAN
+
+L<http://search.cpan.org/dist/Net-NationalRail-LiveDepartureBoards>
+
+=back
+
+
+=head1 COPYRIGHT & LICENSE
+
+Copyright (C) 2009, 2010 Tim Retout, all rights reserved.
+
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+
+=head1 SEE ALSO
+
+L<WWW::NationalRail>, L<WWW::LiveDepartureBoards>
+
+=cut
+
+1; # End of Net::NationalRail::LiveDepartureBoards

Added: branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/t/00-load.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/t/00-load.t?rev=54702&op=file
==============================================================================
--- branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/t/00-load.t (added)
+++ branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/t/00-load.t Tue Mar 23 23:27:26 2010
@@ -1,0 +1,9 @@
+#!perl -T
+
+use Test::More tests => 1;
+
+BEGIN {
+	use_ok( 'Net::NationalRail::LiveDepartureBoards' );
+}
+
+diag( "Testing Net::NationalRail::LiveDepartureBoards $Net::NationalRail::LiveDepartureBoards::VERSION, Perl $], $^X" );

Added: branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/t/pod-coverage.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/t/pod-coverage.t?rev=54702&op=file
==============================================================================
--- branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/t/pod-coverage.t (added)
+++ branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/t/pod-coverage.t Tue Mar 23 23:27:26 2010
@@ -1,0 +1,18 @@
+use strict;
+use warnings;
+use Test::More;
+
+# Ensure a recent version of Test::Pod::Coverage
+my $min_tpc = 1.08;
+eval "use Test::Pod::Coverage $min_tpc";
+plan skip_all => "Test::Pod::Coverage $min_tpc required for testing POD coverage"
+    if $@;
+
+# Test::Pod::Coverage doesn't require a minimum Pod::Coverage version,
+# but older versions don't recognize some common documentation styles
+my $min_pc = 0.18;
+eval "use Pod::Coverage $min_pc";
+plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage"
+    if $@;
+
+all_pod_coverage_ok();

Added: branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/t/pod.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/t/pod.t?rev=54702&op=file
==============================================================================
--- branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/t/pod.t (added)
+++ branches/upstream/libnet-nationalrail-livedepartureboards-perl/current/t/pod.t Tue Mar 23 23:27:26 2010
@@ -1,0 +1,12 @@
+#!perl -T
+
+use strict;
+use warnings;
+use Test::More;
+
+# Ensure a recent version of Test::Pod
+my $min_tp = 1.22;
+eval "use Test::Pod $min_tp";
+plan skip_all => "Test::Pod $min_tp required for testing POD" if $@;
+
+all_pod_files_ok();




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