r65600 - in /branches/upstream/libversion-next-perl: ./ current/ current/lib/ current/lib/Version/ current/t/ current/xt/ current/xt/release/

diocles at users.alioth.debian.org diocles at users.alioth.debian.org
Wed Dec 8 22:31:28 UTC 2010


Author: diocles
Date: Wed Dec  8 22:31:18 2010
New Revision: 65600

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=65600
Log:
[svn-inject] Installing original source of libversion-next-perl (0.002)

Added:
    branches/upstream/libversion-next-perl/
    branches/upstream/libversion-next-perl/current/
    branches/upstream/libversion-next-perl/current/Changes
    branches/upstream/libversion-next-perl/current/LICENSE
    branches/upstream/libversion-next-perl/current/MANIFEST
    branches/upstream/libversion-next-perl/current/META.json
    branches/upstream/libversion-next-perl/current/META.yml
    branches/upstream/libversion-next-perl/current/Makefile.PL
    branches/upstream/libversion-next-perl/current/README
    branches/upstream/libversion-next-perl/current/dist.ini
    branches/upstream/libversion-next-perl/current/lib/
    branches/upstream/libversion-next-perl/current/lib/Version/
    branches/upstream/libversion-next-perl/current/lib/Version/Next.pm
    branches/upstream/libversion-next-perl/current/t/
    branches/upstream/libversion-next-perl/current/t/00-compile.t
    branches/upstream/libversion-next-perl/current/t/version-next.t
    branches/upstream/libversion-next-perl/current/xt/
    branches/upstream/libversion-next-perl/current/xt/release/
    branches/upstream/libversion-next-perl/current/xt/release/distmeta.t
    branches/upstream/libversion-next-perl/current/xt/release/pod-coverage.t
    branches/upstream/libversion-next-perl/current/xt/release/pod-syntax.t
    branches/upstream/libversion-next-perl/current/xt/release/portability.t

Added: branches/upstream/libversion-next-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libversion-next-perl/current/Changes?rev=65600&op=file
==============================================================================
--- branches/upstream/libversion-next-perl/current/Changes (added)
+++ branches/upstream/libversion-next-perl/current/Changes Wed Dec  8 22:31:18 2010
@@ -1,0 +1,9 @@
+Revision history for Version-Next
+
+0.002     2010-10-01 13:46:06 EST5EDT
+
+    - Don't specify minimum Carp version (fails on 5.6.x)
+
+0.001     2010-03-18 22:57:48 EST5EDT
+
+    - first draft

Added: branches/upstream/libversion-next-perl/current/LICENSE
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libversion-next-perl/current/LICENSE?rev=65600&op=file
==============================================================================
--- branches/upstream/libversion-next-perl/current/LICENSE (added)
+++ branches/upstream/libversion-next-perl/current/LICENSE Wed Dec  8 22:31:18 2010
@@ -1,0 +1,207 @@
+This software is Copyright (c) 2010 by David Golden.
+
+This is free software, licensed under:
+
+  The Apache License, Version 2.0, January 2004
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

Added: branches/upstream/libversion-next-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libversion-next-perl/current/MANIFEST?rev=65600&op=file
==============================================================================
--- branches/upstream/libversion-next-perl/current/MANIFEST (added)
+++ branches/upstream/libversion-next-perl/current/MANIFEST Wed Dec  8 22:31:18 2010
@@ -1,0 +1,15 @@
+Changes
+LICENSE
+MANIFEST
+META.json
+META.yml
+Makefile.PL
+README
+dist.ini
+lib/Version/Next.pm
+t/00-compile.t
+t/version-next.t
+xt/release/distmeta.t
+xt/release/pod-coverage.t
+xt/release/pod-syntax.t
+xt/release/portability.t

Added: branches/upstream/libversion-next-perl/current/META.json
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libversion-next-perl/current/META.json?rev=65600&op=file
==============================================================================
--- branches/upstream/libversion-next-perl/current/META.json (added)
+++ branches/upstream/libversion-next-perl/current/META.json Wed Dec  8 22:31:18 2010
@@ -1,0 +1,60 @@
+{
+   "abstract" : "increment module version numbers simply and correctly",
+   "author" : [
+      "David Golden <dagolden at cpan.org>"
+   ],
+   "dynamic_config" : 0,
+   "generated_by" : "Dist::Zilla version 4.101612, CPAN::Meta::Converter version 2.102400",
+   "license" : [
+      "apache_2_0"
+   ],
+   "meta-spec" : {
+      "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
+      "version" : "2"
+   },
+   "name" : "Version-Next",
+   "no_index" : {
+      "directory" : [
+         "t",
+         "xt",
+         "examples",
+         "corpus"
+      ]
+   },
+   "prereqs" : {
+      "configure" : {
+         "requires" : {
+            "ExtUtils::MakeMaker" : "6.31"
+         }
+      },
+      "runtime" : {
+         "requires" : {
+            "Carp" : 0,
+            "Sub::Exporter" : 0,
+            "perl" : "5.006"
+         }
+      },
+      "test" : {
+         "requires" : {
+            "File::Find" : 0,
+            "File::Temp" : 0,
+            "Test::Exception" : "0.29",
+            "Test::More" : "0.88"
+         }
+      }
+   },
+   "provides" : {
+      "Version::Next" : {
+         "file" : "lib/Version/Next.pm",
+         "version" : "0.002"
+      }
+   },
+   "release_status" : "stable",
+   "resources" : {
+      "repository" : {
+         "url" : "http://github.com/dagolden/version-next"
+      }
+   },
+   "version" : "0.002"
+}
+

Added: branches/upstream/libversion-next-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libversion-next-perl/current/META.yml?rev=65600&op=file
==============================================================================
--- branches/upstream/libversion-next-perl/current/META.yml (added)
+++ branches/upstream/libversion-next-perl/current/META.yml Wed Dec  8 22:31:18 2010
@@ -1,0 +1,35 @@
+---
+abstract: 'increment module version numbers simply and correctly'
+author:
+  - 'David Golden <dagolden at cpan.org>'
+build_requires:
+  File::Find: 0
+  File::Temp: 0
+  Test::Exception: 0.29
+  Test::More: 0.88
+configure_requires:
+  ExtUtils::MakeMaker: 6.31
+dynamic_config: 0
+generated_by: 'Dist::Zilla version 4.101612, CPAN::Meta::Converter version 2.102400'
+license: apache
+meta-spec:
+  url: http://module-build.sourceforge.net/META-spec-v1.4.html
+  version: 1.4
+name: Version-Next
+no_index:
+  directory:
+    - t
+    - xt
+    - examples
+    - corpus
+provides:
+  Version::Next:
+    file: lib/Version/Next.pm
+    version: 0.002
+requires:
+  Carp: 0
+  Sub::Exporter: 0
+  perl: 5.006
+resources:
+  repository: http://github.com/dagolden/version-next
+version: 0.002

Added: branches/upstream/libversion-next-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libversion-next-perl/current/Makefile.PL?rev=65600&op=file
==============================================================================
--- branches/upstream/libversion-next-perl/current/Makefile.PL (added)
+++ branches/upstream/libversion-next-perl/current/Makefile.PL Wed Dec  8 22:31:18 2010
@@ -1,0 +1,57 @@
+
+use strict;
+use warnings;
+
+ BEGIN { require 5.006; } 
+
+use ExtUtils::MakeMaker 6.31;
+
+
+
+my %WriteMakefileArgs = (
+  'ABSTRACT' => 'increment module version numbers simply and correctly',
+  'AUTHOR' => 'David Golden <dagolden at cpan.org>',
+  'BUILD_REQUIRES' => {
+    'File::Find' => '0',
+    'File::Temp' => '0',
+    'Test::Exception' => '0.29',
+    'Test::More' => '0.88'
+  },
+  'CONFIGURE_REQUIRES' => {
+    'ExtUtils::MakeMaker' => '6.31'
+  },
+  'DISTNAME' => 'Version-Next',
+  'EXE_FILES' => [],
+  'LICENSE' => 'apache',
+  'NAME' => 'Version::Next',
+  'PREREQ_PM' => {
+    'Carp' => '0',
+    'Sub::Exporter' => '0'
+  },
+  'VERSION' => '0.002',
+  '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);
+
+
+

Added: branches/upstream/libversion-next-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libversion-next-perl/current/README?rev=65600&op=file
==============================================================================
--- branches/upstream/libversion-next-perl/current/README (added)
+++ branches/upstream/libversion-next-perl/current/README Wed Dec  8 22:31:18 2010
@@ -1,0 +1,67 @@
+NAME
+    Version::Next - increment module version numbers simply and correctly
+
+VERSION
+    version 0.002
+
+SYNOPSIS
+       use Version::Next;
+ 
+       my $new_version = next_version( $old_version );
+
+DESCRIPTION
+    This module provides a simple, correct way to increment a Perl module
+    version number. It does not attempt to guess what the original version
+    number author intended, it simply increments in the smallest possible
+    fashion. Decimals are incremented like an odometer. Dotted decimals are
+    incremented piecewise and presented in a standardized way.
+
+    If more complex version manipulation is necessary, you may wish to
+    consider Perl::Version.
+
+USAGE
+    This module uses Sub::Exporter for optional exporting. Nothing is
+    exported by default.
+
+  "next_version"
+       my $new_version = next_version( $old_version );
+
+    Given a string, this function make the smallest logical increment and
+    returns it. The input string is very minimally checked that it resembles
+    a version number. Given "undef", the function returns 0.
+
+    Decimal versions are incremented like an odometer, preserving the
+    original number of decimal places. If an underscore is present
+    (indicating an "alpha" version), its relative position is preserved.
+    Examples:
+
+       0.001    ->   0.002
+       0.999    ->   1.000
+       0.1229   ->   0.1230
+       0.12_34  ->   0.12_35
+       0.12_99  ->   0.13_00
+
+    Dotted-decimal versions have the least significant element incremented
+    by one. If the result exceeds 999, the element resets to 0 and the next
+    most significant element is incremented, and so on. Any leading zero
+    padding is removed. Examples:
+
+      v1.2.3     ->  v1.2.4
+      v1.2.999   ->  v1.3.0
+      v1.999.999 ->  v2.0.0
+      v1.2.3_4   ->  v1.2.3_5
+      v1.2.3_999 ->  v1.2.4_0
+
+SEE ALSO
+    *   Perl::Version
+
+AUTHOR
+    David Golden <dagolden at cpan.org>
+
+COPYRIGHT AND LICENSE
+    This software is Copyright (c) 2010 by David Golden.
+
+    This is free software, licensed under:
+
+      The Apache License, Version 2.0, January 2004
+

Added: branches/upstream/libversion-next-perl/current/dist.ini
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libversion-next-perl/current/dist.ini?rev=65600&op=file
==============================================================================
--- branches/upstream/libversion-next-perl/current/dist.ini (added)
+++ branches/upstream/libversion-next-perl/current/dist.ini Wed Dec  8 22:31:18 2010
@@ -1,0 +1,8 @@
+name              = Version-Next
+author            = David Golden <dagolden at cpan.org>
+license           = Apache_2_0
+copyright_holder  = David Golden
+
+[@DAGOLDEN]
+git_remote = github
+

Added: branches/upstream/libversion-next-perl/current/lib/Version/Next.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libversion-next-perl/current/lib/Version/Next.pm?rev=65600&op=file
==============================================================================
--- branches/upstream/libversion-next-perl/current/lib/Version/Next.pm (added)
+++ branches/upstream/libversion-next-perl/current/lib/Version/Next.pm Wed Dec  8 22:31:18 2010
@@ -1,0 +1,169 @@
+#
+# This file is part of Version-Next
+#
+# This software is Copyright (c) 2010 by David Golden.
+#
+# This is free software, licensed under:
+#
+#   The Apache License, Version 2.0, January 2004
+#
+use strict;
+use warnings;
+package Version::Next;
+BEGIN {
+  $Version::Next::VERSION = '0.002';
+}
+# ABSTRACT: increment module version numbers simply and correctly
+
+# Dependencies
+# use version 0.81 (); # XXX not out yet
+use Carp ();
+
+# Exporting
+use Sub::Exporter 0 ( -setup => { exports => [ 'next_version' ] } );
+
+sub next_version {
+  my $version = shift;
+  return 0 unless defined $version;
+
+  # XXX when next version.pm comes out, use version::is_lax
+  Carp::croak( "Doesn't look like a version number: '$version'" )
+    unless $version =~ m{\Av?[0-9._]+\z};
+
+  my $new_ver;
+  my $num_dots =()= $version =~ /(\.)/g;
+  my $has_v = $version =~ /^v/;
+  my $is_alpha = $version =~ /\A[^_]+_\d+\z/;
+
+  if ( $has_v || $num_dots > 1 ) { # vstring
+    $version =~ s{^v}{} if $has_v;
+    my @parts = split /\./, $version;
+    if ( $is_alpha ) { # vstring with alpha
+      push @parts, split /_/, pop @parts;
+    }
+    my @new_ver;
+    while ( @parts ) {
+      my $p = pop @parts;
+      if ( $p < 999 || ! @parts ) {
+        unshift @new_ver, $p+1;
+        last;
+      }
+      else {
+        unshift @new_ver, 0;
+      }
+    }
+    $new_ver = $has_v ? 'v' : '';
+    $new_ver .= join( ".", map { 0+$_ } @parts, @new_ver );
+    if ( $is_alpha ) {
+      $new_ver =~ s{\A(.*)\.(\d+)}{$1_$2};
+    }
+  }
+  else { # decimal fraction
+    my $alpha_neg_offset;
+    if ( $is_alpha ) {
+      $alpha_neg_offset = index( $version, "_" ) +1 - length( $version );
+      $version =~ s{_}{};
+    }
+    my ($fraction) = $version =~ m{\.(\d+)$};
+    my $n = defined $fraction ? length($fraction) : 0;
+    $new_ver = sprintf("%.${n}f",$version + (10**-$n));
+    if ( $is_alpha ) {
+      substr($new_ver, $alpha_neg_offset, 0, "_");
+    }
+  }
+  return $new_ver;
+
+}
+
+1;
+
+
+
+=pod
+
+=head1 NAME
+
+Version::Next - increment module version numbers simply and correctly
+
+=head1 VERSION
+
+version 0.002
+
+=head1 SYNOPSIS
+
+   use Version::Next;
+ 
+   my $new_version = next_version( $old_version );
+
+=head1 DESCRIPTION
+
+This module provides a simple, correct way to increment a Perl module version
+number.  It does not attempt to guess what the original version number author
+intended, it simply increments in the smallest possible fashion.  Decimals are
+incremented like an odometer.  Dotted decimals are incremented piecewise and
+presented in a standardized way.
+
+If more complex version manipulation is necessary, you may wish to consider
+L<Perl::Version>.
+
+=head1 USAGE
+
+This module uses L<Sub::Exporter> for optional exporting.  Nothing is exported
+by default.
+
+=head2 C<<< next_version >>>
+
+   my $new_version = next_version( $old_version );
+
+Given a string, this function make the smallest logical increment and returns
+it.  The input string is very minimally checked that it resembles a version
+number.  Given C<<< undef >>>, the function returns C<<< 0 >>>.
+
+Decimal versions are incremented like an odometer, preserving the original
+number of decimal places.  If an underscore is present (indicating an "alpha"
+version), its relative position is preserved.  Examples:
+
+   0.001    ->   0.002
+   0.999    ->   1.000
+   0.1229   ->   0.1230
+   0.12_34  ->   0.12_35
+   0.12_99  ->   0.13_00
+
+Dotted-decimal versions have the least significant element incremented by one.
+If the result exceeds C<<< 999 >>>, the element resets to C<<< 0 >>> and the next
+most significant element is incremented, and so on.  Any leading zero padding
+is removed.  Examples:
+
+  v1.2.3     ->  v1.2.4
+  v1.2.999   ->  v1.3.0
+  v1.999.999 ->  v2.0.0
+  v1.2.3_4   ->  v1.2.3_5
+  v1.2.3_999 ->  v1.2.4_0
+
+=head1 SEE ALSO
+
+=over
+
+=item *
+
+L<Perl::Version>
+
+=back
+
+=head1 AUTHOR
+
+David Golden <dagolden at cpan.org>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is Copyright (c) 2010 by David Golden.
+
+This is free software, licensed under:
+
+  The Apache License, Version 2.0, January 2004
+
+=cut
+
+
+__END__
+

Added: branches/upstream/libversion-next-perl/current/t/00-compile.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libversion-next-perl/current/t/00-compile.t?rev=65600&op=file
==============================================================================
--- branches/upstream/libversion-next-perl/current/t/00-compile.t (added)
+++ branches/upstream/libversion-next-perl/current/t/00-compile.t Wed Dec  8 22:31:18 2010
@@ -1,0 +1,54 @@
+#!perl
+#
+# This file is part of Version-Next
+#
+# This software is Copyright (c) 2010 by David Golden.
+#
+# This is free software, licensed under:
+#
+#   The Apache License, Version 2.0, January 2004
+#
+
+use strict;
+use warnings;
+
+use Test::More;
+use File::Find;
+use File::Temp qw{ tempdir };
+
+my @modules;
+find(
+  sub {
+    return if $File::Find::name !~ /\.pm\z/;
+    my $found = $File::Find::name;
+    $found =~ s{^lib/}{};
+    $found =~ s{[/\\]}{::}g;
+    $found =~ s/\.pm$//;
+    # nothing to skip
+    push @modules, $found;
+  },
+  'lib',
+);
+
+my @scripts = glob "bin/*";
+
+my $plan = scalar(@modules) + scalar(@scripts);
+$plan ? (plan tests => $plan) : (plan skip_all => "no tests to run");
+
+{
+    # fake home for cpan-testers
+     local $ENV{HOME} = tempdir( CLEANUP => 1 );
+
+    like( qx{ $^X -Ilib -e "require $_; print '$_ ok'" }, qr/^\s*$_ ok/s, "$_ loaded ok" )
+        for sort @modules;
+
+    SKIP: {
+        eval "use Test::Script 1.05; 1;";
+        skip "Test::Script needed to test script compilation", scalar(@scripts) if $@;
+        foreach my $file ( @scripts ) {
+            my $script = $file;
+            $script =~ s!.*/!!;
+            script_compiles( $file, "$script script compiles" );
+        }
+    }
+}

Added: branches/upstream/libversion-next-perl/current/t/version-next.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libversion-next-perl/current/t/version-next.t?rev=65600&op=file
==============================================================================
--- branches/upstream/libversion-next-perl/current/t/version-next.t (added)
+++ branches/upstream/libversion-next-perl/current/t/version-next.t Wed Dec  8 22:31:18 2010
@@ -1,0 +1,149 @@
+use strict;
+use warnings;
+
+use Test::More 0.88; END { done_testing }
+use Test::Exception 0.29;
+
+# Work around buffering that can show diags out of order
+Test::More->builder->failure_output(*STDOUT) if $ENV{HARNESS_VERBOSE};
+
+my ($obj);
+require_ok( 'Version::Next' );
+can_ok( 'Version::Next', 'next_version' );
+eval "use Version::Next 'next_version'";
+can_ok( 'main', 'next_version' );
+is( next_version(1), 2, "1 + 1 == 2");
+throws_ok { next_version('abc') } qr/Doesn't look like a version number: 'abc' at/, "throws error on bad input";
+
+for my $case ( <DATA> ) {
+  chomp $case;
+  next if $case =~ m{\A(?:#|\s*\z)};
+  my ($input, $output) = split ' ', $case;
+  is( next_version($input), $output, "$input -> $output" );
+}
+
+__DATA__
+# Decimals
+0       1
+1       2
+9       10
+
+0.0     0.1
+0.1     0.2
+0.2     0.3
+0.9     1.0
+1.0     1.1
+
+0.00    0.01
+0.01    0.02
+0.09    0.10
+0.10    0.11
+0.90    0.91
+0.99    1.00
+1.00    1.01
+
+1.009   1.010
+1.999   2.000
+1.1000  1.1001
+1.1999  1.2000
+
+# Alpha decimals
+0.0_1     0.0_2
+0.0_1     0.0_2
+0.0_2     0.0_3
+0.0_9     0.1_0
+1.0_0     1.0_1
+
+0.0_00    0.0_01
+0.0_01    0.0_02
+0.0_09    0.0_10
+0.0_10    0.0_11
+0.0_90    0.0_91
+0.0_99    0.1_00
+1.0_00    1.0_01
+
+1.0_009   1.0_010
+1.0_999   1.1_000
+1.0_1000  1.0_1001
+1.0_1999  1.0_2000
+
+1.23_01   1.23_02
+1.23_09   1.23_10
+1.23_99   1.24_00
+
+# Dotted Decimals
+v0      v1
+v1      v2
+v9      v10
+
+v0.0    v0.1
+v0.1    v0.2
+v0.9    v0.10
+v0.10   v0.11
+v0.99   v0.100
+v0.999  v1.0
+v0.1000 v1.0
+
+0.0.0    0.0.1
+0.0.1    0.0.2
+0.0.9    0.0.10
+0.0.10   0.0.11
+0.0.99   0.0.100
+0.0.999  0.1.0
+0.0.1000 0.1.0
+
+v0.0.0    v0.0.1
+v0.0.1    v0.0.2
+v0.0.9    v0.0.10
+v0.0.10   v0.0.11
+v0.0.99   v0.0.100
+v0.0.999  v0.1.0
+v0.0.1000 v0.1.0
+
+v0.999.0        v0.999.1
+v1.999.999      v2.0.0
+v1.1000.1000    v2.0.0
+
+# Alpha dotted decimals
+
+v0.0_0    v0.0_1
+v0.0_1    v0.0_2
+v0.0_9    v0.0_10
+v0.0_10   v0.0_11
+v0.0_99   v0.0_100
+v0.0_999  v0.1_0
+v0.0_1000 v0.1_0
+
+v0.1.2_0    v0.1.2_1
+v0.1.2_1    v0.1.2_2
+v0.1.2_9    v0.1.2_10
+v0.1.2_10   v0.1.2_11
+v0.1.2_99   v0.1.2_100
+v0.1.2_999  v0.1.3_0
+v0.1.2_1000 v0.1.3_0
+
+v0.999_0        v0.999_1
+v1.999_999      v2.0_0
+v1.1000_1000    v2.0_0
+
+v0.1.999_0        v0.1.999_1
+v1.1.999_999      v1.2.0_0
+v1.1.1000_1000    v1.2.0_0
+
+# dotted decimals with leading zeros
+
+v0.00.00    v0.0.1
+v0.00.01    v0.0.2
+v0.00.09    v0.0.10
+v0.00.010   v0.0.11
+v0.00.099   v0.0.100
+v0.000.999  v0.1.0
+v0.0.01000  v0.1.0
+
+v0.0_00    v0.0_1
+v0.0_01    v0.0_2
+v0.0_09    v0.0_10
+v0.0_010   v0.0_11
+v0.0_099   v0.0_100
+v0.0_0999  v0.1_0
+v0.0_01000 v0.1_0

Added: branches/upstream/libversion-next-perl/current/xt/release/distmeta.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libversion-next-perl/current/xt/release/distmeta.t?rev=65600&op=file
==============================================================================
--- branches/upstream/libversion-next-perl/current/xt/release/distmeta.t (added)
+++ branches/upstream/libversion-next-perl/current/xt/release/distmeta.t Wed Dec  8 22:31:18 2010
@@ -1,0 +1,16 @@
+#!perl
+#
+# This file is part of Version-Next
+#
+# This software is Copyright (c) 2010 by David Golden.
+#
+# This is free software, licensed under:
+#
+#   The Apache License, Version 2.0, January 2004
+#
+
+use Test::More;
+
+eval "use Test::CPAN::Meta";
+plan skip_all => "Test::CPAN::Meta required for testing META.yml" if $@;
+meta_yaml_ok();

Added: branches/upstream/libversion-next-perl/current/xt/release/pod-coverage.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libversion-next-perl/current/xt/release/pod-coverage.t?rev=65600&op=file
==============================================================================
--- branches/upstream/libversion-next-perl/current/xt/release/pod-coverage.t (added)
+++ branches/upstream/libversion-next-perl/current/xt/release/pod-coverage.t Wed Dec  8 22:31:18 2010
@@ -1,0 +1,22 @@
+#!perl
+#
+# This file is part of Version-Next
+#
+# This software is Copyright (c) 2010 by David Golden.
+#
+# This is free software, licensed under:
+#
+#   The Apache License, Version 2.0, January 2004
+#
+
+use Test::More;
+
+eval "use Test::Pod::Coverage 1.08";
+plan skip_all => "Test::Pod::Coverage 1.08 required for testing POD coverage"
+  if $@;
+
+eval "use Pod::Coverage::TrustPod";
+plan skip_all => "Pod::Coverage::TrustPod required for testing POD coverage"
+  if $@;
+
+all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' });

Added: branches/upstream/libversion-next-perl/current/xt/release/pod-syntax.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libversion-next-perl/current/xt/release/pod-syntax.t?rev=65600&op=file
==============================================================================
--- branches/upstream/libversion-next-perl/current/xt/release/pod-syntax.t (added)
+++ branches/upstream/libversion-next-perl/current/xt/release/pod-syntax.t Wed Dec  8 22:31:18 2010
@@ -1,0 +1,16 @@
+#!perl
+#
+# This file is part of Version-Next
+#
+# This software is Copyright (c) 2010 by David Golden.
+#
+# This is free software, licensed under:
+#
+#   The Apache License, Version 2.0, January 2004
+#
+use Test::More;
+
+eval "use Test::Pod 1.41";
+plan skip_all => "Test::Pod 1.41 required for testing POD" if $@;
+
+all_pod_files_ok();

Added: branches/upstream/libversion-next-perl/current/xt/release/portability.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libversion-next-perl/current/xt/release/portability.t?rev=65600&op=file
==============================================================================
--- branches/upstream/libversion-next-perl/current/xt/release/portability.t (added)
+++ branches/upstream/libversion-next-perl/current/xt/release/portability.t Wed Dec  8 22:31:18 2010
@@ -1,0 +1,17 @@
+#!perl
+#
+# This file is part of Version-Next
+#
+# This software is Copyright (c) 2010 by David Golden.
+#
+# This is free software, licensed under:
+#
+#   The Apache License, Version 2.0, January 2004
+#
+
+use Test::More;
+
+eval "use Test::Portability::Files";
+plan skip_all => "Test::Portability::Files required for testing portability"
+  if $@;
+run_tests();




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