--- /dev/null
+cover_db
+META.yml
+Makefile
+blib
+inc
+pm_to_blib
+MANIFEST
+Makefile.old
--- /dev/null
+.git/
+blib
+pm_to_blib
+MANIFEST.bak
+MANIFEST.SKIP~
+cover_db
+Makefile$
+Makefile.old$
--- /dev/null
+use inc::Module::Install;
+
+name 'MooseX-Runnable';
+all_from 'lib/MooseX/Runnable.pm';
+
+build_requires 'Catalyst::Runtime';
+build_requires 'Test::WWW::Mechanize::Catalyst';
+build_requires 'Test::More';
+build_requires 'ok';
+
+WriteAll();
--- /dev/null
+package MooseX::Runnable;
+use Moose::Role;
+
+our $RUNNING_APP;
+
+requires 'run';
+
+sub run_as_application {
+ my $class = shift;
+ my @args = @_;
+
+ if($class->does('MooseX::Getopt')){
+ my $self = $class->new_with_options(@args);
+ local $RUNNING_APP = $self;
+ exit $self->run( $self->extra_argv );
+ }
+
+ local $RUNNING_APP = $class->new(@args);
+ exit $RUNNING_APP->run;
+}
+
+1;
--- /dev/null
+package MooseX::Runnable::Run;
+use strict;
+use warnings;
+
+use Class::MOP;
+
+use Sub::Exporter -setup => {
+ exports => ['run_as_application'],
+ groups => {
+ default => ['run_as_application'],
+ },
+};
+
+sub run_as_application($;@){
+ my ($app, @args) = @_;
+
+ eval 'package main; use FindBin qw($Bin); use lib "$Bin/../lib"; 1;' or die;
+
+ Class::MOP::load_class($app);
+ die "$app is not runnable" unless $app->does('MooseX::Runnable');
+ $app->run_as_application(@args);
+}
+
+1;
--- /dev/null
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+use Test::More tests => 1;
+use ok 'MooseX::Runnable';
--- /dev/null
+#!perl -T
+
+use Test::More;
+eval "use Test::Pod::Coverage 1.04";
+plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" if $@;
+all_pod_coverage_ok();
--- /dev/null
+#!perl -T
+
+use Test::More;
+eval "use Test::Pod 1.14";
+plan skip_all => "Test::Pod 1.14 required for testing POD" if $@;
+all_pod_files_ok();