Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed small name generation bug in Mojolicious::Plugin::Config
- Loading branch information
Showing
9 changed files
with
79 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package MyApp; | ||
use Mojo::Base 'Mojolicious'; | ||
|
||
# "Well, at least here you'll be treated with dignity. | ||
# Now strip naked and get on the probulator." | ||
sub startup { | ||
my $self = shift; | ||
my $r = $self->routes; | ||
|
||
# Load plugin | ||
$self->plugin('Config'); | ||
|
||
# GET / | ||
$r->get( | ||
'/' => sub { | ||
my $self = shift; | ||
$self->render(text => $self->config->{works}); | ||
} | ||
); | ||
|
||
# GET /test | ||
$r->get( | ||
'/test' => sub { | ||
my $self = shift; | ||
$self->render(text => $self->config->{whatever}); | ||
} | ||
); | ||
} | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{works => 'too!'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{whatever => 'works!'}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env perl | ||
use Mojo::Base -strict; | ||
|
||
use utf8; | ||
|
||
# Disable Bonjour, IPv6 and libev | ||
BEGIN { | ||
$ENV{MOJO_NO_BONJOUR} = $ENV{MOJO_NO_IPV6} = 1; | ||
$ENV{MOJO_IOWATCHER} = 'Mojo::IOWatcher'; | ||
$ENV{MOJO_MODE} = 'testing'; | ||
} | ||
|
||
# "Of all the parasites I've had over the years, | ||
# these worms are among the best." | ||
use Test::More tests => 9; | ||
use Test::Mojo; | ||
|
||
use FindBin; | ||
use lib "$FindBin::Bin/external/lib"; | ||
my $t = Test::Mojo->new('MyApp'); | ||
|
||
# GET / | ||
$t->get_ok('/')->status_is(200)->content_is('too!'); | ||
|
||
# GET /index.html | ||
$t->get_ok('/index.html')->status_is(200) | ||
->content_is('External static file!'); | ||
|
||
# GET /test | ||
$t->get_ok('/test')->status_is(200)->content_is('works!'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters