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
perl -MMojo::Util=dumper -MYAML -wE ' | |
no warnings "once"; | |
sub Vault::yaml_load { | |
my ($class, $node) = @_; | |
my ($h, $s) = sub { my @l = split /\n/, $$node; return (shift @l, join("", @l)) }->(); | |
my %h; | |
@h{qw(blurb version encryption id)} = split /;/, $h; | |
bless {%h, secret => $s}, $class; | |
} | |
$YAML::TagClass->{vault} = "Vault"; |
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
use Mojo::Base -strict; | |
use Test::Mojo; | |
use Test::More; | |
use Mojolicious::Lite; | |
get '/pets' => sub { | |
my $c = shift->openapi->valid_input or return; | |
$c->render(openapi => $c->validation->output); | |
}, |
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
use Mojo::Base -strict; | |
use Test::Mojo; | |
use Test::More; | |
use Mojolicious::Lite; | |
get '/pets' => sub { | |
my $c = shift->openapi->valid_input or return; | |
$c->render(openapi => $c->validation->output); | |
}, |
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
use Mojo::Base -strict; | |
use Mojo::JSON 'true'; | |
use Test::Mojo; | |
use Test::More; | |
use Mojolicious::Lite; | |
get( | |
'/no-default-options/:id' => sub { $_[0]->render(openapi => {id => $_[0]->stash('id')}) }, | |
'Dummy' | |
); |
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
{ | |
"swagger" : "2.0", | |
"x-bundled" : { | |
"__definitions_DefaultResponse" : { | |
"type" : "object", | |
"properties" : { | |
"errors" : { | |
"items" : { | |
"type" : "object", | |
"required" : [ |
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
{ | |
"schemes" : [ | |
"http" | |
], | |
"paths" : { | |
"/echo" : { | |
"post" : { | |
"x-mojo-name" : "echo", | |
"responses" : { | |
"200" : { |
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
sub generiere_eins_bis_drei { | |
$i = 0; | |
return sub { | |
return if $i > 2; | |
return ++$i; | |
} | |
} | |
$generator = generiere_eins_bis_drei; | |
while ($wert = $generator->()) { |
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
diff --git a/lib/Mojolicious/Plugin/MethodOverride.pm b/lib/Mojolicious/Plugin/MethodOverride.pm | |
index 3a09501..e9a7f27 100644 | |
--- a/lib/Mojolicious/Plugin/MethodOverride.pm | |
+++ b/lib/Mojolicious/Plugin/MethodOverride.pm | |
@@ -9,6 +9,9 @@ our $VERSION = '0.053'; | |
sub register { | |
my ($self, $app, $conf) = @_; | |
+ my $log = $app->log; | |
+ |
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
#!/usr/bin/env perl | |
BEGIN { | |
$ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll'; | |
} | |
use strict; | |
use warnings; | |
use Mojo::IOLoop; |
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
--- a/lib/Mojo/EventEmitter.pm | |
+++ b/lib/Mojo/EventEmitter.pm | |
@@ -12,7 +12,11 @@ sub emit { | |
if (my $s = $self->{events}{$name}) { | |
warn "-- Emit $name in @{[blessed $self]} (@{[scalar @$s]})\n" if DEBUG; | |
- for my $cb (@$s) { $self->$cb(@_) } | |
+ my $i = 0; | |
+ for my $cb (@$s) { | |
+ warn "xx call cb #@{[$i++]} $name in @{[blessed $self]}\n" if DEBUG; |
NewerOlder