Changeset 13231
- Timestamp:
- 06/04/08 23:39:58 (5 years ago)
- Location:
- lang/perl/mobirc/trunk
- Files:
-
- 29 modified
- 1 moved
-
config.yaml.sample (modified) (1 diff)
-
lib/App/Mobirc.pm (modified) (2 diffs)
-
lib/App/Mobirc/ConfigLoader.pm (modified) (2 diffs)
-
lib/App/Mobirc/Model/Channel.pm (modified) (1 diff)
-
lib/App/Mobirc/Plugin/Component/HTTPD.pm (moved) (moved from lang/perl/mobirc/trunk/lib/App/Mobirc/HTTPD.pm) (3 diffs)
-
lib/App/Mobirc/Web/Middleware/MobileAgent.pm (modified) (1 diff)
-
lib/App/Mobirc/Web/Template/Mobile.pm (modified) (1 diff)
-
lib/App/Mobirc/Web/Template/MobileAjax.pm (modified) (1 diff)
-
t/00_compile.t (modified) (1 diff)
-
t/Core/channel.t (modified) (1 diff)
-
t/Plugins/Authorizer/BasicAuth.t (modified) (1 diff)
-
t/Plugins/Authorizer/DoCoMoGUID-authorizer.t (modified) (1 diff)
-
t/Plugins/Authorizer/DoCoMoGUID-html_filter.t (modified) (2 diffs)
-
t/Plugins/Component/IRCClient.t (modified) (1 diff)
-
t/Plugins/DocRoot.t (modified) (1 diff)
-
t/Plugins/Filter/clickable.t (modified) (1 diff)
-
t/Plugins/Filter/decorate-irc-color.t (modified) (1 diff)
-
t/Plugins/Filter/no-decorate-irc-color.t (modified) (1 diff)
-
t/Plugins/GPS.t (modified) (1 diff)
-
t/Plugins/HTMLFilter/CompressHTML.t (modified) (1 diff)
-
t/Plugins/HTMLFilter/ConvertPictograms.t (modified) (1 diff)
-
t/Plugins/HTMLFilter/DoCoMoCSS.t (modified) (2 diffs)
-
t/Plugins/HTMLFilter/NickGroup.t (modified) (1 diff)
-
t/Plugins/StickyTime.t (modified) (1 diff)
-
t/Role/Context.t (modified) (1 diff)
-
t/Web/Template/Ajax/channel.t (modified) (1 diff)
-
t/Web/Template/Ajax/menu.t (modified) (1 diff)
-
t/Web/Template/IRCMessage.t (modified) (1 diff)
-
t/Web/Template/Mobile/topics.t (modified) (1 diff)
-
t/Web/Template/MobileAjax/index.t (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/mobirc/trunk/config.yaml.sample
r13013 r13231 58 58 # root: /foo/ 59 59 60 - module: Component::HTTPD 61 config: 62 port: 5678 63 64 60 65 httpd: 61 port: 578562 title: mobirc63 66 lines: 40 64 67 # root: / 65 # recent_log_per_page: 4066 # charset: cp93267 # content_type: text/html; charset=Shift_JIS68 68 -
lang/perl/mobirc/trunk/lib/App/Mobirc.pm
r13228 r13231 7 7 use App::Mobirc::ConfigLoader; 8 8 use App::Mobirc::Util; 9 use App::Mobirc::HTTPD;10 9 use UNIVERSAL::require; 11 10 use Carp; … … 49 48 sub run { 50 49 my $self = shift; 51 die"this is instance method" unless blessed $self;50 croak "this is instance method" unless blessed $self; 52 51 53 52 $self->run_hook('run_component'); 54 55 App::Mobirc::HTTPD->init($self->config, $self);56 53 57 54 $poe_kernel->run(); -
lang/perl/mobirc/trunk/lib/App/Mobirc/ConfigLoader.pm
r13230 r13231 34 34 mapping => { 35 35 lines => { type => 'int', }, 36 address => { type => 'str', },37 port => { type => 'int', required => 1, },38 title => { type => 'str', },39 content_type => { type => 'str', },40 charset => { type => 'str', },41 host => { type => 'str', },42 36 root => { type => 'str', }, 43 37 echo => { type => 'bool', }, … … 95 89 96 90 # set default vars. 91 $config->{httpd}->{lines} ||= 20; 97 92 $config->{httpd}->{root} ||= decode( 'utf8', '/' ); 98 93 $config->{httpd}->{echo} = true unless exists $config->{httpd}->{echo}; -
lang/perl/mobirc/trunk/lib/App/Mobirc/Model/Channel.pm
r13013 r13231 68 68 my ($self, $key, $row) = @_; 69 69 70 my $log_max = $self->{global_context}->config->{httpd}->{lines} ;70 my $log_max = $self->{global_context}->config->{httpd}->{lines} || 20; 71 71 72 72 push @{$self->{$key}}, $row; -
lang/perl/mobirc/trunk/lib/App/Mobirc/Plugin/Component/HTTPD.pm
r13031 r13231 1 package App::Mobirc:: HTTPD;1 package App::Mobirc::Plugin::Component::HTTPD; 2 2 use strict; 3 use warnings; 4 5 use POE; 6 use POE::Filter::HTTPD; 7 use POE::Component::Server::TCP; 3 use MooseX::Plaggerize::Plugin; 8 4 9 5 use HTTP::MobileAgent; … … 21 17 ]; 22 18 23 sub init { 24 my ( $class, $config, $global_context ) = @_; 19 has address => ( 20 is => 'ro', 21 isa => 'Str', 22 default => '0.0.0.0', 23 ); 24 25 has port => ( 26 is => 'ro', 27 isa => 'Int', 28 default => 80, 29 ); 30 31 hook run_component => sub { 32 my ( $self, $global_context ) = @_; 25 33 26 34 HTTP::Engine->new( 27 35 interface => { 28 36 module => 'POE', 29 args => {30 host => ($config->{httpd}->{address} || '0.0.0.0'),31 port => ($config->{httpd}->{port} || 80),37 args => { 38 host => $self->address, 39 port => $self->port, 32 40 }, 33 41 request_handler => \&App::Mobirc::Web::Handler::handler, … … 36 44 37 45 $global_context->load_plugin('StickyTime'); 38 } 46 }; 39 47 40 48 1; -
lang/perl/mobirc/trunk/lib/App/Mobirc/Web/Middleware/MobileAgent.pm
r13031 r13231 1 1 package App::Mobirc::Web::Middleware::MobileAgent; 2 2 use Moose; 3 use HTTP::MobileAgent; 4 use HTTP::MobileAgent::Plugin::Charset; 3 5 4 6 sub setup { -
lang/perl/mobirc/trunk/lib/App/Mobirc/Web/Template/Mobile.pm
r13164 r13231 8 8 use HTML::Entities qw/encode_entities/; 9 9 use URI::Escape qw/uri_escape/; 10 use HTTP::MobileAgent::Plugin::Charset; 10 11 11 12 template 'mobile/wrapper_mobile' => sub { -
lang/perl/mobirc/trunk/lib/App/Mobirc/Web/Template/MobileAjax.pm
r13166 r13231 7 7 use App::Mobirc; 8 8 use Path::Class; 9 use HTTP::MobileAgent::Plugin::Charset; 9 10 10 11 private template 'mobile-ajax/wrapper_mobile' => sub { -
lang/perl/mobirc/trunk/t/00_compile.t
r13031 r13231 11 11 use_ok 'App::Mobirc::Plugin::Component::IRCClient'; 12 12 13 use_ok 'App::Mobirc:: HTTPD';13 use_ok 'App::Mobirc::Plugin::Component::HTTPD'; 14 14 use_ok 'App::Mobirc::Web::Router'; 15 15 -
lang/perl/mobirc/trunk/t/Core/channel.t
r12354 r13231 10 10 App::Mobirc->new( 11 11 { 12 httpd => { port => 3333, title => 'mobirc',lines => 40 },12 httpd => { lines => 40 }, 13 13 global => { keywords => [qw/foo/], stopwords => [qw/foo31/] } 14 14 } -
lang/perl/mobirc/trunk/t/Plugins/Authorizer/BasicAuth.t
r13227 r13231 5 5 use App::Mobirc::Plugin::Authorizer::BasicAuth; 6 6 use MIME::Base64 (); 7 use HTTP::Engine::Context; 7 8 8 9 my $mobirc = App::Mobirc->new( 9 10 { 10 httpd => { port => 3333, title => 'mobirc',lines => 40 },11 httpd => { lines => 40 }, 11 12 global => { keywords => [qw/foo/] } 12 13 } -
lang/perl/mobirc/trunk/t/Plugins/Authorizer/DoCoMoGUID-authorizer.t
r13017 r13231 11 11 my $mobirc = App::Mobirc->new( 12 12 { 13 httpd => { port => 3333, title => 'mobirc',lines => 40 },13 httpd => { lines => 40 }, 14 14 global => { keywords => [qw/foo/] } 15 15 } -
lang/perl/mobirc/trunk/t/Plugins/Authorizer/DoCoMoGUID-html_filter.t
r13031 r13231 3 3 use Test::More; 4 4 use App::Mobirc; 5 use HTTP::MobileAgent; 5 6 use HTTP::Engine middlewares => [ 6 7 qw/ +App::Mobirc::Web::Middleware::MobileAgent / … … 13 14 my $mobirc = App::Mobirc->new( 14 15 { 15 httpd => { port => 3333, title => 'mobirc',lines => 40 },16 httpd => { lines => 40 }, 16 17 global => { keywords => [qw/foo/] } 17 18 } -
lang/perl/mobirc/trunk/t/Plugins/Component/IRCClient.t
r13013 r13231 15 15 my $PORT = 9999; 16 16 17 my $config = {18 httpd => {19 port => 88888,20 lines => 50,21 },22 };23 24 17 $SIG{INT} = sub { die }; 25 18 26 my $global_context = App::Mobirc->new($config); 19 my $global_context = App::Mobirc->new( 20 { 21 httpd => { }, 22 } 23 ); 27 24 $global_context->load_plugin( 28 25 { -
lang/perl/mobirc/trunk/t/Plugins/DocRoot.t
r13013 r13231 8 8 my $global_context = App::Mobirc->new( 9 9 { 10 httpd => { port => 3333, title => 'mobirc',lines => 40 },10 httpd => { lines => 40 }, 11 11 global => { keywords => [qw/foo/] } 12 12 } -
lang/perl/mobirc/trunk/t/Plugins/Filter/clickable.t
r13013 r13231 14 14 my $global_context = App::Mobirc->new( 15 15 { 16 httpd => { port => 3333, title => 'mobirc',lines => 40 },16 httpd => { lines => 40 }, 17 17 global => { keywords => [qw/foo/] } 18 18 } -
lang/perl/mobirc/trunk/t/Plugins/Filter/decorate-irc-color.t
r13013 r13231 10 10 my $global_context = App::Mobirc->new( 11 11 { 12 httpd => { port => 3333, title => 'mobirc',lines => 40 },12 httpd => { lines => 40 }, 13 13 global => { keywords => [qw/foo/] } 14 14 } -
lang/perl/mobirc/trunk/t/Plugins/Filter/no-decorate-irc-color.t
r13013 r13231 9 9 my $global_context = App::Mobirc->new( 10 10 { 11 httpd => { port => 3333, title => 'mobirc',lines => 40 },11 httpd => { lines => 40 }, 12 12 global => { keywords => [qw/foo/] } 13 13 } -
lang/perl/mobirc/trunk/t/Plugins/GPS.t
r13013 r13231 4 4 use Test::More tests => 2; 5 5 use HTTP::Engine::Context; 6 use HTTP::Engine middlewares => [ 7 '+App::Mobirc::Web::Middleware::MobileAgent' 8 ]; 6 9 7 10 my $mobirc = App::Mobirc->new( 8 11 { 9 httpd => { port => 3333, title => 'mobirc',lines => 40 },12 httpd => { lines => 40 }, 10 13 global => { keywords => [qw/foo/], stopwords => [qw/foo31/] }, 11 14 } -
lang/perl/mobirc/trunk/t/Plugins/HTMLFilter/CompressHTML.t
r13013 r13231 7 7 my $global_context = App::Mobirc->new( 8 8 { 9 httpd => { port => 3333, title => 'mobirc',lines => 40 },9 httpd => { lines => 40 }, 10 10 global => { keywords => [qw/foo/] } 11 11 } -
lang/perl/mobirc/trunk/t/Plugins/HTMLFilter/ConvertPictograms.t
r13013 r13231 5 5 use HTTP::Engine::Context; 6 6 use Test::Base; 7 use HTTP::Engine middlewares => [ 8 '+App::Mobirc::Web::Middleware::MobileAgent' 9 ]; 7 10 8 11 my $global_context = App::Mobirc->new( 9 12 { 10 httpd => { port => 3333, title => 'mobirc',lines => 40 },13 httpd => { lines => 40 }, 11 14 global => { keywords => [qw/foo/] } 12 15 } -
lang/perl/mobirc/trunk/t/Plugins/HTMLFilter/DoCoMoCSS.t
r13029 r13231 6 6 use App::Mobirc::Plugin::HTMLFilter::DoCoMoCSS; 7 7 use HTTP::Engine::Context; 8 use HTTP::Engine middlewares => [ 9 '+App::Mobirc::Web::Middleware::MobileAgent' 10 ]; 8 11 9 12 my $c = HTTP::Engine::Context->new; … … 11 14 my $global_context = App::Mobirc->new( 12 15 { 13 httpd => { port => 3333,},16 httpd => { }, 14 17 global => { keywords => [qw/foo/], assets_dir => 'assets' } 15 18 } -
lang/perl/mobirc/trunk/t/Plugins/HTMLFilter/NickGroup.t
r13044 r13231 6 6 my $mobirc = App::Mobirc->new( 7 7 { 8 httpd => { port => 3333, title => 'mobirc',lines => 40 },8 httpd => { lines => 40 }, 9 9 global => { keywords => [qw/foo/] } 10 10 } -
lang/perl/mobirc/trunk/t/Plugins/StickyTime.t
r13019 r13231 6 6 my $global_context = App::Mobirc->new( 7 7 { 8 httpd => { port => 3333, title => 'mobirc',lines => 40 },8 httpd => { lines => 40 }, 9 9 global => { keywords => [qw/foo/] } 10 10 } -
lang/perl/mobirc/trunk/t/Role/Context.t
r12355 r13231 7 7 my $c = App::Mobirc->new( 8 8 { 9 httpd => { port => 3333, title => 'mobirc',lines => 40 },9 httpd => { lines => 40 }, 10 10 global => { keywords => [qw/foo/], stopwords => [qw/foo31/] } 11 11 } -
lang/perl/mobirc/trunk/t/Web/Template/Ajax/channel.t
r13031 r13231 14 14 my $c = App::Mobirc->new( 15 15 { 16 httpd => { port => 3333, title => 'mobirc',lines => 40 },16 httpd => { lines => 40 }, 17 17 global => {}, 18 18 } -
lang/perl/mobirc/trunk/t/Web/Template/Ajax/menu.t
r13031 r13231 12 12 my $c = App::Mobirc->new( 13 13 { 14 httpd => { port => 3333, title => 'mobirc',lines => 40 },14 httpd => { lines => 40 }, 15 15 global => { keywords => [qw/foo/], stopwords => [qw/foo31/] }, 16 16 } -
lang/perl/mobirc/trunk/t/Web/Template/IRCMessage.t
r13042 r13231 10 10 my $c = App::Mobirc->new( 11 11 { 12 httpd => { port => 3333, title => 'mobirc',lines => 40 },12 httpd => { lines => 40 }, 13 13 global => { keywords => [qw/foo/], stopwords => [qw/foo31/] }, 14 14 plugin => [ -
lang/perl/mobirc/trunk/t/Web/Template/Mobile/topics.t
r13031 r13231 10 10 my $c = App::Mobirc->new( 11 11 { 12 httpd => { port => 3333, title => 'mobirc',lines => 40 },12 httpd => { lines => 40 }, 13 13 global => { keywords => [qw/foo/], stopwords => [qw/foo31/] }, 14 14 } -
lang/perl/mobirc/trunk/t/Web/Template/MobileAjax/index.t
r13164 r13231 10 10 my $c = App::Mobirc->new( 11 11 { 12 httpd => { port => 3333, title => 'mobirc',lines => 40 },12 httpd => { lines => 40 }, 13 13 global => { keywords => [qw/foo/], stopwords => [qw/foo31/], assets_dir => 'assets/' }, 14 14 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)