diff -Nru libnumber-range-perl-0.11/Changes libnumber-range-perl-0.12/Changes --- libnumber-range-perl-0.11/Changes 2014-05-14 17:45:13.000000000 +0000 +++ libnumber-range-perl-0.12/Changes 2014-06-19 17:03:47.000000000 +0000 @@ -45,3 +45,7 @@ 0.11 Wed May 14, 2014 - Add in rangeList (https://github.com/larrys/Number-Range/pull/4) + +0.11 Thu June 19, 2014 + - Fix rangeList when only large ranges are used + (https://github.com/larrys/Number-Range/pull/6) diff -Nru libnumber-range-perl-0.11/debian/changelog libnumber-range-perl-0.12/debian/changelog --- libnumber-range-perl-0.11/debian/changelog 2014-05-16 15:55:59.000000000 +0000 +++ libnumber-range-perl-0.12/debian/changelog 2014-06-20 15:28:15.000000000 +0000 @@ -1,3 +1,10 @@ +libnumber-range-perl (0.12-1) unstable; urgency=medium + + * New upstream release. + * Update years of upstream copyright. + + -- gregor herrmann Fri, 20 Jun 2014 17:28:08 +0200 + libnumber-range-perl (0.11-1) unstable; urgency=low [ Salvatore Bonaccorso ] diff -Nru libnumber-range-perl-0.11/debian/copyright libnumber-range-perl-0.12/debian/copyright --- libnumber-range-perl-0.11/debian/copyright 2014-05-16 15:55:59.000000000 +0000 +++ libnumber-range-perl-0.12/debian/copyright 2014-06-20 15:28:15.000000000 +0000 @@ -4,7 +4,7 @@ Source: https://metacpan.org/release/Number-Range Files: * -Copyright: 2004-2012, Larry Shatzer, Jr., +Copyright: 2004-2014, Larry Shatzer, Jr., License: Artistic or GPL-1+ Files: debian/* diff -Nru libnumber-range-perl-0.11/lib/Number/Range.pm libnumber-range-perl-0.12/lib/Number/Range.pm --- libnumber-range-perl-0.11/lib/Number/Range.pm 2014-05-14 17:45:25.000000000 +0000 +++ libnumber-range-perl-0.12/lib/Number/Range.pm 2014-06-19 17:03:11.000000000 +0000 @@ -11,7 +11,7 @@ our @ISA = qw(Exporter); -our $VERSION = '0.11'; +our $VERSION = '0.12'; sub new { my $this = shift; @@ -248,21 +248,25 @@ # Get the range as an array (excluding large ones) my @range = $self->range(1); - # Get the first element in the array range - my $previous = shift(@range); - my @sub = ($previous); + # If we have any ranges + if (@range) { - # Process ranges stored as arrays - foreach my $current (@range) { - if ($current == ($previous + 1)) { - $sub[1] = $current; - } else { - push(@return,[@sub]); - @sub = ($current); - } - $previous = $current; + # Get the first element in the array range + my $previous = shift(@range); + my @sub = ($previous); + + # Process ranges stored as arrays + foreach my $current (@range) { + if ($current == ($previous + 1)) { + $sub[1] = $current; + } else { + push(@return,[@sub]); + @sub = ($current); + } + $previous = $current; + } + push(@return,[@sub]); } - push(@return,[@sub]); # Process ranges stored as large range hash entries if($self->{_largeRangehash}) { @@ -389,7 +393,7 @@ =head1 COPYRIGHT AND LICENSE -Copyright (C) 2004-12 by Larry Shatzer, Jr. +Copyright (C) 2004-14 by Larry Shatzer, Jr. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff -Nru libnumber-range-perl-0.11/META.yml libnumber-range-perl-0.12/META.yml --- libnumber-range-perl-0.11/META.yml 2014-05-14 17:46:45.000000000 +0000 +++ libnumber-range-perl-0.12/META.yml 2014-06-19 17:04:42.000000000 +0000 @@ -1,6 +1,6 @@ --- #YAML:1.0 name: Number-Range -version: 0.11 +version: 0.12 abstract: Perl extension defining ranges of numbers and testing if a author: - Larry Shatzer, Jr. diff -Nru libnumber-range-perl-0.11/README libnumber-range-perl-0.12/README --- libnumber-range-perl-0.11/README 2014-05-14 17:44:18.000000000 +0000 +++ libnumber-range-perl-0.12/README 2014-06-19 17:02:48.000000000 +0000 @@ -1,4 +1,4 @@ -Number-Range version 0.11 +Number-Range version 0.12 ========================= Number::Range is an object-oriented interface to test if a number exists in a @@ -19,8 +19,7 @@ COPYRIGHT AND LICENCE -Copyright (C) 2004-12 by Larry Shatzer, Jr. +Copyright (C) 2004-14 by Larry Shatzer, Jr. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. - diff -Nru libnumber-range-perl-0.11/t/Number-Range.t libnumber-range-perl-0.12/t/Number-Range.t --- libnumber-range-perl-0.11/t/Number-Range.t 2014-05-14 17:39:53.000000000 +0000 +++ libnumber-range-perl-0.12/t/Number-Range.t 2014-06-19 17:02:30.000000000 +0000 @@ -1,4 +1,4 @@ -use Test::More tests => 38; +use Test::More tests => 40; BEGIN { use_ok('Number::Range') }; ok($range = Number::Range->new("10..100")); @@ -56,3 +56,8 @@ # Large ranges always end up at the end of the list because they are processed seperatly ok($rangeList[3][0] == 300); ok($rangeList[3][1] == 300000); +# Test rangeList with only a single large range +$range = Number::Range->new("300..300000"); +@rangeList = $range->rangeList(); +ok($rangeList[0][0] == 300); +ok($rangeList[0][1] == 300000);