Plack-Middleware-LimitRequest

 view release on metacpan or  search on metacpan

inc/Plack/Builder.pm  view on Meta::CPAN

79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
    $app;
}
 
# DSL goes here
our $_add = our $_add_if = our $_mount = sub {
    Carp::croak("enable/mount should be called inside builder {} block");
};
 
sub enable         { $_add->(@_) }
sub enable_if(&$@) { $_add_if->(@_) }
 
sub mount {
    my $self = shift;
    if (Scalar::Util::blessed($self)) {
        $self->_mount(@_);
    }else{
        $_mount->($self, @_);
    }
}
 
sub builder(&) {
    my $block = shift;
 
    my $self = __PACKAGE__->new;
 
    my $mount_is_called;
    my $urlmap = Plack::App::URLMap->new;
    local $_mount = sub {
        $mount_is_called++;
        $urlmap->map(@_);
        $urlmap;

inc/Test/Base.pm  view on Meta::CPAN

269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
    ) {
        Test::More::is($actual, $expected, $name);
    }
    else {
        $name = '' unless defined $name;
        ok $actual eq $expected, $name;
        diag Text::Diff::diff(\$expected, \$actual);
    }
}
 
sub run(&;$) {
    (my ($self), @_) = find_my_self(@_);
    my $callback = shift;
    for my $block (@{$self->block_list}) {
        $block->run_filters unless $block->is_filtered;
        &{$callback}($block);
    }
}
 
my $name_error = "Can't determine section names";
sub _section_names {



( run in 0.499 second using v1.01-cache-2.11-cpan-87723dcf8b7 )