r22065 - in /branches/upstream/libperl6-junction-perl/current: ./ lib/Perl6/ lib/Perl6/Junction/ t/

dmn at users.alioth.debian.org dmn at users.alioth.debian.org
Mon Jun 23 09:44:30 UTC 2008


Author: dmn
Date: Mon Jun 23 09:44:30 2008
New Revision: 22065

URL: http://svn.debian.org/wsvn/?sc=1&rev=22065
Log:
[svn-upgrade] Integrating new upstream version, libperl6-junction-perl (1.40000)

Added:
    branches/upstream/libperl6-junction-perl/current/lib/Perl6/Junction/Base.pm   (with props)
Modified:
    branches/upstream/libperl6-junction-perl/current/Changes
    branches/upstream/libperl6-junction-perl/current/MANIFEST
    branches/upstream/libperl6-junction-perl/current/META.yml
    branches/upstream/libperl6-junction-perl/current/lib/Perl6/Junction.pm
    branches/upstream/libperl6-junction-perl/current/lib/Perl6/Junction/All.pm
    branches/upstream/libperl6-junction-perl/current/lib/Perl6/Junction/Any.pm
    branches/upstream/libperl6-junction-perl/current/lib/Perl6/Junction/None.pm
    branches/upstream/libperl6-junction-perl/current/lib/Perl6/Junction/One.pm
    branches/upstream/libperl6-junction-perl/current/t/all.t
    branches/upstream/libperl6-junction-perl/current/t/any.t
    branches/upstream/libperl6-junction-perl/current/t/none.t
    branches/upstream/libperl6-junction-perl/current/t/one.t

Modified: branches/upstream/libperl6-junction-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libperl6-junction-perl/current/Changes?rev=22065&op=diff
==============================================================================
--- branches/upstream/libperl6-junction-perl/current/Changes (original)
+++ branches/upstream/libperl6-junction-perl/current/Changes Mon Jun 23 09:44:30 2008
@@ -1,3 +1,8 @@
+1.40000 2008-06-20
+
+    - Added 'values' method to ensure that we can fetch data from junctions
+      and create new junctions based upon old ones.
+
 1.30000 2007-05-11
 
 	- Non-development release.

Modified: branches/upstream/libperl6-junction-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/branches/upstream/libperl6-junction-perl/current/MANIFEST?rev=22065&op=diff
==============================================================================
--- branches/upstream/libperl6-junction-perl/current/MANIFEST (original)
+++ branches/upstream/libperl6-junction-perl/current/MANIFEST Mon Jun 23 09:44:30 2008
@@ -2,6 +2,7 @@
 lib/Perl6/Junction.pm
 lib/Perl6/Junction/All.pm
 lib/Perl6/Junction/Any.pm
+lib/Perl6/Junction/Base.pm
 lib/Perl6/Junction/None.pm
 lib/Perl6/Junction/One.pm
 Makefile.PL

Modified: branches/upstream/libperl6-junction-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libperl6-junction-perl/current/META.yml?rev=22065&op=diff
==============================================================================
--- branches/upstream/libperl6-junction-perl/current/META.yml (original)
+++ branches/upstream/libperl6-junction-perl/current/META.yml Mon Jun 23 09:44:30 2008
@@ -1,13 +1,14 @@
 --- #YAML:1.0
 name:                Perl6-Junction
-version:             1.30000
+version:             1.40000
 abstract:            ~
 license:             ~
-generated_by:        ExtUtils::MakeMaker version 6.31
+author:              ~
+generated_by:        ExtUtils::MakeMaker version 6.44
 distribution_type:   module
 requires:     
     Carp:                          0
     Test::More:                    0
 meta-spec:
-    url:     http://module-build.sourceforge.net/META-spec-v1.2.html
-    version: 1.2
+    url:     http://module-build.sourceforge.net/META-spec-v1.3.html
+    version: 1.3

Modified: branches/upstream/libperl6-junction-perl/current/lib/Perl6/Junction.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libperl6-junction-perl/current/lib/Perl6/Junction.pm?rev=22065&op=diff
==============================================================================
--- branches/upstream/libperl6-junction-perl/current/lib/Perl6/Junction.pm (original)
+++ branches/upstream/libperl6-junction-perl/current/lib/Perl6/Junction.pm Mon Jun 23 09:44:30 2008
@@ -7,7 +7,7 @@
 use Perl6::Junction::One;
 
 require Exporter;
-our $VERSION = '1.30000';
+our $VERSION = '1.40000';
 
 our @ISA = qw/ Exporter /;
 my @routines = qw/ all any none one /;
@@ -15,19 +15,19 @@
 our %EXPORT_TAGS = ( ALL => [@routines] );
 
 sub all {
-    return Perl6::Junction::All->all(@_);
+    return Perl6::Junction::All->new(@_);
 }
 
 sub any {
-    return Perl6::Junction::Any->any(@_);
+    return Perl6::Junction::Any->new(@_);
 }
 
 sub none {
-    return Perl6::Junction::None->none(@_);
+    return Perl6::Junction::None->new(@_);
 }
 
 sub one {
-    return Perl6::Junction::One->one(@_);
+    return Perl6::Junction::One->new(@_);
 }
 
 1;
@@ -124,11 +124,22 @@
 Returns true only if B<one and only one> argument tests true according to 
 the operator used.
 
+=head1 ALTERING JUNCTIONS
+
+You cannot alter junctions.  Instead, you can create new junctions out of old
+junctions.  You can do this by calling the C<values> method on a junction.
+
+ my $numbers = any(qw/1 2 3 4 5/);
+ print $numbers == 3 ? 'Yes' : 'No';   # Yes
+
+ $numbers = any( grep { $_ != 3 } $numbers->values );
+ print $numbers == 3 ? 'Yes' : 'No';   # No
+
 =head1 EXPORT
 
 'all', 'any', 'none', 'one', as requested.
 
-All subroutines can be called by it's fully qualified name, if you don't 
+All subroutines can be called by its fully qualified name, if you don't 
 want to export them.
 
   use Perl6::Junction;
@@ -169,6 +180,11 @@
 
 Carl Franks
 
+=head1 ACKNOWLEDGEMENTS
+
+Thanks to C<Curtis "Ovid" Poe> for the L</"ALTERING JUNCTIONS"> changes in
+release C<0.40000>.
+
 =head1 COPYRIGHT AND LICENSE
 
 Copyright 2005, Carl Franks.  All rights reserved.  

Modified: branches/upstream/libperl6-junction-perl/current/lib/Perl6/Junction/All.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libperl6-junction-perl/current/lib/Perl6/Junction/All.pm?rev=22065&op=diff
==============================================================================
--- branches/upstream/libperl6-junction-perl/current/lib/Perl6/Junction/All.pm (original)
+++ branches/upstream/libperl6-junction-perl/current/lib/Perl6/Junction/All.pm Mon Jun 23 09:44:30 2008
@@ -1,29 +1,8 @@
 package Perl6::Junction::All;
 use strict;
-our $VERSION = '1.30000';
+our $VERSION = '1.40000';
 
-use overload(
-    '=='   => \&num_eq,
-    '!='   => \&num_ne,
-    '>='   => \&num_ge,
-    '>'    => \&num_gt,
-    '<='   => \&num_le,
-    '<'    => \&num_lt,
-    'eq'   => \&str_eq,
-    'ne'   => \&str_ne,
-    'ge'   => \&str_ge,
-    'gt'   => \&str_gt,
-    'le'   => \&str_le,
-    'lt'   => \&str_lt,
-    'bool' => \&bool,
-    '""'   => sub {shift},
-);
-
-sub all {
-    my ( $proto, @param ) = @_;
-
-    return bless \@param, $proto;
-}
+use base 'Perl6::Junction::Base';
 
 sub num_eq {
     return regex_eq(@_) if ref( $_[1] ) eq 'Regexp';

Modified: branches/upstream/libperl6-junction-perl/current/lib/Perl6/Junction/Any.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libperl6-junction-perl/current/lib/Perl6/Junction/Any.pm?rev=22065&op=diff
==============================================================================
--- branches/upstream/libperl6-junction-perl/current/lib/Perl6/Junction/Any.pm (original)
+++ branches/upstream/libperl6-junction-perl/current/lib/Perl6/Junction/Any.pm Mon Jun 23 09:44:30 2008
@@ -1,29 +1,8 @@
 package Perl6::Junction::Any;
 use strict;
-our $VERSION = '1.30000';
+our $VERSION = '1.40000';
 
-use overload(
-    '=='   => \&num_eq,
-    '!='   => \&num_ne,
-    '>='   => \&num_ge,
-    '>'    => \&num_gt,
-    '<='   => \&num_le,
-    '<'    => \&num_lt,
-    'eq'   => \&str_eq,
-    'ne'   => \&str_ne,
-    'ge'   => \&str_ge,
-    'gt'   => \&str_gt,
-    'le'   => \&str_le,
-    'lt'   => \&str_lt,
-    'bool' => \&bool,
-    '""'   => sub {shift},
-);
-
-sub any {
-    my ( $proto, @param ) = @_;
-
-    return bless \@param, $proto;
-}
+use base 'Perl6::Junction::Base';
 
 sub num_eq {
     return regex_eq(@_) if ref( $_[1] ) eq 'Regexp';

Added: branches/upstream/libperl6-junction-perl/current/lib/Perl6/Junction/Base.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libperl6-junction-perl/current/lib/Perl6/Junction/Base.pm?rev=22065&op=file
==============================================================================
--- branches/upstream/libperl6-junction-perl/current/lib/Perl6/Junction/Base.pm (added)
+++ branches/upstream/libperl6-junction-perl/current/lib/Perl6/Junction/Base.pm Mon Jun 23 09:44:30 2008
@@ -1,0 +1,33 @@
+package Perl6::Junction::Base;
+use strict;
+our $VERSION = '1.40000';
+
+use overload(
+    '=='   => "num_eq",
+    '!='   => "num_ne",
+    '>='   => "num_ge",
+    '>'    => "num_gt",
+    '<='   => "num_le",
+    '<'    => "num_lt",
+    'eq'   => "str_eq",
+    'ne'   => "str_ne",
+    'ge'   => "str_ge",
+    'gt'   => "str_gt",
+    'le'   => "str_le",
+    'lt'   => "str_lt",
+    'bool' => "bool",
+    '""'   => sub {shift},
+);
+
+sub new {
+    my ( $class, @param ) = @_;
+    return bless \@param, $class;
+}
+
+sub values {
+    my $self = shift;
+    return wantarray ? @$self : [ @$self ];
+}
+
+1;
+

Propchange: branches/upstream/libperl6-junction-perl/current/lib/Perl6/Junction/Base.pm
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: branches/upstream/libperl6-junction-perl/current/lib/Perl6/Junction/None.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libperl6-junction-perl/current/lib/Perl6/Junction/None.pm?rev=22065&op=diff
==============================================================================
--- branches/upstream/libperl6-junction-perl/current/lib/Perl6/Junction/None.pm (original)
+++ branches/upstream/libperl6-junction-perl/current/lib/Perl6/Junction/None.pm Mon Jun 23 09:44:30 2008
@@ -1,29 +1,8 @@
 package Perl6::Junction::None;
 use strict;
-our $VERSION = '1.30000';
+our $VERSION = '1.40000';
 
-use overload(
-    '=='   => \&num_eq,
-    '!='   => \&num_ne,
-    '>='   => \&num_ge,
-    '>'    => \&num_gt,
-    '<='   => \&num_le,
-    '<'    => \&num_lt,
-    'eq'   => \&str_eq,
-    'ne'   => \&str_ne,
-    'ge'   => \&str_ge,
-    'gt'   => \&str_gt,
-    'le'   => \&str_le,
-    'lt'   => \&str_lt,
-    'bool' => \&bool,
-    '""'   => sub {shift},
-);
-
-sub none {
-    my ( $class, @param ) = @_;
-
-    return bless \@param, $class;
-}
+use base 'Perl6::Junction::Base';
 
 sub num_eq {
     return regex_eq(@_) if ref( $_[1] ) eq 'Regexp';

Modified: branches/upstream/libperl6-junction-perl/current/lib/Perl6/Junction/One.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libperl6-junction-perl/current/lib/Perl6/Junction/One.pm?rev=22065&op=diff
==============================================================================
--- branches/upstream/libperl6-junction-perl/current/lib/Perl6/Junction/One.pm (original)
+++ branches/upstream/libperl6-junction-perl/current/lib/Perl6/Junction/One.pm Mon Jun 23 09:44:30 2008
@@ -1,29 +1,8 @@
 package Perl6::Junction::One;
 use strict;
-our $VERSION = '1.30000';
-
-use overload(
-    '=='   => \&num_eq,
-    '!='   => \&num_ne,
-    '>='   => \&num_ge,
-    '>'    => \&num_gt,
-    '<='   => \&num_le,
-    '<'    => \&num_lt,
-    'eq'   => \&str_eq,
-    'ne'   => \&str_ne,
-    'ge'   => \&str_ge,
-    'gt'   => \&str_gt,
-    'le'   => \&str_le,
-    'lt'   => \&str_lt,
-    'bool' => \&bool,
-    '""'   => sub {shift},
-);
-
-sub one {
-    my ( $class, @param ) = @_;
-
-    return bless \@param, $class;
-}
+our $VERSION = '1.40000';
+
+use base 'Perl6::Junction::Base';
 
 sub num_eq {
     return regex_eq(@_) if ref( $_[1] ) eq 'Regexp';

Modified: branches/upstream/libperl6-junction-perl/current/t/all.t
URL: http://svn.debian.org/wsvn/branches/upstream/libperl6-junction-perl/current/t/all.t?rev=22065&op=diff
==============================================================================
--- branches/upstream/libperl6-junction-perl/current/t/all.t (original)
+++ branches/upstream/libperl6-junction-perl/current/t/all.t Mon Jun 23 09:44:30 2008
@@ -1,5 +1,5 @@
 use strict;
-use Test::More tests => 87;
+use Test::More tests => 90;
 
 use Perl6::Junction 'all';
 
@@ -105,3 +105,11 @@
 ok( !all( 'a', undef, 'c' ), '! bool' );
 
 like( all( 1, 2 ), qr/^Perl6::Junction::All=/, 'stringified to ref' );
+
+my @data = qw(3 4 5 6 7);
+my $junction = all(@data);
+can_ok $junction, 'values';
+my @values = $junction->values;
+is_deeply \@values, \@data, 'values() in list context';
+my $values = $junction->values;
+is_deeply $values, \@data, 'values() in scalar context';

Modified: branches/upstream/libperl6-junction-perl/current/t/any.t
URL: http://svn.debian.org/wsvn/branches/upstream/libperl6-junction-perl/current/t/any.t?rev=22065&op=diff
==============================================================================
--- branches/upstream/libperl6-junction-perl/current/t/any.t (original)
+++ branches/upstream/libperl6-junction-perl/current/t/any.t Mon Jun 23 09:44:30 2008
@@ -1,5 +1,5 @@
 use strict;
-use Test::More tests => 72;
+use Test::More tests => 75;
 
 use Perl6::Junction 'any';
 
@@ -91,3 +91,10 @@
 
 like( any( 1, 2 ), qr/^Perl6::Junction::Any=/, 'stringified to ref' );
 
+my @data = qw(3 4 5 6 7);
+my $junction = any(@data);
+can_ok $junction, 'values';
+my @values = $junction->values;
+is_deeply \@values, \@data, 'values() in list context';
+my $values = $junction->values;
+is_deeply $values, \@data, 'values() in scalar context';

Modified: branches/upstream/libperl6-junction-perl/current/t/none.t
URL: http://svn.debian.org/wsvn/branches/upstream/libperl6-junction-perl/current/t/none.t?rev=22065&op=diff
==============================================================================
--- branches/upstream/libperl6-junction-perl/current/t/none.t (original)
+++ branches/upstream/libperl6-junction-perl/current/t/none.t Mon Jun 23 09:44:30 2008
@@ -1,5 +1,5 @@
 use strict;
-use Test::More tests => 78;
+use Test::More tests => 81;
 
 use Perl6::Junction 'none';
 
@@ -97,3 +97,10 @@
 
 like( none( 1, 2 ), qr/^Perl6::Junction::None=/, 'stringified to ref' );
 
+my @data = qw(3 4 5 6 7);
+my $junction = none(@data);
+can_ok $junction, 'values';
+my @values = $junction->values;
+is_deeply \@values, \@data, 'values() in list context';
+my $values = $junction->values;
+is_deeply $values, \@data, 'values() in scalar context';

Modified: branches/upstream/libperl6-junction-perl/current/t/one.t
URL: http://svn.debian.org/wsvn/branches/upstream/libperl6-junction-perl/current/t/one.t?rev=22065&op=diff
==============================================================================
--- branches/upstream/libperl6-junction-perl/current/t/one.t (original)
+++ branches/upstream/libperl6-junction-perl/current/t/one.t Mon Jun 23 09:44:30 2008
@@ -1,5 +1,5 @@
 use strict;
-use Test::More tests => 95;
+use Test::More tests => 98;
 
 use Perl6::Junction 'one';
 
@@ -114,3 +114,10 @@
 
 like( one( 1, 2 ), qr/^Perl6::Junction::One=/, 'stringified to ref' );
 
+my @data = qw(3 4 5 6 7);
+my $junction = one(@data);
+can_ok $junction, 'values';
+my @values = $junction->values;
+is_deeply \@values, \@data, 'values() in list context';
+my $values = $junction->values;
+is_deeply $values, \@data, 'values() in scalar context';




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