Skip to content

Commit

Permalink
moved mobile related middlewares from core to middleware dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
dann committed Jan 31, 2009
1 parent c1f07d2 commit ace846d
Show file tree
Hide file tree
Showing 38 changed files with 401 additions and 166 deletions.
4 changes: 0 additions & 4 deletions angelos-core/Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ requires(
# View Plugins (remove from core)

# Middleware
'HTTP::MobileAgent' => 0,
'Encode::JP::Mobile' => 0,
'HTTP::MobileAgent::Plugin::Charset' => 0,
'Data::Visitor::Encode' => 0,
);

if (HAVE_MP) {
Expand Down
2 changes: 1 addition & 1 deletion angelos-core/lib/Angelos/Request.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sub setup {
for my $mixin ( $self->config->mixins('request') ) {
my $module = join '::',
( 'Angelos', 'Request', 'Mixin', $mixin->{module} );
$module->require or die "Can't load $module";
$module->require or die "Can't load $module: $@";
$module->new->SETUP;
}
}
Expand Down
2 changes: 1 addition & 1 deletion angelos-core/lib/Angelos/Response.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sub setup {
for my $mixin ( $self->config->mixins('response') ) {
my $module = join '::',
( 'Angelos', 'Response', 'Mixin', $mixin->{module} );
$module->require or die "Can't load $module";
$module->require or die "Can't load $module: $@";
$module->new->SETUP;
}
}
Expand Down
20 changes: 0 additions & 20 deletions angelos-core/t/unit/110_jobqueue/basic.t

This file was deleted.

20 changes: 0 additions & 20 deletions angelos-core/t/unit/120_i18n/basic.t

This file was deleted.

20 changes: 0 additions & 20 deletions angelos-core/t/unit/200_plugins_engine/basic.t

This file was deleted.

20 changes: 0 additions & 20 deletions angelos-core/t/unit/210_plugins_controller/basic.t

This file was deleted.

20 changes: 0 additions & 20 deletions angelos-core/t/unit/220_plugins_view/basic.t

This file was deleted.

20 changes: 0 additions & 20 deletions angelos-core/t/unit/230_plugins_core/basic.t

This file was deleted.

20 changes: 0 additions & 20 deletions angelos-core/t/unit/240_middleware/basic.t

This file was deleted.

20 changes: 0 additions & 20 deletions angelos-core/t/unit/skelton.t

This file was deleted.

12 changes: 12 additions & 0 deletions angelos-middlewares/Angelos-Middleware-MobileAgent/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cover_db
META.yml
Makefile
blib
inc
pm_to_blib
MANIFEST
Makefile.old
tmon.out
cover_db_view
nytprof
.DS_Store
3 changes: 3 additions & 0 deletions angelos-middlewares/Angelos-Middleware-MobileAgent/.shipit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
steps = FindVersion, ChangeVersion, CheckChangeLog, DistTest, Commit, Tag, MakeDist, UploadCPAN
git.tagpattern = release-%v
git.push_to = origin
4 changes: 4 additions & 0 deletions angelos-middlewares/Angelos-Middleware-MobileAgent/Changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Revision history for Perl extension Angelos::Middleware::MobileAgent

0.01 Sun Feb 1 00:31:53 2009
* original version
21 changes: 21 additions & 0 deletions angelos-middlewares/Angelos-Middleware-MobileAgent/MANIFEST.SKIP
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
\bRCS\b
\bCVS\b
^MANIFEST\.
^Makefile$
~$
^#
\.old$
^blib/
^pm_to_blib
^MakeMaker-\d
\.gz$
\.cvsignore
^t/9\d_.*\.t
^t/perlcritic
^xt/
^tools/
\.svn/
\.git/
^[^/]+\.yaml$
^[^/]+\.pl$
^\.shipit$
13 changes: 13 additions & 0 deletions angelos-middlewares/Angelos-Middleware-MobileAgent/Makefile.PL
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
use inc::Module::Install;
name 'Angelos-Middleware-MobileAgent';
all_from 'lib/Angelos/Middleware/MobileAgent.pm';

requires(
'Angelos' => 0,
'HTTP::MobileAgent' => 0,
);

build_requires 'Test::More';
use_test_base;
auto_include;
WriteAll;
27 changes: 27 additions & 0 deletions angelos-middlewares/Angelos-Middleware-MobileAgent/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
This is Perl module Angelos::Middleware::MobileAgent.

INSTALLATION

Angelos::Middleware::MobileAgent installation is straightforward. If your CPAN shell is set up,
you should just be able to do

% cpan Angelos::Middleware::MobileAgent

Download it, unpack it, then build it as per the usual:

% perl Makefile.PL
% make && make test

Then install it:

% make install

DOCUMENTATION

Angelos::Middleware::MobileAgent documentation is available as in POD. So you can do:

% perldoc Angelos::Middleware::MobileAgent

to read the documentation online with your favorite pager.

Takatoshi Kitano
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package Angelos::Middleware::MobileAgent;
use HTTP::Engine::Middleware;
use HTTP::MobileAgent;

BEGIN {
## no critic.
sub HTTP::MobileAgent::can_display_utf8 {
my $self = shift;
if ( $self->is_non_mobile
|| ( $self->is_vodafone && $self->is_type_3gc )
|| $self->xhtml_compliant )
{
return 1;
}
else {
return 0;
}
}

## no critic.
sub HTTP::MobileAgent::encoding {
my $self = shift;
$self->can_display_utf8() ? 'utf-8' : 'cp932';
}
}

middleware_method 'mobile_attribute' => sub {
my $self = shift;
$self->{mobile_agent} ||= HTTP::MobileAgent->new( $self->headers );
};

__MIDDLEWARE__

__END__
=head1 NAME
Angelos::Middleware::MobileAgent -
=head1 SYNOPSIS
use Angelos::Middleware::MobileAgent;
=head1 DESCRIPTION
Angelos::Middleware::MobileAgent is
=head1 AUTHOR
Takatoshi Kitano E<lt>kitano.tk@gmail.comE<gt>
=head1 SEE ALSO
=head1 LICENSE
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

use strict;
use Test::More tests => 1;

BEGIN { use_ok 'Angelos::Middleware::MobileAgent' }
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
use Test::Dependencies
exclude => [qw/Test::Dependencies Test::Base Test::Perl::Critic Angelos::Middleware::MobileAgent/],
style => 'light';
ok_dependencies();
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use Test::More;
eval q{ use Test::Spelling };
plan skip_all => "Test::Spelling is not installed." if $@;
add_stopwords(map { split /[\s\:\-]/ } <DATA>);
$ENV{LANG} = 'C';
set_spell_cmd("aspell list");
all_pod_files_spelling_ok('lib');
__DATA__
Takatoshi Kitano
Angelos::Middleware::MobileAgent
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
use strict;
use Test::More;
eval { use Test::Perl::Critic -profile => 'xt/perlcriticrc' };
plan skip_all => "Test::Perl::Critic is not installed." if $@;
all_critic_ok('lib');
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[TestingAndDebugging::ProhibitNoStrict]
allow=refs
4 changes: 4 additions & 0 deletions angelos-middlewares/Angelos-Middleware-MobileAgent/xt/pod.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
use Test::More;
eval "use Test::Pod 1.00";
plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
all_pod_files_ok();
12 changes: 12 additions & 0 deletions angelos-middlewares/Angelos-Middleware-MobileJP/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cover_db
META.yml
Makefile
blib
inc
pm_to_blib
MANIFEST
Makefile.old
tmon.out
cover_db_view
nytprof
.DS_Store
3 changes: 3 additions & 0 deletions angelos-middlewares/Angelos-Middleware-MobileJP/.shipit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
steps = FindVersion, ChangeVersion, CheckChangeLog, DistTest, Commit, Tag, MakeDist, UploadCPAN
git.tagpattern = release-%v
git.push_to = origin
Loading

0 comments on commit ace846d

Please sign in to comment.