From: Jonathan Rockway Date: Wed, 29 Apr 2009 11:34:58 +0000 (-0500) Subject: makefile, doc cleanups X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=00d7989a23f3ed99dcf5b3a58f0843cd9d47115a;p=gitmo%2FMooseX-Runnable.git makefile, doc cleanups --- diff --git a/Makefile.PL b/Makefile.PL index ff4b00f..feca4ff 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -3,8 +3,12 @@ use inc::Module::Install; name 'MooseX-Runnable'; all_from 'lib/MooseX/Runnable.pm'; -build_requires 'Catalyst::Runtime'; -build_requires 'Test::WWW::Mechanize::Catalyst'; +requires 'Moose'; +requires 'MooseX::Getopt'; # not really +requires 'MooseX::Types' => 0.11; +requires 'MooseX::Types::Path::Class'; +requires 'namespace::autoclean'; + build_requires 'Test::More'; build_requires 'ok'; diff --git a/lib/MooseX/Runnable.pm b/lib/MooseX/Runnable.pm index 7080702..e54bc8d 100644 --- a/lib/MooseX/Runnable.pm +++ b/lib/MooseX/Runnable.pm @@ -23,7 +23,7 @@ Create a class, tag it runnable, and provide a C method: sub run { my $name = shift; say "Hello, $name."; - return 0; + return 0; # success } Then you can run this class as an application with the included diff --git a/lib/MooseX/Runnable/Invocation.pm b/lib/MooseX/Runnable/Invocation.pm index a8fb57b..c1a2a1a 100644 --- a/lib/MooseX/Runnable/Invocation.pm +++ b/lib/MooseX/Runnable/Invocation.pm @@ -93,7 +93,7 @@ sub validate_class { my @bad_attributes = map { $_->name } grep { $_->is_required && $_->has_default || $_->has_builder - } $class->compute_all_applicable_attributes; + } $class->get_all_attributes; confess 'By default, MooseX::Runnable calls the constructor with no'. diff --git a/lib/MooseX/Runnable/Invocation/Scheme/MooseX/Getopt.pm b/lib/MooseX/Runnable/Invocation/Scheme/MooseX/Getopt.pm index e286151..ed53b63 100644 --- a/lib/MooseX/Runnable/Invocation/Scheme/MooseX/Getopt.pm +++ b/lib/MooseX/Runnable/Invocation/Scheme/MooseX/Getopt.pm @@ -17,3 +17,18 @@ around create_instance => sub { }; 1; + +__END__ + +=head1 NAME + +MooseX::Runnable::Invocation::Scheme::MooseX::Getopt - run MX::Getopt classes + +=head1 DESCRIPTION + +This role will be used by C to create an +instance of the class to be run with C. Any args not +consumed by MX::Getopt will be passed to the class's run method. + +(See the test C for an example.) +