/usr/share/perl5/MooseX/Runnable.pm is in libmoosex-runnable-perl 0.09-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | package MooseX::Runnable;
BEGIN {
$MooseX::Runnable::AUTHORITY = 'cpan:JROCKWAY';
}
# git description: v0.08-3-ge30197d
$MooseX::Runnable::VERSION = '0.09';
# ABSTRACT: Tag a class as a runnable application
# KEYWORDS: moose extension executable execute script binary run modulino
use Moose::Role;
use namespace::autoclean;
requires 'run';
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
MooseX::Runnable - Tag a class as a runnable application
=head1 VERSION
version 0.09
=head1 SYNOPSIS
Create a class, tag it runnable, and provide a C<run> method:
package App::HelloWorld;
use feature 'say';
use Moose;
with 'MooseX::Runnable';
sub run {
my ($self,$name) = @_;
say "Hello, $name.";
return 0; # success
}
Then you can run this class as an application with the included
C<mx-run> script:
$ mx-run App::HelloWorld jrockway
Hello, jrockway.
$
C<MooseX::Runnable> supports L<MooseX::Getopt|MooseX::Getopt>, and
other similar systems (and is extensible, in case you have written
such a system).
=head1 DESCRIPTION
MooseX::Runnable is a framework for making classes runnable
applications. This role doesn't do anything other than tell the rest
of the framework that your class is a runnable application that has a
C<run> method which accepts arguments and returns the process' exit
code.
This is a convention that the community has been using for a while.
This role tells the computer that your class uses this convention, and
let's the computer abstract away some of the tedium this entails.
=head1 REQUIRED METHODS
=head2 run
Your class must implement C<run>. It accepts the command-line args
(that were not consumed by another parser, if applicable) and returns
an integer representing the UNIX exit value. C<return 0> means
success.
=head1 THINGS YOU GET
=head2 C<mx-run>
This is a script that accepts a C<MooseX::Runnable> class and tries to
run it, using C<MooseX::Runnable::Run>.
The syntax is:
mx-run Class::Name
mx-run <args for mx-run> -- Class::Name <args for Class::Name>
for example:
mx-run -Ilib App::HelloWorld --args --go --here
or:
mx-run -Ilib +Persistent --port 8080 -- App::HelloWorld --args --go --here
=head2 C<MooseX::Runnable::Run>
If you don't want to invoke your app with C<mx-run>, you can write a
custom version using L<MooseX::Runnable::Run|MooseX::Runnable::Run>.
=head1 ARCHITECTURE
C<MX::Runnable> is designed to be extensible; users can run plugins
from the command-line, and application developers can add roles to
their class to control behavior.
For example, if you consume L<MooseX::Getopt|MooseX::Getopt>, the
command-line will be parsed with C<MooseX::Getopt>. Any recognized
args will be used to instantiate your class, and any extra args will
be passed to C<run>.
=head1 BUGS
Many of the plugins shipped are unstable; they may go away, change,
break, etc. If there is no documentation for a plugin, it is probably
just a prototype.
=head1 AUTHOR
Jonathan Rockway <jrockway@cpan.org>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2009 by Jonathan Rockway.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=head1 CONTRIBUTORS
=for stopwords Doug Bell Duke Leto Jonathan Rockway Karen Etheridge
=over 4
=item *
Doug Bell <doug.bell@baml.com>
=item *
Duke Leto <jonathan@leto.net>
=item *
Jonathan Rockway <jon@jrock.us>
=item *
Karen Etheridge <ether@cpan.org>
=back
=cut
|