Camelia, the Perl 6 bug

IRC log for #mojo, 2012-04-13

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

All times shown according to UTC.

Time Nick Message
00:16 jnap joined #mojo
01:02 scott joined #mojo
01:10 tempire mmajchrzak: heroku
01:41 xaka joined #mojo
01:47 lukep joined #mojo
01:57 asarch joined #mojo
02:07 mire joined #mojo
02:08 GitHub137 joined #mojo
02:08 GitHub137 [mojo] kraih pushed 1 new commit to master: http://git.io/1W4Ctw
02:08 GitHub137 [mojo/master] added example for testing custom transactions - Sebastian Riedel
02:08 GitHub137 left #mojo
02:09 sri tempire: that still means the new routes implementation needs to be planned
02:10 sri or is it wrong to look for backwards compatible solutions
02:10 sri ?
02:13 sri not to mention that a routes re-work needs to be planned too
02:16 sri oh well, i mostly lost interest anyway, if nobody really cares it's not an issue :)
02:22 GitHub149 joined #mojo
02:22 GitHub149 [mojo] kraih pushed 1 new commit to master: http://git.io/cM47Cw
02:22 GitHub149 [mojo/master] added another advanced testing example - Sebastian Riedel
02:22 GitHub149 left #mojo
02:24 asarch joined #mojo
02:50 tempire Maybe I'm just not sure what we're working towards.
02:50 tempire (regarding routes)
02:51 tempire sri: have you seen the meteor js screencast?
02:54 sri tempire: yes, it's what i've been preaching like forever ;p
02:54 sri web apps in the future will just *sync* client and server side
02:55 tempire for sure.
02:55 purl like totally!
02:56 tempire I feel like what we really need is some layers that handle that sort of thing.
02:57 tempire not necessarily that specifically, but stuff that eliminates the steps we're used to.
02:57 sri an application
02:57 purl rumour has it an application is cute.  please do send
02:57 tempire of course, I say that while I have yet to complete the asset pipeline
02:57 tempire but it's coming, I promise! :)
02:57 sri yeye ;p
02:58 * sri hides before someone says mongodb driver
02:58 tempire honestly, what I'm really working on is something were functionality can be determined without depending on js or perl.
02:59 tempire but that's my secret project
03:01 tempire wait - what do you mean by an application?
03:07 sri on the server side meteor is not a framework, it's an application that syncs js files and mongodb data with the client
03:16 mercutioviz joined #mojo
03:20 sri ask: yes it's outdated, ipv6 is built in these days
03:23 sri the wiki still needs a complete review, almost every page contains some outdated information
03:26 sri i love that you can do stuff like this :) https://github.com/kraih/mojo/bl​ob/master/lib/Test/Mojo.pm#L472
04:16 lukep joined #mojo
04:33 GitHub40 joined #mojo
04:33 GitHub40 [mojo] kraih pushed 1 new commit to master: http://git.io/ce0SUg
04:33 GitHub40 [mojo/master] tweaked hook documentation - Sebastian Riedel
04:33 GitHub40 left #mojo
04:41 sri hmm
04:41 sri i wonder if auto rendering should default to an empty 204 response instead of 404
04:43 sri No Content seems more appropriate than Not Found if a route matches but no response gets rendered
06:01 trexy joined #mojo
06:01 trexy hi
06:01 purl hola, trexy.
06:01 trexy I've got a quick newbie question
06:02 trexy I need the document root to default to index.html
06:02 trexy when you go to mysite.com -> I need the static controller to pick up index.html
06:02 trexy any suggestions?
06:04 trexy I have this at the start of my startup method ....      # set up the routes
06:04 trexy my $r = $self->routes;
06:04 trexy # Normal route to controller
06:04 trexy $r->route('/')->to('static#serve_root');
06:04 trexy
06:12 buu Does that not work?
06:13 trexy no - not currently
06:14 trexy actually on a closer look when I go to http://mysite.com - the server is returning a 404
06:15 trexy I'd like this request to be handled by the '/' route
06:16 trexy how do other sites handle the /index.html case?
06:27 sri please don't paste into the channel
06:34 trexy ok - sorry about the paste
06:53 sshaw joined #mojo
06:54 sshaw sri: if no response is rendered 200 is returned, no?
06:55 sshaw 405 instead of 404 for POST to GET route, etc...
06:58 sshaw in either case 204 is better. i find mysqlf manually sending 204 a lot for AJAX updates
07:03 sshaw purl: ¡que honda!
07:03 purl sshaw: huh?
07:04 fhelmber_ joined #mojo
07:06 jp joined #mojo
07:09 trexy I just asked a question on stackoverflow - if an answer comes to mind: http://stackoverflow.com/questions/10136573/settin​g-up-a-default-route-to-index-html-in-mojolicious
07:25 spleenjack joined #mojo
07:26 buu trexy: At the risk of being obvious, can't you just do a normal route/controller then render index.html ?
07:27 trexy ok
07:30 trexy so I could have a route for '/' -> action#handle_server_root
07:30 trexy then some kind of wildcard route
07:32 trexy $r->route('/*')->to('static#serve_root');
07:32 trexy ?
07:38 buu yuh
07:38 ki0 joined #mojo
07:38 buu I guess? If yuo want to match other things?
07:41 sri hmm, i would answer the question but i don't have a stackoverflow account :o
07:43 sri i will answer here if you promise to answer your own question over there
07:44 Vandal joined #mojo
07:45 trexy will do sri
07:45 sri $r->get('/' => sub { shift->render_static('/index.html') });
07:45 sri that's what i would do
07:46 trexy ok - and then for other files like /favicon.ico is there another route?
07:46 sri why would you need a route for favicon.ico?
07:47 trexy hmmm - probably not understanding routes ...
07:47 sri http://mojolicio.us/perldoc/M​ojolicious/Lite#Static_files
07:48 sri there's a lot of good documentation that should make it more clear
07:49 trexy I've read through quite a bit just missing a piece in the puzzle here ... so there is a default route to serve /favicon.ico  from /public?
07:49 sri separate dispatcher that runs before routes
07:51 trexy ok - so in theory I could remove the '/' catch all route and replace with $r->get('/' => sub { shift->render_static('/index.html') });
07:51 trexy and then have the 'separate dispatcher' pick up /favicon.ico
07:52 sri yes
07:53 trexy ok - thanks - trying that now
07:53 sri btw. '/' is not a catch all route
07:54 sri it only catches '/'
07:54 trexy ah ok
07:57 trexy omg - I think this is a my own fossil - static#serve_root
07:57 trexy I thought it was a mojolicious controller - turns out it was one of my old ones - doh
07:58 trexy cool - all works now - thanks for your help - much appreciated
07:58 trexy will update stackoverflow with the answer
08:00 sri trexy++
08:03 osprey joined #mojo
08:04 GitHub68 joined #mojo
08:04 GitHub68 [mojo] kraih pushed 1 new commit to master: http://git.io/1wOFSw
08:04 GitHub68 [mojo/master] use more lite routes in the routing guide - Sebastian Riedel
08:04 GitHub68 left #mojo
08:05 sri actually wonder if we should use lite style routes wherever possible
08:07 hugh joined #mojo
08:17 ver joined #mojo
08:21 batman is there a plugin or something that pass on the message to render_not_found($message) to the template?
08:22 batman i would like to say "could not find image", "could not find user in databsase", ... and display that on the page
08:22 batman i could simply add a helper, but i'm curious if there already was a way to do this
08:25 GitHub26 joined #mojo
08:25 GitHub26 [mojo] kraih pushed 1 new commit to master: http://git.io/3Zb9KQ
08:25 GitHub26 [mojo/master] removed unused resource argument from render_not_found - Sebastian Riedel
08:25 GitHub26 left #mojo
08:25 sri what argument? :)
08:46 tempire yes to the lite style routes
08:47 sri tempire: to what extent?
08:48 tempire in the guides
08:48 sri well, replacing everything in the routing guide is not easy
08:48 sri or bridges and waypoints for example make no sense anymore
08:49 tempire well, I don't think it should be forced.  but whenever it makes sense.
08:49 tempire well.  maybe it would be confusing.
08:50 sri i've already moved the short intriduction and replaced all mentions of ->route() after that
08:57 spleenjack1 joined #mojo
08:59 GitHub131 joined #mojo
08:59 GitHub131 [mojo] kraih pushed 1 new commit to master: http://git.io/TPZIOw
08:59 GitHub131 [mojo/master] use more lite routes in examples - Sebastian Riedel
08:59 GitHub131 left #mojo
09:00 sri ok, now ->route() is limited to the first half of the routing guide to explain primitives
09:21 daxim joined #mojo
10:24 batman sri: what was that count-code-lines command again?
10:26 batman got it now.
10:28 batman is there a tool for counting html/css/javascript as well?
10:32 Psyche^ joined #mojo
10:33 Leandr joined #mojo
10:39 batman i guess i can count those with just wc -l ..
10:41 Akron joined #mojo
11:00 Andrei666 joined #mojo
11:07 batman is this the way to avoid template caching: $app->renderer->cache->max_keys(0); ?
11:39 sri it's not supposed to be avoidable
11:48 Andrei666 is it possible to route directly to the template, bypassing a controller?
11:48 Gedge joined #mojo
11:49 Andrei666 via a get request?
11:50 Andrei666 and only the post request should go through the controller...
11:53 Andrei666 maybe with hooks?
11:55 GitHub48 joined #mojo
11:55 GitHub48 [mojo] kraih pushed 1 new commit to master: http://git.io/a_x-Zw
11:55 GitHub48 [mojo/master] small optimizations - Sebastian Riedel
11:55 GitHub48 left #mojo
11:56 sri not just possible, actually shown on our frontpage -.-
11:57 batman sri: but the request will go trough the default controller generated by mojo?
11:57 sri ?
11:58 Andrei666 sri: yes, I saw examples in a non-lite app, to be more specific in the tweetylicious app
11:59 batman all requests (except static) dispatch to a controller, right? either MyApp::Controller or Mojoliciosu::Controller?
11:59 Andrei666 sorry...i saw the examples in lite apps
11:59 Andrei666 but how can that be achieved in a non-lite app
12:02 sri Andrei666: the exact same way
12:03 sri batman: no, dispatching *to* a controlle rimplies that a controller exists
12:03 sri umm
12:03 sri s/controller/action/
12:03 sri s/a/an/
12:04 batman ok
12:05 sri we instantiate a default controller because it's necessary for rendering and stuff, but not dispatching to
12:05 Andrei666 sri: $r->route('/login')->via('​get')->to_template(....)?  or how?
12:05 sri lite apps don't dispatch *to* a controller, they just pass around a default one for convenience
12:06 sri Andrei666: what is to_template?
12:06 Andrei666 nothing atm, but i'm trying to get something like that...
12:07 Andrei666 i want to bypass the controller/aciton
12:07 Andrei666 *action
12:07 sri step back and think about how the lite example works, then translate that
12:15 marcus TRISTAR RED SECTOR INC
12:15 hugh joined #mojo
12:29 GitHub169 joined #mojo
12:29 GitHub169 [mojo] kraih pushed 1 new commit to master: http://git.io/mCpdOw
12:29 GitHub169 [mojo/master] more lite route examples - Sebastian Riedel
12:29 GitHub169 left #mojo
12:40 Andrei666 sri: thanks for the examples
12:40 Andrei666 :)
12:44 black joined #mojo
13:19 sri :)
13:25 jnap joined #mojo
13:38 black joined #mojo
13:42 mattastrophe joined #mojo
13:44 Htbaa joined #mojo
13:50 nafcool joined #mojo
13:50 nafcool hey
13:50 nafcool I've uploaded my app on Heroku
13:50 nafcool and i want to edit my webpage
13:50 nafcool how do i edit the existing app?
13:51 sjn locally, then upload it again?
13:53 mire joined #mojo
13:56 inokenty joined #mojo
13:56 nafcool alright
13:56 osprey left #mojo
13:56 nafcool but it will create another app
13:59 d4rkie joined #mojo
14:03 mattastrophe joined #mojo
14:15 d4rkie joined #mojo
14:25 ColonelPanic001 left #mojo
14:29 mattastrophe joined #mojo
14:42 CromeDome joined #mojo
14:50 jp joined #mojo
15:05 gabiruh joined #mojo
15:07 GitHub164 joined #mojo
15:07 GitHub164 [mojo] kraih pushed 1 new commit to master: http://git.io/8Ybpyg
15:07 GitHub164 [mojo/master] added nested lite route example - Sebastian Riedel
15:07 GitHub164 left #mojo
15:09 xaka joined #mojo
15:16 mattastrophe joined #mojo
15:45 jp joined #mojo
15:47 mattastrophe joined #mojo
15:47 Psyche^ joined #mojo
16:18 xaka joined #mojo
16:21 mattastrophe joined #mojo
16:26 baton8 joined #mojo
16:35 JasonCrome joined #mojo
16:39 mattastrophe joined #mojo
16:53 mattastrophe joined #mojo
17:13 mattastrophe joined #mojo
17:31 tempire nafcool: you just push the git repo
17:31 tempire I don't know how else you would do it
17:34 mattastrophe joined #mojo
17:43 r0b3rt joined #mojo
18:14 GitHub155 joined #mojo
18:14 GitHub155 [mojo] kraih pushed 1 new commit to master: http://git.io/Jd4h5g
18:14 GitHub155 [mojo/master] small mojobar tweak - Sebastian Riedel
18:14 GitHub155 left #mojo
18:14 jp joined #mojo
18:29 GitHub131 joined #mojo
18:29 GitHub131 [mojo] kraih pushed 1 new commit to master: http://git.io/lBx1jg
18:29 GitHub131 [mojo/master] more diverse lite route examples - Sebastian Riedel
18:29 GitHub131 left #mojo
19:01 GabrielVieira joined #mojo
19:03 jnap_ joined #mojo
19:08 asarch joined #mojo
19:18 Dani joined #mojo
19:27 jnap joined #mojo
19:30 nuba joined #mojo
19:51 marcus hurk
19:51 marcus hnnag
20:02 zivester joined #mojo
20:14 JerJer joined #mojo
20:16 JerJer why would this route not be found?  it shows up when i do ./myapp routes         $r->namespace('Valid::Controller');   $r->route('/json/:query')->to(action => 'json')->name('json');
20:16 JerJer (before these lines:  my $r = $self->routes;)
20:26 buu JerJer: How are you attempting to activate it?
20:28 JerJer um … not sure what you mean by activate
20:29 JerJer this is a full mojo app, within the startup sub
20:29 JerJer should i be doing $r->route  or $r->get   ? i've seen both
20:32 marcus JerJer: ->route matches any http method unless you restrict it with via
20:32 JerJer ahh ok
20:34 rwstauner joined #mojo
20:34 JerJer the sub in my controller package is not getting called… i added a debug log print
20:34 JerJer /json/:query          GET  "json"
21:11 jnap joined #mojo
21:33 Dani left #mojo
21:36 JerJer I must be missing something… i have tried everything, but the code in my controller is never called
21:36 JerJer but there are no warnings or errors i can find
21:37 JerJer i've also tried:    $r->get('/json')->to(action => 'json')->name('json');    - no dice   (yet it shows up in ./myapp.pl routes)
21:42 Kallisti joined #mojo
21:45 marty JerJer:  Are you taling your mojo log?   If so, you should see a message similar to this.... Routing to "Myapp::Myaction->mysub"
21:46 Kallisti joined #mojo
21:46 JerJer marty:  nothing like that is printed
21:46 marty do you see a message like that at all? Even when it routes as you intend?
21:46 JerJer nope
21:47 JerJer Template "json.html.ep" not found.
21:47 JerJer all that prints out:   http://pastebin.com/sTssiK7z
21:48 marty have you gotten any pages to work?
21:49 mee left #mojo
21:49 JerJer marty:  yes.  I have a default layout and the other routes display the proper template, but the controller code isn't getting called
21:50 JerJer if I change to:   $r->get('/json')->to('json');
21:50 JerJer i get the Dispatching to "json"   and  json does not exist, maybe a typo?
21:51 JerJer before that line I set:   $r->namespace('yConference::Web::Controller');
21:51 JerJer which is a valid namespace with a sub json {}
21:52 JerJer and yConference::Web::Controller has a base of :  use Mojo::Base 'Mojolicious::Controller';
21:55 marty Hmmm.   yConference  Hmmm
21:55 GitHub186 joined #mojo
21:55 GitHub186 [mojo] kraih pushed 1 new commit to master: http://git.io/e116oA
21:55 GitHub186 [mojo/master] improved router log messages - Sebastian Riedel
21:55 GitHub186 left #mojo
21:55 sri try that
21:56 marty Is it a camelcase issue?
21:57 JerJer hmm - now i gotta figure out how to update mojo   :)
21:58 sri cpanm http://latest.mojolicio.us
22:01 JerJer ugh - not a good day :(    http://pastebin.com/9jmMtStX
22:07 mattastrophe joined #mojo
22:28 JerJer sri: ok now I see  "json" does not exist, maybe a typo?
22:32 JerJer also, i have a template for /  - I see the rendered template, but i get the similar message "rooms" does not exist, maybe a typo?
22:33 JerJer AHHA!
22:33 JerJer if I do:    $r->namespace('yConference::Web');     then   $r->get('/json')->to('controller#json');    The code gets called
22:34 JerJer Routing to action "yConference::Web::Controller->json".
22:40 chromatic joined #mojo
22:40 chromatic I hear there's interest in a Mojo book.
22:58 marty \o/

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