Giter Site home page Giter Site logo

amon's Issues

5.08+ fails on perl-5.19.4: needs HTTP::Session

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 

New generated app from 5.06 still needs Router::Simple

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? :)

Amon2 4.x should depend/recommend Teng

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.

依存モジュールのご連絡 HTTP::Session::Store::OnMemory

009_csrf_defender.t が HTTP::Session::Store::OnMemory 及び String::Random に依存しているのでテストの際、インストールが必要でした。
String::Random は 002_router_simple.t では Test::Requires に指定されていました。

Web::Request->uri_with(): URIエンコードのバグ

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からやり直すとバグが再現する

Use jquery 2.0.x by default.

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.

is config read only?

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の実装はまずいのかなと思いました!

という、テストケースもつけないバグ報告ですみません><

Windowsでもエラー出ないように

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;

admin.psgi の typo

admin.psgi の 25行目の adin は admin ではないでしょうか?

        root => File::Spec->catdir(dirname(__FILE__), 'static', 'adin');

amon2 シンプルで勉強になります。

Minilla friendly dist.

Current Amon5's Build.PL is hacked well. It's not minil friendly.
Code move to builder/MyBuilder.pm.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.