Author: kwilliams
Date: Sun Jun 21 19:57:38 2009
New Revision: 12876
Modified:
Module-Build/trunk/Changes
Module-Build/trunk/lib/Module/Build/API.pod
Module-Build/trunk/lib/Module/Build/Base.pm
Log:
Add can_action() method
Modified: Module-Build/trunk/Changes
==============================================================================
--- Module-Build/trunk/Changes (original)
+++ Module-Build/trunk/Changes Sun Jun 21 19:57:38 2009
@@ -18,6 +18,7 @@
Other
- On MSWin32, bumped File::Spec prereq to 3.30 for a variety of fixes
- Add support for VMS in Unix compatibility mode (RT#42157)
+ - Added a can_action($name) method (RT#45172)
0.33_02 - Mon Jun 15 12:23:55 EDT 2009
Modified: Module-Build/trunk/lib/Module/Build/API.pod
==============================================================================
--- Module-Build/trunk/lib/Module/Build/API.pod (original)
+++ Module-Build/trunk/lib/Module/Build/API.pod Sun Jun 21 19:57:38 2009
@@ -985,6 +985,13 @@
Returns a hash reference indicating the C<build_requires>
prerequisites that were passed to the C<new()> method.
+=item can_action( $action )
+
+Returns a reference to the method that defines C<$action>, or false
+otherwise. This is handy for actions defined (or maybe not!) in subclasses.
+
+[version 0.32_xx]
+
=item cbuilder()
[version 0.2809]
Modified: Module-Build/trunk/lib/Module/Build/Base.pm
==============================================================================
--- Module-Build/trunk/lib/Module/Build/Base.pm (original)
+++ Module-Build/trunk/lib/Module/Build/Base.pm Sun Jun 21 19:57:38 2009
@@ -1590,11 +1590,16 @@
return if $self->{_completed_actions}{$action}++;
local $self->{action} = $action;
- my $method = "ACTION_$action";
- die "No action '$action' defined, try running the 'help' action.\n" unless $self->can($method);
+ my $method = $self->can_action( $action );
+ die "No action '$action' defined, try running the 'help' action.\n" unless $method;
return $self->$method();
}
+sub can_action {
+ my ($self, $action) = @_;
+ return $self->can( "ACTION_$action" );
+}
+
# cuts the user-specified options out of the command-line args
sub cull_options {
my $self = shift;
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.