This file contains hidden or 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
#!/usr/bin/env perl | |
# put.pl | |
# This works : | |
# ./put.pl daemon | |
# mojo get --method PUT --content 'foo' --header 'X-Disk: /tmp' http://localhost:3000/here | |
# This does not : | |
# ./put.pl get --method PUT --content 'foo' --header 'X-Disk: /tmp' /here |
This file contains hidden or 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
#!/usr/bin/env perl | |
# put.pl | |
# This works : | |
# ./put.pl daemon | |
# mojo get --method PUT --content 'foo' --header 'X-Disk: /tmp' http://localhost:3000/here | |
# This does not : | |
# ./put.pl get --method PUT --content 'foo' --header 'X-Disk: /tmp' /here |
This file contains hidden or 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
#!/usr/bin/env perl | |
# put.t | |
use Test::More tests => 3; | |
use Mojolicious::Lite; | |
use Test::Mojo; | |
$ENV{MOJO_MAX_MEMORY_SIZE} = 2; # Force temp files. | |
$ENV{MOJO_TMPDIR} = "/nosuchdir"; # test setting tempdir dynamically |
This file contains hidden or 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
#!/usr/bin/env perl | |
use Mojolicious::Lite; | |
use Coro; | |
use Mojo::IOLoop; | |
Mojo::IOLoop->recurring(0 => sub {cede}); | |
hook around_dispatch => sub { | |
my $next = shift; | |
async { $next->() }; |
This file contains hidden or 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
Name: perl-Mojolicious | |
Version: 3.56 | |
Release: 1%{?dist} | |
Summary: A next generation web framework for Perl | |
License: Artistic 2.0 | |
Group: Development/Libraries | |
URL: http://mojolicious.org/ | |
Source0: http://search.cpan.org/CPAN/modules/by-module/Mojolicous/Mojolicious-%{version}.tar.gz | |
BuildArch: noarch | |
BuildRequires: perl >= 0:5.010, perl(ExtUtils::MakeMaker) |
This file contains hidden or 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
use Mojo::ByteStream; | |
app->helper(alerts => sub { | |
my $c = shift; | |
my $html = ''; | |
for my $message (qw|success info error|) { | |
my $css = "alert alert-$message"; | |
if($c->flash($message)) { | |
$html .= $c->tag('div', class => $css, $c->flash($message)); |
This file contains hidden or 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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Test::More tests => 6; | |
use Test::Mojo; | |
my $url = 'http://localhost/~rhaen/index.html'; | |
my $t = Test::Mojo->new; |
This file contains hidden or 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
use Mojolicious::Lite; | |
use EV; | |
use IO::Async::Process; | |
use IO::Async::Loop::EV; | |
my $loop = IO::Async::Loop::EV->new; | |
get '/' => sub { | |
my $self = shift; |
This file contains hidden or 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
use Mojolicious::Lite; | |
use EV; | |
use IO::Async::Process; | |
use IO::Async::Loop::EV; | |
my $loop = IO::Async::Loop::EV->new; | |
get '/' => sub { | |
my $self = shift; |