Skip to content

Commit

Permalink
Ensure the naming of files during app and dockerfile generation is co…
Browse files Browse the repository at this point in the history
…nsistent
  • Loading branch information
kathackeray committed Feb 21, 2022
1 parent 4093223 commit e57c2ad
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/Mojolicious.pm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ has log => sub {
};
has 'max_request_size';
has mode => sub { $ENV{MOJO_MODE} || $ENV{PLACK_ENV} || 'development' };
has moniker => sub { Mojo::Util::decamelize ref shift };
has moniker => sub { Mojo::Util::class_to_file ref shift };
has plugins => sub { Mojolicious::Plugins->new };
has preload_namespaces => sub { [] };
has renderer => sub { Mojolicious::Renderer->new };
Expand Down Expand Up @@ -425,7 +425,7 @@ variables or C<development>.
$app = $app->moniker('foo_bar');
Moniker of this application, often used as default filename for configuration files and the like, defaults to
decamelizing the application class with L<Mojo::Util/"decamelize">.
transforming the application class with L<Mojo::Util/"class_to_file">.
=head2 plugins
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Command/Author/generate/app.pm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ sub run {
$self->render_to_rel_file('appclass', "$name/lib/$app", {class => $class});

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

# Controller
my $controller = "${class}::Controller::Example";
Expand Down
2 changes: 1 addition & 1 deletion t/mojo/daemon.t
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ subtest 'Timeout' => sub {
subtest 'Pipelined' => sub {
my $daemon = Mojo::Server::Daemon->new({listen => ['http://127.0.0.1'], silent => 1});
my $port = $daemon->start->ports->[0];
is $daemon->app->moniker, 'mojo-hello_world', 'right moniker';
is $daemon->app->moniker, 'mojo_hello_world', 'right moniker';
my $buffer = '';
my $id;
$id = Mojo::IOLoop->client(
Expand Down

0 comments on commit e57c2ad

Please sign in to comment.