[Moose-commits] r7946 - in MooseX-Role-Cmd: . lib/MooseX/Role

isillitoe at code2.0beta.co.uk isillitoe at code2.0beta.co.uk
Tue Jun 2 16:31:06 GMT 2009


Author: isillitoe
Date: 2009-06-02 09:31:06 -0700 (Tue, 02 Jun 2009)
New Revision: 7946

Modified:
   MooseX-Role-Cmd/Changes
   MooseX-Role-Cmd/lib/MooseX/Role/Cmd.pm
Log:
Changed get_all_attributes() to get_attribute_map() when collating list of attributes to use for cmd args (doesn't inherit all inherited attributes - only attributes in current class).



Modified: MooseX-Role-Cmd/Changes
===================================================================
--- MooseX-Role-Cmd/Changes	2009-06-02 13:24:59 UTC (rev 7945)
+++ MooseX-Role-Cmd/Changes	2009-06-02 16:31:06 UTC (rev 7946)
@@ -1,19 +1,10 @@
 
-0.05 Thu Feb 12 13:40:54 GMT 2009
+0.05 Tue Jun  2 17:27:38 BST 2009
     - Added POD
     
     - Added trait attribute: 'cmdopt_env'
         - allow ENV variables to be set rather than command line params
     
-    - cmd_args()
-        - use get_all_attributes() to allow for inherited attributes
-      
-      NOTE: there's a possibility this will break compatibility if you happen to be
-            mixing your modules in with other roles, however it is pretty useful.
-            e.g. using inheritance to provide different usage cases for executables
-                t/lib/Test/Dir.pm
-                t/lib/Test/DirWithTraits.pm
-            
     - private: _attr_name_to_cmd_options()
         - changed to _attr_to_cmd_options (i.e. attribute not attribute name) 
         to provide more flexibility

Modified: MooseX-Role-Cmd/lib/MooseX/Role/Cmd.pm
===================================================================
--- MooseX-Role-Cmd/lib/MooseX/Role/Cmd.pm	2009-06-02 13:24:59 UTC (rev 7945)
+++ MooseX-Role-Cmd/lib/MooseX/Role/Cmd.pm	2009-06-02 16:31:06 UTC (rev 7946)
@@ -145,7 +145,7 @@
     # exclude this role's attributes from the flag list
     # could use custom metaclasses and introspection, but this will do for now
     my %non_flag   = map  {     $_ => 1    } __PACKAGE__->meta->get_attribute_list;
-    my @flag_attrs = grep { !$non_flag{$_->name} } $self->meta->get_all_attributes;
+    my @flag_attrs = grep { !$non_flag{$_->name} } values %{ $self->meta->get_attribute_map };
     
     #####
     # IS: 2008/10/15




More information about the Moose-commits mailing list