Amon2

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

    - [Setup] include all files from twitter-bootstrap. closed #53
    - [Setup] move view class generator to ::View class.

3.64 2012-12-04

    - upgrade es5shim to latest
    - upgrade deps for fine version of HTML::FillInForm::Lite and Xslate
    - Merge branch 'master' of github.com:tokuhirom/Amon
    - testing memory leaks
    - support method not allowed on Flavor::Large
    - added Amon2->debug_mode()
    - added warn_handler for default flavor
    - upgrade assets. jquery 1.8.3, and latest bootstrap.
    - support method not allowed on Flavor::Large
    - added Amon2->debug_mode()
    - added warn_handler for default flavor

    [from Keiji, Yoshimi <walf443@gmail.com>]
    - Update lib/Amon2/Plugin/Web/JSON.pm
    - fix hijacking message.

3.63 2012-11-20

    - Plugin::Web::JSON: micro optimization(cache user_agent value)

MANIFEST  view on Meta::CPAN

t/100_core/003_redirect.t
t/100_core/004_web_to_app_leak.t
t/100_core/005_trigger.t
t/100_core/008_request_uri_with.t
t/100_core/009_uri_for.t
t/100_core/010_add_config.t
t/100_core/011_random_string.t
t/100_core/012_trigger_controller.t
t/100_core/013_tiffany.t
t/100_core/014_load_plugins.t
t/100_core/015_debug_mode.t
t/100_core/016_context_guard.t
t/100_core/017_local_context.t
t/200_app/01_extended.t
t/200_app/02_deepnamespace.t
t/300_setup/01_minimum.t
t/300_setup/02_basic.t
t/300_setup/03_asset.t
t/300_setup/06_large.t
t/300_setup/07_run_cli_server.t
t/300_setup/08_installable.t

README.md  view on Meta::CPAN

        __PACKAGE__->load_plugins("+MyApp::Plugin::Foo"); # => loads MyApp::Plugin::Foo

- `MyApp->load_config()`

    You can get a configuration hashref from `config/$ENV{PLACK_ENV}.pl`. You can override this method for customizing configuration loading method.

- `MyApp->add_config()`

    DEPRECATED.

- `MyApp->debug_mode()`

    **((EXPERIMENTAL))**

    This method returns a boolean value. It returns true when $ENV{AMON2\_DEBUG} is true value, false otherwise.

    You can override this method if you need.

# PROJECT LOCAL MODE

**THIS MODE IS HIGHLY EXPERIMENTAL**

lib/Amon2.pm  view on Meta::CPAN

       $class = ref $class || $class;
    die "Do not call Amon2->config() directly." if __PACKAGE__ eq $class;
    no strict 'refs';
    my $config = $class->load_config();
    *{"$class\::config"} = sub { $config }; # Class cache.
    return $config;
}

sub mode_name { $ENV{PLACK_ENV} }

sub debug_mode { $ENV{AMON2_DEBUG} ? 1 : 0 }

sub add_config {
    my ($class, $key, $hash) = @_; $hash or Carp::croak("missing args: \$hash");
    Carp::cluck("Amon2->add_config() method was deprecated.");

    # This method will be deprecated.
    $class->config->{$key} = +{
        %{$class->config->{$key} || +{}},
        %{$hash},
    };

lib/Amon2.pm  view on Meta::CPAN

    __PACKAGE__->load_plugins("+MyApp::Plugin::Foo"); # => loads MyApp::Plugin::Foo

=item C<< MyApp->load_config() >>

You can get a configuration hashref from C<< config/$ENV{PLACK_ENV}.pl >>. You can override this method for customizing configuration loading method.

=item C<< MyApp->add_config() >>

DEPRECATED.

=item C<< MyApp->debug_mode() >>

B<((EXPERIMENTAL))>

This method returns a boolean value. It returns true when $ENV{AMON2_DEBUG} is true value, false otherwise.

You can override this method if you need.

=back

=head1 PROJECT LOCAL MODE

share/flavor/Minimum/lib/__PATH__/Web/View.pm  view on Meta::CPAN

        }
    }
    my $view = Text::Xslate->new(+{
        'syntax'   => 'Kolon',
        'module'   => [
            'Text::Xslate::Bridge::Star',
            '<% $view_functions_package // ($module ~ "::Web::ViewFunctions") %>',
        ],
        'function' => {
        },
        ($context->debug_mode ? ( warn_handler => sub {
            Text::Xslate->print( # print method escape html automatically
                '[[', @_, ']]',
            );
        } ) : () ),
        %$view_conf
    });
    return $view;
}

1;

t/100_core/015_debug_mode.t  view on Meta::CPAN

use strict;
use warnings;
use utf8;
use Test::More;
use Amon2;

subtest 'enabled debug mode' => sub {
    local $ENV{AMON2_DEBUG} = 1;
    is(Amon2->debug_mode(), 1);
};

subtest 'disabled debug mode' => sub {
    local $ENV{AMON2_DEBUG} = 0;
    is(Amon2->debug_mode(), 0);
};

done_testing;



( run in 1.357 second using v1.01-cache-2.11-cpan-49f99fa48dc )