Skip to content

Commit

Permalink
fixed Mojo::Command->app to be an attribute and not a method
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 15, 2012
1 parent 5deff5e commit bb2cd94
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion Changes
@@ -1,6 +1,6 @@
This file documents the revision history for Perl extension Mojolicious.

2.44 2012-01-13 00:00:00
2.44 2012-01-16 00:00:00
- Added EXPERIMENTAL url_with helper to
Mojolicious::Plugin::DefaultHelpers. (diegok, marcus, judofyr, sri)
- Added EXPERIMENTAL support for removing query parmaters while
Expand All @@ -10,6 +10,7 @@ This file documents the revision history for Perl extension Mojolicious.
- Improved syntax highlighting in perldoc browser slightly.
- Improved Mojo::Base tests.
- Improved documentation.
- Fixed Mojo::Command->app to be an attribute and not a method.
- Fixed Mojo::ByteStream, Mojo::Collection and Mojo::DOM to not be
subclasses of Mojo::Base.

Expand Down
16 changes: 8 additions & 8 deletions lib/Mojo/Command.pm
Expand Up @@ -12,6 +12,7 @@ use Mojo::Template;
use Mojo::Loader;
use Mojo::Util qw/b64_decode decamelize/;

has app => sub { Mojo::Server->new->app };
has hint => <<"EOF";
See '$0 help COMMAND' for more information on a specific command.
Expand All @@ -33,8 +34,6 @@ has usage => "usage: $0\n";
# Cache
my $CACHE = {};

sub app { Mojo::Server->new->app }

sub chmod_file {
my ($self, $path, $mod) = @_;
chmod $mod, $path or croak qq/Can't chmod path "$path": $!/;
Expand Down Expand Up @@ -342,6 +341,13 @@ default.
L<Mojo::Command> implements the following attributes.
=head2 C<app>
my $app = $command->app;
$command = $command->app(Mojolicious->new);
Currently active application, defaults to a L<Mojo::HelloWorld> object.
=head2 C<description>
my $description = $command->description;
Expand Down Expand Up @@ -389,12 +395,6 @@ Usage information for command, used for the help screen.
L<Mojo::Command> inherits all methods from L<Mojo::Base> and implements the
following new ones.
=head2 C<app>
my $app = $command->app;
Currently active application, defaults to a L<Mojo::HelloWorld> object.
=head2 C<chmod_file>
$command = $command->chmod_file('/foo/bar.txt', 0644);
Expand Down

0 comments on commit bb2cd94

Please sign in to comment.