Navigation Menu

Skip to content

Commit

Permalink
Mojo::HelloWorld is supposed to be a Mojolicious subclass
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jul 8, 2017
1 parent 9c86f37 commit 61abb5d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 11 deletions.
3 changes: 2 additions & 1 deletion Changes
@@ -1,6 +1,7 @@

7.36 2017-07-07
7.36 2017-07-08
- Fixed basename method in Mojo::File to work with relative paths. (jberger)
- Fixed Mojo::HelloWorld to actually be a Mojolicious subclass.

7.35 2017-07-05
- Removed deprecated watch attribute from Mojo::Server::Morbo.
Expand Down
26 changes: 22 additions & 4 deletions lib/Mojo/HelloWorld.pm
@@ -1,9 +1,12 @@
package Mojo::HelloWorld;
use Mojolicious::Lite;
use Mojo::Base 'Mojolicious';

app->log->level('error')->path(undef);

any '/*whatever' => {whatever => '', text => 'Your Mojo is working!'};
sub startup {
my $self = shift;
$self->log->level('error')->path(undef);
$self->routes->any(
'/*whatever' => {whatever => '', text => 'Your Mojo is working!'});
}

1;

Expand All @@ -25,6 +28,21 @@ Mojo::HelloWorld - Hello World!
L<Mojo::HelloWorld> is the default L<Mojolicious> application, used mostly for
testing.
=head1 ATTRIBUTES
L<Mojo::HelloWorld> inherits all attributes from L<Mojolicious>.
=head1 METHODS
L<Mojo::HelloWorld> inherits all methods from L<Mojolicious> and implements the
following new ones.
=head2 startup
$hello->startup;
Creates a catch-all route that renders a text message.
=head1 SEE ALSO
L<Mojolicious>, L<Mojolicious::Guides>, L<http://mojolicious.org>.
Expand Down
6 changes: 1 addition & 5 deletions lib/Mojolicious/Guides.pod
Expand Up @@ -216,13 +216,9 @@ This is the class hierarchy of the L<Mojolicious> distribution.

=over 2

=item * L<Mojolicious::Lite>

=over 2

=item * L<Mojo::HelloWorld>

=back
=item * L<Mojolicious::Lite>

=back

Expand Down
2 changes: 1 addition & 1 deletion t/mojo/daemon.t
Expand Up @@ -245,7 +245,7 @@ ok $remote_port > 0, 'has remote port';
$daemon
= Mojo::Server::Daemon->new({listen => ['http://127.0.0.1'], silent => 1});
my $port = $daemon->start->ports->[0];
is $daemon->app->moniker, 'HelloWorld', '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 61abb5d

Please sign in to comment.