Skip to content

Commit

Permalink
fix a bug in the app generator command where the config file name was…
Browse files Browse the repository at this point in the history
… not based on the application moniker
  • Loading branch information
kraih committed Apr 22, 2017
1 parent fabe4d3 commit 56d4d89
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Changes
Expand Up @@ -7,6 +7,8 @@
Mojo::Home.
- Removed deprecated rel_dir method from Mojolicious::Command.
- Removed deprecated is_status_class method from Mojo::Message::Response.
- Fixed a bug in the app generator command where the config file name was not
based on the application moniker.

7.30 2017-04-04
- Deprecated Mojo::Server::Morbo::watch in favor of
Expand Down
6 changes: 3 additions & 3 deletions lib/Mojolicious/Command/generate/app.pm
@@ -1,7 +1,7 @@
package Mojolicious::Command::generate::app;
use Mojo::Base 'Mojolicious::Command';

use Mojo::Util qw(class_to_file class_to_path);
use Mojo::Util qw(class_to_file class_to_path decamelize);

has description => 'Generate Mojolicious application directory structure';
has usage => sub { shift->extract_usage };
Expand All @@ -25,8 +25,8 @@ EOF
my $app = class_to_path $class;
$self->render_to_rel_file('appclass', "$name/lib/$app", $class);

# Config file
$self->render_to_rel_file('config', "$name/$name.conf");
# Config file (using the default moniker)
$self->render_to_rel_file('config', "$name/@{[decamelize $class]}.conf");

# Controller
my $controller = "${class}::Controller::Example";
Expand Down

0 comments on commit 56d4d89

Please sign in to comment.