tokuhirom / amon Goto Github PK
View Code? Open in Web Editor NEWyet another web application framework
Home Page: http://amon.64p.org/
License: Other
yet another web application framework
Home Page: http://amon.64p.org/
License: Other
/* test; */
みたいなSQLに対応できません。まともな対応は難しいと思うので、テーブルのセットアップをフレーバーから外すべきかと。
add nginx.conf
@kazeburo suggests to create server runner script instead of creating .psgi file.
I agreed this thing. Then, Amon2 5.00 will not create app.psgi and create script/foo-server instead.
.
uri_with()でURIエンコードがうまくいかないケースがある
原因はよくわかりませんでした
$ amon2-setup.pl MyApp && cd MyApp
$ carton install
### tmpl/index.tt に記述して http://localhost:5000/?q=%E3%81%82 へアクセス(q=あ)
# <a href="[% uri_with() %]">uri_with()</a>: [% uri_with() %]<br>
# <a href="[% uri_with({}) %]">uri_with({})</a>: [% uri_with({}) %]<br>
# <a href="[% uri_with({page => 1}) %]">uri_with({page => 1})</a>: [% uri_with({page => 1}) %]<br>
$ carton exec plackup
# 3つのうち、uri_woth()の出力が違ってるものがある(3つ目のuri_with)
### 開いて何も編集せずに上書き保存
$ vim local/lib/perl5/Amon2/Web/Request.pm
$ carton exec plackup
# なぜか3つの出力が同じになってる!!!
# この後、local/を削除してcarton installし直してもバグは再現しない
# amon2-setup.plからやり直すとバグが再現する
Amon.pmのL28
- $libpath;
+ $libpath || '.';
にしたら正常に動きました。
軽い変更だったので、forkとかはしてません。
plugin the JS assets, etc.
009_csrf_defender.t が HTTP::Session::Store::OnMemory 及び String::Random に依存しているのでテストの際、インストールが必要でした。
String::Random は 002_router_simple.t では Test::Requires に指定されていました。
This is a serious issue..
FormValidator::Lite docs. or plugin?
Seems like new Amon2 needs an explicit dep on HTTP::Session for the CSRF defender test?
t/600_plugins/008_no_cache.t ................... skipped: Test requires module 'HTTP::Session' but it's not found
Can't locate HTTP/Session/Store/OnMemory.pm in @INC (you may need to install the HTTP::Session::Store::OnMemory module) (@INC contains: /home/zakame/.cpanm/work/1382262323.4252/Amon2-5.09/blib/lib /home/zakame/.cpanm/work/1382262323.4252/Amon2-5.09/blib/arch /home/zakame/.cpanm/work/1382262323.4252/Amon2-5.09/_build/lib /home/zakame/.plenv/versions/5.19.4/lib/perl5/site_perl/5.19.4/x86_64-linux /home/zakame/.plenv/versions/5.19.4/lib/perl5/site_perl/5.19.4 /home/zakame/.plenv/versions/5.19.4/lib/perl5/5.19.4/x86_64-linux /home/zakame/.plenv/versions/5.19.4/lib/perl5/5.19.4 .) at t/600_plugins/009_csrf_defender.t line 35.
BEGIN failed--compilation aborted at t/600_plugins/009_csrf_defender.t line 35.
t/600_plugins/009_csrf_defender.t ..............
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run
.
admin.psgi の 25行目の adin は admin ではないでしょうか?
root => File::Spec->catdir(dirname(__FILE__), 'static', 'adin');
amon2 シンプルで勉強になります。
TMT work with perl5.8.1
amon-setup.pl でプロジェクトを作成し、
$ perl Makefile.PL
$ make && make test
すると、blib内にtmplフォルダがない。tmpl見つからない。といった内容のエラーが出ます。
#perl-casualで相談してたらtを書き換える、こんな解決法が出ました。
http://gist.github.com/262149
Make http://twitter.github.com/bootstrap/ as default CSS framework.
.
Older IE was mostly gone. Use jQuery 2.x.x by default.
If user want to support older IEs, users can replace jquery by himself.
Banners should say "carton exec perl script/foo-server"
Current version of standalone script is not installable. Maybe.
Current version of Amon2 contains only three files from bootstrap. There is no reason to strip.
diff --git a/lib/Amon2/Setup/VC/Git.pm b/lib/Amon2/Setup/VC/Git.pm
index 08eb3d1..b1b9284 100644
--- a/lib/Amon2/Setup/VC/Git.pm
+++ b/lib/Amon2/Setup/VC/Git.pm
@@ -18,7 +18,7 @@ sub do_import {
!system("git init") or die $?;
!system("git add .") or die $?;
- !system("git commit -m 'initial import'") or die $?;
+ !system("git commit -m \"initial import\"") or die $?;
}
1;
Jonk?
.
Will it be deprecated?
add a API dispatcher taken from Ukigumo
Now,after_dipatch,before_dispath is available in MyApp::Web.I wanna add after_dipatch,before_dispath on individual Controllers.Please!
.
https://github.com/tokuhirom/Amon/blob/master/lib/Amon2/Plugin/Web/HTTPSession.pm#L19
重箱の隅をつつくような報告で恐縮します。
パッケージ名でなく "__PACKAGE__"
というキーが指定されています。
https://github.com/tokuhirom/Amon/blob/master/lib/Amon2/Setup/Flavor/Minimum.pm#L148
ここでconfigに書き込みしてしまっている。
MyApp
MyApp::PC -> MyApp
MyApp::Admin -> MyApp
があるときに(Flavor::Largeで作るとこうなりますね)
MyApp->config;
MyApp::PC->config;
MyApp::Admin->config;
の順に呼ぶと
https://github.com/tokuhirom/Amon/blob/master/lib/Amon2.pm#L46
ここでconfigメソッドが定義されてしまう関係上
その三つの->configが返すのは同じreferenceになってしまうので
最初に提示した
view_conf->{path}
が、MyApp::PCとMyApp::Adminで一緒になってしまう。
で、ここはまあ事前に
$view_conf = +{ %{$view_conf} };
としてあげれば解決するわけですが
もし、Amonのポリシーとしてconfigは読み込み専用としないのであればsub configの実装はまずいのかなと思いました!
という、テストケースもつけないバグ報告ですみません><
Can't locate feature.pm in @inc~というのが出るので確認したら、Test::Requiresにfeatureが書かれてないからみたいです。
Seems that Amon2::Web::Dispatcher::Lite still calls Router::Simple and not Router::Boom:
[zakame@yorozuya:~/src/TmpSpike] master* ± carton exec perl -Ilib script/tmpspike-server
Can't locate Router/Simple.pm in @INC (@INC contains: script/../lib lib /home/zakame
/src/TmpSpike/local/lib/perl5/x86_64-linux /home/zakame/src/TmpSpike/local
/lib/perl5 /home/zakame/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/x86_64
-linux /home/zakame/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2 /home/zaka
me/perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2/x86_64-linux /home/zakame/perl5/perlb
rew/perls/perl-5.14.2/lib/5.14.2 .) at /home/zakame/src/TmpSpike/local/lib/perl
5/Amon2/Web/Dispatcher/Lite.pm line 5.
BEGIN failed--compilation aborted at /home/zakame/src/TmpSpike/local/lib/perl5/
Amon2/Web/Dispatcher/Lite.pm line 5.
Compilation failed in require at script/../lib/TmpSpike/Web/Dispatcher.pm line
5.
I know Amon2::Web::Dispatcher::Lite is going to be split off its own dist soon though, so probably its time for the boilerplate in $APP/Web/Dispatcher.pm to be updated? :)
Plack::Request does not cache the uri object. It hits high traffic web sites.
test_psgiでAmon::WebのPlack::Request->new($env)の$envがハッシュリファレンスじゃないようでエラーが出ているよう。
Current Amon5's Build.PL is hacked well. It's not minil friendly.
Code move to builder/MyBuilder.pm.
I often use it.
From a freshly-set up Amon2 install and doing amon2-setup.pl HelloFromKoding
:
guest-141158@vm-0:~/work/HelloFromKoding$ plackup -r
Watching ./lib app.psgi for file updates.
Error while loading /home/guest-141158/work/HelloFromKoding/app.psgi: Can't locate Teng/Schema/Declare.pm in @INC (you may need to install the Teng
::Schema::Declare module) (@INC contains: /home/guest-141158/work/HelloFromKoding/lib /home/guest-141158/work/HelloFromKoding/extlib/lib/perl5 /hom
e/guest-141158/.plenv/versions/5.18.1/lib/perl5/site_perl/5.18.1/x86_64-linux /home/guest-141158/.plenv/versions/5.18.1/lib/perl5/site_perl/5.18.1
/home/guest-141158/.plenv/versions/5.18.1/lib/perl5/5.18.1/x86_64-linux /home/guest-141158/.plenv/versions/5.18.1/lib/perl5/5.18.1 .) at /home/gues
t-141158/work/HelloFromKoding/lib/HelloFromKoding/DB/Schema.pm line 6.
BEGIN failed--compilation aborted at /home/guest-141158/work/HelloFromKoding/lib/HelloFromKoding/DB/Schema.pm line 6.
Compilation failed in require at /home/guest-141158/work/HelloFromKoding/lib/HelloFromKoding.pm line 8.
BEGIN failed--compilation aborted at /home/guest-141158/work/HelloFromKoding/lib/HelloFromKoding.pm line 8.
Compilation failed in require at /home/guest-141158/.plenv/versions/5.18.1/lib/perl5/5.18.1/parent.pm line 20.
BEGIN failed--compilation aborted at /home/guest-141158/work/HelloFromKoding/lib/HelloFromKoding/Web.pm line 5.
Compilation failed in require at /home/guest-141158/work/HelloFromKoding/app.psgi line 9.
BEGIN failed--compilation aborted at /home/guest-141158/work/HelloFromKoding/app.psgi line 9.
I know, the new app's cpanfile
itself does depend on Teng, but what I mean is that the Amon2 installation should ought to get Teng installed as well (as expected from a new user's perspective.) Or, at the very least, have some blurb at the end of the amon2-setup run for the Basic flavor about installing Teng before further work on the new app.
Flavor's architecture and Plugin's flavor architecture.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.