r50552 - in /branches/upstream/libparse-method-signatures-perl/current: Changes MANIFEST META.yml Makefile.PL README lib/Parse/Method/Signatures.pm

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Sat Jan 9 17:31:36 UTC 2010


Author: jawnsy-guest
Date: Sat Jan  9 17:31:29 2010
New Revision: 50552

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=50552
Log:
[svn-upgrade] Integrating new upstream version, libparse-method-signatures-perl (1.003013)

Added:
    branches/upstream/libparse-method-signatures-perl/current/README
Modified:
    branches/upstream/libparse-method-signatures-perl/current/Changes
    branches/upstream/libparse-method-signatures-perl/current/MANIFEST
    branches/upstream/libparse-method-signatures-perl/current/META.yml
    branches/upstream/libparse-method-signatures-perl/current/Makefile.PL
    branches/upstream/libparse-method-signatures-perl/current/lib/Parse/Method/Signatures.pm

Modified: branches/upstream/libparse-method-signatures-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-method-signatures-perl/current/Changes?rev=50552&op=diff
==============================================================================
--- branches/upstream/libparse-method-signatures-perl/current/Changes (original)
+++ branches/upstream/libparse-method-signatures-perl/current/Changes Sat Jan  9 17:31:29 2010
@@ -1,6 +1,9 @@
 Changelog for Parse::Method::Signatures
 
-1.003012 - 2009/09/13
+1.003013 - 2010/01/08
+  - Add version to List::MoreUtils as we need part() (Leo Lapworth)
+
+1.003012 - 2009/12/16
   - Pass from_namespace to type constraint class even if there is a callback
     provided. (This lets the callback be wrapped/extended better.)
 

Modified: branches/upstream/libparse-method-signatures-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-method-signatures-perl/current/MANIFEST?rev=50552&op=diff
==============================================================================
--- branches/upstream/libparse-method-signatures-perl/current/MANIFEST (original)
+++ branches/upstream/libparse-method-signatures-perl/current/MANIFEST Sat Jan  9 17:31:29 2010
@@ -26,6 +26,7 @@
 Makefile.PL
 MANIFEST			This list of files
 META.yml
+README
 t/ppi.t
 t/signatures.t
 t/struct.t

Modified: branches/upstream/libparse-method-signatures-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-method-signatures-perl/current/META.yml?rev=50552&op=diff
==============================================================================
--- branches/upstream/libparse-method-signatures-perl/current/META.yml (original)
+++ branches/upstream/libparse-method-signatures-perl/current/META.yml Sat Jan  9 17:31:29 2010
@@ -22,36 +22,8 @@
   directory:
     - inc
     - t
-provides:
-  Parse::Method::Signatures:
-    file: lib/Parse/Method/Signatures.pm
-    version: 1.003012
-  Parse::Method::Signatures::Param:
-    file: lib/Parse/Method/Signatures/Param.pm
-  Parse::Method::Signatures::Param::Bindable:
-    file: lib/Parse/Method/Signatures/Param/Bindable.pm
-  Parse::Method::Signatures::Param::Named:
-    file: lib/Parse/Method/Signatures/Param/Named.pm
-  Parse::Method::Signatures::Param::Placeholder:
-    file: lib/Parse/Method/Signatures/Param/Placeholder.pm
-  Parse::Method::Signatures::Param::Positional:
-    file: lib/Parse/Method/Signatures/Param/Positional.pm
-  Parse::Method::Signatures::Param::Unpacked:
-    file: lib/Parse/Method/Signatures/Param/Unpacked.pm
-  Parse::Method::Signatures::Param::Unpacked::Array:
-    file: lib/Parse/Method/Signatures/Param/Unpacked/Array.pm
-  Parse::Method::Signatures::Param::Unpacked::Hash:
-    file: lib/Parse/Method/Signatures/Param/Unpacked/Hash.pm
-  Parse::Method::Signatures::ParamCollection:
-    file: lib/Parse/Method/Signatures/ParamCollection.pm
-  Parse::Method::Signatures::Sig:
-    file: lib/Parse/Method/Signatures/Sig.pm
-  Parse::Method::Signatures::TypeConstraint:
-    file: lib/Parse/Method/Signatures/TypeConstraint.pm
-  Parse::Method::Signatures::Types:
-    file: lib/Parse/Method/Signatures/Types.pm
 requires:
-  List::MoreUtils: 0
+  List::MoreUtils: 0.20
   Moose: 0
   MooseX::Traits: 0.06
   MooseX::Types: 0.17
@@ -63,4 +35,4 @@
   homepage: http://github.com/ashb/Parse-Method-Signatures/tree/master
   license: http://dev.perl.org/licenses/
   repository: git://github.com/ashb/Parse-Method-Signatures.git
-version: 1.003012
+version: 1.003013

Modified: branches/upstream/libparse-method-signatures-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-method-signatures-perl/current/Makefile.PL?rev=50552&op=diff
==============================================================================
--- branches/upstream/libparse-method-signatures-perl/current/Makefile.PL (original)
+++ branches/upstream/libparse-method-signatures-perl/current/Makefile.PL Sat Jan  9 17:31:29 2010
@@ -6,7 +6,7 @@
 name 'Parse-Method-Signatures';
 all_from 'lib/Parse/Method/Signatures.pm';
 
-requires 'List::MoreUtils';
+requires 'List::MoreUtils' => '0.20';
 requires 'Moose';
 requires 'MooseX::Traits' => '0.06';
 requires 'MooseX::Types' => '0.17';

Added: branches/upstream/libparse-method-signatures-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-method-signatures-perl/current/README?rev=50552&op=file
==============================================================================
--- branches/upstream/libparse-method-signatures-perl/current/README (added)
+++ branches/upstream/libparse-method-signatures-perl/current/README Sat Jan  9 17:31:29 2010
@@ -1,0 +1,139 @@
+NAME
+    Parse::Method::Signatures - Perl6 like method signature parser
+
+DESCRIPTION
+    Inspired by Perl6::Signature but streamlined to just support the subset
+    deemed useful for TryCatch and MooseX::Method::Signatures.
+
+TODO
+    *   Document the parameter return types.
+
+    *   Probably lots of other things
+
+METHODS
+    There are only two public methods to this module, both of which should
+    be called as class methods. Both methods accept either a single
+    (non-ref) scalar as the value for the "input" attribute, or normal new
+    style arguments (hash or hash-ref).
+
+  signature
+     my $sig = Parse::Method::Signatures->signature( '(Str $foo)' )
+
+    Attempts to parse the (bracketed) method signature. Returns a value or
+    croaks on error.
+
+  param
+      my $param = Parse::Method::Signatures->param( 'Str $foo where { length($_) < 10 }')
+
+    Attempts to parse the specification for a single parameter. Returns
+    value or croaks on error.
+
+ATTRIBUTES
+    All the attributes on this class are read-only.
+
+  input
+    Type: Str
+
+    The string to parse.
+
+  offset
+    Type: Int
+
+    Offset into "input" at which to start parsing. Useful for using with
+    Devel::Declare linestring
+
+  signature_class
+    Default: Parse::Method::Signatures::Sig
+
+    Type: Str (loaded on demand class name)
+
+  param_class
+    Default: Parse::Method::Signatures::Param
+
+    Type: Str (loaded on demand class name)
+
+  type_constraint_class
+    Default: Parse::Method::Signatures::TypeConstraint
+
+    Type: Str (loaded on demand class name)
+
+    Class that is used to turn the parsed type constraint into an actual
+    Moose::Meta::TypeConstraint object.
+
+  from_namespace
+    Type: ClassName
+
+    Let this module know which package it is parsing signatures form. This
+    is entirely optional, and the only effect is has is on parsing type
+    constraints.
+
+    If this attribute is set it is passed to "type_constraint_class" which
+    can use it to introspect the package (commmonly for MooseX::Types
+    exported types). See "find_registered_constraint" in
+    Parse::Method::Signature::TypeConstraints for more details.
+
+  type_constraint_callback
+    Type: CodeRef
+
+    Passed to the constructor of "type_constraint_class". Default
+    implementation of this callback asks Moose for a type constrain matching
+    the name passed in. If you have more complex requirements, such as
+    parsing types created by MooseX::Types then you will want a callback
+    similar to this:
+
+     # my $target_package defined elsewhere.
+     my $tc_cb = sub {
+       my ($pms_tc, $name) = @_;
+       my $code = $target_package->can($name);
+       $code ? eval { $code->() } 
+             : $pms_tc->find_registered_constraint($name);
+     }
+
+    Note that the above example is better provided by providing the
+    "from_namespace" attribute.
+
+CAVEATS
+    Like Perl6::Signature, the parsing of certain constructs is currently
+    only a 'best effort' - specifically default values and where code blocks
+    might not successfully for certain complex cases. Patches/Failing tests
+    welcome.
+
+    Additionally, default value specifications are not evaluated which means
+    that no such lexical or similar errors will not be produced by this
+    module. Constant folding will also not be performed.
+
+    There are certain constructs that are simply too much hassle to avoid
+    when the work around is simple. Currently the only cases that are known
+    to parse wrong are when using anonymous variables (i.e. just sigils) in
+    unpacked arrays. Take the following example:
+
+     method foo (ArrayRef [$, $], $some_value_we_care_about) {
+
+    In this case the $] is treated as one of perl's magic variables
+    (specifically, the patch level of the Perl interpreter) rather than a
+    "$" followed by a "]" as was almost certainly intended. The work around
+    for this is simple: introduce a space between the charcters:
+
+     method foo (ArrayRef [ $, $ ], $some_value_we_care_about) {
+
+    The same applies
+
+AUTHOR
+    Ash Berlin <ash at cpan.org>.
+
+    Thanks to Florian Ragwitz <rafl at debian.org>.
+
+    Many thanks to Piers Cawley to showing me the way to refactor my
+    spaghetti code into something more manageable.
+
+SEE ALSO
+    Devel::Declare which is used by most modules that use this (currently by
+    all modules known to the author.)
+
+    <http://github.com/ashb/trycatch/tree>.
+
+LICENSE
+    Licensed under the same terms as Perl itself.
+
+    This distribution copyright 2008-2009, Ash Berlin <ash at cpan.org>
+

Modified: branches/upstream/libparse-method-signatures-perl/current/lib/Parse/Method/Signatures.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-method-signatures-perl/current/lib/Parse/Method/Signatures.pm?rev=50552&op=diff
==============================================================================
--- branches/upstream/libparse-method-signatures-perl/current/lib/Parse/Method/Signatures.pm (original)
+++ branches/upstream/libparse-method-signatures-perl/current/lib/Parse/Method/Signatures.pm Sat Jan  9 17:31:29 2010
@@ -15,7 +15,7 @@
 use Carp qw/croak/;
 
 use namespace::clean -except => 'meta';
-our $VERSION = '1.003012';
+our $VERSION = '1.003013';
 our $ERROR_LEVEL = 0;
 our %LEXTABLE;
 our $DEBUG = $ENV{PMS_DEBUG} || 0;
@@ -1044,7 +1044,7 @@
 
 Thanks to Florian Ragwitz <rafl at debian.org>.
 
-Many thanks to Piers Crawley to showing me the way to refactor my spaghetti
+Many thanks to Piers Cawley to showing me the way to refactor my spaghetti
 code into something more manageable.
 
 =head1 SEE ALSO




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