1 package MooseX::Runnable;
12 MooseX::Runnable - tag a class as a runnable application
16 Create a class, tag it runnable, and provide a C<run> method:
18 package App::HelloWorld;
21 with 'MooseX::Runnable';
29 Then you can run this class as an application with the included
32 $ mx-run App::HelloWorld jrockway
36 C<MooseX::Runnable> supports L<MooseX::Getopt|MooseX::Getopt>, and
37 other similar systems (and is extensible, in case you have written
42 MooseX::Runnable is a framework for making classes runnable
43 applications. This role doesn't do anything other than tell the rest
44 of the framework that your class is a runnable application that has a
45 C<run> method which accepts arguments and returns the process' exit
48 This is a convention that the community has been using for a while.
49 This role tells the computer that your class uses this convention, and
50 let's the computer abstract away some of the tedium this entails.
52 =head1 REQUIRED METHODS
58 This is a script that accepts a C<MooseX::Runnable> class and tries to
59 run it, using C<MooseX::Runnable::Run>.
63 mx-run <args for mx-run> -- Class::Name <args for Class::Name>
67 mx-run -Ilib -- App::HelloWorld --args --go --here
71 mx-run -Ilib +Persistent --port 8080 -Persistent -- App::HelloWorld --args --go --here
72 =head2 C<MooseX::Runnable::Run>
74 If you don't want to invoke your app with C<mx-run>, you can write a
75 custom version using L<MooseX::Runnable::Run|MooseX::Runnable::Run>.