]> git.vpit.fr Git - perl/modules/Sub-Prototype-Util.git/commitdiff
This is 0.11 v0.11
authorVincent Pit <vince@profvince.com>
Sat, 24 Aug 2013 20:24:32 +0000 (17:24 -0300)
committerVincent Pit <vince@profvince.com>
Sat, 24 Aug 2013 20:24:32 +0000 (17:24 -0300)
Changes
META.json
META.yml
README
lib/Sub/Prototype/Util.pm

diff --git a/Changes b/Changes
index cc7bed2a434355d5df30bd9c874d9cff89fff6ef..ecb0419cb093bc663ea54684e1098a61824b243e 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,13 @@
 Revision history for Sub-Prototype-Util
 
 Revision history for Sub-Prototype-Util
 
+0.11    2013-08-24 20:25 UTC
+        This is a maintenance release. The code contains no functional change.
+        Satisfied users of version 0.10 can skip this update.
+        + Doc : POD headings are now properly linkable.
+        + Tst : Author tests are no longer bundled with this distribution.
+                They are only made available to authors in the git repository.
+        + Upd : Package metadata overhaul.
+
 0.10    2011-08-25 11:05 UTC
         + Chg : recall() now uses "goto" to call the wrapper code (except for
                 perl 5.8.0).
 0.10    2011-08-25 11:05 UTC
         + Chg : recall() now uses "goto" to call the wrapper code (except for
                 perl 5.8.0).
index 456b7f6cadd2f96e905e1f3cb09dd8b8d3de4b32..d3ffcae9dfb34eb627b8a9f3c43eda546aacab5c 100644 (file)
--- a/META.json
+++ b/META.json
@@ -4,7 +4,7 @@
       "Vincent Pit <perl@profvince.com>"
    ],
    "dynamic_config" : 0,
       "Vincent Pit <perl@profvince.com>"
    ],
    "dynamic_config" : 0,
-   "generated_by" : "ExtUtils::MakeMaker version 6.59, CPAN::Meta::Converter version 2.112150",
+   "generated_by" : "ExtUtils::MakeMaker version 6.72, CPAN::Meta::Converter version 2.132140",
    "license" : [
       "perl_5"
    ],
    "license" : [
       "perl_5"
    ],
    "prereqs" : {
       "build" : {
          "requires" : {
    "prereqs" : {
       "build" : {
          "requires" : {
-            "Carp" : 0,
-            "Exporter" : 0,
-            "ExtUtils::MakeMaker" : 0,
-            "Scalar::Util" : 0,
-            "Test::More" : 0
+            "Carp" : "0",
+            "Exporter" : "0",
+            "ExtUtils::MakeMaker" : "0",
+            "Scalar::Util" : "0",
+            "Test::More" : "0"
          }
       },
       "configure" : {
          "requires" : {
          }
       },
       "configure" : {
          "requires" : {
-            "ExtUtils::MakeMaker" : 0
+            "ExtUtils::MakeMaker" : "0"
          }
       },
       "runtime" : {
          "requires" : {
          }
       },
       "runtime" : {
          "requires" : {
-            "Carp" : 0,
-            "Exporter" : 0,
-            "Scalar::Util" : 0,
+            "Carp" : "0",
+            "Exporter" : "0",
+            "Scalar::Util" : "0",
             "perl" : "5.006"
          }
       }
             "perl" : "5.006"
          }
       }
@@ -46,7 +46,7 @@
    "release_status" : "stable",
    "resources" : {
       "bugtracker" : {
    "release_status" : "stable",
    "resources" : {
       "bugtracker" : {
-         "web" : "http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Sub-Prototype-Util"
+         "web" : "http://rt.cpan.org/Dist/Display.html?Name=Sub-Prototype-Util"
       },
       "homepage" : "http://search.cpan.org/dist/Sub-Prototype-Util/",
       "license" : [
       },
       "homepage" : "http://search.cpan.org/dist/Sub-Prototype-Util/",
       "license" : [
@@ -56,5 +56,5 @@
          "url" : "http://git.profvince.com/?p=perl%2Fmodules%2FSub-Prototype-Util.git"
       }
    },
          "url" : "http://git.profvince.com/?p=perl%2Fmodules%2FSub-Prototype-Util.git"
       }
    },
-   "version" : "0.10"
+   "version" : "0.11"
 }
 }
index 4d0ec702fedcea954ca514a3d75eb0eb7af6cb41..6d56ab0c2c88258f1ed69003e5c8aaa780f78685 100644 (file)
--- a/META.yml
+++ b/META.yml
@@ -11,7 +11,7 @@ build_requires:
 configure_requires:
   ExtUtils::MakeMaker: 0
 dynamic_config: 0
 configure_requires:
   ExtUtils::MakeMaker: 0
 dynamic_config: 0
-generated_by: 'ExtUtils::MakeMaker version 6.59, CPAN::Meta::Converter version 2.112150'
+generated_by: 'ExtUtils::MakeMaker version 6.72, CPAN::Meta::Converter version 2.132140'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -27,8 +27,8 @@ requires:
   Scalar::Util: 0
   perl: 5.006
 resources:
   Scalar::Util: 0
   perl: 5.006
 resources:
-  bugtracker: http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Sub-Prototype-Util
+  bugtracker: http://rt.cpan.org/Dist/Display.html?Name=Sub-Prototype-Util
   homepage: http://search.cpan.org/dist/Sub-Prototype-Util/
   license: http://dev.perl.org/licenses/
   repository: http://git.profvince.com/?p=perl%2Fmodules%2FSub-Prototype-Util.git
   homepage: http://search.cpan.org/dist/Sub-Prototype-Util/
   license: http://dev.perl.org/licenses/
   repository: http://git.profvince.com/?p=perl%2Fmodules%2FSub-Prototype-Util.git
-version: 0.10
+version: 0.11
diff --git a/README b/README
index 040b0e70e3f3bb7106b0f2a6a05434bd16ff4fbe..ad69e34840c8e265741c6352da03ecbb056a2bcb 100644 (file)
--- a/README
+++ b/README
@@ -2,7 +2,7 @@ NAME
     Sub::Prototype::Util - Prototype-related utility routines.
 
 VERSION
     Sub::Prototype::Util - Prototype-related utility routines.
 
 VERSION
-    Version 0.10
+    Version 0.11
 
 SYNOPSIS
         use Sub::Prototype::Util qw<flatten wrap recall>;
 
 SYNOPSIS
         use Sub::Prototype::Util qw<flatten wrap recall>;
@@ -10,10 +10,17 @@ SYNOPSIS
         my @a = qw<a b c>;
         my @args = ( \@a, 1, { d => 2 }, undef, 3 );
 
         my @a = qw<a b c>;
         my @args = ( \@a, 1, { d => 2 }, undef, 3 );
 
-        my @flat = flatten '\@$;$', @args; # ('a', 'b', 'c', 1, { d => 2 })
-        recall 'CORE::push', @args; # @a contains 'a', 'b', 'c', 1, { d => 2 }, undef, 3
+        my @flat = flatten '\@$;$', @args;
+        # @flat contains now ('a', 'b', 'c', 1, { d => 2 })
+
+        my $res = recall 'CORE::push', @args;
+        # @a contains now 'a', 'b', 'c', 1, { d => 2 }, undef, 3
+        # and $res is 7
+
         my $splice = wrap 'CORE::splice';
         my $splice = wrap 'CORE::splice';
-        my @b = $splice->(\@a, 4, 2); # @a is now ('a', 'b', 'c', 1, 3) and @b is ({ d => 2 }, undef)
+        my @b = $splice->(\@a, 4, 2);
+        # @a contains now ('a', 'b', 'c', 1, 3)
+        # and @b is ({ d => 2 }, undef)
 
 DESCRIPTION
     Prototypes are evil, but sometimes you just have to bear with them,
 
 DESCRIPTION
     Prototypes are evil, but sometimes you just have to bear with them,
@@ -24,7 +31,9 @@ DESCRIPTION
     They all handle 5.10's "_" prototype.
 
 FUNCTIONS
     They all handle 5.10's "_" prototype.
 
 FUNCTIONS
-  "flatten $proto, @args"
+  "flatten"
+        my @flattened = flatten($proto, @args);
+
     Flattens the array @args according to the prototype $proto. When @args
     is what @_ is after calling a subroutine with prototype $proto,
     "flatten" returns the list of what @_ would have been if there were no
     Flattens the array @args according to the prototype $proto. When @args
     is what @_ is after calling a subroutine with prototype $proto,
     "flatten" returns the list of what @_ would have been if there were no
@@ -32,7 +41,10 @@ FUNCTIONS
     prototype, e.g. when a reference type is wrong or when not enough
     elements were provided.
 
     prototype, e.g. when a reference type is wrong or when not enough
     elements were provided.
 
-  "wrap $name, %opts"
+  "wrap"
+        my $wrapper = wrap($name, %opts);
+        my $wrapper = wrap({ $name => $proto }, %opts);
+
     Generates a wrapper that calls the function $name with a prototyped
     argument list. That is, the wrapper's arguments should be what @_ is
     when you define a subroutine with the same prototype as $name.
     Generates a wrapper that calls the function $name with a prototyped
     argument list. That is, the wrapper's arguments should be what @_ is
     when you define a subroutine with the same prototype as $name.
@@ -48,24 +60,28 @@ FUNCTIONS
 
         my $push = wrap { 'CORE::push' => '\@$' }; # only pushes 1 arg
 
 
         my $push = wrap { 'CORE::push' => '\@$' }; # only pushes 1 arg
 
-    Others arguments are seen as key / value pairs that are meant to tune
-    the code generated by "wrap". Valid keys are :
+    The remaining arguments %opts are treated as key / value pairs that are
+    meant to tune the code generated by "wrap". Valid keys are :
+
+    *   "ref => $func"
 
 
-    "ref => $func"
         Specifies the function used in the generated code to test the
         reference type of scalars. Defaults to 'ref'. You may also want to
         use "reftype" in Scalar::Util.
 
         Specifies the function used in the generated code to test the
         reference type of scalars. Defaults to 'ref'. You may also want to
         use "reftype" in Scalar::Util.
 
-    "wrong_ref => $code"
+    *   "wrong_ref => $code"
+
         The code executed when a reference of incorrect type is encountered.
         The result of this snippet is also the result of the generated code,
         hence it defaults to 'undef'. It's a good place to "croak" or "die"
         too.
 
         The code executed when a reference of incorrect type is encountered.
         The result of this snippet is also the result of the generated code,
         hence it defaults to 'undef'. It's a good place to "croak" or "die"
         too.
 
-    "sub => $bool"
+    *   "sub => $bool"
+
         Encloses the code into a "sub { }" block. Default is true.
 
         Encloses the code into a "sub { }" block. Default is true.
 
-    "compile => $bool"
+    *   "compile => $bool"
+
         Makes "wrap" compile the code generated and return the resulting
         code reference. Be careful that in this case "ref" must be a fully
         qualified function name. Defaults to true, but turned off when "sub"
         Makes "wrap" compile the code generated and return the resulting
         code reference. Be careful that in this case "ref" must be a fully
         qualified function name. Defaults to true, but turned off when "sub"
@@ -75,9 +91,13 @@ FUNCTIONS
     by using the "\&@" prototype :
 
         my $grep = wrap { 'CORE::grep' => '\&@' };
     by using the "\&@" prototype :
 
         my $grep = wrap { 'CORE::grep' => '\&@' };
-        sub mygrep (&@) { $grep->(@_) } # the prototypes are intentionally different
+        # the prototypes are intentionally different
+        sub mygrep (&@) { $grep->(@_) }
+
+  "recall"
+        my @res = recall($name, @args);
+        my @res = recall({ $name => $proto }, @args);
 
 
-  "recall $name, @args"
     Calls the function $name with the prototyped argument list @args. That
     is, @args should be what @_ is when you call a subroutine with $name as
     prototype. You can still force the prototype by passing "{ $name =>
     Calls the function $name with the prototyped argument list @args. That
     is, @args should be what @_ is when you call a subroutine with $name as
     prototype. You can still force the prototype by passing "{ $name =>
@@ -118,7 +138,7 @@ SUPPORT
     <http://www.profvince.com/perl/cover/Sub-Prototype-Util>.
 
 COPYRIGHT & LICENSE
     <http://www.profvince.com/perl/cover/Sub-Prototype-Util>.
 
 COPYRIGHT & LICENSE
-    Copyright 2008,2009,2010,2011 Vincent Pit, all rights reserved.
+    Copyright 2008,2009,2010,2011,2013 Vincent Pit, all rights reserved.
 
     This program is free software; you can redistribute it and/or modify it
     under the same terms as Perl itself.
 
     This program is free software; you can redistribute it and/or modify it
     under the same terms as Perl itself.
index a7a4ab19a1e7112600a156275f69eadee8bf3517..317f4e242b41fa0e4588996bcbb4e57560608658 100644 (file)
@@ -14,13 +14,13 @@ Sub::Prototype::Util - Prototype-related utility routines.
 
 =head1 VERSION
 
 
 =head1 VERSION
 
-Version 0.10
+Version 0.11
 
 =cut
 
 use vars qw<$VERSION>;
 
 
 =cut
 
 use vars qw<$VERSION>;
 
-$VERSION = '0.10';
+$VERSION = '0.11';
 
 =head1 SYNOPSIS
 
 
 =head1 SYNOPSIS