The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2014-06-04

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

All times shown according to UTC.

Time Nick Message
00:01 punter left #mojo
00:03 asarch joined #mojo
00:08 jberger marcus++
00:09 jberger btw marcus, any thoughts on my Mojo::Pg branch
00:21 Akron joined #mojo
00:40 Akron joined #mojo
00:40 Kovensky joined #mojo
00:50 Kovensky joined #mojo
00:50 dvinciguerra joined #mojo
00:50 Gedge joined #mojo
00:50 riche joined #mojo
00:50 Eke- joined #mojo
00:50 mullinator joined #mojo
00:50 beyondcreed joined #mojo
00:50 Tiger joined #mojo
00:50 oetiker_ joined #mojo
00:50 risugg joined #mojo
00:50 Negor joined #mojo
00:50 Claudio joined #mojo
00:50 Adura joined #mojo
00:50 dotan_dimet joined #mojo
00:50 dj_goku_ joined #mojo
00:50 odc joined #mojo
00:50 crab joined #mojo
00:50 kvorg joined #mojo
00:50 genio joined #mojo
00:50 kmx joined #mojo
00:50 DaniBunny joined #mojo
00:50 nikita joined #mojo
00:50 tianon joined #mojo
00:50 bzero joined #mojo
00:50 yusukebe joined #mojo
00:50 michael_ joined #mojo
00:50 ssm joined #mojo
00:50 inokenty joined #mojo
00:50 cosimo joined #mojo
00:50 mtths joined #mojo
00:50 doby joined #mojo
00:50 suy joined #mojo
00:50 Bender joined #mojo
00:50 marcus joined #mojo
00:50 Jonis joined #mojo
00:50 jberger joined #mojo
00:50 dahl joined #mojo
00:50 lupi joined #mojo
00:50 nemux joined #mojo
00:50 robinsmidsrod joined #mojo
00:50 geira joined #mojo
00:50 shadowpaste joined #mojo
00:50 noidd joined #mojo
00:50 upasana joined #mojo
00:50 dsog joined #mojo
00:50 Kundun joined #mojo
00:50 augensalat joined #mojo
00:50 mst joined #mojo
00:50 BinGOs joined #mojo
00:50 xtetsuji joined #mojo
00:50 garu joined #mojo
00:50 gabiruh joined #mojo
00:50 Andreas joined #mojo
01:02 Akron joined #mojo
01:02 laouji joined #mojo
01:04 jberger Every time I think I have come up with a solution for the next Mojo::Pg problem, I look at Mojolicious::Plugin::PgAsync and it does that thing already
01:14 ua left #mojo
01:24 tempire Is there something wrong with ::Plugin::PgAsync?
01:41 laouji_ joined #mojo
01:48 btyler joined #mojo
01:48 klapperl_ joined #mojo
02:05 Bravo13 joined #mojo
02:17 zackiv31 joined #mojo
02:42 ua_ joined #mojo
02:48 Averna joined #mojo
03:09 jberger tempire: not that I have found. it would be nice if it was more than a plugin
03:09 jberger I tried to find a public repo, I would submit a pr to make it more reusable
03:24 dvinciguerra joined #mojo
03:31 laouji_ joined #mojo
03:41 moritz joined #mojo
03:45 basic6_ joined #mojo
04:33 laouji joined #mojo
05:10 Eke- joined #mojo
05:14 d4rkie joined #mojo
05:31 laouji joined #mojo
05:59 Kovensky joined #mojo
06:06 laouji_ joined #mojo
06:20 dotandimet joined #mojo
06:24 denis_boyun joined #mojo
06:27 Eke|| joined #mojo
06:29 laouji joined #mojo
06:29 laouji_ joined #mojo
06:36 laouji joined #mojo
06:52 Guest-quest joined #mojo
06:52 Vandal joined #mojo
06:54 Guest-quest hi, how to determine the current route within methods of the $c controller?
07:00 Eke- joined #mojo
07:13 eseyman joined #mojo
07:18 rawler joined #mojo
07:20 igorsutton joined #mojo
07:30 dotandimet http://mojolicio.us/perldoc/Mojolicious/Plugin/DefaultHelpers#current_route
07:31 dotandimet Guest-quest: $c->current_route
07:35 dexteruk joined #mojo
07:36 Guest-quest dotandimet: no such)
07:38 dotandimet Guest-guest: What version are you using? I think it was added in the last year.
07:40 Guest-quest 'Tiger Face 5.05';
07:42 trone joined #mojo
07:43 Guest-quest i think $c->match...
07:43 dod joined #mojo
07:50 igorsutton joined #mojo
08:03 basiliscos joined #mojo
08:04 dotan_dimet current_route causes a no such method error? It's defined via AUTOLOAD
08:07 Guest-quest sorry, by helper, yeah
08:09 Guest-quest thank you
08:09 dotan_dimet Without Argos it should return $c->match>endpoint  or ''
08:10 Guest-quest ok
08:22 gregf joined #mojo
08:39 abra joined #mojo
08:54 priodev joined #mojo
08:54 jnbek joined #mojo
09:00 fhelmber_ joined #mojo
09:00 sivoais joined #mojo
09:03 KindOne joined #mojo
09:06 edestler joined #mojo
09:19 ovnimancer joined #mojo
09:31 dpetrov_ joined #mojo
09:36 mire__ joined #mojo
09:41 _Dave joined #mojo
09:42 Adurah joined #mojo
09:45 dotandimet joined #mojo
09:46 klapperl joined #mojo
09:56 dgikiller joined #mojo
10:02 denis_boyun joined #mojo
10:06 rem_lex joined #mojo
10:14 dotandimet Argos = args. Damn autocorrect :)
10:16 nicomen is there some way I can check if there is a controller available for a given route, and if not I take over control?
10:16 nicomen (this is inside a (to => sub) callback
10:16 nicomen )
10:20 ryozi joined #mojo
10:30 d4rkie joined #mojo
10:35 basiliscos joined #mojo
10:45 dotandimet joined #mojo
10:47 alnewkirk joined #mojo
10:55 gregf joined #mojo
11:22 abra_ joined #mojo
11:25 punter joined #mojo
11:27 ovnimancer nicomen: you can redefine render_not_found in your base controller class
11:29 ovnimancer or you can define one "ultimate" route after all route definitions
11:36 nicomen hm, I can of only want to let this happen for a specific bridge
11:36 nicomen can = kind
11:38 ovnimancer maybe check module with Mojo::Loader before route defenition?
11:38 nicomen yeah something like that, although runtime would be fine
11:38 ovnimancer definition*
11:39 nicomen and I would like to re-use the action#name to Module::Path routine
11:40 dotandimet joined #mojo
11:46 nicomen actually there must be some way to this that is easier, basically I have /foo/*, I want to use common routing if the request goes to /foo/bar/baz and Foo::Bar::Baz exists, but if not I want to do a straight $c->render("foo/bar/baz.html");
11:50 ovnimancer maybe put all this into a plugin? and redifine render_not_found? =)
11:51 ovnimancer i do something like this when split api and web parts
11:54 nicomen hm, render_maybe ...
11:56 ovnimancer render_maybe is for template alternates
11:56 ovnimancer oh, they have controller/action param =)
11:58 dotandimet joined #mojo
12:12 shmuel joined #mojo
12:14 Eke- joined #mojo
12:17 lestrrat joined #mojo
12:23 mire__ joined #mojo
12:34 dgikiller joined #mojo
13:07 disputin joined #mojo
13:08 Eke|| joined #mojo
13:11 cpan_mojo Minion 0.14 by Sebastian Riedel - http://metacpan.org/release/SRI/Minion-0.14 (depends on Mojolicious)
13:15 Akron joined #mojo
13:17 stephan48 e37
13:20 dpetrov_ joined #mojo
13:34 btyler joined #mojo
13:52 dvinciguerra joined #mojo
14:05 nicomen strace -o FILE # now THAT would have saved me a LOT of time during my debugging years (instead of 2>&1 1> FILE, but wait I need STDOUT to not go in the file, arggh, google google, f*** this shit)
14:06 neyasov_ joined #mojo
14:06 moritz have you tried strace -o - ?
14:07 moritz no idea if it works
14:19 cpan_mojo Minion 0.15 by Sebastian Riedel - http://metacpan.org/release/SRI/Minion-0.15 (depends on Mojolicious)
14:19 shmuel joined #mojo
14:23 inokenty joined #mojo
14:25 shmuel_ joined #mojo
14:30 dgikiller joined #mojo
14:30 punter joined #mojo
14:34 bluescreen joined #mojo
14:36 bluescreen_ joined #mojo
14:38 dotandimet joined #mojo
14:39 sh4 joined #mojo
14:53 gryphon joined #mojo
14:55 cpan_mojo Mango 0.42 by Sebastian Riedel - http://metacpan.org/release/SRI/Mango-0.42 (depends on Mojolicious)
15:04 mad_hatter joined #mojo
15:05 mad_hatter hey guys, new to mojo here and mucking through all of the docs/tutorials...can someone explain to me how the get function works? it has a very interesting syntax that I'm not used to seeing in my previous perl endeavors...
15:05 mad_hatter well..i guess all the functions in that same class im having an issue with...get,post,any (all of the ones ive seen thus far)
15:06 sri that's the whole Mojolicious::Lite DSL https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Lite.pm#L33
15:25 mad_hatter sri: so to make sure im understanding the syntax correctly: get, post, any, etc could be called in this fashion: get('/', sub { ... }, 'layout'); and still be functionally correct right?
15:32 batman mad_hatter: yes.
15:32 batman it's exactly the same. just doesn't look so "sweet"
15:33 batman exported functions (which does not require parentheses) are often called "sugar"
15:33 batman actually - any function defined earlier in the code can be called without parentheses
15:34 batman like this: use List::Util 'sum'; print sum 1, 5, 6;
15:35 mad_hatter gotcha...a big obstacle in learning mojo so far has been getting a firm grasp of just what all I can pass to get
15:36 batman yeah, that is a bit confusing imo
15:38 _Dave I've been reading about REST all day. seems quite religious.
15:38 batman _Dave: oh?
15:39 batman i think you should pick the stuff you like about rest and leave the rest
15:39 batman pun _not_ intended :/
15:39 mad_hatter lol
15:40 batman sri: https://metacpan.org/pod/Mojolicious::Routes::Route#get <-- can't you pass on { default => "value" } to get() as well...?
15:55 russum joined #mojo
16:05 denis_boyun joined #mojo
16:17 sri _Dave: wait till you get to HATEOAS :)
16:18 sri batman: of course, which is why there's a reference to the tutorial
16:18 sri the arguments are too dynamic for a list of valid argument variations
16:18 dod joined #mojo
16:19 sri there's also constraints
16:19 sri and and and
16:21 asarch joined #mojo
16:24 batman ok, just a bit surprised it wasn't in the routing doc as well.
16:25 batman But it makes sense. Too much redundant doc I guess
16:25 sri how could it be in the routing doc?
16:25 batman What do you mean?
16:26 sri what exactly did you expect in the routing docs?
16:26 batman All the arguments get() could take. I will make an example later.
16:26 batman I'm currently on the bus...
16:27 batman On my way to Oslo.pm mojoconf recap.
16:28 sri there is 7 elements that can be an argument, and they all can be dynamically combined
16:28 sri good luck making a list of *all* possibilities
16:28 sri oops, i mean 8 elements
16:29 hesperaux joined #mojo
16:31 hesperaux joined #mojo
16:31 batman 7? Wow. I only knew about four 0o
16:31 sri 8 in the any case
16:33 sri methods, pattern, defaults, constraints, conditions, code, name
16:33 sri it's 7 after all ;p
16:34 D4RK-PH0ENiX joined #mojo
16:36 sri of course all are optional
16:37 sri if you really really want to add a list of possibilities, please make sure it's complete, and still readable enough to be useful
16:38 sri historically, having more examples for those functions/methods has been bad though, it encouraged people to skip the tutorial, so i might still veto changes
16:40 dotandimet joined #mojo
16:50 asarch joined #mojo
16:53 cfedde joined #mojo
17:00 dgikiller joined #mojo
17:03 sugar joined #mojo
17:23 fhelmber_ joined #mojo
17:27 sh4 joined #mojo
17:33 zackiv31 joined #mojo
17:44 gryphon joined #mojo
17:48 riche sri: about the documentation: I think you're right but it would be nice to have a pod link to one or more sections in the guides explaining its use in context
17:49 dotandimet joined #mojo
17:54 inokenty joined #mojo
18:04 jnbek joined #mojo
18:45 basiliscos joined #mojo
18:48 dgikiller joined #mojo
18:50 mire__ joined #mojo
18:55 mad_hatter batman: if you do do that hook me up with the beta ;)
19:18 punter joined #mojo
19:26 Eke- joined #mojo
19:47 dotandimet joined #mojo
20:01 beyondcreed joined #mojo
20:10 sh4 joined #mojo
20:18 sh4|2 joined #mojo
20:33 dvinciguerra joined #mojo
20:41 mishantil Doing a $c->redirect_to('/foo/bar') inside a condition (defined by add_condition(mybaz => sub{...}) ) applied using over->(mybaz => 'woha') should work right?
20:42 mishantil Or is it something about redirects inside conditions that is fishy?
20:44 mishantil Ooooh. So conditions applied using over is just for _route matching_?
20:48 sri yes
20:48 basiliscos joined #mojo
20:49 mishantil Thanks. That made a lot of things _much_ clearer. :)
20:57 mishantil So which part of mojo could be abused to make sure that when the code reaches the inside of a under()-bridge, there is a variable set in stash?
20:58 mishantil Putting in a condition which only does a stash(foo => $bar) then returns true?
20:59 sri i don't understand the problem
21:00 mishantil I will try to explain better. :)
21:01 sri http://mojolicio.us/perldoc/Mojolicious/Lite#Optional_placeholders
21:03 mishantil What I want to do is for each route do some checking to see if the user has access to that route.
21:03 mishantil What I thought could be done was to specify entrypoint-id (defined in a db) for each route,
21:03 mishantil then in a bridge I could check to see if the set entrypoint matches the enabled entry-points for the user in the db.
21:04 mishantil like $br->get('/foo/bar')->over(section => 'magic-foo#foobared-place')->to('foo#bar');
21:05 dvinciguerra joined #mojo
21:05 mishantil and I'd use the condition 'section' to just ->stash(section => $section), which would then be available when the bridge-check was reached.
21:23 fhelmber_ joined #mojo
21:24 good_news_everyon joined #mojo
21:24 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/sK38-w
21:24 good_news_everyon mojo/master f69342b Sebastian Riedel: use slightly more advanced example for bridges
21:24 good_news_everyon left #mojo
21:26 mishantil Ok, so that worked fairly well. Please let me know if it was a retarded way of doing it. :p
21:34 sri it sounds wrong, but i didn't understand much
21:37 good_news_everyon joined #mojo
21:37 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/2cZjPA
21:37 good_news_everyon mojo/master 016d38f Sebastian Riedel: fixed typo in under example
21:37 good_news_everyon left #mojo
21:38 * sri wonders if the first under example might be a little too complicated for the tutorial now with the allow stash value http://mojolicio.us/perldoc/Mojolicious/Lite#Under
21:50 good_news_everyon joined #mojo
21:50 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/8SbZiw
21:50 good_news_everyon mojo/master 14bb818 Sebastian Riedel: simplify bridge example in tutorial again
21:50 good_news_everyon left #mojo
21:51 sri yea, better keep it simple
22:28 neyasov__ joined #mojo
22:37 disputin joined #mojo
23:10 d4rkie joined #mojo
23:33 tempire Looks like the mojolicious girl is done with finals
23:33 tempire good for her
23:33 purl i guess good for her is distributing LPP stuff, actually
23:33 sri i'm so glad marcus found a way to block her from search results
23:36 russum joined #mojo
23:40 meshl joined #mojo
23:48 asarch joined #mojo
23:54 shmuel joined #mojo
23:58 neyasov__ joined #mojo

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