Amon2

 view release on metacpan or  search on metacpan

lib/Amon2/Setup/Flavor.pm  view on Meta::CPAN

        jQuery Bootstrap MicroTemplateJS StrftimeJS SprintfJS
        MicroLocationJS MicroDispatcherJS XSRFTokenJS
    );
    @assets;
}

sub infof {
    my $caller = do {
        my $x;
        for (1..10) {
            $x = caller($_);
            last if $x ne __PACKAGE__;
        }
        $x;
    };
    $caller =~ s/^Amon2::Setup:://;
    print "[$caller] ";
    @_==1 ? print(@_) : printf(@_);
    print "\n";
}

lib/Amon2/Web/Dispatcher/Lite.pm  view on Meta::CPAN

package Amon2::Web::Dispatcher::Lite;
use strict;
use warnings;
use parent 'Amon2::Web';
use Router::Simple 0.14;
use Router::Simple::Sinatraish;

sub import {
    my $class = shift;
    my $caller = caller(0);

    Router::Simple::Sinatraish->export_to_level(1);
    my $router = $caller->router;

    no strict 'refs';
    *{"$caller\::dispatch"} = sub {
        my ($klass, $c) = @_;

        if (my $p = $router->match($c->request->env)) {
            return $p->{code}->($c, $p);

lib/Amon2/Web/Dispatcher/RouterBoom.pm  view on Meta::CPAN

package Amon2::Web::Dispatcher::RouterBoom;
use strict;
use warnings;
use utf8;
use 5.008_001;
use Router::Boom::Method;

sub import {
    my $class = shift;
    my %args = @_;
    my $caller = caller(0);

    my $router = Router::Boom::Method->new();

    my $base;

    no strict 'refs';

    *{"${caller}::base"} = sub { $base = $_[0] };

    # functions

lib/Amon2/Web/Dispatcher/RouterSimple.pm  view on Meta::CPAN

package Amon2::Web::Dispatcher::RouterSimple;
use strict;
use warnings;
use Router::Simple 0.03;

sub import {
    my $class = shift;
    my %args = @_;
    my $caller = caller(0);

    my $router = Router::Simple->new();

    no strict 'refs';
    # functions
    *{"${caller}::connect"} = sub {
        if (@_ == 2 && !ref $_[1]) {
            my ($path, $dest_str) = @_;
            my ($controller, $action) = split('#', $dest_str);
            my %dest;



( run in 0.767 second using v1.01-cache-2.11-cpan-26ccb49234f )