Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fixed small memory leak in Mojolicious
  • Loading branch information
kraih committed May 21, 2012
1 parent e229b80 commit a181b9a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
3 changes: 2 additions & 1 deletion Changes
@@ -1,8 +1,9 @@

2.96 2012-05-20
2.96 2012-05-21
- Added merge method to Mojo::Path.
- Improved documentation.
- Improved tests.
- Fixed small memory leak in Mojolicious.
- Fixed small bug that prevented already prepared IO::Socket::SSL handles to
be used by Mojo::UserAgent.
- Fixed small Mojo::URL and Mojo::Path stringification bugs.
Expand Down
22 changes: 11 additions & 11 deletions lib/Mojo/Command.pm
Expand Up @@ -10,14 +10,15 @@ use Mojo::Server;
use Mojo::Template;
use Mojo::Util qw(b64_decode decamelize);

has app => sub { Mojo::Server->new->app };
has description => 'No description.';
has quiet => 0;
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 @@ -199,16 +200,6 @@ 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.
# Introspect
say "Template path: $_" for @{$command->app->renderer->paths};
=head2 C<description>
my $description = $command->description;
Expand All @@ -235,6 +226,15 @@ 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.
# Introspect
say "Template path: $_" for @{$command->app->renderer->paths};
=head2 C<chmod_file>
$command = $command->chmod_file('/home/sri/foo.txt', 0644);
Expand Down

0 comments on commit a181b9a

Please sign in to comment.