Skip to content

Instantly share code, notes, and snippets.

View taiyoh's full-sized avatar
👶

taiyoh taiyoh

👶
View GitHub Profile
#!/usr/bin/env perl
use strict;
use warnings;
use Text::MicroTemplate qw/:all/;
use YAML qw/Dump/;
my $text = << '...';
<?= $hoge ?>
@taiyoh
taiyoh / gist:117938
Created May 26, 2009 07:24
append test for ark-perl/t/004_forward.t
diff --git a/t/004_forward.t b/t/004_forward.t
index 3130ffa..21f8bb8 100644
--- a/t/004_forward.t
+++ b/t/004_forward.t
@@ -42,6 +42,16 @@ use Test::Base;
my ($self, $c) = @_;
$c->res->{body} .= 'six_';
}
+
+ sub seven : Local {
diff --git a/lib/Ark/Test.pm b/lib/Ark/Test.pm
index 9ec8f11..4f0eec4 100644
--- a/lib/Ark/Test.pm
+++ b/lib/Ark/Test.pm
@@ -5,6 +5,8 @@ use HTTP::Request;
use HTTP::Engine;
use HTTP::Cookies;
+use YAML qw/Dump/;
+
diff --git a/lib/Ark/View/MT.pm b/lib/Ark/View/MT.pm
index 7ba34a0..c809199 100644
--- a/lib/Ark/View/MT.pm
+++ b/lib/Ark/View/MT.pm
@@ -75,7 +75,7 @@ sub render {
or return;
my $renderer = $self->build_template($template . $self->extension);
- $renderer->($self->context, @_)->as_string;
+ $renderer->($self, $self->context, @_)->as_string;
package ArkApp::View::MTFile;
use Ark 'View::MTFile';
has '+wrapper' => default => 'wrapper';
has '+wrapper_pre' => default => sub {
my $self = shift;
return '<? $self->wrapper_file(\'' . $self->wrapper . $self->extension . "')->( sub {?>";
};
diff --git a/lib/Text/MicroTemplate/Extended.pm b/lib/Text/MicroTemplate/Extended.pm
index d775b80..0474663 100644
--- a/lib/Text/MicroTemplate/Extended.pm
+++ b/lib/Text/MicroTemplate/Extended.pm
@@ -34,15 +34,17 @@ sub block {
code => \$code,
};
- my \$current_ref = \$$self->{package_name}::_MTREF;
- my \$block_ref = \$block->{context_ref};
// very very simple js validation?
var Validation = {
form : {
nickname : [[
function (data) { return data.length <= 10; },
'10文字以内で入力してください'
]],
rating : [[
function (data) { return 1 <= data && data <= 5; },
'1〜5までの数字からお選びください'
diff --git a/lib/Ark/Action.pm b/lib/Ark/Action.pm
index e6565b3..5dd972c 100644
--- a/lib/Ark/Action.pm
+++ b/lib/Ark/Action.pm
@@ -21,6 +21,14 @@ has controller => (
no Mouse;
+do {
+ my %contained_action_class;
use Test::Base;
plan 'no_plan';
{
package T;
use Ark;
package T::MyActionClass;
use Mouse::Role;
# 他のポート番号を指定する際につけてください
#port = 3128
# デバッグオプションを有効にしたいときにつけてください
#debug = 1
# プロキシサーバへつなぐ為のパラメータ。ホスト名かIPを指定してください
#domain = hogehoge.local
[www.example.com]
/path/to/remote.js = /path/to/local.js