Camelia, the Perl 6 bug

IRC log for #mojo, 2013-10-03

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

All times shown according to UTC.

Time Nick Message
00:06 btyler joined #mojo
00:39 bellows joined #mojo
00:43 bellows hi, inflate classifies jquery-1.10.2.min.js as a template -- do you consider this a bug?
00:45 bellows can't influence it with prefix, @@ public/js/vendor/jquery-1.10.2.min.js it goes to templates/public/js/vendor/jquery-1.10.2.min.js
00:47 bellows I guess I'll write hyperinflater.pm
00:52 shmuel joined #mojo
01:00 shankr joined #mojo
01:01 punter joined #mojo
01:01 sri bellows: http://mojolicio.us/perldoc/M​ojolicious/Lite#Static_files
01:08 laouji joined #mojo
01:22 bellows i see -- but lite doesn't treat the file as a template ...
01:26 sri certainly does
01:27 russum left #mojo
01:28 bellows jquery-1.10.2.min.js ? what renderer?
01:41 bellows oh, I see, its not served as static; how do I go about monkeypatching this, I know I can Mojolicious::Command::inflate for inflation, but where do I do the serving portion
02:00 d4rkie joined #mojo
02:00 d4rkie joined #mojo
02:13 tba joined #mojo
02:21 bellows why can't I serve foo.min.js with Mojo::Loader->new->data('main')->{'foo.min.js'} = 'not template <%= localtime %>';   get '/foo.min.js' => sub { shift->render_static( '/foo.min.js' ); };
02:55 crab joined #mojo
03:03 preflex_ joined #mojo
04:01 preflex_ joined #mojo
04:04 * tempire looks at this newfangled validation
04:07 * tempire is thankful the source link exists in the pod
04:08 tempire I dig it.
04:09 tempire api is based on input::validator, which is the only validator I've ever found to be useful.
04:09 tempire ah, add_check, good.
04:09 * tempire will use it
04:56 tba_ joined #mojo
04:59 crab hi /tmp/ire
05:01 dqw7 joined #mojo
05:18 basic6 joined #mojo
06:21 highflying joined #mojo
06:41 basiliscos joined #mojo
06:55 dod joined #mojo
07:03 KindOne joined #mojo
07:14 Vandal joined #mojo
07:29 dod joined #mojo
07:35 fhelmber_ joined #mojo
07:49 trone joined #mojo
08:04 arthas joined #mojo
08:13 damaya joined #mojo
08:14 damaya I currently have a mojo web app that is grabbing information from an Oracle SQL database. Unfortunately, the host is quite slow.
08:15 damaya There's a cron job that populates the data in this database from a bunch of sources every 5 minutes, then the web app that pulls the data and displays it, allows users the modify it, etc.
08:15 damaya Is it feasible to get rid of the SQL database and use DBIx::Class + SQLite?
08:15 damaya Meaning, is there a way to populate a SQLite database from script X and access that same data from web app Y?
08:16 damaya I know this isn't completely mojo related, but looking at tempire's mojo lite app / full app examples I see that he's using DBIx::Class and SQLite, but reading up on SQLite it seems from what I gather that the data is relative to a single app and not persistent (i.e., not actually stored anywhere).
08:18 damaya please disregard my question
08:21 themage joined #mojo
08:23 mire__ joined #mojo
08:30 ver joined #mojo
08:37 dod joined #mojo
08:37 REPLEffect joined #mojo
08:54 avkhozov joined #mojo
08:58 avkhozov joined #mojo
09:01 avkhozov joined #mojo
09:04 avkhozov joined #mojo
09:08 avkhozov joined #mojo
09:11 avkhozov joined #mojo
09:13 KindTwo joined #mojo
09:14 avkhozov joined #mojo
09:16 jpn joined #mojo
09:17 avkhozov joined #mojo
09:20 avkhozov joined #mojo
09:23 avkhozov joined #mojo
09:26 avkhozov joined #mojo
09:29 avkhozov joined #mojo
09:32 avkhozov joined #mojo
09:32 dod joined #mojo
09:35 avkhozov joined #mojo
09:38 avkhozov joined #mojo
09:41 avkhozov joined #mojo
09:44 avkhozov joined #mojo
09:47 avkhozov joined #mojo
09:48 laouji joined #mojo
09:50 avkhozov joined #mojo
09:54 avkhozov joined #mojo
09:55 punter joined #mojo
09:57 avkhozov joined #mojo
09:58 laouji_ joined #mojo
10:00 avkhozov joined #mojo
10:03 avkhozov joined #mojo
10:06 avkhozov joined #mojo
10:07 batman sri++ # 307d6e13c37886d553c5f4e9e7620b1d85e650d8..​.dbd9149b359ff8846e09a99dc425a86f83d11bfe
10:09 * batman wonder if he's still on ignore...
10:09 avkhozov joined #mojo
10:12 avkhozov joined #mojo
10:13 mire_ joined #mojo
10:14 avkhozov joined #mojo
10:17 avkhozov joined #mojo
10:20 avkhozov joined #mojo
10:23 avkhozov joined #mojo
10:24 marcus sri: That looks quite sane!
10:25 avkhozov joined #mojo
10:28 avkhozov joined #mojo
10:31 avkhozov joined #mojo
10:34 avkhozov joined #mojo
10:37 maxhq joined #mojo
10:38 avkhozov joined #mojo
10:39 punter joined #mojo
10:42 avkhozov joined #mojo
10:42 gear joined #mojo
10:42 gear hey
10:45 avkhozov joined #mojo
10:46 gear my Mojolicious::Lite service runs behind the apache proxy. after updating mojolicious from CPAN it started to output LAN address in url_for helpers. how can i solve this issue?
10:47 avkhozov joined #mojo
10:50 avkhozov joined #mojo
10:54 avkhozov joined #mojo
10:56 avkhozov joined #mojo
10:59 sri \o/
10:59 avkhozov joined #mojo
11:03 avkhozov joined #mojo
11:06 avkhozov joined #mojo
11:08 sri batman: no
11:08 avkhozov joined #mojo
11:09 sri tempire: actually i don't think there are similar validators yet
11:09 sri it's mostly based on the one from play framework
11:10 jason2 joined #mojo
11:11 avkhozov joined #mojo
11:13 fhelmber_ joined #mojo
11:14 avkhozov joined #mojo
11:17 avkhozov joined #mojo
11:20 avkhozov joined #mojo
11:23 avkhozov joined #mojo
11:26 avkhozov joined #mojo
11:28 avkhozov joined #mojo
11:31 avkhozov joined #mojo
11:34 avkhozov joined #mojo
11:38 avkhozov joined #mojo
11:41 avkhozov joined #mojo
11:44 avkhozov joined #mojo
11:47 avkhozov joined #mojo
11:51 avkhozov joined #mojo
11:53 avkhozov joined #mojo
11:55 avkhozov joined #mojo
11:58 avkhozov joined #mojo
11:59 btyler joined #mojo
12:01 avkhozov joined #mojo
12:06 denisboyun joined #mojo
12:23 sixBB joined #mojo
12:42 b2bedi joined #mojo
13:07 asarch joined #mojo
13:15 marty wow. did mongodb change their projection syntax?  all of a sudden my queries that return an object from an array of objects is failing.  even in the mongo shell.   uhhhhg
13:15 hrupp joined #mojo
13:25 sri marty: aggregation pipeline?
13:28 marty sri: that's a nice alternative to mapReduce.   I never new that exists.  thanks, I might use it.
13:28 marty s/new/knew/
13:28 sri oh, i meant if you were referring to the aggregation pipeline ;p
13:28 sri guess not
13:30 marty well I'm not sure what changed but my queries that used to work db.coll.find({}, {'array.0.obj' : true}); no longer work.   I have no idea why
13:31 sri they switched out the query engine recently, could have something to do with that
13:31 * marty nods
13:31 marty that sucks, I used that a LOT in my app.   :(
13:54 sh4 joined #mojo
13:56 ryozi joined #mojo
14:00 thomason joined #mojo
14:02 rem_lex| joined #mojo
14:03 gear left #mojo
14:04 thomason left #mojo
14:04 thomason joined #mojo
14:10 dod joined #mojo
14:11 moltar joined #mojo
14:15 thomason joined #mojo
14:15 thomason did I log in? My client is flaky.
14:15 memowe yep, you did!
14:16 thomason Awesome. Sorry about that. I'm a mojo newb, so bear with me. What's the best way to set up a route with multiple methods?
14:16 thomason So I can get /foo/bar, and post to /foo/bar. But I don't want to repeat the string '/foo/bar' in my routes definition.
14:16 thomason Best I've come up with is to toss it into a separate bariable ($foobar = '/foo/bar') and had that into the routes method. Is there a slicker way?
14:17 sri http://mojolicio.us/perldoc/Mojoli​cious/Guides/Routing#HTTP_methods
14:17 sri http://mojolicio.us/perldoc/M​ojolicious/Lite#HTTP_methods
14:17 thomason Yeah, I saw that, but that's also duplicating the route name ('/bye'). It's also sending the get and post requests to the same action.
14:18 thomason I'd want to go to different actions and not dupe the route name. I didn't know if there was a better way to do it other than just stuffing the string into a variable.
14:18 sri http://mojolicio.us/perldoc/Mojolicious/Lite#Under
14:21 thomason I was thinking under would do it, but I don't quite have the syntax right. I tried this:
14:21 thomason my $route = $r->under('/foo')->to('controller' => 'example');
14:21 thomason $route->via('GET')->to(action => 'foo');
14:21 mire_ joined #mojo
14:21 thomason but it complains that the route isn't found. Swapping ->under to ->route works, but then I can't set a new via('POST') on it or it'll override the GET. :-/
14:23 sri http://mojolicio.us/perldoc/Mojoli​cious/Guides/Routing#Nested_routes
14:25 thomason Aren't those for setting up different subroutes? So I can define /foo as a global and then set up /bar underneath it? I don't think that's what I want here.
14:25 thomason I'm not trying to be difficult, I've read all these docs, I just haven't seen what I need to see, or implement it in a way that works (as per code I pasted up above there)
14:25 sri no, that's not how they work
14:26 sri second sentence should make that pretty clear "A route with children can't match on its own though, only the actual endpoints of these nested routes can."
14:29 thomason Is this how I should be doing it? It does work, but the extra empty route looks like a kludge.
14:29 thomason my $route = $r->route('/foo')->to('controller' => 'example');
14:29 thomason $route->route('/')->via('GET')->to(action => 'foo');
14:29 thomason $route->route('/')->via('POST')->to(action => 'bar');
14:29 sri please don't ever paste code into an irc channel
14:29 thomason apologies. What's proper etiquette to share it?
14:29 sri a paste site
14:29 thomason noted
14:30 sri there are many many shortcuts for that
14:31 sri http://mojolicio.us/perldoc/Mojolicious​/Guides/Routing#More_convenient_routes
14:32 thomason That last example there ("Even the more abstract concepts") looks closest to what I want, but it's using a subroutine callback for the get/post requests. What's the syntax to hand it off to a controller/action instead?
14:33 sri you can't deduce that from the earlier examples?
14:34 mst joined up thinking is disappointingly rare these days
14:34 mst Bender: spread the love
14:36 thomason Ah. I see. So I can tack on a ->get() and ->post() to the route and append to it and it works fine.
14:36 thomason Oddly enough, tacking on the ->via('get') and ->via('post') didn't work. I thought the methods were just a shortcut for the via call with the arg? Was I mistaken?
14:43 denis_boyun joined #mojo
14:43 bluescreen joined #mojo
14:44 thomason Ahh. I think I've got it. So calling ->get() on a route generates a new route that only responds to the get request, but ->via('get') on a route adds a get restriction onto the existing route w/o creating a new one. Is that correct?
15:05 good_news_everyone joined #mojo
15:05 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/Ma25pw
15:05 good_news_everyone mojo/master 07562ff Sebastian Riedel: added another routing example
15:05 good_news_everyone left #mojo
15:08 thomason wunderbar. tyvm for the additional example in there.
15:16 HtbaaPi joined #mojo
15:30 thomason Did I get that distinction between get creating a new route and via('get') adding a restriction onto an existing route? I'm good to go if that's the case, and it explains why my initial stabs failed.
15:39 good_news_everyone joined #mojo
15:39 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/OIkTPw
15:39 good_news_everyone mojo/master e931641 Sebastian Riedel: removed experimental status from label_for helper
15:39 good_news_everyone left #mojo
15:47 good_news_everyone joined #mojo
15:47 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/FOxu8g
15:47 good_news_everyone mojo/master f3ffc55 Sebastian Riedel: more label_for tests
15:47 good_news_everyone left #mojo
16:20 d4rkie joined #mojo
16:24 good_news_everyone joined #mojo
16:24 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/Si6h1g
16:24 good_news_everyone mojo/master 2c5b3c5 Sebastian Riedel: better label_for test
16:24 good_news_everyone left #mojo
16:28 tianon joined #mojo
16:59 bowtie_ joined #mojo
17:07 marty thomason:  You can always use the routes command to see what routes are created.     http://mojolicio.us/perldoc/​Mojolicious/Commands#routes
17:14 denis_boyun joined #mojo
17:26 dod joined #mojo
17:36 moltar joined #mojo
17:42 maxhq joined #mojo
17:51 dvinciguerra joined #mojo
18:12 thomason joined #mojo
18:14 dsteinbrunner joined #mojo
18:15 asarch joined #mojo
19:02 thomason I thought I'd had the routing operating the way I wanted, but I'm clearly still missing something. Could somebody take a look @ http://pastebin.com/t3rWUPPQ and point me in the right direction?
20:00 denisboyun joined #mojo
20:03 mire_ joined #mojo
20:03 marty thomason:  does this help?   http://irclog.perlgeek.de/​mojo/2013-10-03#i_7667782
20:16 thomason Sorry, no good. I knew about the routes command, and it's the same output I get from the web server on a 404 anyway. The docs actually seem to imply that this can't be done.
20:17 thomason It looks like once you nest a route, that the parent route is arbitrarily disabled. i.e., once /bar is a subroute of /foo, then /foo/bar works but /foo begins to fail.
20:30 moltar joined #mojo
20:42 marty thomason:  if you do not need route chaining then you can simply put the more restrictive route first in your config.
20:43 marty wait, let me think on that.  my head is in another place. sorry
21:03 marty thomason:  Here you go.....
21:04 marty https://gist.github.com/MadMartigan/6817097
21:07 basiliscos joined #mojo
21:08 thomason cool, thanks, but is there a way to do that w/o using the callbacks? I still wanted to route 'em through a controller/action pair. Or would I just dispatch it to the controller from within the callback? (assuming that's possible)
21:14 davido joined #mojo
21:16 marty The callbacks were just used for example.  you can route to anywhere.  ie:  ->to('controller#action')
21:17 marty the chain will continue as long as the return value is true
21:23 bpmedley joined #mojo
21:38 thomason Super! Progress! Next thing - if I try to assign a controller to the initial bridge route via ->to(), then the whole ball of wax fails.
21:38 thomason If I don't tack on a ->to and just have $r->bridge('/foo') to start, I can chain properly, but need to repeat the controller on subsequent routes.
21:39 thomason Can it just not be assigned initially in that manner? It seemed like it could.
21:46 sri seriously... that's all explained earlier in te routing guide
21:47 lukep joined #mojo
21:47 sri you're ignoring everything it tells you about nested routes, how the stash is inherited and what the different stash values mean
21:50 thomason What am I ignoring? It says that the stash is simply inherited from route to route and newer values override old ones.
21:50 thomason http://pastebin.com/TXAHedTA
21:51 sri why would you use a bridge there?
21:51 thomason earlier suggestion from marty.
21:51 sri you need to understand what bridges actually do, not just paste together random examples
21:52 thomason it's an overly simplified example from the real one that has two different methods to hit the root URL + a few subroutes.
22:05 thomason Take a look at the original pastebin I'd submitted - http://pastebin.com/t3rWUPPQ It looks like I can't chain a route two layers deep, and I'm trying to understand why.
22:05 thomason Cut me a break. If I didn't actually want to find out how this stuff works, I wouldn't be pestering you guys with stupid questions. I'd've long ago just hacked around it. I'm trying to grok the right way to do it.
22:08 sri of course what you want is possible and i could just give you the code, but i want to know what information might be missing from the docs that you didn't find it yourself
22:08 abhishekisnot1 joined #mojo
22:09 sri problem is that it's all there and totally obvious to me
22:10 thomason Well, from the docs what I pasted there looks like the right way to do it. I can set up a route, give it a few defaults, and then hang a subroute off of it and fill in the differences.
22:11 thomason It just seems to blow up when I hang a second subroute off of the first one. I don't understand what the difference is. The parent route is ->route, and the subroute is ->route->get, but otherwise look identical.
22:12 sri http://mojolicio.us/perldoc/Mojoli​cious/Guides/Routing#Nested_routes
22:12 sri "A route with children can't match on its own though, only the actual endpoints of these nested routes can."
22:14 thomason So is the proper solution just to toss on a redundant $foo_route->get; after I define the /baz path hanging off of $foo_route?
22:14 sri one of those routes shouldn't be a child but a sibling
22:15 thomason My example is overly simplified. I'm thinking ahead to deep trees. So there's /foo with routes hanging off of it, /foo/bar with routes hanging off of it, /foo/bar/baz with routes hanging off of it, and so on.
22:17 thomason Lemme cook up a more involved example, maybe that'll help. I think I'm grokking it right, just trying to confirm.
22:23 thomason Here's a more involved example - http://pastebin.com/9Btna3tZ I think I've got it, I'm just asking for confirmation that I'm understanding the basics of how the routes are set up and that this is a decent way to do it.
22:24 thomason (as a side note, I'm not necessarily saying that setting up such a deep tree structure like this is a good thing nor lobbying for it, I just want to know how to do it)
22:27 bluescreen joined #mojo
22:42 thomason joined #mojo
22:46 marty thomason:  Not sure if you have seen this, but it may be relevant to what you are trying to achieve.   http://mojolicio.us/perldoc/Mojo​licious/Guides/Routing#Shortcuts
23:01 good_news_everyone joined #mojo
23:01 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/Nfxwew
23:01 good_news_everyone mojo/master 428a272 Sebastian Riedel: mention similarities between param methods
23:01 good_news_everyone left #mojo
23:06 bpmedley joined #mojo
23:13 davido joined #mojo
23:39 zivester joined #mojo
23:45 Gedge joined #mojo

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