Ark

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

            "Clone" : "0",
            "Cookie::Baker" : "0.11",
            "Data::UUID" : "0",
            "Devel::StackTrace" : "0",
            "Digest::SHA1" : "0",
            "Exporter::AutoClean" : "0",
            "FormValidator::Lite" : "0",
            "HTML::Escape" : "0",
            "HTML::Shakan" : "2.00",
            "HTTP::Cookies" : "0",
            "HTTP::Request" : "0",
            "JSON" : "0",
            "Mouse" : "1.00",
            "Object::Container" : "0.08",
            "Path::AttrRouter" : "0.03",
            "Path::Class" : "0.16",
            "Plack" : "0.9910",
            "Plack::Request::WithEncoding" : "0.10",
            "Text::MicroTemplate" : "0",
            "Text::SimpleTable" : "0",
            "Try::Tiny" : "0.02",

META.json  view on Meta::CPAN

         "suggests" : {
            "Ark::Plugin::Authentication" : "0",
            "Ark::Plugin::I18N" : "0",
            "Ark::Plugin::MobileJP" : "0",
            "Ark::Plugin::ReproxyCallback" : "0"
         }
      },
      "test" : {
         "requires" : {
            "File::Temp" : "0",
            "HTTP::Request::Common" : "0",
            "Test::More" : "0.98",
            "Test::Output" : "0",
            "Test::Requires" : "0",
            "URI" : "0"
         }
      }
   },
   "provides" : {
      "Ark" : {
         "file" : "lib/Ark.pm",

META.yml  view on Meta::CPAN

---
abstract: 'light weight Catalyst-ish web application framework'
author:
  - 'Daisuke Murase <typester@cpan.org>'
build_requires:
  File::Temp: '0'
  HTTP::Request::Common: '0'
  Test::More: '0.98'
  Test::Output: '0'
  Test::Requires: '0'
  URI: '0'
configure_requires:
  Module::Build::Tiny: '0.035'
dynamic_config: 0
generated_by: 'Minilla/v3.1.9, CPAN::Meta::Converter version 2.150010'
license: perl
meta-spec:

META.yml  view on Meta::CPAN

  Clone: '0'
  Cookie::Baker: '0.11'
  Data::UUID: '0'
  Devel::StackTrace: '0'
  Digest::SHA1: '0'
  Exporter::AutoClean: '0'
  FormValidator::Lite: '0'
  HTML::Escape: '0'
  HTML::Shakan: '2.00'
  HTTP::Cookies: '0'
  HTTP::Request: '0'
  JSON: '0'
  Mouse: '1.00'
  Object::Container: '0.08'
  Path::AttrRouter: '0.03'
  Path::Class: '0.16'
  Plack: '0.9910'
  Plack::Request::WithEncoding: '0.10'
  Text::MicroTemplate: '0'
  Text::SimpleTable: '0'
  Try::Tiny: '0.02'

cpanfile  view on Meta::CPAN

requires 'Class::Data::Inheritable';
requires 'Clone';
requires 'Data::UUID';
requires 'Exporter::AutoClean';
requires 'FormValidator::Lite';
requires 'HTML::Escape';
requires 'HTML::Shakan', '2.00';
requires 'HTTP::Cookies';
requires 'HTTP::Request';
requires 'JSON';
requires 'Mouse', '1.00';
requires 'Object::Container', '0.08';
requires 'Path::AttrRouter', '0.03';
requires 'Path::Class', '0.16';
requires 'Plack::Request::WithEncoding', '0.10';
requires 'Plack', '0.9910';
requires 'Try::Tiny',   '0.02';
requires 'URI::WithBase';
requires 'perl', '5.008001';

cpanfile  view on Meta::CPAN

suggests 'Ark::Plugin::MobileJP';
suggests 'Ark::Plugin::I18N';
suggests 'Ark::Plugin::ReproxyCallback';

on configure => sub {
    requires 'Module::Build::Tiny', '0.035';
};

on test => sub {
    requires 'File::Temp';
    requires 'HTTP::Request::Common';
    requires 'Test::More', '0.98';
    requires 'Test::Output';
    requires 'Test::Requires';
    requires 'URI';
};

on develop => sub {
    requires 'Cache::MemoryCache';
    requires 'JSON';
    requires 'Template';

lib/Ark/Test.pm  view on Meta::CPAN

package Ark::Test;
use Mouse;

use HTTP::Request;
use HTTP::Cookies;
use Plack 0.9910; # only for declare dep version
use Plack::Test;

use FindBin;
use Path::Class qw/dir/;

use Ark::Test::Context;

sub import {

lib/Ark/Test.pm  view on Meta::CPAN

            if ($option{reuse_connection}) {
                if ($persist_app) {
                    $app = $persist_app;
                }
                else {
                    $persist_app = $app;
                    $cookie = HTTP::Cookies->new;
                }
            }

            my $req = ref($_[0]) eq 'HTTP::Request' ? $_[0] : HTTP::Request->new(@_);
            if ($cookie) {
                unless ($req->uri->can('host') and $req->uri->host) {
                    $req->uri( URI->new('http://localhost' . $req->uri->path_query ) );
                    $req->header( Host => 'localhost' );
                }
                $cookie->add_cookie_header($req) unless $req->header('Cookie');
            }

            my $res;
            test_psgi(

t/context_uri_for.t  view on Meta::CPAN

my $admin_slash = builder {
    my $env = shift;
    mount '/admin/' => $app->handler;
};


test_psgi
  app    => $root,
  client => sub {
    my $cb  = shift;
    my $req = HTTP::Request->new( GET => "http://localhost/" );
    my $res = $cb->($req);
    is $res->content, 'http://localhost/root';
    is $res->code,    200;

    $req = HTTP::Request->new( GET => "http://localhost/admin" );
    $res = $cb->($req);
    is $res->content, 'http://localhost/admin';
    is $res->code,    200;

  };

test_psgi
  app    => $admin,
  client => sub {
    my $cb  = shift;
    my $req = HTTP::Request->new( GET => "http://localhost/admin" );
    my $res = $cb->($req);
    is $res->content, 'http://localhost/admin/root';
    is $res->code,    200;

    $req = HTTP::Request->new( GET => "http://localhost/admin/admin" );
    $res = $cb->($req);
    is $res->content, 'http://localhost/admin/admin';
    is $res->code,    200;

  };

test_psgi
  app    => $admin_slash,
  client => sub {
    my $cb  = shift;
    my $req = HTTP::Request->new( GET => "http://localhost/admin" );
    my $res = $cb->($req);
    is $res->content, 'http://localhost/admin/root';
    is $res->code,    200;

    $req = HTTP::Request->new( GET => "http://localhost/admin/admin" );
    $res = $cb->($req);
    is $res->content, 'http://localhost/admin/admin';
    is $res->code,    200;
  };

done_testing;

t/form.t  view on Meta::CPAN

use strict;
use warnings;
use Test::More;
use FindBin;
use lib "$FindBin::Bin/form/lib";


use Ark::Test 'T';
use HTTP::Request::Common;

is(
    get('/login_form_input'),
    '<input name="username" type="text" />',
    'input method ok',
);

is(
    get('/login_form_render'),
    '<label for="id_username">Your Username</label><input id="id_username" name="username" type="text" />',

t/form_cleanup.t  view on Meta::CPAN

use strict;
use warnings;
use Test::More;
use FindBin;
use lib "$FindBin::Bin/form/lib";


use Ark::Test 'T', 'reuse_connection' => 1;
use HTTP::Request::Common;

is(
    get('/login_form_input'),
    '<input name="username" type="text" />',
    'input method ok',
);

{
    my $res = request GET '/';
    like $res->content, qr/OK/, '$self->form is empty';

t/form_validator_lite.t  view on Meta::CPAN

use strict;
use warnings;
use Test::More;
use FindBin;
use lib "$FindBin::Bin/form_validator_lite/lib";


use Ark::Test 'T';
use HTTP::Request::Common;

{
    my ($res, $c) = ctx_get('/login');
    isa_ok($c, 'Ark::Context');
    isa_ok(my $form = $c->validator, "FormValidator::Lite");
}

done_testing;

t/plugin_session.t  view on Meta::CPAN

    $res = request(GET => '/regen');
    is $res->content, 'regenerated', 'sid regenerated';
    my ($new_sid) = $res->header('Set-Cookie') =~ /testapp_session=(\w+)/;

    is get('/incr'), 2, 'session continued ok';
    isnt $sid, $new_sid, 'but session_id updated ok';

    is get('/regen_and_incr'), 3, 'modified session data and regenerated sid on the same request ok';

    # old sid is now removed
    my $request = HTTP::Request->new(GET => '/incr');
    $request->header( Cookie => "testapp_session=$sid" );
    is request($request)->content, 1, 'old session already expired';
}
done_testing;



( run in 1.224 second using v1.01-cache-2.11-cpan-de7293f3b23 )