Camelia, the Perl 6 bug

IRC log for #mojo, 2010-09-08

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:15 tempire joined #mojo
00:15 ash_ left #mojo
00:15 Kulag left #mojo
00:16 Kulag joined #mojo
01:15 Drossel joined #mojo
01:16 Kulag left #mojo
01:21 Drossel is now known as Kulag
01:21 [1]awnstudio joined #mojo
01:26 awnstudio left #mojo
01:26 [1]awnstudio is now known as awnstudio
01:41 [1]awnstudio joined #mojo
01:45 awnstudio left #mojo
01:45 [1]awnstudio is now known as awnstudio
01:58 Kulag left #mojo
01:58 Kulag joined #mojo
02:29 xantus_ left #mojo
02:29 ash_ joined #mojo
02:35 janus left #mojo
02:37 ash_ left #mojo
02:38 Foxcool joined #mojo
02:43 garu hey guys, anyone had luck setting up mojolicious::lite on dreamhost?
02:43 garu I could use some help :)
02:48 janus joined #mojo
02:49 garu (with fcgi)
03:09 yakudzo joined #mojo
04:03 tholen42 joined #mojo
04:05 tl left #mojo
04:19 garu I keep getting "FastCGI: incomplete headers (0 bytes) received from server"
04:29 garu neither mojolicious nor lite work :(
04:30 garu and the setup seems to be right, since the same steps with catalyst work :/
04:30 * garu even tried forcing 'fcgi'
05:11 ysyrota joined #mojo
05:19 memememomo joined #mojo
05:28 koban joined #mojo
05:28 koban left #mojo
05:28 koban joined #mojo
06:29 xantus_ joined #mojo
06:55 zakame hmmm from a plugin, how does one throw an error page (say, the plugin is given bad input)
07:04 sri garu: define "forcing fcgi"
07:04 sri zakame: die?
07:06 zakame would that set server status and all to say an error 500?
07:06 sri possibly
07:06 zakame though I haven't tried die, will do...
07:22 zakame hmmm die works as far as propagating my error to MojoX::Dispatcher::Routes and Mojolicious::Controller, but it doesn't render an error page... (pasting log shortly)
07:22 sri zakame: maybe you didn't give me enough information
07:23 sri zakame: are you talking about a helper or a hook?
07:23 zakame yeah more likely that :)  I'm adding a test to my write_excel plugin checking if a given setting is defined...
07:26 zakame and if not defined, I'd want to throw a 500 error page instead of the spreadsheet
07:29 ltriant left #mojo
07:31 zakame
07:32 zakame http://pastebin.com/MH2H6Fwm
07:34 sri no idea, quite sure that case has tests
07:46 GitHub65 joined #mojo
07:46 GitHub65 mojo: master Sebastian Riedel * 733079a (1 files in 1 dirs): added tests - http://bit.ly/9A6Ow8
07:46 GitHub65 left #mojo
07:46 sri zakame: that should be your exact case, works flawless in tests
07:52 zakame the die I'm doing comes from my renderer, not a helper (i'm not sure if there's a difference though)
08:01 spleenjack joined #mojo
08:22 sri zakame: yes....that information would have been essential -.-
08:23 sri a renderer should not die
08:28 marcus hmm
08:28 marcus showmetheshell stopped working for me with mojolicious trunk
08:29 marcus can't use string "...." as a subroutine reference at template line 8.
08:29 marcus <%== stash('js')->() if stash 'js' %>
08:30 marcus I guess it's related to the new block syntax?
08:30 sri marcus: and you're certain it's a bug?
08:31 marcus sri: it worked last week when I tested it, and now it's broken
08:31 sri make a test case
08:31 marcus vti can do it, it's his code.
08:31 marcus I am at a conference stand atm
08:31 sri don't think there have been any changes to the shash helper though
08:32 marcus %{ stash js =>
08:32 sri eww
08:32 marcus yeah, vti does evil thing
08:32 marcus +s
08:32 sri that syntax has been broken for ages
08:33 sri you must have had am ancient version of mojolicious
08:33 sri *an
08:33 marcus I doubt that
08:34 omega git bisect!
08:34 yko joined #mojo
08:34 GitHub190 joined #mojo
08:34 GitHub190 mojo: master Sebastian Riedel * f98eec5 (5 files in 5 dirs): fixed a bug where a broken renderer could cause a fatal exception - http://bit.ly/cGWfQm
08:34 GitHub190 left #mojo
08:35 sri it's not a bug btw
08:35 sri that syntax was unsupportable at some point
08:35 marcus it's pretty ugly.
08:36 sri vti just used undocumented accidental features :/
08:36 * sri waves fist angrily at vti
08:38 sri zakame: fixed
08:38 sri even broken renderers should work now
08:39 sri and the evil fatal exception should hopefully never be triggered
08:40 sri except for plugin hooks that screw up big time
08:40 sri but thats ok
08:49 yko left #mojo
08:58 vti marcus: fixed
09:20 koban left #mojo
09:28 zakame sri: thanks :) so as for my renderer trying to handle bad input, what should I do?
09:46 sri zakame: depends what you want to do, generally $c->render_exception(...) might be a good idea
09:52 koban joined #mojo
09:54 sri marcus: btw. did you print the flyer in color or bw?
09:54 zloyrusskiy joined #mojo
10:11 zakame sri: hmm looks like that does what I want :) thanks
10:13 perlrocks Twitter: "Doh! #mojolicious fails to build on #win32 #strawberry #perl" --rabenfeder http://twitter.com/rabenfeder/status/23901913313
10:25 sri !tweet @rabenfeder Already fixed in the github repo, http://github.com/kraih/mojo. :) #mojolicious #perl
10:25 perlrocks sri: http://twitter.com/perlrocks/status/23902511154
10:25 perlrocks Twitter: "@rabenfeder Already fixed in the github repo, http://github.com/kraih/mojo. :) #mojolicious #perl --sri" --perlrocks http://twitter.com/perlrocks/status/23902511154
10:29 perlrocks Twitter: "#mojolicious needs t-shirts and badges!" --rabenfeder http://twitter.com/rabenfeder/status/23902698097
10:29 sri !tweet @rabenfeder Agreed!
10:29 perlrocks sri: http://twitter.com/perlrocks/status/23902724390
10:46 yakudzo left #mojo
11:08 sri http://blog.kraih.com/actual-perl-marketing
11:13 perlrocks Twitter: "I really need to blog more, there is so much happening so fast. http://bit.ly/9lpCXa #mojolicious #perl" --kraih http://twitter.com/kraih/status/23904974982
11:28 Kulag left #mojo
11:29 Kulag joined #mojo
11:33 Kulag left #mojo
11:42 Kulag joined #mojo
11:46 perlrocks Twitter: "says pushed a new Mojolicious::Plugin::WriteExcel version http://tinyurl.com/2coshrx (dance) http://plurk.com/p/7g0ia9" --zakame http://twitter.com/zakame/status/23906833173
11:49 Kulag left #mojo
11:53 Kulag joined #mojo
11:57 esskar get '/tag/(*tag)' => {tag => qr(.+)} => 'tag';
11:57 esskar why is it routed /tag routed to the above route?
12:01 esskar why is &tag routed to the above route?
12:02 esskar why is /tag routed to the above route?
12:03 sri because your route is wrong
12:04 sri get '/tag/(*tag)' => [tag => qr(.+)] => 'tag';
12:04 sri thats what you want
12:04 sri hash is default values, array is constraints
12:06 esskar you are always right
12:06 esskar thanks again
12:08 sri ALL GLORY TO THE HYPNOSRI!
12:10 perlrocks Twitter: "The initial start page for a #mojolicious generated application could be friedlier with lighter and smoother fonts, a fancy graphic? #perl" --rabenfeder http://twitter.com/rabenfeder/status/23908372338
12:14 sri !tweet @rabenfder Agreed too. :)
12:14 perlrocks sri: http://twitter.com/perlrocks/status/23908563096
12:14 sri grr typo
12:14 sri !tweet @rabenfeder Agreed too. :)
12:14 perlrocks sri: http://twitter.com/perlrocks/status/23908607382
13:14 garu sri: "forcing fcgi" => app->start('fcgi')
13:21 garu sri: I tried both mojolicious and mojolicious::lite, renaming the binary to dispatch.fcgi like dreamhost wiki tells me to, and adding the use lib qw(...) with the proper local::lib paths :(
13:28 awnstudio left #mojo
13:28 zloyrusskiy left #mojo
13:34 dotan left #mojo
13:40 sri garu: do you mean app->start('fastcgi')?
13:41 garu ooh, could that be it? :)
13:41 sri the fcgi backend doesn't exist anymore
13:41 sri and it was never in the core package i think
13:43 garu my mistake then, I must have read it here
13:43 garu let's see
13:44 perlrocks Twitter: "Why when I read the source code # mojolicious I have a feeling that I do not know # Perl =)? I would strenuously to learn!" (ru) --xomaa http://twitter.com/xomaa/status/23914982019
13:46 garu no dice... this is really weird, the cgi interface seems to work
13:46 garu oh!
13:46 garu wait
13:46 garu a-ha!
13:46 garu sri++
13:46 sri :)
14:00 arthas joined #mojo
14:17 * sri needs waffles
14:37 Rhaen joined #mojo
14:37 Rhaen *bows* I am new here. *bows*
14:38 Rhaen Just started to look into mojo
14:39 MojoGuest388 joined #mojo
14:39 MojoGuest388 From: http://www.google.com/search?sourceid=c​hrome&amp;ie=UTF-8&amp;q=websocket+demo (8 hits)
14:39 MojoGuest388 test
14:39 MojoGuest388 left #mojo
14:39 * sri waves
14:42 garu Rhaen: welcome :)
14:43 MojoGuest915 joined #mojo
14:43 MojoGuest915 From: http://www.google.com/search?sourceid=c​hrome&amp;ie=UTF-8&amp;q=websocket+demo (9 hits)
14:44 MojoGuest915 left #mojo
14:44 yko joined #mojo
14:46 garu sri: dreamhost really needs 'fastcgi'... their problem, or something we can try to improve detection-wise?
14:46 sri garu: you tell me :)
14:47 sri right now we detect fastcgi because most implementations have nothing in %ENV at startup
14:48 garu lemme change the app so it dumps %ENV on the page
14:48 sri return 'fastcgi' unless defined $ENV{PATH};
14:48 sri thats our current check
14:50 sri it's in Mojo::Commands
14:51 garu wow... Dumper(\%ENV) is... verbose
14:53 garu yeah, PATH is there alright
14:53 garu /usr/local/bin:/usr/bin:/bin
14:54 sri so we need something else
14:54 garu doesn't fastcgi need an env var of some kind?
14:54 sri none
14:55 sri everything is sent over the wire
14:55 garu crap :)
14:55 sri maybe apache sets a version or so?
14:56 sri nopaste please
14:58 garu sri: http://gamehunt.net/env
14:59 sri RAILS_ENV haha
15:00 sri 'FCGI_ID' => 1,?
15:00 garu well, since I had to activate PHP+FastCGI to use Perl, nothing else surprises me :)
15:00 sri thats like perfect
15:00 garu yup
15:00 garu that's what I thought
15:00 garu which I why I asked about those env vars earlier... I see two in DH
15:00 garu that one, and FCGI_ROLE
15:03 GitHub130 joined #mojo
15:03 GitHub130 mojo: master Sebastian Riedel * e621e89 (2 files in 2 dirs): improved FastCGI detection for Dreamhost - http://bit.ly/aLR9sF
15:03 GitHub130 left #mojo
15:03 sri that should do it :)
15:03 garu sri++
15:04 garu I wonder if this will have setbacks when trying to run a dev server on dreamhost
15:04 sri how so?
15:04 garu then again, it would be called as ./myapp daemon
15:04 garu so, nevermind :)
15:05 sri yea, FCGI_ env vars come from mod_fcgi
15:05 sri ROLE is very specific
15:05 sri same for ID i guess
15:05 xantus__ joined #mojo
15:06 sri having both in %ENV is actually rather weird
15:06 garu because one of the steps to make sure the app is running is to, before creating a .htaccess with the fastcgi rules, one of the ways to test your app is calling the .pl from the web, which should invoke it as cgi
15:07 koban left #mojo
15:07 xantus__ any recent changes that would break: $self->render( action => 'login_redirect' );
15:07 sri i doubt mod_cgi sets those env vars too
15:07 sri xantus: i hope not
15:07 garu so, "if it's working as cgi, here's what you should do to make it run as fastcgi"
15:07 sri garu: cgi detection has priority anyway
15:08 sri doesn't reach fastcgi if it can detect cgi
15:08 garu cool
15:09 garu if this fails - which I don't think it will - one could always check $0 for .cfgi suffix
15:09 garu err .fcgi
15:09 sri yea, we'll see
15:10 sri *crosses fingers*
15:10 garu they recommend you call your app's dispatcher "dispatch.fcgi" to avoid it being killed by their process killer
15:10 garu not sure if it's standard procedure for fcgi apps
15:10 garu anyway, let's see how it goes :)
15:10 sri Oo
15:13 xantus___ joined #mojo
15:13 xantus__ left #mojo
15:14 xantus___ ARG
15:14 xantus___ is now known as xantus[]
15:16 garu hmm
15:16 garu no worky :(
15:19 xantus[] left #mojo
15:22 xantus[] joined #mojo
15:23 xantus[] left #mojo
15:23 garu wth...it doesn't seem to find that env var
15:24 sri Oo
15:24 sri oh, so it gets set on every request
15:25 sri ok, maybe we can use something that's not there
15:25 sri any windows users here?
15:26 sri i would need to know whats in their %ENV by default
15:26 garu it could be DH lagging on us
15:26 sri maybe $ENV{SHELL} or $ENV{HOME}
15:27 sri or even $ENV{USER}
15:27 garu (as I'm forcing fastcgi again and nothings happening)
15:27 sri windows users i need you!
15:27 sri oh
15:30 Kulag left #mojo
15:33 garu sigh
15:33 garu ok, got it working again
15:34 ysyrota left #mojo
15:35 GitHub188 joined #mojo
15:35 GitHub188 mojo: master Sebastian Riedel * 19bc21d (1 files in 1 dirs): improved FastCGI detection again - http://bit.ly/cJlZDZ
15:35 GitHub188 left #mojo
15:35 garu sri: yeah, it doesn't see that env var before starting the app
15:36 sri try that one :)
15:36 sri TMP variations might work better
15:37 sri TMP and TEMP can be traced back to windows 95
15:37 sri TMPDIR on os x
15:38 garu but... would this relate well to fastcgi
15:38 garu ?
15:38 * garu tries anyway
15:38 sri not at all
15:38 garu ah... !defined :)
15:38 sri but it's a good indicator for shell invokation
15:38 garu indeed... maybe better than path
15:40 dotan joined #mojo
15:41 garu I believe a 'yay' is in order :)
15:41 garu but... DH doesn't have a TMP env var on the shell
15:42 Kulag joined #mojo
15:42 garu hmmm... neither does my ubuntu :P
15:42 sri :S
15:42 sri what does it have?
15:42 garu either I'm blind or... nothing
15:42 garu wth
15:43 sri nopaste please both :)
15:43 sri nevermind, i have a cluster of ubuntu machines...
15:44 sri *smacks forehead*
15:44 garu heh
15:45 yko left #mojo
15:47 GitHub168 joined #mojo
15:47 GitHub168 mojo: master Sebastian Riedel * 422f271 (1 files in 1 dirs): improved FastCGI detection again - http://bit.ly/bEC7Ib
15:47 GitHub168 left #mojo
15:48 sri garu: don't you dare saying it doesn't work! :)
15:49 sri i guess USER and WINDIR are good choices
15:53 garu let's see
15:56 garu w00t!
15:56 garu \o/
15:56 garu now we're talking!
15:56 xantus[] joined #mojo
15:56 sri \o/
15:56 garu sri: fastcgi on the server, plain mojolicious sweetness on the CLI
15:57 garu sri++
16:02 perlrocks Twitter: "Time to drive home. First steps with #mojolicious had been made. I decided to play around with the templating first. *ugh*, complex!" --rabenfeder http://twitter.com/rabenfeder/status/23926504103
16:04 sri !tweet @rabenfeder It's just Perl. ;)
16:04 perlrocks sri: http://twitter.com/perlrocks/status/23926635794
16:04 sri but the begin/end stuff really needs to be released
16:05 sri go test helpers so i can release soon!!!
16:06 GabrielVieira joined #mojo
16:08 Rhaen left #mojo
16:10 josh803316 joined #mojo
16:11 ptomli joined #mojo
16:11 josh803316 In need of some help, if anyone is in a helping mood
16:12 josh803316 In my package Tasc::Auth  I try this:  $self->render( action => 'login_redirect' );   which should render the auth#login_redirect template
16:13 josh803316 but instead I just get The page you were requesting "/" could not be found.   (a redirect to /)
16:17 xantus[] left #mojo
16:17 xantus[]_ joined #mojo
16:17 josh803316 $auth->route( '/tasc' )->via( 'get' )->to( 'tascapp#index' )->name( 'tascapp' );   this takes me to $self->redirect( 'index' );  because the user hasn't logged in
16:18 josh803316 and that takes me to $auth->route( '/' )->via('get')->to( 'auth#index' )->name( 'index' );
16:21 josh803316 Is this the correct syntax, or did something change as I recently updated to the most recent mojo:  $self->render( action => 'login_redirect' );
16:24 sri josh803316: could be a bug actually
16:25 josh803316 any recommendation on a workaround?
16:25 sri wait 10 mins
16:25 josh803316 cool, thanks, I have a demo today in a couple hours that is pretty important so I really appreciate the help
16:28 xantus[]_ left #mojo
16:28 xantus[] joined #mojo
16:33 sri interesting, in my tests it actually just works, i have no idea why though Oo
16:35 josh803316 Hmmmm, so maybe I'm doing something wrong or is there still a logic flaw?
16:35 sri unsure
16:36 josh803316 it worked before and no code changed other than the mojo update.........so something is definitely different, but my original logic might have been flawed and the update just exposed it more....
16:36 sri like i said, i can't replicate it yet
16:37 josh803316 I'm working on it here trying to narrow it down as well........anything I can do to provide you more info?
16:37 ptomli do you remember what the last revision of mojo that it worked on?
16:38 sri think i have a fix, but no reliable test yet :S
16:38 josh803316 hang on, let me see if I have the history
16:39 ptomli interesting solution path there sri :)
16:39 xantus[] left #mojo
16:39 xantus[] joined #mojo
16:40 arthas left #mojo
16:40 sri i'll commit it so you can relax before your demo :)
16:41 GitHub96 joined #mojo
16:41 GitHub96 mojo: master Sebastian Riedel * 70c6c95 (2 files in 2 dirs): added tests - http://bit.ly/bIagj6
16:41 GitHub96 left #mojo
16:41 josh803316 Thanks a ton, I'll have to drink a couple virtual beers with you
16:41 sri \o/
16:42 sri now lets see how to trigger it
16:44 sri oh interesting
16:44 josh803316 hmmm, closer, now it redirects to the login page
16:45 josh803316 but it doesn't actually render the page
16:45 sri oO
16:45 josh803316 I keep seeing this
16:45 josh803316 Mojo::Server:58 [886]: Waiting for delayed response, forgot to render or resume?
16:45 sri that means nothing got rendered
16:45 sri not even a 404 which is very weird
16:46 sri the log should have more debug info
16:46 josh803316 I see GET's on all the files
16:46 josh803316 yeah, I'm looking at the log
16:49 josh803316 I see this
16:49 josh803316 Wed Sep  8 11:48:32 2010 debug Mojolicious:158 [1004]: GET /js/auth/login.js (Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.3) Gecko/20100402 Remi/fc12 Firefox/3.6.3).
16:49 josh803316 Wed Sep  8 11:48:32 2010 debug MojoX::Dispatcher::Static:76 [1004]: Serving static file "js/auth/login.js".
16:50 sri normal static request
16:50 josh803316 and when I view source I see the login file the way I would expect
16:50 josh803316 I'll debug this a little more......one sec
16:50 sri i don't see a relation
16:51 josh803316 yeah, what i mean is......it should be fine now, not sure why it isn't
16:51 josh803316 although I still see this after every "Serving" message
16:51 josh803316 Wed Sep  8 11:48:32 2010 debug Mojo::Server:58 [1004]: Waiting for delayed response, forgot to render or resume?
16:52 sri thats very weird
16:53 sri like your MojoX::Dispatcher::Static is from an older version of mojolicious
16:53 josh803316 ahhhh, let me copy and replace the update
16:55 xantus[] left #mojo
16:55 xantus[] joined #mojo
16:58 GitHub8 joined #mojo
16:58 GitHub8 mojo: master Sebastian Riedel * 53dbe70 (1 files in 1 dirs): improved test - http://bit.ly/cRV2Zb
16:58 GitHub8 left #mojo
16:58 sri ok that triggers it
17:01 spleenjack left #mojo
17:01 josh803316 k, let me test it
17:05 josh803316 Can't locate object method "helper" via package "Mojolicious::Lite" at /web/sites/mojo/t/mojolicious/lite_app.t line 53.
17:05 sri clear indicator your version is screwed
17:06 nuclon joined #mojo
17:06 nuclon evening :)
17:06 xantus[] left #mojo
17:06 sri josh803316: i suggest a clean reinstallation
17:06 * sri waves
17:06 josh803316 yeah, something is way off.........let me try to reinstall mojo
17:06 nuclon does Mojo::Message::Request have an method for getting user ip address?
17:07 josh803316 what would you recommend as the best way to reinstall.......remove all Mojo libs except git repo and cpan?
17:07 sri nuclon: thats in the transaction
17:07 sri josh803316: possibly remove *everything* :)
17:08 josh803316 k, I'm doing an updatedb and I'll search for everything
17:08 sri if tests run against the cpan version something is really screwed
17:08 josh803316 k
17:08 sri nuclon: $self->tx->remote_address or so
17:13 nuclon sri: yeah, already found it, thanks :)
17:18 sri oh, google ajax search is live
17:19 sri http://www.google.com/instant/#utm_campaign=​launch&amp;utm_medium=et&amp;utm_source=rpp
17:20 ptomli doesn't like me yet
17:20 ptomli ahh, it does on .com, not the regional servers
17:21 esskar_ left #mojo
17:21 ptomli and kills safari
17:21 sri my safari likes it
17:22 josh803316 hmmm, even after updating all the local perl mods with the git stuff, the page still doesn't display
17:22 josh803316 the test runs now though
17:22 ptomli hmm, seemed like a background request halted and then i got to dream of the beach for a while
17:23 josh803316 and I'm still getting this:  Wed Sep  8 12:22:01 2010 debug Mojo::Server:58 [1989]: Waiting for delayed response, forgot to render or resume?
17:24 sri are you sure it's coming from the static dispatcher?
17:25 sri that message means nothing got rendered
17:25 josh803316 yeah, and that's what I'm seeing,  nothing get rendered....how can I verify it came from the static dispatcher?
17:25 sri request just a static file
17:25 josh803316 MojoX::Dispatcher::Static:76 [1989]: Serving static file "favicon.ico".
17:25 josh803316 Wed Sep  8 12:24:32 2010 debug Mojo::Server:58 [1989]: Waiting for delayed response, forgot to render or resume?
17:26 josh803316 actually the static file worked
17:26 josh803316 but I still see this
17:26 josh803316 Wed Sep  8 12:24:32 2010 debug Mojolicious:158 [1989]: GET /favicon.ico (Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.55 Safari/534.3).
17:26 josh803316 Wed Sep  8 12:24:32 2010 debug MojoX::Dispatcher::Static:76 [1989]: Serving static file "favicon.ico".
17:26 josh803316 Wed Sep  8 12:24:32 2010 debug Mojo::Server:58 [1989]: Waiting for delayed response, forgot to render or resume?
17:27 sri doesn't make sense at all
17:27 sri i can't replicate it either
17:27 josh803316 I know, sorry to be such a pain in the arse..........how else can I narrow it down
17:27 sri please try turning it into a minimal test case
17:27 josh803316 k
17:29 ashleydev left #mojo
17:29 ashleydev joined #mojo
17:31 MojoGuest445 joined #mojo
17:31 MojoGuest445 From: http://www.google.no/url?sa=t&amp;source=we​b&amp;cd=2&amp;ved=0CBwQFjAB&amp;url=http%3​A%2F%2Fdev.xantus.org%2F&amp;rct=j&amp;q=we​bsocket%20demos&amp;ei=W8iHTKjeKp-VOIfU3LIM​&amp;usg=AFQjCNGw6nZv0wO42uzUnHhWcD0vcKNULg (1 hits)
17:31 GabrielVieira left #mojo
17:32 MojoGuest445 WebSockets are cool!
17:32 MojoGuest445 left #mojo
17:36 josh803316 sri, I don't have time to put a test case now......I reverted my mojo in my project and it's working
17:36 josh803316 I'll have to use that mojo for now and try to figure out the issue after the demo
17:36 josh803316 thanks for your help!!!!
17:36 sri sure, sadly nothing more i could do without a test case
17:38 josh803316 yeah, I'll try to create one later........I know there is something there that is off just not sure what it is
17:40 nuclon left #mojo
17:42 sri i hate it when planet.perl.org doesn't pick up my blog posts :(
17:44 ptomli rookie issue: i'm seeing a strict exception because $message isn't declared in template, from mojolicious generate
17:45 sri you changed the ->render(message => ..) call, didn't you?
17:45 ptomli no, but i did shuffle package names about...
17:46 sri well, somehow the message stash value doesn't reach the template
17:46 ptomli but the view being rendered suggests the request is getting routed to the right place, ish?
17:47 sri or that auto-rendering kicked in
17:47 sri a route without action but template still gets rendered
17:47 ptomli k, i'll dig, best way to learn anyhoo
17:48 ptomli the route is still the same as was generated
17:48 ptomli $r->route('/:controller/:actio​n/:id')->to('example#welcome', id => 1);
17:48 sri then it is auto-rendering
17:49 ptomli so GET / somehow is autorendering templates/example/welcome.html.ep
17:49 sri mojolicious will always try hard to generate content with whatever it can get :)
17:49 sri only if there's a route that matched
17:49 sri and the right stash keys to generate a template name are available
17:49 sri like :controller and :action
17:50 ptomli so the route matched, but the controller wasn't found, and so there's no 'message' in the stash
17:50 sri $r->route('/foo')->to(template => 'bar') would work for bar.html.ep for example
17:50 sri exactly
17:51 * ptomli ponders how GET / results in example/welcome
17:51 sri defaults i guess
17:51 sri in ->to(...)
17:51 ptomli doh
17:51 ptomli to('example#welcome', id => 1);
17:51 ptomli i'm an idiot
17:52 sri :)
17:54 ptomli and i knew i'd seen something to set the default namespace for controllers
17:54 sri use the guides luke
17:54 ptomli yeah, i found it again
17:55 ptomli does the dev log indicate when a controller has been matched/dispatched-to?
17:56 sri it used to
17:56 sri might have changed though with the application embedding change
17:58 janus is include in extends expected to work? (no test case, just hit it locally)
17:59 sri janus: of course, think it's tested indirectly through layout
17:59 ptomli bingo Result: PASS
17:59 janus local problem then, thanks
18:01 janus ewww, missing = :)
18:01 ptomli sri: to answer my own question, the dev log doesn't seem to show when a controller/action is hit
18:02 sri ptomli: lets see if i can bring it back then
18:02 ptomli :)
18:04 ptomli if everything except my login page and static resources is meant to be behind authentication, the best route is use a condition [plugin] on the route[s] that serve up the application?
18:05 marcus sri: printed in black and white. It worked well. Handed out like 10 of them.
18:07 GitHub168 joined #mojo
18:07 GitHub168 mojo: master Sebastian Riedel * 19e84b9 (1 files in 1 dirs): improved dispatcher debug messages - http://bit.ly/cGgZXD
18:07 GitHub168 left #mojo
18:07 sri ptomli: there ya go :)
18:08 sri marcus: that doesn't sound like much
18:08 ptomli muchos gracias
18:09 * sri cracks the whip
18:09 sri marcus: get us more minions!
18:10 ptomli at a con?
18:10 sri he's at javazone
18:10 ptomli converting the spring-mvc croud?
18:10 ptomli crowd*
18:12 sri wasn't it struts2 these days?
18:13 ptomli i dunno, i've recently launched a spring-mvc thing and declared that the last time i do a java web frontend
18:13 ptomli now i'm trying to come up with a plan to replace a mason monstrosity
18:15 marcus sri: yeah, color would probably have been better
18:15 marcus there's one more day of con tho
18:16 marcus we also had 4-5 people who we demoed the IRC websocket example to
18:16 marcus (the simple one, not xantus' one)
18:16 sri so few?
18:16 sri java dead? :)
18:17 ptomli lol
18:17 marcus no, but the communities stand was in a corner of the conference. Not that many java people care about non-java stuff
18:17 marcus we were next to the kindergarden ;)
18:17 sri lol
18:17 sri thats evil
18:17 marcus java programmers are mostly corporate tools, it seems
18:17 ptomli hey!
18:18 marcus :D
18:18 marcus ptomli: hit a nerve?
18:18 ptomli grrrr
18:19 spleenjack joined #mojo
18:19 ptomli for that, you can explain why magic i'm failing to incant to convince app->plugin to load my code.. the guide doesn't seem to offer anything special
18:20 ptomli basically i copied the werewolf example, but i'm seeing    Plugin "authenticated_condition" missing
18:21 ptomli some namespace setting for plugins maybe?
18:21 sri whats your plugin called?
18:21 ptomli XYZ::Web::Plugin::AuthenticatedCondition
18:21 sri thats it
18:21 sri it doesn't search the app namespace
18:22 ptomli my app is XYZ::Web
18:22 sri ye
18:22 ptomli ahh
18:22 ptomli so it must be in the mojo namespace
18:22 sri it defaults to Mojolicious::Plugin
18:22 sri app->plugins->namespaces
18:22 ptomli can i configure that, or do i ship my app with packages in the mojo namespace
18:22 ptomli ahh, cheers
18:23 sri guess we could add the app namespace by default
18:27 ptomli yeah, it's odd to have to [re]specify the default when adding mine
18:30 josh803316 Sri, I narrowed the issue down to the specific module.........I cleaned everything, installed the latest Mojo from git, it was broken as before. I reverted Mojo::Transaction::HTTP to the one from CPAN
18:30 josh803316 and it worked as I would normally expect
18:31 josh803316 that's all the debugging/test case stuff I can do until after the demo but hope that would help us in narrowing it down
18:45 esskar_ joined #mojo
18:46 sri ptomli: added (github bot seems to have missed it...)
18:47 sri josh803316: hmm, that might just be a sideeffect and not the actual cause
18:47 josh803316 probably true, I was afraid of that......later today I'll try to create a test case
18:48 sri it's prolly something very simple
18:48 josh803316 at least for now I have a workaround
18:48 sri just need a test and it will be fixed in no time
18:49 ptomli sri: looks good :)
18:49 marcus (test is an euphemism for bribe. Small unmarked bills only.)
18:50 sri did i mention how much i love the new helper methods?
18:50 ptomli is the only/best was to direct the same url via different HTTP methods to different controller subs by using multiple routes? or DSL like ::Lite
18:51 sri or a nested route i guess
18:52 sri my $a = $r->route('/foo'); $a->route->via('get')->to(...) and so on
18:52 ptomli yeah, i see
18:53 ptomli or i could use a ::Lite controller, embedded?
18:55 sri sure
18:55 sri http://pastie.org/1146478 # fun way to use "for" for nested routes :)
18:56 ptomli you're evil, i like it
18:58 marcus that is what she said
18:58 ptomli http://pastie.org/1146486
18:59 ptomli i tend to prefer using separate subs for get/post to keep things cleaner, not sure how that's going to work out for me with mojo
18:59 sri resetPassword looks out of place
19:00 ptomli reset-password# would result in Reset::Password though
19:00 sri reset_password
19:01 ptomli yeah, though personally not sure that's much better
19:01 sri it's more perlish for sure
19:02 ptomli indeed, must whack these corporate tool java tendencies with a soggy newspaper
19:02 sri indeed
19:15 ptomli reading quotes from cartoons is not helping me grok the sauce
19:22 ptomli are there helpers for adding elements to layout sections, i'm thinking about views saying stuff like "add this stylesheet to the head"?
19:31 sri you could do something similar with the content helper
19:31 sri not exactly the way you might expect it though
19:31 sri it's easy to add such a helper though
19:32 ptomli yeah, i kinda see it sorta-maybe possible, though it seems i'd be working with strings not arrays or whatnot, working up a pastie
19:32 sri ye
19:34 sri <% stack foo => begin %>A<% end %> <% stack foo => begin %>B<% end %> <%= stack 'foo' %>
19:34 sri and get AB
19:34 ptomli yeah
19:34 ptomli does extends allow passing stash values?
19:34 sri ye
19:35 Rhaen joined #mojo
19:35 Rhaen *bows* good evening
19:35 ptomli http://pastie.org/1146575
19:35 ptomli 'nin
19:35 * sri waves
19:36 ptomli it's rough, but i think gets the idea across. trying to emulate the ZF helpers, in a way
19:36 Rhaen wheew, this channel is so friendly!
19:37 sri just don't tell anyone! :)
19:38 Rhaen oh, no. I won't.
19:38 sri ptomli: looks like a good candidate for a plugin
19:39 ptomli expect so, i'll need to look at how the plugins work
19:39 ptomli what would a mojo-ish style be for something like this?
19:39 sri Mojolicious::Plugin::* should have an exampl for almost everything
19:40 sri *+e
19:40 Rhaen_ joined #mojo
19:41 sri ptomli: the scripts are loaded from the files and embedded into the head section right?
19:41 ptomli could be, or could be references
19:41 ptomli or could be meta-tag data
19:42 ptomli it's not just for scripts/css, just a way of passing structured data to the layout/parent
19:42 sri ah ok, not javascript specific, got the impression from the example
19:42 ptomli sorry, was the easiest example to come up with
19:42 ptomli could even be an array of page title elements
19:43 ptomli you familiar at all with ZF?
19:44 ptomli http://framework.zend.com/manual​/en/zend.view.helpers.html#zend.view.helpers.initial.headtitle
19:45 sri ptomli: http://pastie.org/1146588 # possibly like this
19:45 Rhaen left #mojo
19:45 Rhaen_ is now known as Rhaen
19:45 Rhaen ah, finally - I am myself again
19:45 sri couldn't think of a better name than head
19:46 sri i would always use blocks, since i love the new syntax :)
19:46 ptomli and the 'head' content would get augmented as it ascends the tree?
19:47 sri the helper would actually be trivial, possibly a oneliner
19:47 sri ye
19:47 sri since we have single inheritance it's trivial
19:47 ptomli i'm wondering how much this differs from the content helper
19:48 sri content is only set once
19:48 sri first wins
19:48 ptomli ahh
19:48 sri for old school template inheritance
19:49 ptomli to deal with, for array type data, prepend/append, i guess you'd have an arg to the block?
19:49 ptomli <% head position => 'prepend' => begin %>
19:49 sri would you actually need that much flexibility?
19:49 ptomli sometimes
19:50 sri you could do that, or just add more helpers
19:50 Rhaen uhm, the question might be - hm, strange. What's the recommended way to store data in an mojo app? Is there anything "pure" and lightweight perl solution?
19:50 ptomli memcached :)
19:50 sri Rhaen: it's a common question, i prefer couchdb personally
19:51 sri there is no recommended way though
19:51 sri mojolicious is model layer agnostic
19:51 Rhaen yup. ok.
19:52 Rhaen I just need a way to store data, using DBIx::Class might be cool, however this will pull a zillion of dependencies in.
19:52 sri ptomli: i would store everything in a string actually i think
19:53 sri right in a stash value
19:53 sri simplicity :)
19:54 ptomli hmm
19:55 sri Rhaen: ORLite is popular for lightweight apps
19:55 ptomli that removes the ability of the layout/parent to render the data as it would want
19:55 ptomli html/xhtml
19:55 ptomli <%= head-stylesheet href => '/css/styles.css' %>
19:56 ptomli then the layout/parent can use the helper to retrieve the data and render as it wants
19:57 sri thats a lot of complexity though
19:57 ptomli or maybe i'm over complicating things, trying to avoid scenarios i've run into before
19:57 sri i'm a simplicity hardliner though
19:57 ptomli often the best way
19:58 sri if a feature can be removed i remove it :)
19:59 sri Rhaen: here's garus twitter clone example http://github.com/garu/tweetylici​ous/blob/master/tweetylicious.pl
20:02 Rhaen sri: awesome! Thanks. I have a small web app at work which needs some love. It uses CGI::App right now and I about to rewrite it on mojolicious
20:02 sri have fun :)
20:02 Rhaen it doesn't do too complicated things so it might be a good start to get into mojo
20:03 Rhaen btw, have you seen the question inside the query? :)
20:03 sri oh, i ignore query mostly
20:03 Rhaen np.
20:03 Rhaen I was just wondering about the catalyst relations
20:04 Rhaen oh, next question. I can access params of a query easily, do I have to check them for bad inputs or is this done by mojo already?
20:04 tempire Well
20:04 tempire I'm either masochistic or brilliant
20:05 tempire I've ported Mojo::DOM to objective-c.
20:05 ptomli lol
20:05 sri oh my
20:05 sri madness!
20:05 ptomli does it run under objective-j though?
20:05 sri Rhaen: define bad
20:06 tempire ptomil: who cares :)
20:06 tempire actually, I have no idea what objective-j is
20:06 ptomli obj-c in javascript
20:06 ptomli very much fun
20:06 tempire javascript or javascript-like?
20:06 tempire 'cause if it's javascript, you could just use jquery and be done with it
20:07 ptomli runs in browsers
20:07 ptomli 2 secs
20:07 ptomli http://cappuccino.org/
20:07 sri motorola just bought it i think
20:07 ptomli yeah
20:08 tempire Ah, so it's more like a framework than a language.
20:09 ptomli well, they're porting cocoa to the browser
20:09 ptomli http://cappuccino.org/learn/tut​orials/objective-j-tutorial.php
20:09 ptomli ought to look quite familiar
20:09 sri the cocoa stuff is much more impressive than objective-j
20:10 sri especially the interface builder
20:11 ptomli i've not used atlas, but i have used the XIB converting tool, with some success
20:11 xantus[] joined #mojo
20:12 sri Rhaen: input is decoded and unescaped properly into well formatted perl characters, but not validated on a higher level if thats what you mean
20:14 ptomli here's the cache helper implemented?
20:14 ptomli where*
20:14 sri defaulthelpers plugin
20:15 sri a block is always passed as a coderef in the last argument
20:15 ptomli the cb ?
20:15 sri ye
20:16 sri you call it and it will return the result of the block
20:16 sri (as in rendered result)
20:16 ptomli unless there's a name.. <%= cache begin fred %> ?
20:16 sri that doesn't work
20:16 ptomli doh, other way round
20:17 ptomli anything dealing with expiry?
20:17 sri <%= cache fred => begin %>
20:17 sri thats just a string before the callback
20:17 ptomli yeah, i see
20:17 sri no expiry
20:17 ptomli it can be handled in the name i guess
20:17 sri i wouldn't mind a patch though :)
20:18 ptomli a feature? noooo
20:18 ptomli ;)
20:18 sri name would become a memory leak over time
20:18 ptomli yup
20:19 sri we are just starting out with the whole helper thing
20:19 ptomli is there a sensible time-string paring module.. like "1d" or "24h" etc
20:20 ptomli parsing*
20:20 sri tons on cpan
20:21 sri we tend to use epoch for everything in mojolicious though
20:21 sri simplicity :)
20:22 ptomli yeah, that would make sense
20:23 sri session expiration and date headers are all epoch based atm
20:23 ptomli could even possibly be clever enough to determine epoch or seconds, assuming nobody wants a cache to run for 40 years :)
20:24 sri i'm sure the erlang folks would disagree there ;p
20:24 ptomli that's ok, i don't do erlang
20:28 xantus[] left #mojo
20:28 xantus[] joined #mojo
20:32 spleenjack left #mojo
20:37 ptomli so.. adding an [optional] expires means also supporting the existing non-hash args to cache
20:37 xantus[] left #mojo
20:37 xantus[] joined #mojo
20:39 sri right
20:40 sri <%= cache foo => {expires => 1234} => begin %>lalala<% end %>
20:40 sri something like that looks usually best
20:40 ptomli ahh
20:44 Rhaen WOW!
20:44 sri sounds like someone's having fun
20:45 Rhaen oh, just discovered parts of the magic of: get '/foo' => 'foo'; post '/foo' => sub ....
20:46 sri :)
20:48 xantus[] left #mojo
20:48 xantus[] joined #mojo
20:53 josh803316 left #mojo
20:58 xantus[] left #mojo
20:58 xantus[] joined #mojo
21:00 ptomli so.. cache expires... $t->.....->content_isnt($cached)...
21:00 awnstudio joined #mojo
21:03 ptomli http://pastie.org/1146776
21:05 sri looks good at first sight
21:06 ptomli typo here and there, but tests pass and it's tested a bit
21:06 sri ptomli++
21:07 ptomli i ought to fork on github, but i use hg at work, git bends me when i type my normal stuff
21:07 sri haha
21:07 sri it's the new vim vs. emacs
21:08 xantus[] left #mojo
21:08 ptomli i used to use git a bit, but work was on cvs when i joined, and they decided to go hg because the plugins for eclipse were better. ho hum, we kinda regret that a bit now
21:10 ptomli content_isnt == 'exact non-match for content' :)
21:11 ptomli right, i'll leave it on pastie, i need to sleep
21:11 sri i'll merge it in and then go to sleep too :)
21:14 ptomli night all
21:14 sri nn
21:14 ptomli left #mojo
21:42 sri Zzz
21:44 garu sri: hey, what are you using for perlrocks's twitter auth?
21:44 garu I heard they changed authentication
21:44 * sri yawns
21:44 * sri stretches
21:44 sri a very ugly hack
21:45 sri a hacked up version of vtis oauth implementation
21:45 garu heh
21:45 garu where is vti's code? :)
21:46 sri http://gist.github.com/507388 # older version of the bot
21:46 sri http://github.com/vti/mojox-oauth # vtis oauth
21:47 sri his implementation is quite good, but he never cleaned it up
21:47 garu thanks :)
21:47 sri have fun :)
21:47 sri Zzz
21:57 vti sri: ;p
22:01 ltriant joined #mojo
23:14 GabrielVieira joined #mojo
23:50 Alias left #mojo

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary