r5047 - in /packages/libroman-perl/branches/upstream/current: Changes MANIFEST META.yml Makefile.PL README Roman.pm lib/ lib/Roman.pm t/ t/00-load.t t/01.t t/pod-coverage.t t/pod.t

gregoa-guest at users.alioth.debian.org gregoa-guest at users.alioth.debian.org
Fri Apr 13 18:53:41 UTC 2007


Author: gregoa-guest
Date: Fri Apr 13 18:53:41 2007
New Revision: 5047

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=5047
Log:
[svn-upgrade] Integrating new upstream version, libroman-perl (1.20)

Added:
    packages/libroman-perl/branches/upstream/current/Changes
    packages/libroman-perl/branches/upstream/current/MANIFEST
    packages/libroman-perl/branches/upstream/current/META.yml
    packages/libroman-perl/branches/upstream/current/Makefile.PL
    packages/libroman-perl/branches/upstream/current/lib/
    packages/libroman-perl/branches/upstream/current/lib/Roman.pm
    packages/libroman-perl/branches/upstream/current/t/
    packages/libroman-perl/branches/upstream/current/t/00-load.t
    packages/libroman-perl/branches/upstream/current/t/01.t
    packages/libroman-perl/branches/upstream/current/t/pod-coverage.t
    packages/libroman-perl/branches/upstream/current/t/pod.t
Removed:
    packages/libroman-perl/branches/upstream/current/Roman.pm
Modified:
    packages/libroman-perl/branches/upstream/current/README

Added: packages/libroman-perl/branches/upstream/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libroman-perl/branches/upstream/current/Changes?rev=5047&op=file
==============================================================================
--- packages/libroman-perl/branches/upstream/current/Changes (added)
+++ packages/libroman-perl/branches/upstream/current/Changes Fri Apr 13 18:53:41 2007
@@ -1,0 +1,12 @@
+Revision history for Roman
+
+1.00    01 Sep 1995
+
+1.10    03 Sep 1997
+        Author's address is now <ozawa at aisoft.co.jp>
+
+1.10_01  06 Mar 2007
+        Rewrite by Alexandr Ciornii
+
+1.20  10 Mar 2007
+        Same as 1.10_01

Added: packages/libroman-perl/branches/upstream/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libroman-perl/branches/upstream/current/MANIFEST?rev=5047&op=file
==============================================================================
--- packages/libroman-perl/branches/upstream/current/MANIFEST (added)
+++ packages/libroman-perl/branches/upstream/current/MANIFEST Fri Apr 13 18:53:41 2007
@@ -1,0 +1,10 @@
+Changes
+MANIFEST
+META.yml # Will be created by "make dist"
+Makefile.PL
+README
+lib/Roman.pm
+t/00-load.t
+t/01.t
+t/pod-coverage.t
+t/pod.t

Added: packages/libroman-perl/branches/upstream/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libroman-perl/branches/upstream/current/META.yml?rev=5047&op=file
==============================================================================
--- packages/libroman-perl/branches/upstream/current/META.yml (added)
+++ packages/libroman-perl/branches/upstream/current/META.yml Fri Apr 13 18:53:41 2007
@@ -1,0 +1,14 @@
+--- #YAML:1.0
+name:                Roman
+version:             1.20
+abstract:            Perl module for conversion between Roman and Arabic numerals.
+license:             perl
+generated_by:        ExtUtils::MakeMaker version 6.31
+distribution_type:   module
+requires:     
+    Test::More:                    0
+meta-spec:
+    url:     http://module-build.sourceforge.net/META-spec-v1.2.html
+    version: 1.2
+author:
+    - Alexandr Ciornii <alexchorny AT gmail.com>

Added: packages/libroman-perl/branches/upstream/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libroman-perl/branches/upstream/current/Makefile.PL?rev=5047&op=file
==============================================================================
--- packages/libroman-perl/branches/upstream/current/Makefile.PL (added)
+++ packages/libroman-perl/branches/upstream/current/Makefile.PL Fri Apr 13 18:53:41 2007
@@ -1,0 +1,19 @@
+use 5.6.0;
+use strict;
+use warnings;
+use ExtUtils::MakeMaker;
+
+WriteMakefile(
+    NAME                => 'Roman',
+    AUTHOR              => 'Alexandr Ciornii <alexchorny AT gmail.com>',
+    VERSION_FROM        => 'lib/Roman.pm',
+    ABSTRACT_FROM       => 'lib/Roman.pm',
+    PL_FILES            => {},
+    PREREQ_PM => {
+        'Test::More' => 0,
+    },
+    ($ExtUtils::MakeMaker::VERSION ge '6.30_00'? 
+     ('LICENSE'		=> 'perl', ) : ()),
+    dist                => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
+    clean               => { FILES => 'Roman-*' },
+);

Modified: packages/libroman-perl/branches/upstream/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libroman-perl/branches/upstream/current/README?rev=5047&op=diff
==============================================================================
--- packages/libroman-perl/branches/upstream/current/README (original)
+++ packages/libroman-perl/branches/upstream/current/README Fri Apr 13 18:53:41 2007
@@ -1,76 +1,60 @@
-Roman.pm version 1.1
-
-NAME
-     Roman - Perl module for conversion between Roman and Arabic
-     numerals.
-
-SYNOPSIS
-             use Roman;
-
-             $arabic = arabic($roman) if isroman($roman);
-             $roman = Roman($arabic);
-             $roman = roman($arabic);
-
-DESCRIPTION
-     This package provides some functions which help conversion
-     of numeric notation between Roman and Arabic.
-
-INSTALLATION
-     Just copy Roman.pm into your perl module path.
-
-BUGS
-     Domain of valid Roman numerals is limited to less than 4000,
-     since proper Roman digits for the rest are not available in
-     ASCII.
-
-CHANGES
-     1997/09/03 Author's address is now <ozawa at aisoft.co.jp>
-
-AUTHOR
-     OZAWA Sakuro <ozawa at aisoft.co.jp>
-
-COPYRIGHT
-     Copyright (c) 1995 OZAWA Sakuro.  All rights reserved.  This
-     program is free software; you can redistribute it and/or
-     modify it under the same terms as Perl itself.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Sun Release 4.1           Last change:                          1
-
-
-
-
-DESCRIPTION
-
-This package provides some functions which help conversion of numeric
-notation between Roman and Arabic.
-
-
-INSTALLATION
-
-Simply copy Roman.pm into your perl module path.
-
-AUTHOR
-
-OZAWA Sakuro <ozawa at prince.pe.u-tokyo.ac.jp>
+Roman.pm version 1.20
+
+NAME
+     Roman - Perl module for conversion between Roman and Arabic
+     numerals.
+
+SYNOPSIS
+             use Roman;
+
+             $arabic = arabic($roman) if isroman($roman);
+             $roman = Roman($arabic);
+             $roman = roman($arabic);
+
+DESCRIPTION
+     This package provides some functions which help conversion
+     of numeric notation between Roman and Arabic.
+
+INSTALLATION
+
+To install this module, run the following commands:
+
+    perl Makefile.PL
+    make
+    make test
+    make install
+
+Or use `cpan` or `cpanp` (best way).
+
+BUGS
+     Domain of valid Roman numerals is limited to less than 4000,
+     since proper Roman digits for the rest are not available in
+     ASCII.
+
+SUPPORT AND DOCUMENTATION
+
+After installing, you can find documentation for this module with the perldoc command.
+
+    perldoc Roman
+
+You can also look for information at:
+
+    Search CPAN
+        http://search.cpan.org/dist/Roman
+
+    CPAN Request Tracker:
+        http://rt.cpan.org/NoAuth/Bugs.html?Dist=Roman
+
+    AnnoCPAN, annotated CPAN documentation:
+        http://annocpan.org/dist/Roman
+
+    CPAN Ratings:
+        http://cpanratings.perl.org/d/Roman
+
+COPYRIGHT AND LICENCE
+
+Copyright (c) 1995-1997 OZAWA Sakuro.
+Copyright (C) 2007 Alexandr Ciornii
+
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.

Added: packages/libroman-perl/branches/upstream/current/lib/Roman.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libroman-perl/branches/upstream/current/lib/Roman.pm?rev=5047&op=file
==============================================================================
--- packages/libroman-perl/branches/upstream/current/lib/Roman.pm (added)
+++ packages/libroman-perl/branches/upstream/current/lib/Roman.pm Fri Apr 13 18:53:41 2007
@@ -1,0 +1,161 @@
+package Roman;
+
+use 5.6.0;
+use warnings;
+use strict;
+our $VERSION='1.20';
+
+=head1 NAME
+
+Roman - Perl module for conversion between Roman and Arabic numerals.
+
+=head1 VERSION
+
+Version 1.20
+
+=cut
+
+
+=head1 SYNOPSIS
+
+	use Roman;
+
+	$arabic = arabic($roman) if isroman($roman);
+	$roman = Roman($arabic);
+	$roman = roman($arabic);
+
+=head1 DESCRIPTION
+
+This package provides some functions which help conversion of numeric
+notation between Roman and Arabic.
+
+=head1 Functions
+
+=head2 isroman
+
+Tests if argument is valid roman number
+
+=head2 arabic
+
+roman => arabic
+
+=head2 Roman
+
+arabic => roman
+
+=head2 roman
+
+Same as Roman, lowercase
+
+=head1 BUGS
+
+Domain of valid Roman numerals is limited to less than 4000, since
+proper Roman digits for the rest are not available in ASCII.
+
+Please report any bugs or feature requests to
+C<bug-roman /AT/ rt.cpan.org>, or through the web interface at
+L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Roman>.
+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 Roman
+
+You can also look for information at:
+
+=over 4
+
+=item * AnnoCPAN: Annotated CPAN documentation
+
+L<http://annocpan.org/dist/Roman>
+
+=item * CPAN Ratings
+
+L<http://cpanratings.perl.org/d/Roman>
+
+=item * RT: CPAN's request tracker
+
+L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Roman>
+
+=item * Search CPAN
+
+L<http://search.cpan.org/dist/Roman>
+
+=back
+
+=head1 AUTHOR
+
+OZAWA Sakuro <ozawa at aisoft.co.jp> 1995-1997
+Alexandr Ciornii, C<< <alexchorny at gmail.com> >> 2007
+
+=head1 COPYRIGHT
+
+Copyright (c) 1995 OZAWA Sakuro.  All rights reserved.  This program
+is free software; you can redistribute it and/or modify it under the
+same terms as Perl itself.
+
+=cut
+
+require Exporter;
+our @ISA = qw(Exporter);
+our @EXPORT = qw(isroman arabic Roman roman);
+
+our %roman2arabic = qw(I 1 V 5 X 10 L 50 C 100 D 500 M 1000);
+my %roman_digit = qw(1 IV 10 XL 100 CD 1000 MMMMMM);
+my @figure = reverse sort keys %roman_digit;
+#my %roman_digit;
+$roman_digit{$_} = [split(//, $roman_digit{$_}, 2)] foreach @figure;
+
+sub isroman($) {
+    my $arg = shift;
+    $arg ne '' and
+      $arg =~ /^(?: M{0,3})
+                (?: D?C{0,3} | C[DM])
+                (?: L?X{0,3} | X[LC])
+                (?: V?I{0,3} | I[VX])$/ix;
+}
+
+sub arabic($) {
+    my $arg = shift;
+    isroman $arg or return undef;
+    my($last_digit) = 1000;
+    my($arabic);
+    foreach (split(//, uc $arg)) {
+        my($digit) = $roman2arabic{$_};
+        $arabic -= 2 * $last_digit if $last_digit < $digit;
+        $arabic += ($last_digit = $digit);
+    }
+    $arabic;
+}
+
+sub Roman($) {
+    my $arg = shift;
+    0 < $arg and $arg < 4000 or return undef;
+    my($x, $roman);
+    foreach (@figure) {
+        my($digit, $i, $v) = (int($arg / $_), @{$roman_digit{$_}});
+        if (1 <= $digit and $digit <= 3) {
+            $roman .= $i x $digit;
+        } elsif ($digit == 4) {
+            $roman .= "$i$v";
+        } elsif ($digit == 5) {
+            $roman .= $v;
+        } elsif (6 <= $digit and $digit <= 8) {
+            $roman .= $v . $i x ($digit - 5);
+        } elsif ($digit == 9) {
+            $roman .= "$i$x";
+        }
+        $arg -= $digit * $_;
+        $x = $i;
+    }
+    $roman;
+}
+
+sub roman($) {
+    lc Roman shift;
+}
+
+1; # End of Roman

Added: packages/libroman-perl/branches/upstream/current/t/00-load.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libroman-perl/branches/upstream/current/t/00-load.t?rev=5047&op=file
==============================================================================
--- packages/libroman-perl/branches/upstream/current/t/00-load.t (added)
+++ packages/libroman-perl/branches/upstream/current/t/00-load.t Fri Apr 13 18:53:41 2007
@@ -1,0 +1,9 @@
+#!perl -T
+
+use Test::More tests => 1;
+
+BEGIN {
+	use_ok( 'Roman' );
+}
+
+diag( "Testing Roman $Roman::VERSION, Perl $], $^X" );

Added: packages/libroman-perl/branches/upstream/current/t/01.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libroman-perl/branches/upstream/current/t/01.t?rev=5047&op=file
==============================================================================
--- packages/libroman-perl/branches/upstream/current/t/01.t (added)
+++ packages/libroman-perl/branches/upstream/current/t/01.t Fri Apr 13 18:53:41 2007
@@ -1,0 +1,22 @@
+#!perl -T
+
+use 5.6.0;
+use strict;
+use warnings;
+our %test;
+BEGIN{
+%test=(
+ 'I'=>1,
+ 'II'=>2,
+ 'III'=>3,
+ qw/V 5 X 10 L 50 C 100 D 500 M 1000 MCDXLIV 1444 MMVII 2007/
+);
+}
+use Test::More tests => (scalar(keys %test)*3+1);
+use_ok 'Roman';
+
+while (my ($rom,$arab)=each %test) {
+ ok(isroman($rom),"$rom is roman");
+ is(arabic($rom),$arab,"$rom is $arab");
+ is(Roman($arab),$rom,"$arab is $rom");
+}

Added: packages/libroman-perl/branches/upstream/current/t/pod-coverage.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libroman-perl/branches/upstream/current/t/pod-coverage.t?rev=5047&op=file
==============================================================================
--- packages/libroman-perl/branches/upstream/current/t/pod-coverage.t (added)
+++ packages/libroman-perl/branches/upstream/current/t/pod-coverage.t Fri Apr 13 18:53:41 2007
@@ -1,0 +1,6 @@
+#!perl -T
+
+use Test::More;
+eval "use Test::Pod::Coverage 1.04";
+plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" if $@;
+all_pod_coverage_ok();

Added: packages/libroman-perl/branches/upstream/current/t/pod.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libroman-perl/branches/upstream/current/t/pod.t?rev=5047&op=file
==============================================================================
--- packages/libroman-perl/branches/upstream/current/t/pod.t (added)
+++ packages/libroman-perl/branches/upstream/current/t/pod.t Fri Apr 13 18:53:41 2007
@@ -1,0 +1,6 @@
+#!perl -T
+
+use Test::More;
+eval "use Test::Pod 1.14";
+plan skip_all => "Test::Pod 1.14 required for testing POD" if $@;
+all_pod_files_ok();




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