r71097 - in /trunk/libmath-basecalc-perl: ./ debian/ debian/source/ lib/Math/ t/
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Fri Mar 11 03:05:37 UTC 2011
Author: jawnsy-guest
Date: Fri Mar 11 03:05:24 2011
New Revision: 71097
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=71097
Log:
* New upstream release
* Bump to debhelper compat 8
* Standards-Version 3.9.1 (refer to GPL-1 specifically)
* Rewrite control description
* Add myself to Uploaders and Copyright
* Use new 3.0 (quilt) source format
* Use short debhelper rules format
Added:
trunk/libmath-basecalc-perl/LICENSE
- copied unchanged from r71096, branches/upstream/libmath-basecalc-perl/current/LICENSE
trunk/libmath-basecalc-perl/debian/source/
trunk/libmath-basecalc-perl/debian/source/format
trunk/libmath-basecalc-perl/dist.ini
- copied unchanged from r71096, branches/upstream/libmath-basecalc-perl/current/dist.ini
trunk/libmath-basecalc-perl/t/02_digit_dash.t
- copied unchanged from r71096, branches/upstream/libmath-basecalc-perl/current/t/02_digit_dash.t
trunk/libmath-basecalc-perl/t/author-critic.t
- copied unchanged from r71096, branches/upstream/libmath-basecalc-perl/current/t/author-critic.t
Modified:
trunk/libmath-basecalc-perl/Build.PL
trunk/libmath-basecalc-perl/Changes
trunk/libmath-basecalc-perl/MANIFEST
trunk/libmath-basecalc-perl/META.yml
trunk/libmath-basecalc-perl/Makefile.PL
trunk/libmath-basecalc-perl/README
trunk/libmath-basecalc-perl/SIGNATURE
trunk/libmath-basecalc-perl/debian/changelog
trunk/libmath-basecalc-perl/debian/compat
trunk/libmath-basecalc-perl/debian/control
trunk/libmath-basecalc-perl/debian/copyright
trunk/libmath-basecalc-perl/debian/rules
trunk/libmath-basecalc-perl/lib/Math/BaseCalc.pm
trunk/libmath-basecalc-perl/t/01_basic_tests.t
Modified: trunk/libmath-basecalc-perl/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-basecalc-perl/Build.PL?rev=71097&op=diff
==============================================================================
--- trunk/libmath-basecalc-perl/Build.PL (original)
+++ trunk/libmath-basecalc-perl/Build.PL Fri Mar 11 03:05:24 2011
@@ -1,24 +1,37 @@
-use Module::Build;
+use strict;
+use warnings;
+
+use Module::Build 0.3601;
-my $build = Module::Build->new
- (
- module_name => 'Math::BaseCalc',
- license => 'perl',
- build_requires => {
- 'Test::More' => 0,
- },
- create_makefile_pl => 'traditional',
- create_readme => 1,
- sign => 1,
- meta_merge =>
- { resources =>
- {
- homepage => 'http://code.google.com/p/perl-math-basecalc',
- repository => 'http://perl-math-basecalc.googlecode.com/svn',
- },
- },
- );
+my %module_build_args = (
+ 'build_requires' => {
+ 'Module::Build' => '0.3601',
+ 'Test::More' => '0'
+ },
+ 'configure_requires' => {
+ 'ExtUtils::MakeMaker' => '6.31',
+ 'Module::Build' => '0.3601'
+ },
+ 'dist_abstract' => 'Convert numbers between various bases',
+ 'dist_author' => [
+ 'Ken Williams <kwilliams at cpan.org>'
+ ],
+ 'dist_name' => 'Math-BaseCalc',
+ 'dist_version' => '1.014',
+ 'license' => 'perl',
+ 'module_name' => 'Math::BaseCalc',
+ 'recommends' => {},
+ 'recursive_test_files' => 1,
+ 'requires' => {
+ 'Carp' => '0',
+ 'vars' => '0'
+ },
+ 'script_files' => []
+);
+
+
+my $build = Module::Build->new(%module_build_args);
$build->create_build_script;
Modified: trunk/libmath-basecalc-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-basecalc-perl/Changes?rev=71097&op=diff
==============================================================================
--- trunk/libmath-basecalc-perl/Changes (original)
+++ trunk/libmath-basecalc-perl/Changes Fri Mar 11 03:05:24 2011
@@ -1,4 +1,15 @@
Revision history for Perl extension Math::BaseCalc.
+
+1.14 - Sat Feb 26 21:06:25 CST 2011
+
+ - Added the ability to use a dash as a valid digit, which turns off
+ recognition of negative numbers. [Nicolas]
+
+ - Fixed typo in docs. [Takayuki Kawakami]
+
+ - Updated distribution to use Dist::Zilla.
+
+1.13 - Sat Jan 17 17:23:22 2009
- Fixed a test failure that occurred on some subset of 64-bit
machines. [Brian Szymanski, Andreas J. König]
Modified: trunk/libmath-basecalc-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-basecalc-perl/MANIFEST?rev=71097&op=diff
==============================================================================
--- trunk/libmath-basecalc-perl/MANIFEST (original)
+++ trunk/libmath-basecalc-perl/MANIFEST Fri Mar 11 03:05:24 2011
@@ -1,10 +1,14 @@
Build.PL
Changes
-lib/Math/BaseCalc.pm
-Makefile.PL
+LICENSE
MANIFEST
META.yml
+Makefile.PL
README
+SIGNATURE
+dist.ini
+lib/Math/BaseCalc.pm
t/01_basic_tests.t
+t/02_digit_dash.t
t/99_podcoverage.t
-SIGNATURE Added here by Module::Build
+t/author-critic.t
Modified: trunk/libmath-basecalc-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-basecalc-perl/META.yml?rev=71097&op=diff
==============================================================================
--- trunk/libmath-basecalc-perl/META.yml (original)
+++ trunk/libmath-basecalc-perl/META.yml Fri Mar 11 03:05:24 2011
@@ -1,21 +1,24 @@
---
+abstract: 'Convert numbers between various bases'
+author:
+ - 'Ken Williams <kwilliams at cpan.org>'
+build_requires:
+ Module::Build: 0.3601
+ Test::More: 0
+configure_requires:
+ ExtUtils::MakeMaker: 6.31
+ Module::Build: 0.3601
+dynamic_config: 0
+generated_by: 'Dist::Zilla version 4.200000, CPAN::Meta::Converter version 2.102400'
+license: perl
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
name: Math-BaseCalc
-version: 1.013
-author:
- - 'Ken Williams, ken at forum.swarthmore.edu'
-abstract: Convert numbers between various bases
-license: perl
+requires:
+ Carp: 0
+ vars: 0
resources:
- homepage: http://code.google.com/p/perl-math-basecalc
- license: http://dev.perl.org/licenses/
- repository: http://perl-math-basecalc.googlecode.com/svn
-build_requires:
- Test::More: 0
-provides:
- Math::BaseCalc:
- file: lib/Math/BaseCalc.pm
- version: 1.013
-generated_by: Module::Build version 0.2808
-meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.2.html
- version: 1.2
+ bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=Math-BaseCalc
+ repository: http://perl-math-basecalc.googlecode.com/svn/trunk
+version: 1.014
Modified: trunk/libmath-basecalc-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-basecalc-perl/Makefile.PL?rev=71097&op=diff
==============================================================================
--- trunk/libmath-basecalc-perl/Makefile.PL (original)
+++ trunk/libmath-basecalc-perl/Makefile.PL Fri Mar 11 03:05:24 2011
@@ -1,14 +1,56 @@
-# Note: this file was auto-generated by Module::Build::Compat version 0.03
-use ExtUtils::MakeMaker;
-WriteMakefile
-(
- 'NAME' => 'Math::BaseCalc',
- 'VERSION_FROM' => 'lib/Math/BaseCalc.pm',
- 'PREREQ_PM' => {
- 'Test::More' => '0'
- },
- 'INSTALLDIRS' => 'site',
- 'EXE_FILES' => [],
- 'PL_FILES' => {}
- )
-;
+
+use strict;
+use warnings;
+
+
+
+use ExtUtils::MakeMaker 6.31;
+
+
+
+my %WriteMakefileArgs = (
+ 'ABSTRACT' => 'Convert numbers between various bases',
+ 'AUTHOR' => 'Ken Williams <kwilliams at cpan.org>',
+ 'BUILD_REQUIRES' => {
+ 'Module::Build' => '0.3601',
+ 'Test::More' => '0'
+ },
+ 'CONFIGURE_REQUIRES' => {
+ 'ExtUtils::MakeMaker' => '6.31',
+ 'Module::Build' => '0.3601'
+ },
+ 'DISTNAME' => 'Math-BaseCalc',
+ 'EXE_FILES' => [],
+ 'LICENSE' => 'perl',
+ 'NAME' => 'Math::BaseCalc',
+ 'PREREQ_PM' => {
+ 'Carp' => '0',
+ 'vars' => '0'
+ },
+ 'VERSION' => '1.014',
+ 'test' => {
+ 'TESTS' => 't/*.t'
+ }
+);
+
+
+unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) {
+ my $br = delete $WriteMakefileArgs{BUILD_REQUIRES};
+ my $pp = $WriteMakefileArgs{PREREQ_PM};
+ for my $mod ( keys %$br ) {
+ if ( exists $pp->{$mod} ) {
+ $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod};
+ }
+ else {
+ $pp->{$mod} = $br->{$mod};
+ }
+ }
+}
+
+delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
+ unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
+
+WriteMakefile(%WriteMakefileArgs);
+
+
+
Modified: trunk/libmath-basecalc-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-basecalc-perl/README?rev=71097&op=diff
==============================================================================
--- trunk/libmath-basecalc-perl/README (original)
+++ trunk/libmath-basecalc-perl/README Fri Mar 11 03:05:24 2011
@@ -1,92 +1,13 @@
-NAME
- Math::BaseCalc - Convert numbers between various bases
-SYNOPSIS
- use Math::BaseCalc;
- my $calc = new Math::BaseCalc(digits => [0,1]); #Binary
- my $bin_string = $calc->to_base(465); # Convert 465 to binary
+This archive contains the distribution Math-BaseCalc,
+version 1.014:
- $calc->digits('oct'); # Octal
- my $number = $calc->from_base('1574'); # Convert octal 1574 to decimal
+ Convert numbers between various bases
-DESCRIPTION
- This module facilitates the conversion of numbers between various number
- bases. You may define your own digit sets, or use any of several
- predefined digit sets.
+This software is copyright (c) 2011 by Ken Williams.
- The to_base() and from_base() methods convert between Perl numbers and
- strings which represent these numbers in other bases. For instance, if
- you're using the binary digit set [0,1], $calc->to_base(5) will return
- the string "101". $calc->from_base("101") will return the number 5.
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
- To convert between, say, base 7 and base 36, use the 2-step process of
- first converting to a Perl number, then to the desired base for the
- result:
- $calc7 = new Math::BaseCalc(digits=>[0..6]);
- $calc36 = new Math::BaseCalc(digits=>[0..9,'a'..'z'];
-
- $in_base_36 = $calc36->to_base( $calc7->from_base('3506') );
-
- If you just need to handle regular octal & hexdecimal strings, you
- probably don't need this module. See the sprintf(), oct(), and hex()
- Perl functions.
-
-METHODS
- * new Math::BaseCalc
- * new Math::BaseCalc(digits=>...)
- Create a new base calculator. You may specify the digit set to use,
- by either giving the digits in a list reference (in increasing
- order, with the 'zero' character first in the list) or by specifying
- the name of one of the predefined digit sets (see the digit() method
- below).
-
- * $calc->to_base(NUMBER)
- Converts a number to a string representing that number in the
- associated base.
-
- * $calc->from_base(STRING)
- Converts a string representing a number in the associated base to a
- Perl integer. The behavior when fed strings with characters not in
- $calc's digit set is currently undefined.
-
- * $calc->digits
- * $calc->digits(...)
- Get/set the current digit set of the calculator. With no arguments,
- simply returns a list of the characters that make up the current
- digit set. To change the current digit set, pass a list reference
- containing the new digits, or the name of a predefined digit set.
- Currently the predefined digit sets are:
-
- bin => [0,1],
- hex => [0..9,'a'..'f'],
- HEX => [0..9,'A'..'F'],
- oct => [0..7],
- 64 => ['A'..'Z','a'..'z',0..9,'+','/'],
- 62 => [0..9,'a'..'z','A'..'Z'],
-
- Examples:
- $calc->digits('bin');
- $calc->digits([0..7]);
- $calc->digits([qw(w a l d o)]);
-
- If any of your "digits" has more than one character, the behavior is
- currently undefined.
-
-QUESTIONS
- The '64' digit set is meant to be useful for Base64 encoding. I took it
- from the MIME::Base64.pm module. Does it look right? It's sure in a
- strange order.
-
-AUTHOR
- Ken Williams, ken at forum.swarthmore.edu
-
-COPYRIGHT
- This is free software in the colloquial nice-guy sense of the word.
- Copyright (c) 1999, Ken Williams. You may redistribute and/or modify it
- under the same terms as Perl itself.
-
-SEE ALSO
- perl(1).
-
Modified: trunk/libmath-basecalc-perl/SIGNATURE
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-basecalc-perl/SIGNATURE?rev=71097&op=diff
==============================================================================
--- trunk/libmath-basecalc-perl/SIGNATURE (original)
+++ trunk/libmath-basecalc-perl/SIGNATURE Fri Mar 11 03:05:24 2011
@@ -1,5 +1,5 @@
This file contains message digests of all files listed in MANIFEST,
-signed via the Module::Signature module, version 0.55.
+signed via the Module::Signature module, version 0.66.
To verify the content in this distribution, first make sure you have
Module::Signature installed, then type:
@@ -14,19 +14,23 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-SHA1 b93bfc33c863133c1d7be41d3de91ee709cd1d1d Build.PL
-SHA1 a42372acb34344dc002e1c90bb0bc6d8e1792fc1 Changes
-SHA1 90fc65867cc3b1cfabc3202a74e87100b9f04a9b MANIFEST
-SHA1 7edffe7a90e341554dc205f9472727bafdfd9a16 META.yml
-SHA1 32e465cf7c76056a5a766c90cb65afbbc7e44d00 Makefile.PL
-SHA1 8132ad35e17ffb205bd21b44d8a1d0e381db6682 README
-SHA1 d52eb28df40a20142c751fe9491f9c3b51fe21fd lib/Math/BaseCalc.pm
-SHA1 1a48a108576bb40b8591b0c32a532390c2e95fa2 t/01_basic_tests.t
+SHA1 d6fed1a5c367c5aa5dac02abdff7a3f732915b93 Build.PL
+SHA1 593ebe034033e3f2ed44b4301459485a70c6c336 Changes
+SHA1 da0b89eff79e9d5128ab28d63e099b840cca39bf LICENSE
+SHA1 efb85867b62f922852a64a8c268669720acd9eb1 MANIFEST
+SHA1 c32bf33a525e53ec467b8825242eb0df362a9c30 META.yml
+SHA1 5172c9080b3819b6dc54d83ded1b494573b47734 Makefile.PL
+SHA1 c783f7e114b9034f982adc59fc40a83329daeffd README
+SHA1 4ee2712901374d04140cf270561589dd86c37b25 dist.ini
+SHA1 cc2b2af3aa4021be2e0bde8b9592479db88e8fa7 lib/Math/BaseCalc.pm
+SHA1 c53f842995fd8e7bbbffff1a7f43d6086a3bd904 t/01_basic_tests.t
+SHA1 d555c130952881de5faacbe7f0def8a5bdb36354 t/02_digit_dash.t
SHA1 19e797985fada8c25f13ce5f0fb873999c3cbe44 t/99_podcoverage.t
+SHA1 fa45d6e6ab1cd421349dea4ef527bfd5cdc8a09e t/author-critic.t
-----BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.5 (Darwin)
+Version: GnuPG v1.4.6 (Darwin)
-iD8DBQFJcmhhgrvMBLfvlHYRAqHkAJ9hclskp69fTz5syYZYf9O0ICmQ8ACfbQt8
-kHOc3r7ya9VGGZK82tvoqTM=
-=9tPk
+iD8DBQFNab/XgrvMBLfvlHYRApzGAJ4htLzN+HJd4YHok9br3Ok1DCTlDgCcC4Ui
+YoF7kdK1i9i1tbmQFZo2et8=
+=V8eq
-----END PGP SIGNATURE-----
Modified: trunk/libmath-basecalc-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-basecalc-perl/debian/changelog?rev=71097&op=diff
==============================================================================
--- trunk/libmath-basecalc-perl/debian/changelog (original)
+++ trunk/libmath-basecalc-perl/debian/changelog Fri Mar 11 03:05:24 2011
@@ -1,4 +1,13 @@
-libmath-basecalc-perl (1.013-2) UNRELEASED; urgency=low
+libmath-basecalc-perl (1.014-1) UNRELEASED; urgency=low
+
+ [ Jonathan Yu ]
+ * New upstream release
+ * Bump to debhelper compat 8
+ * Standards-Version 3.9.1 (refer to GPL-1 specifically)
+ * Rewrite control description
+ * Add myself to Uploaders and Copyright
+ * Use new 3.0 (quilt) source format
+ * Use short debhelper rules format
[ Nathan Handler ]
* debian/watch: Update to ignore development releases.
@@ -14,7 +23,7 @@
[ Ansgar Burchardt ]
* Update my email address.
- -- Ryan Niebur <ryan at debian.org> Fri, 25 Sep 2009 00:25:24 -0700
+ -- Jonathan Yu <jawnsy at cpan.org> Thu, 10 Mar 2011 22:30:21 -0500
libmath-basecalc-perl (1.013-1) unstable; urgency=low
Modified: trunk/libmath-basecalc-perl/debian/compat
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-basecalc-perl/debian/compat?rev=71097&op=diff
==============================================================================
--- trunk/libmath-basecalc-perl/debian/compat (original)
+++ trunk/libmath-basecalc-perl/debian/compat Fri Mar 11 03:05:24 2011
@@ -1,1 +1,1 @@
-7
+8
Modified: trunk/libmath-basecalc-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-basecalc-perl/debian/control?rev=71097&op=diff
==============================================================================
--- trunk/libmath-basecalc-perl/debian/control (original)
+++ trunk/libmath-basecalc-perl/debian/control Fri Mar 11 03:05:24 2011
@@ -1,11 +1,13 @@
Source: libmath-basecalc-perl
Section: perl
Priority: optional
-Build-Depends: debhelper (>= 7)
-Build-Depends-Indep: perl, libtest-pod-coverage-perl
+Build-Depends: debhelper (>= 8)
+Build-Depends-Indep: perl
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
-Uploaders: Ansgar Burchardt <ansgar at debian.org>, Ryan Niebur <ryan at debian.org>
-Standards-Version: 3.8.0
+Uploaders: Ansgar Burchardt <ansgar at debian.org>,
+ Jonathan Yu <jawnsy at cpan.org>,
+ Ryan Niebur <ryan at debian.org>
+Standards-Version: 3.9.1
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libmath-basecalc-perl/
Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libmath-basecalc-perl/
Homepage: http://search.cpan.org/dist/Math-BaseCalc/
@@ -13,8 +15,7 @@
Package: libmath-basecalc-perl
Architecture: all
Depends: ${misc:Depends}, ${perl:Depends}
-Description: Convert numbers between various bases
- This module facilitates the conversion of numbers between various
- number bases. You may define your own digit sets, or use any of
- several predefined digit sets.
-
+Description: module for numeric base conversion
+ Math::BaseCalc is a Perl module for converting numeric values between various
+ bases. It provides several predefined digit sets (Hexadecimal, Base64, etc.)
+ and allows custom digit sets to be defined for base conversion.
Modified: trunk/libmath-basecalc-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-basecalc-perl/debian/copyright?rev=71097&op=diff
==============================================================================
--- trunk/libmath-basecalc-perl/debian/copyright (original)
+++ trunk/libmath-basecalc-perl/debian/copyright Fri Mar 11 03:05:24 2011
@@ -1,26 +1,33 @@
-Format-Specification: http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=226
-Upstream-Name: Math-BaseCalc
-Upstream-Maintainer: Ken Williams <ken at forum.swarthmore.edu>
-Upstream-Source: http://search.cpan.org/dist/Math-BaseCalc/
+Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135
+Maintainer: Ken Williams <kwilliams at cpan.org>
+Source: http://search.cpan.org/dist/Math-BaseCalc/
+Name: Math-BaseCalc
Files: *
-Copyright: 1999-2009, Ken Williams
-License: GPL-1+ | Artistic
- You may redistribute and/or modify it under the same terms as Perl itself.
- .
- Perl is distributed under the GNU General Public License, either version 1 or
- (at your opinion) any later version, and the Artistic License.
- .
- On Debian systems, the complete text of the GNU General Public License can be
- found in /usr/share/common-licenses/GPL and the Artistic license in
- /usr/share/common-licenses/Artistic.
+Copyright: 1999-2011, Ken Williams <kwilliams at cpan.org>
+License: Artistic or GPL-1+
Files: debian/*
-Copyright: © 2000-2002, Mike Mattice <mattice at debian.org>
- © 2006, Stephen Quinney <sjq at debian.org>
- © 2008, Anibal Monsalve Salazar <anibal at debian.org>
- © 2008, Ansgar Burchardt <ansgar at debian.org>
-License: GPL-1+ | Artistic
- It is assumed that all contributors release their work under the same terms
- as the module and Perl.
+Copyright: 2000-2002, Mike Mattice <mattice at debian.org>
+ 2006, Stephen Quinney <sjq at debian.org>
+ 2008, Anibal Monsalve Salazar <anibal at debian.org>
+ 2008, Ansgar Burchardt <ansgar at 43-1.org>
+ 2009, Ryan Niebur <ryanryan52 at gmail.com>
+ 2011, Jonathan Yu <jawnsy at cpan.org>
+License: Artistic or GPL-1+
+License: Artistic
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the Artistic License, which comes with Perl.
+ .
+ On Debian systems, the complete text of the Artistic License can be
+ found in `/usr/share/common-licenses/Artistic'.
+
+License: GPL-1+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 1, or (at your option)
+ any later version.
+ .
+ On Debian systems, the complete text of version 1 of the GNU General
+ Public License can be found in `/usr/share/common-licenses/GPL-1'.
Modified: trunk/libmath-basecalc-perl/debian/rules
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-basecalc-perl/debian/rules?rev=71097&op=diff
==============================================================================
--- trunk/libmath-basecalc-perl/debian/rules (original)
+++ trunk/libmath-basecalc-perl/debian/rules Fri Mar 11 03:05:24 2011
@@ -1,23 +1,4 @@
#!/usr/bin/make -f
-build: build-stamp
-build-stamp:
- TEST_POD=1 dh build
- touch $@
-
-clean:
+%:
dh $@
-
-install: install-stamp
-install-stamp: build-stamp
- dh install
- touch $@
-
-binary-arch:
-
-binary-indep: install
- dh $@
-
-binary: binary-arch binary-indep
-
-.PHONY: binary binary-arch binary-indep install clean build
Added: trunk/libmath-basecalc-perl/debian/source/format
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-basecalc-perl/debian/source/format?rev=71097&op=file
==============================================================================
--- trunk/libmath-basecalc-perl/debian/source/format (added)
+++ trunk/libmath-basecalc-perl/debian/source/format Fri Mar 11 03:05:24 2011
@@ -1,0 +1,1 @@
+3.0 (quilt)
Modified: trunk/libmath-basecalc-perl/lib/Math/BaseCalc.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-basecalc-perl/lib/Math/BaseCalc.pm?rev=71097&op=diff
==============================================================================
--- trunk/libmath-basecalc-perl/lib/Math/BaseCalc.pm (original)
+++ trunk/libmath-basecalc-perl/lib/Math/BaseCalc.pm Fri Mar 11 03:05:24 2011
@@ -3,11 +3,12 @@
use strict;
use Carp;
use vars qw($VERSION);
-$VERSION = '1.013';
+$VERSION = '1.014';
sub new {
my ($pack, %opts) = @_;
my $self = bless {}, $pack;
+ $self->{has_dash} = 0;
$self->digits($opts{digits});
return $self;
}
@@ -16,6 +17,7 @@
my $self = shift;
if (@_) {
# Set the value
+
if (ref $_[0]) {
$self->{digits} = [ @{ shift() } ];
@@ -25,6 +27,7 @@
croak "Unrecognized digit set '$name'" unless exists $digitsets{$name};
$self->{digits} = $digitsets{$name};
}
+ $self->{has_dash} = grep { $_ eq '-' } @{$self->{digits}};
# Build the translation table back to numbers
@{$self->{trans}}{@{$self->{digits}}} = 0..$#{$self->{digits}};
@@ -47,7 +50,7 @@
sub from_base {
my $self = shift;
- return -1*$self->from_base(substr($_[0],1)) if $_[0] =~ /^-/; # Handle negative numbers
+ return -1*$self->from_base(substr($_[0],1)) if !$self->{has_dash} && $_[0] =~ /^-/; # Handle negative numbers
my $str = shift;
my $dignum = @{$self->{digits}};
@@ -92,6 +95,10 @@
Math::BaseCalc - Convert numbers between various bases
+=head1 VERSION
+
+version 1.014
+
=head1 SYNOPSIS
use Math::BaseCalc;
@@ -119,7 +126,7 @@
result:
$calc7 = new Math::BaseCalc(digits=>[0..6]);
- $calc36 = new Math::BaseCalc(digits=>[0..9,'a'..'z'];
+ $calc36 = new Math::BaseCalc(digits=>[0..9,'a'..'z']);
$in_base_36 = $calc36->to_base( $calc7->from_base('3506') );
@@ -139,6 +146,9 @@
by either giving the digits in a list reference (in increasing order,
with the 'zero' character first in the list) or by specifying the name
of one of the predefined digit sets (see the digit() method below).
+
+If your digit set includes the character C<->, then a dash at the
+beginning of a number will no longer signify a negative number.
=item * $calc->to_base(NUMBER)
@@ -198,4 +208,4 @@
perl(1).
-=cut
+=cut
Modified: trunk/libmath-basecalc-perl/t/01_basic_tests.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-basecalc-perl/t/01_basic_tests.t?rev=71097&op=diff
==============================================================================
--- trunk/libmath-basecalc-perl/t/01_basic_tests.t (original)
+++ trunk/libmath-basecalc-perl/t/01_basic_tests.t Fri Mar 11 03:05:24 2011
@@ -2,7 +2,7 @@
use strict;
use warnings;
-use Test::More tests =>13;
+use Test::More tests =>15;
use_ok('Math::BaseCalc');
my $calc = new Math::BaseCalc(digits=>[0,1]);
@@ -77,3 +77,12 @@
is($third, '10011111111010', "1110111 x 1010110 = 10011111111010");
}
+{
+ $calc->digits(['a', 'b', 'c']);
+ my $result = $calc->from_base('-bba');
+ is($result, '-12', "negative numbers treated correctly");
+
+ $calc->digits(['a', 'b', '-']);
+ $result = $calc->from_base('-bba');
+ is($result, 2*27+9+3, "dash can be a digit");
+}
More information about the Pkg-perl-cvs-commits
mailing list