Catalyst-Controller-Mobile-JP

 view release on metacpan or  search on metacpan

META.yml  view on Meta::CPAN

--- 
abstract: decode/encode with Encode::JP::Mobile
author: 
  - Naoki Tomita <tomita@cpan.org>
build_requires: 
  HTTP::Request::Common: 0
  Test::More: 0
distribution_type: module
generated_by: Module::Install version 0.68
license: perl
meta-spec: 
  url: http://module-build.sourceforge.net/META-spec-v1.3.html
  version: 1.3
name: Catalyst-Controller-Mobile-JP
no_index: 
  directory: 

Makefile.PL  view on Meta::CPAN

name 'Catalyst-Controller-Mobile-JP';
all_from 'lib/Catalyst/Controller/Mobile/JP.pm';

requires 'Catalyst::Runtime'  => '5.70';
requires 'Class::Accessor::Fast';
requires 'Encode::JP::Mobile' => '0.25';
requires 'Catalyst::Plugin::MobileAgent';
requires 'HTTP::MobileAgent::Plugin::Charset';

build_requires 'Test::More';
build_requires 'HTTP::Request::Common';

use_test_base;
auto_include;

WriteAll;

inc/HTTP/Request/Common.pm  view on Meta::CPAN

#line 1
package HTTP::Request::Common;

use strict;
use vars qw(@EXPORT @EXPORT_OK $VERSION $DYNAMIC_FILE_UPLOAD);

$DYNAMIC_FILE_UPLOAD ||= 0;  # make it defined (don't know why)

require Exporter;
*import = \&Exporter::import;
@EXPORT =qw(GET HEAD PUT POST);
@EXPORT_OK = qw($DYNAMIC_FILE_UPLOAD);

require HTTP::Request;
use Carp();

$VERSION = "5.811";

my $CRLF = "\015\012";   # "\r\n" is not portable

sub GET  { _simple_req('GET',  @_); }
sub HEAD { _simple_req('HEAD', @_); }
sub PUT  { _simple_req('PUT' , @_); }

sub POST
{
    my $url = shift;
    my $req = HTTP::Request->new(POST => $url);
    my $content;
    $content = shift if @_ and ref $_[0];
    my($k, $v);
    while (($k,$v) = splice(@_, 0, 2)) {
	if (lc($k) eq 'content') {
	    $content = $v;
	}
	else {
	    $req->push_header($k, $v);
	}

inc/HTTP/Request/Common.pm  view on Meta::CPAN

    else {
        $req->header('Content-Length' => 0);
    }
    $req;
}


sub _simple_req
{
    my($method, $url) = splice(@_, 0, 2);
    my $req = HTTP::Request->new($method => $url);
    my($k, $v);
    while (($k,$v) = splice(@_, 0, 2)) {
	if (lc($k) eq 'content') {
	    $req->add_content($v);
            $req->header("Content-Length", length(${$req->content_ref}));
	}
	else {
	    $req->push_header($k, $v);
	}
    }

t/01_encoding.t  view on Meta::CPAN

use strict;
use warnings;
use Test::Base;
use FindBin;
use lib "$FindBin::Bin/lib";
use HTTP::Request::Common;

plan tests => 1 + 1 * blocks;

use_ok('Catalyst::Test', 'TestApp');

filters {
    input => [qw( eval )],
};

run {

t/02_fallback.t  view on Meta::CPAN

use strict;
use warnings;
use Test::Base;
use FindBin;
use lib "$FindBin::Bin/lib";
use HTTP::Request::Common;

plan tests => 1 + 1 * blocks;

use_ok('Catalyst::Test', 'TestApp');

filters {
    expected => [qw( eval )],
};

run {

t/03_fallback-htmlspecialchars.t  view on Meta::CPAN

use strict;
use warnings;
use Test::Base;
use FindBin;
use lib "$FindBin::Bin/lib";
use HTTP::Request::Common;

plan tests => 1 + 1 * blocks;

use_ok('Catalyst::Test', 'TestApp');

run {
    my $block = shift;
    my $res = request(
        POST '/htmlspecialchars_test',
        User_Agent => $block->user_agent,



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