Permalink
Browse files

made Makefile writing style simple

  • Loading branch information...
1 parent 0ac0210 commit fa84ef774db8fcd4d98f3910062445fc24c5d168 @dann committed Jan 24, 2009
View
@@ -1,3 +1,6 @@
+use strict;
+use warnings;
+
#use lib 'privinc';
use inc::Module::Install;
@@ -24,68 +27,70 @@ if (HAVE_MP) {
name 'Angelos';
all_from 'lib/Angelos.pm';
-# Core
-requires 'Mouse' => '0.14';
-requires 'HTTP::Engine' => 0;
-requires 'HTTP::Router' => 0;
-requires 'HTTP::Session' => 0;
-requires 'Module::Pluggable::Object' => 0;
-requires 'UNIVERSAL::require' => 0;
-requires 'Log::Dispatch::Config' => 0;
-requires 'Log::Dispatch::Configurator' => 0;
-requires 'Log::Dispatch::Configurator::YAML' => 0;
-requires 'Log::Dispatch::Colorful' => 0;
-requires 'String::CamelCase' => 0;
-requires 'Path::Class' => 0;
-requires 'Devel::InnerPackage' => 0;
-requires 'Exception::Class' => 0;
-requires 'File::Spec' => 0;
-requires 'IO::Pager' => 0;
-requires 'Class::Singleton' => 0;
-requires 'Params::Validate' => 0;
-requires 'Class::Method::Modifiers::Fast' => 0;
-
-# components
-requires 'Template' => 0;
-
-# i18n
-requires 'Locale::Maketext::Simple' => 0;
-requires 'Locale::Maketext::Extract' => 0;
-
-# config
-requires 'Kwalify' => 0;
-requires 'YAML' => 0;
-requires 'Data::Visitor::Callback' => 0;
-
-# script
-requires 'Pod::Simple::Text' => 0;
-requires 'MouseX::Getopt' => 0;
-requires 'IPC::System::Simple' => 0;
-requires 'App::Cmd' => 0;
-requires 'Module::Setup' => 0;
-requires 'FindBin::libs' => 0;
-requires 'File::Slurp' => 0;
-requires 'File::HomeDir' => 0;
-requires 'Devel::EvalContext' => 0;
-
-# BootLoader Plugins
-requires 'Text::SimpleTable' => 0;
-requires 'File::Find::Rule' => 0;
-requires 'Term::ReadLine' => 0;
-requires 'JSON::XS' => 0;
-requires 'MIME::Types' => 0;
-
-# Controller Plugins (remove from core)
-requires 'HTML::FillInForm' => 0;
-requires 'FormValidator::Simple' => 0;
-
-# View Plugins (remove from core)
-
-# Middleware
-requires 'HTTP::MobileAgent' => 0;
-requires 'Encode::JP::Mobile' => 0;
-requires 'HTTP::MobileAgent::Plugin::Charset' => 0;
-requires 'Data::Visitor::Encode' => 0;
+requires(
+ # Basics
+ 'Mouse' => '0.14',
+ 'HTTP::Engine' => 0,
+ 'HTTP::Router' => 0,
+ 'HTTP::Session' => 0,
+ 'Module::Pluggable::Object' => 0,
+ 'UNIVERSAL::require' => 0,
+ 'Log::Dispatch::Config' => 0,
+ 'Log::Dispatch::Configurator' => 0,
+ 'Log::Dispatch::Configurator::YAML' => 0,
+ 'Log::Dispatch::Colorful' => 0,
+ 'String::CamelCase' => 0,
+ 'Path::Class' => 0,
+ 'Devel::InnerPackage' => 0,
+ 'Exception::Class' => 0,
+ 'File::Spec' => 0,
+ 'IO::Pager' => 0,
+ 'Class::Singleton' => 0,
+ 'Params::Validate' => 0,
+ 'Class::Method::Modifiers::Fast' => 0,
+
+ # Config
+ 'Kwalify' => 0,
+ 'YAML' => 0,
+ 'Data::Visitor::Callback' => 0,
+
+ # Script
+ 'Pod::Simple::Text' => 0,
+ 'MouseX::Getopt' => 0,
+ 'IPC::System::Simple' => 0,
+ 'App::Cmd' => 0,
+ 'Module::Setup' => 0,
+ 'FindBin::libs' => 0,
+ 'File::Slurp' => 0,
+ 'File::HomeDir' => 0,
+ 'Devel::EvalContext' => 0,
+
+ # BootLoader Plugins
+ 'Text::SimpleTable' => 0,
+ 'File::Find::Rule' => 0,
+ 'Term::ReadLine' => 0,
+ 'JSON::XS' => 0,
+ 'MIME::Types' => 0,
+
+ # Components
+ 'Template' => 0,
+
+ # I18N
+ 'Locale::Maketext::Simple' => 0,
+ 'Locale::Maketext::Extract' => 0,
+
+ # Controller Plugins (remove from core)
+ 'HTML::FillInForm' => 0,
+ 'FormValidator::Simple' => 0,
+
+ # 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) {
Apache::TestMM::filter_args();
@@ -99,21 +104,22 @@ else {
author_tests('xt');
}
-test_requires 'Test::More' => 0;
-test_requires 'Test::Differences' => 0;
-test_requires 'Test::Deep' => 0;
-test_requires 'Test::Exception' => 0;
-test_requires 'Test::MockObject' => 0;
-test_requires 'Test::Class' => 0;
-test_requires 'Test::TCP' => 0;
-test_requires 'LWP::UserAgent' => 0;
-test_requires 'Module::Load::Conditional' => 0;
-test_requires 'Carp::Always' => 0;
-test_requires 'Module::Install::AuthorTests' => 0;
+test_requires(
+ 'Test::More' => 0,
+ 'Test::Differences' => 0,
+ 'Test::Deep' => 0,
+ 'Test::Exception' => 0,
+ 'Test::MockObject' => 0,
+ 'Test::Class' => 0,
+ 'Test::TCP' => 0,
+ 'LWP::UserAgent' => 0,
+ 'Module::Load::Conditional' => 0,
+ 'Carp::Always' => 0,
+ 'Module::Install::AuthorTests' => 0,
+);
install_script 'bin/angelos';
use_test_base;
auto_include;
WriteAll;
-
@@ -68,6 +68,7 @@ sub action {
$self->_match->params->{action};
}
+# TODO change interface
# redirect_to( action => $action) ?
# redirect_to( url => $url) ?
sub redirect {
@@ -88,8 +89,7 @@ sub forward {
@_,
{ action => 1, # required
controller => { type => SCALAR },
-
- #params => { type => HASHREF },
+ params => { optional => 1, type => HASHREF },
}
);
my $controller ||= $forward_to{controller};
@@ -15,6 +15,10 @@ sub wrap {
sub overload_request_method {
my ( $self, $req ) = @_;
+
+ my $method = $req->method;
+ return $req unless $method && uc $method eq 'POST';
+
my $overload = $req->param('_method')
|| $req->param('x-tunneled-method')
|| $req->header('X-HTTP-Method-Override');
@@ -1,7 +1,6 @@
package Angelos::Middleware::Session;
use Angelos::Class;
use HTTP::Session;
-use Angelos::Config;
use UNIVERSAL::require;
BEGIN {
@@ -34,7 +33,7 @@ has 'state' => (
has 'id' => (
is => 'rw',
- default => 'HTTP::Session::ID::MD5'
+ default => 'HTTP::Session::ID::SHA1'
);
sub wrap {
@@ -47,7 +46,7 @@ sub wrap {
$req->session->response_filter($res);
$req->session->finalize;
$res;
- }
+ }
}
sub build_session {
@@ -4,8 +4,6 @@ components:
- module: A
plugins:
- engine:
- - module: Session
controller:
- module: ActionProfiler
@@ -0,0 +1,2 @@
+#!/bin/sh
+perl -Ilib -MTest::Continuous -e runtests

0 comments on commit fa84ef7

Please sign in to comment.