Created
October 2, 2009 18:39
-
-
Save jshirley/199990 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package MyApp; | |
use Moose; | |
with 'MooseX::Role::Environment'; | |
=head1 SYNOPSIS | |
Simple usage! After you have the default 'myapp.yml', go nuts (look at http://gist.github.com/198143) | |
perl -MMyApp -e 'MyApp->new->run'; | |
=cut | |
coerce 'MyApp::Thing', | |
from HashRef, | |
via { MyApp::Thing->new_with_traits( $_ ) }; | |
has 'thing' => ( | |
is => 'ro', | |
isa => 'MyApp::Thing', | |
coerce => 1 | |
); | |
has '+configfile' => ( default => sub { shift->path_to('myapp.yml')->stringify } ); | |
sub run { | |
my ( $self ) = @_; | |
# Oh, how contrived. | |
my $output = $self->path_to("data")->file("output.log"); | |
my $thing = $self->thing->do_it( $output ); | |
} | |
1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment