Skip to content

Commit

Permalink
Attempt to squash warnings for undefined dates and add rudimentary ve…
Browse files Browse the repository at this point in the history
…rsion sorting when dates are equal
  • Loading branch information
bricas committed Feb 11, 2011
1 parent 54b66b2 commit 9d8bdc7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions Changes
@@ -1,5 +1,10 @@
Revision history for perl module CPAN::Changes

0.05 TO BE RELEASED

- Attempt to squash warnings for undefined dates and add rudimentary
version sorting when dates are equal

0.04 2011-02-10

- Remove done_testing() from a test.
Expand Down
7 changes: 5 additions & 2 deletions lib/CPAN/Changes.pm
Expand Up @@ -7,7 +7,7 @@ use CPAN::Changes::Release;
use Text::Wrap ();
use Scalar::Util ();

our $VERSION = '0.04';
our $VERSION = '0.05';

sub new {
my $class = shift;
Expand Down Expand Up @@ -121,7 +121,10 @@ sub releases {
$self->add_release( @_ );
}

return sort { $a->date cmp $b->date } values %{ $self->{ releases } };
return sort {
( $a->date || '' ) cmp( $b->date || '' )
|| $a->version cmp $b->version
} values %{ $self->{ releases } };
}

sub add_release {
Expand Down
2 changes: 1 addition & 1 deletion t/self.t
@@ -1,7 +1,7 @@
use strict;
use warnings;

use Test::More tests => 7;
use Test::More tests => 8;

use_ok( 'CPAN::Changes' );

Expand Down

0 comments on commit 9d8bdc7

Please sign in to comment.