Camelia, the Perl 6 bug

IRC log for #mojo, 2013-01-06

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

All times shown according to UTC.

Time Nick Message
00:00 inokenty Can anyone help me with this http://pastebin.com/zEzmHhz5 ?
00:01 inokenty (description in comments)
00:04 mire_ joined #mojo
00:11 vervain I'm not sure why you render your menu in the under sub
00:11 Molaf__ joined #mojo
00:12 inokenty To share this menu for all routes
00:12 vervain Why would it not just be a library template that you could use with include.
00:12 vervain Or must make it a part of the layout itself.
00:13 vervain s/must/just/
00:21 inokenty vervain: Thanks
00:21 inokenty include works http://pastebin.com/xGY5HCcd
00:26 sri hmm, i guess i have a solution for the after_render hook
00:31 good_news_everyone joined #mojo
00:31 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/rDzKcg
00:31 good_news_everyone mojo/master 6f08d75 Sebastian Riedel: added after_render hook
00:31 good_news_everyone left #mojo
00:32 sri the new example does look a lot friendlier, doesn't it? http://mojolicio.us/perldoc/Mojolicious/Guid​es/Rendering#Postprocessing_dynamic_content
00:35 travis-ci joined #mojo
00:35 travis-ci [travis-ci] kraih/mojo#76 (master - 6f08d75 : Sebastian Riedel): The build was broken.
00:35 travis-ci [travis-ci] Change view : https://github.com/kraih/mojo/com​pare/d43d0953bd7a...6f08d7500f13
00:35 travis-ci [travis-ci] Build details : http://travis-ci.org/kraih/mojo/builds/3978110
00:35 travis-ci left #mojo
00:35 sri :o
00:36 sri ok, just a travis bug
00:36 sri after_render will not be emitted for partial content, just the real render call
00:37 sri http://mojolicio.us/perldoc/M​ojolicious/Controller#render
00:44 good_news_everyone joined #mojo
00:44 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/ZSH5_Q
00:44 good_news_everyone mojo/master a1179c1 Sebastian Riedel: better after_render tests
00:44 good_news_everyone left #mojo
00:45 travis-ci joined #mojo
00:45 travis-ci [travis-ci] kraih/mojo#77 (master - a1179c1 : Sebastian Riedel): The build was fixed.
00:45 travis-ci [travis-ci] Change view : https://github.com/kraih/mojo/com​pare/6f08d7500f13...a1179c129b01
00:45 travis-ci [travis-ci] Build details : http://travis-ci.org/kraih/mojo/builds/3978225
00:45 travis-ci left #mojo
00:47 tempire looks good
00:48 * tempire didn't know you could my $var
01:07 hlin joined #mojo
01:52 davehorner joined #mojo
02:13 duncanthrax joined #mojo
02:43 davehorner joined #mojo
03:21 ka2u joined #mojo
03:21 noganex_ joined #mojo
04:06 davehorner joined #mojo
04:13 ryozi joined #mojo
04:34 zivester joined #mojo
04:36 zivester joined #mojo
04:54 kryptonite joined #mojo
05:37 davehorner joined #mojo
06:01 ka2u joined #mojo
06:14 wircus please, let's not go there.
06:17 wircus uhm, oops, scrolled back. Meant, let's not start term lawyering
06:19 battleship joined #mojo
06:40 Vandal joined #mojo
06:41 Vandal joined #mojo
06:51 PanzerBjorn joined #mojo
06:52 PanzerBjorn Quick question: can helpers not access other helpers? I have a a helped with an anonymous sub that calls another helper to get an object. That object is always null for my helper. =/
06:52 PanzerBjorn s/helped/helper/
06:57 * PanzerBjorn Picard facepalms. "Nevermind, basic OOD Perl brainleak."
06:57 ladnaV joined #mojo
07:13 lsm joined #mojo
07:20 PanzerBjorn left #mojo
07:43 davehorner joined #mojo
07:53 ladnaV joined #mojo
08:52 marcus http://www.archiveteam.org/index​.php?title=Wget_with_WARC_output wonder if there would be any point in Mojo::UA supporting WARC
08:52 marcus http://bibnum.bnf.fr/WARC/WARC_IS​O_28500_version1_latestdraft.pdf
08:53 davehorner joined #mojo
08:56 jwang joined #mojo
08:57 Vandal joined #mojo
08:59 wircus joined #mojo
09:20 * tempire term layers
09:31 mandreacchio joined #mojo
09:48 good_news_everyone joined #mojo
09:48 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/d4PHHQ
09:48 good_news_everyone mojo/master 887d5fe Sebastian Riedel: more after_render tests
09:48 good_news_everyone left #mojo
09:50 good_news_everyone joined #mojo
09:50 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/06ny1g
09:50 good_news_everyone mojo/master f168976 Sebastian Riedel: mention that after_render is not emitted for partial content
09:50 good_news_everyone left #mojo
09:50 sri marcus: what are your thoughts on after_render?
10:25 guest-suggest joined #mojo
10:44 good_news_everyone joined #mojo
10:44 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/KCqc3w
10:44 good_news_everyone mojo/master 7909f3a Sebastian Riedel: mention that after_render can trigger out of order
10:44 good_news_everyone left #mojo
10:45 dotan joined #mojo
10:53 sri i'm still considering the removal of after_render
10:59 ObseLeTe joined #mojo
11:03 sri after_render and after_dispatch seem so redunadant
11:03 sri i think the gain might be too small
11:30 mire_ joined #mojo
11:57 yakubori joined #mojo
11:57 yakubori top o the morning to ya, fellas :P
11:57 * vervain tips his hat at yakubori
12:21 sri http://pastie.org/5630765 # these are the choices basically
12:22 sri the question is if we care enough about filtering content generated by the renderer to give it its own hook
12:23 crab i think it's worth keeping after_render
12:31 good_news_everyone joined #mojo
12:31 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/Uh7hTg
12:31 good_news_everyone mojo/master dfb87a1 Sebastian Riedel: tweaked hook descriptions
12:31 good_news_everyone left #mojo
12:32 sri hmm, that's +2 already
12:32 sri i think what bugs me is that it's so hard to say if filtering content could be a thing if it was easier
12:34 sri and perhaps that so far there is only one use case for it
12:42 Molaf_ joined #mojo
12:44 rem_lex|pivo joined #mojo
12:49 sri hmm
13:04 guest-quest joined #mojo
13:08 guest-quest joined #mojo
13:14 rem_lex|pivo joined #mojo
13:21 Vandal joined #mojo
13:38 sri perhaps caching
13:40 sri after_render seems like a convenient place for writing the result into a static file
13:42 sri you could combine a render_cached helper with an after_render hook to do caching transparently
13:44 sri well, it's easy enough without the hook... :/
14:14 davehorner joined #mojo
14:44 davehorner joined #mojo
15:05 good_news_everyone joined #mojo
15:05 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/q_mAlg
15:05 good_news_everyone mojo/master 297cc67 Sebastian Riedel: rendering guide tweaks
15:05 good_news_everyone left #mojo
15:16 Britzel joined #mojo
15:32 Miked joined #mojo
15:53 marcus wow, rails is really getting it hard this week.
15:53 wircus (https://twitter.com/charlieso​me/status/287923967505858561)
15:55 wircus coming hot on the heels of various sql injection holes....
15:56 Vandal joined #mojo
16:04 yakubori joined #mojo
16:13 sri ouch
16:13 sri marcus: CAN HAZ OPINIONZ?
16:13 good_news_everyone joined #mojo
16:13 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/bhPHfw
16:13 good_news_everyone mojo/master 7b6ef50 Sebastian Riedel: more documentation tweaks
16:13 good_news_everyone left #mojo
16:15 * sri closes the channel door before marcus can sneak out again
16:17 ObseLeTe joined #mojo
16:20 jbnewman joined #mojo
16:24 marcus sri: OIONZ?
16:25 marcus ONIONZ?
16:25 * marcus is having goodbye party in russia before going back to oslo tomorrow.
16:25 sri what do you think about after_render? ;p
16:25 marcus sri: I like after_render
16:25 marcus it's neat
16:26 marcus specially now that it doesn't trigger for partials
16:26 marcus sri: will it trigger for any format? Like tt or json?
16:26 sri tt is not a format
16:26 marcus any renderer
16:26 sri yes
16:26 marcus good stuff.
16:27 sri the format passed to it would be html, txt and the like
16:28 marcus right.
16:28 marcus it makes sense for it to care about format, not renderer.
16:39 mattastrophe joined #mojo
16:43 sri i guess after_render is also a lot better for adding etags than after_dispatch
16:43 sri ok, that makes two use cases :)
16:44 sri filtering generated content, and generating custom headers based on generated content
16:44 sri in after_dispatch you would have to handle all the special cases too for both
16:47 sri turning rendered content automatically into static files might be a third use case...
16:47 vervain The latter is the one I want to play with.  At the moment I use ttree to render my static content, and generate some wrapper libs for my mojo app.
16:48 vervain It would be a lot goovier if I could do something like myapp make_static to do what ttree is doing.
16:48 sri that seems unrelated to my scenario
16:49 vervain I think your idea is to do it more dynamically and then as needed, but my idea is just a special case of that 'I think'
16:49 * sri nods
17:15 basic6 joined #mojo
17:21 ryozi joined #mojo
17:23 dotan joined #mojo
17:35 basic6 in a layout file, how do i check if a certain stash variable exists (to hide a part of it, if it doesn't) without causing warnings or errors (global symbol requires explicit package name)?
17:36 inokenty basic6: stash 'variable'
17:36 vervain <% if ( stash( foo ) )
17:36 vervain ya, what he said ;-)
17:36 basic6 right, so easy, thanks!
17:48 yakubori status_is(200)->text_like('html body' => qr/Welcome sri/); is this example from the Test::Mojo docs, is the key string a css accessor which contents are then regexed for 'Welcome sri'?
17:48 yakubori s/is this/in this/
17:49 Shaeto joined #mojo
17:51 Shaeto hi guys, small question: how to redirect mojolicious logs to another folder, for example to /var/log/
17:51 Shaeto i meant hypnotoad logs
17:53 dod joined #mojo
17:55 guest-quest Shaeto: ты просто глянь http://mojolicio.us/perldoc/Mojo/Log
17:56 inokenty guest-quest: Ты тут со всеми по-русски общаешься? =)
17:58 guest-quest inokenty: нет, просто своего увидел
18:02 sri this is an english channel
18:02 guest-quest sri: we are sorry
18:05 gryphon joined #mojo
18:17 Shaeto ок спасибо
18:18 sh4 joined #mojo
18:27 dod joined #mojo
18:37 b2b joined #mojo
18:39 diegok Hi!. Is there a way to retry an action on after_dispatch?. My use case is to retry one time after an exception is raised and it can be fixed. Of course I can wrap each action on an eval, but I want this to be app wide till I fix the problem more properly :-)
18:50 buu diegok: Can you just call the method again and pass it correct things?
18:50 buu diegok: What about the 'around' hook?
18:50 diegok buu: yes, I'm playing with around but not getting what I want :(
18:51 diegok buu: my problem is I don't know which method to call...
18:51 buu Isn't it passed to arond?
18:51 buu *around
18:51 diegok when using after_dispatch I can see 'exeption' on the stash so I know there was a problem
18:52 buu diegok: $app->hook( around_dispatch => sub { my($next,$c) = @_; eval{ $next->() }; if($@) { $next->()} }
18:53 diegok buu: that't what I have now :)
18:53 diegok well, with some debug messages in the middle
18:53 buu And?
18:54 diegok I don't see my failing method executing again but I see my debug messages 5 times :-/
18:55 buu Do you have debug messages inside the handler?
18:55 Shaeto $self->app->log->path('/var/log/mylog.log'); solved my question, thank you
18:56 guest-quest Shaeto: sorry for long way
18:56 diegok buu: yes... It's called again... but I see many debug messages...
18:57 diegok buu: thanks, I'll keep looking this way :)
18:57 * buu shrugs
18:57 buu I don't know much about the internals
19:00 diegok buu: well, this solution kind of work... now I need to understand why I got so many debug messages and I need a better approach to simulate my error as its not doing well :)
19:14 yakubori can you simulate a click with Test::Mojo?
19:15 yakubori if not, would anyone (other than me) be interested in that? :)
19:17 yakubori actually, that's probably more in the domain of things like selenium… :/
19:20 buu yakubori: You mean to trigger javascript or something?
19:20 yakubori ya -- I don't think the Mojo::UserAgent is really built for that though.
19:20 buu Er, no, it's not.
19:20 buu IT just does http..
19:22 yakubori it's cool. i can test http responses and basic content stuff with Test::Mojo, and drive UI tests with Selenium. I just though for a second it might be possible to roll it in.
19:39 ObseLeTe joined #mojo
19:41 sattellite joined #mojo
19:46 mattastrophe joined #mojo
20:07 diegok buu: this was working just fine!, I was seeing many output because of other requests (I feels really stupid now!) :-)
20:08 sh4|2 joined #mojo
20:18 dpetrov_ joined #mojo
20:26 buu =O
20:26 buu Yay
20:29 kryptonite joined #mojo
20:30 rem_lex|pivo joined #mojo
20:33 ipman joined #mojo
20:35 wircus yay
20:35 sri \o/
20:38 good_news_everyone joined #mojo
20:38 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/VwUBXg
20:38 good_news_everyone mojo/master 6d6f87e Sebastian Riedel: small optimizations
20:38 good_news_everyone left #mojo
20:39 jegade joined #mojo
20:39 sri i want to get rid of MOJO_EXE entirely
20:40 sri but one little test resists all my attempts :(
20:40 lukep joined #mojo
20:41 trmjoa joined #mojo
20:43 sri whole thing only exists so the config plugin can generate a better default config file name :o
20:45 sri at this point we can't really make it go away, so maybe it should be turned into a public api others can use as well
20:45 sri app->executable or so
20:47 wircus that seems useful
20:47 jegade hi, something goes wrong if i have undefined hash items http://pastie.org/5632376
20:47 sri wircus: i guess, but it needs a good name!
20:48 wircus jegade: you mean, you can't set a redis value to be undefined?
20:48 wircus jegade: what do you expect it to do?
20:49 wircus sri: what should it return if it's a standalone app?
20:50 jegade wircus: undef was given by other parts of my application, it should ignored
20:50 sri wircus: whatever this results in https://github.com/kraih/mojo/blob/​master/lib/Mojolicious/Lite.pm#L13
20:50 wircus jegade: I suggest you ignore it in the controller then.
20:51 sri wircus: it's lite specific
20:51 wircus sri: script_name ?
20:52 sri wircus: what do you mean with standalone anyway?
20:52 wircus sri: s/standalone/full/
20:52 sri ah, not availbale there
20:52 sri config file name is generated based on app class name there
20:53 sri full apps are a lot simpler :)
20:53 coff joined #mojo
20:54 sri if you want something portable to suggest a name, i guess it would have to be $app->default_name or so
20:54 wircus grr, I really hate when js stuff works great in development then blows up in my face in production.
20:54 sri which contains "foo_bar" for both
20:55 wircus ->moniker
20:55 sri that would work
20:55 coff Anyone got a clue why having a simple "$ua->get($someurl)->res->json" in a script would cause Mojo to print 'Event "close" failed: Can't call method "test" on an undefined value' as the script terminates?
20:56 sri wircus: you think a default moniker would be useful for config plugins and the like?
20:56 wircus sri: I think so. would like to hear the opinions of tempire and crab on the subject as well.
20:57 * sri too
21:07 * sri shakes tempire
21:18 sri adding moniker results in less code
21:25 sri http://pastie.org/5632554 # here's the patch
21:25 * sri pokes marcus
21:30 sri MOJO_EXE still exists, but is more hidden
21:33 sri http://pastie.org/5632576 # and a more complete patch ;p
21:39 tempire which part am I opinionating on?
21:40 tempire what it should return, or what it should be called?
21:40 sri Mojolicious->moniker currently :)
21:40 sri oh, everything
21:40 sri should it exists at all?
21:41 * sri likes that something rather complex becomes trivial to test
21:42 tempire it should exist.
21:42 sri that settles it :)
21:42 tempire I'l use it in deploy-heroku
21:43 good_news_everyone joined #mojo
21:43 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/c-Ee8A
21:43 good_news_everyone mojo/master 17f4b7a Sebastian Riedel: added moniker attribute to Mojolicious
21:43 good_news_everyone left #mojo
21:43 tempire having a hook named after_render will encourage its usage, I think.
21:43 tempire it's more obvious
21:44 sri yea, the old names are not that great, but a little late for changing
21:44 Shaeto left #mojo
21:44 sri after_dispatch and especially after_static_dispatch are rather scary
21:47 sri i think my main worry with after_render is that it doesn't add enough value over after_dispatch, which has rather similar semantics
21:53 sri but looking at my comparison from earlier, it seems pretty comprelling http://pastie.org/5630765
21:55 sri ./myapp.pl eval -v 'app->moniker' should be a good debug tool
21:59 xaka joined #mojo
22:08 xaka joined #mojo
22:15 _xaka_ joined #mojo
22:27 jamesstanley joined #mojo
22:28 jamesstanley I'm new to Mojolicious. What is the recommended way to build a navbar? I don't mind hardcoding it in the template, but I need to set class="active" for the current page, and I don't know a neat way to do that in the template.
22:29 xaka joined #mojo
22:31 buu jamesstanley: Uh, <% if $page eq 'this_page'; print 'active' %> ?
22:31 buu I actually have no idea what the default templating language looks like
22:31 buu But you get my point I hope
22:32 jamesstanley that was the best I could come up with
22:32 _xaka_ joined #mojo
22:32 jamesstanley there must be something neater possible
22:32 jamesstanley but thanks
22:32 tempire buu: <%= 'active' if $page eq 'this_page' %>
22:34 sri or you make a helper to generate those links which does the active check
22:35 sri %= menu_link Foo => '/foo'
22:35 jamesstanley that is neat, I'll do that
22:35 jamesstanley cheers sri
22:36 buu Wouldn't you need to pass in other args to set the class?
22:37 sri the class would be hardcoded in the helper
22:37 xaka joined #mojo
22:37 buu I meant for having multiple classes applied
22:38 sri that should be trivial
22:45 good_news_everyone joined #mojo
22:45 good_news_everyone [mojo] kraih tagged v3.73 at e06102b: http://git.io/Bxxdgw
22:45 good_news_everyone left #mojo
22:51 yakubori joined #mojo
22:52 sri hahahaha
22:52 sri no matter how hidden something is... someone will use it http://grep.cpan.me/?q=MOJO_EXE
23:08 xaka joined #mojo
23:10 vervain If it's not preceeded with an _ I consider it fair game, documented or not.
23:10 vervain Or should I say, usually I do, around here I know better. :-)
23:16 anaio joined #mojo
23:36 ipman joined #mojo
23:37 xaka joined #mojo
23:42 _xaka_ joined #mojo
23:45 tempire whoa
23:45 tempire you can drag opera tabs into chrome
23:48 jzawodn joined #mojo
23:55 xaka joined #mojo

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