Camelia, the Perl 6 bug

IRC log for #mojo, 2013-07-01

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

All times shown according to UTC.

Time Nick Message
00:35 punter Anyone knows where the AccessLog plugin pull the "remote user"s username from?
00:35 punter I.e. how do I set the remote user from Mojolicious, so that it appears in the access.log?
00:36 shmuel joined #mojo
00:36 bpmedley punter: What does your app use for authentication?
00:37 punter bpmedley: A hook I made reads the X-SID header, and fetches the relevant $user database object (ORM) from the db
00:37 punter instead of cookie, I got X-SID
00:38 bpmedley %{ResponseHeaderName}o, possibly?
00:39 punter So you're suggesting that I send to the client a new header, for the sole purpose of logging it to access.log?
00:40 bpmedley punter: Sorry, I guess I'm not familiar with X-SID.  I thought was a header sent by the client at every request.
00:40 punter I made the X-SID header myself. It's sent by the client at every request. But %{ResponseHeaderName} is part of the response
00:41 punter The server is an API server, not an HTML one, that's why I have such weird requests
00:41 bpmedley https://metacpan.org/module/M​ojolicious::Plugin::AccessLog  <-- Check out uname_helper
00:42 punter The reason I asked is that I saw in AccessLog's documentation that %u displays the remote user's username. I guess I could look into AccessLog's source code, I forgot to do that. Sorry
00:42 punter I'll look at uname_helper too
00:42 punter aaa
00:42 punter thanx
00:47 punter g'night all, it was nice meeting you
00:47 punter left #mojo
01:25 egopro joined #mojo
01:33 duncanthrax joined #mojo
01:34 daemonic joined #mojo
01:37 * sri fricking hates addison wesley ebooks...
01:38 sri i buy their damn overpriced books... and end up having to use a pirated copy anyway because they think it's cool to put my name on every damn page !@#$%
01:42 jberger tempire, perlr thinks stevan is miyagawa :o
01:43 sri because that is miyagawa
01:43 sri linking to a stevan post
01:43 jberger yeah, I just clicked on it
01:43 jberger oops
01:45 d4rkie joined #mojo
01:55 asarch joined #mojo
01:57 Meiermann joined #mojo
01:59 d4rkie joined #mojo
02:22 abra_ joined #mojo
02:25 asarch joined #mojo
03:05 D4RK-PH0ENiX joined #mojo
03:20 amirite joined #mojo
03:50 preflex_ joined #mojo
04:06 d4rkie joined #mojo
04:13 arpadszasz joined #mojo
04:28 Psyche^ joined #mojo
04:48 spacebat joined #mojo
04:49 spacebat hi, I've got a mojolicious template that I'd like to reuse, but it refers to things like $heading that, if they aren't supplied, cause errors
04:50 spacebat I've tried <%= $heading || 'default' %> and even <%= eval { $heading } || 'default' %> but still get the render error
04:50 spacebat I see that I can set defaults at the application level but this is really specific to the template that is being reused
04:51 spacebat short of symbol table inspection, what's the trick?
04:52 sri it's just perl
04:52 sri no strict 'vars'
04:54 sri odd that your first instinct was symbol table hacks
05:04 egopro joined #mojo
05:10 spacebat my first instinct was || and then eval {}  ||
05:11 spacebat is there a way to expose all the values available in a data structure that I can get at inside the template
05:11 spacebat ?
05:11 sri http://mojolicio.us/perldoc/Mojoli​cious/Plugin/DefaultHelpers#stash
05:12 spacebat ah, that would be it - thanks :)
05:13 spacebat stash('heading') || 'default' is the trick
05:15 good_news_everyone joined #mojo
05:15 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/3LtG_w
05:15 good_news_everyone mojo/master b58a570 Sebastian Riedel: fixed typo in helper example
05:15 good_news_everyone left #mojo
05:18 whitebook joined #mojo
05:23 egopro joined #mojo
05:34 mike_ joined #mojo
05:40 Britzel joined #mojo
05:51 Britzel_ joined #mojo
06:18 dpetrov_ joined #mojo
06:31 iankent joined #mojo
06:51 suy joined #mojo
07:09 shmuel joined #mojo
07:10 Vandal joined #mojo
07:22 dod joined #mojo
07:32 someone joined #mojo
07:47 dod joined #mojo
08:08 marcus_ What's the coolest lightweight dbix thingie these days?
08:09 judofyr joined #mojo
08:12 Caldrin marcus_: What's a DBIX thingie?
08:13 marcus_ Caldrin: Like DBIx::Simple, DBIx::Skinny
08:15 dod joined #mojo
08:25 jzawodn joined #mojo
08:33 maxhq joined #mojo
08:37 egopro joined #mojo
08:37 egopro joined #mojo
08:50 Meiermann joined #mojo
08:51 dod joined #mojo
08:54 dod joined #mojo
08:57 fhelmber_ joined #mojo
09:06 mtths joined #mojo
09:16 rem_lex| joined #mojo
09:18 dpetrov_ marcus_: DBIx::Class? :P
09:20 Caldrin dpetrov_: IMHO thats a cool thingie, but its certainly not lightweight.
09:45 egopro joined #mojo
10:19 basic6_ joined #mojo
10:20 basic6_ how do i create a route that uses a style.css.ep template (this looks for style.html.ep: $r->get('colors.css')->to("colors") )?
10:23 yakudza joined #mojo
10:36 Vandal basic6_, http://mojolicio.us/perldoc/Moj​olicious/Guides/Routing#Formats
10:41 cosmincx joined #mojo
10:46 trone joined #mojo
11:00 arpadszasz joined #mojo
11:37 Jonis can you make mojo post UTF8?
11:38 libsysguy joined #mojo
12:01 marcus_ dpetrov_: yeah, not lightweight
12:01 dpetrov_ define lightweight? :)
12:01 jast DBI is lightweight :}
12:02 marcus_ dpetrov_: mostly writing your own SQL, but with more convenience than DBI.
12:03 d4rkie joined #mojo
12:03 dpetrov_ well in that case DBIx::Simple probably
12:03 dpetrov_ never looked at ::Skinny
12:26 bowtie joined #mojo
12:30 maxhq joined #mojo
12:34 whitebook joined #mojo
12:44 bowtie joined #mojo
12:48 basiliscos joined #mojo
13:02 gryphon joined #mojo
13:12 mire joined #mojo
13:16 whitebook joined #mojo
13:18 libsysguy1 joined #mojo
13:33 bowtie joined #mojo
13:37 amirite joined #mojo
13:46 whitebook joined #mojo
13:49 punter joined #mojo
13:58 egopro joined #mojo
14:00 yakudza joined #mojo
14:00 asarch joined #mojo
14:11 dod joined #mojo
14:23 whitebook joined #mojo
14:30 doby joined #mojo
14:38 cosmincx joined #mojo
14:42 nicomen are aware that plack closes *STDERR and that the proper io handle to use is in $ENV{psgi.errors} ?
14:42 nicomen +you?
15:17 egopro joined #mojo
15:19 * sri yawns
15:23 nicomen local *STDERR = $env->{'psgi.errors'}; in Mojo::Server::PSGI->run() seems to do the trick!
15:24 bluescreen joined #mojo
15:26 jiyuperl joined #mojo
15:27 whitebook joined #mojo
15:29 whitebook1 joined #mojo
16:28 egopro joined #mojo
16:38 Jonis I keep looking and looking and can't figure out how to enable log in startup
16:45 mire joined #mojo
16:46 bpmedley Jonis:  $self->log->level("debug");  <-- Something like that?
16:53 Jonis bpmedley: well, I thought $self->app->log->debug('message'); would work out of the box for me, but I'm clearly missing somrthing
16:53 Jonis something too
16:53 bpmedley Is it production?
16:54 Jonis no
16:55 bpmedley Are you using morbo?
16:55 Jonis yup
16:55 Jonis eventually it'll be in production, but not for a while yet
16:55 bpmedley Are there permission issues with the log directory?
16:56 Jonis no, I'm a total moron
16:56 Jonis :(
16:56 bpmedley What was it?
16:56 Jonis I forgot about how it starts logging directly when you create the log directory
16:57 Jonis so I was looking at the morbo stderr instead of the log file :P
16:57 Jonis $moronpoints++
16:57 bpmedley Cool, glad it was an easy fix.. :)
17:04 Jonis does $self->app->log->fatal('ohshit') work out of the box in production?
17:04 Jonis (assuming fatal works like that)
17:05 sri it's all documented http://mojolicio.us/perldoc/Mojolicious/Lite#Mode
17:07 bluescreen joined #mojo
17:09 sh4 joined #mojo
17:11 nicomen sri: any chance you could add that fix for PSGI STDERR I mentioned? I have tried to work around it from my app, but can't seem to do it...
17:13 trone joined #mojo
17:43 sri nicomen: what fix?
17:51 diegok Hi o/
17:51 sri if you mean that one line you pasted... that's not a fix
17:51 sri \o
17:52 libsysguy1 left #mojo
17:53 diegok I would like to intercept any not found request, check if I have a redirection defined and if not let the usual happen... I mean, this can happen when no route is defined or when route is defined but render_not_found is manually called... is there an easy way of doing this?
17:53 diegok If I have a redirect defined I'll send a 3xx instead of 404
17:54 diegok till now I can set a catch-all route at the end and replace all render_not_found in my code... But I like to keep the render_not_found if possible :)
18:17 KindOne joined #mojo
18:26 whitebook joined #mojo
18:37 nic it's diegok \o/
18:41 diegok hi nic! \o/ :-)
18:42 diegok any suggestion for my redirect thingy?
18:44 nic afraid I don't know a solution, but I betting there's a way :)
18:45 nic I'd rather be thinking about that tbh
18:47 nic somehow a db full of MyISAM (non-transactional) is trying to rollback massive transactions; my solution is to manually set the relay position each time this happens => not fun
18:53 punter joined #mojo
19:31 punter $c->render(json => $obj) doesn't work for blessed $obj does it? In my tests, it rendered the following: "ABC=HASH(0x4ef0c48)" (including the quotes)
19:32 punter ABC is the class
19:32 punter So I have to "unbless" it first with Data::Structure::Util - I wonder whether Mojo should have this fixed though
19:36 bpmedley nic: https://gist.github.com/brianmed/5903844  <-- Does this work for you?
19:36 punter Of course, maybe I should be passing blessed objects to the renderer
19:36 punter I'll check
19:36 punter a, nic, not me
19:41 jamesw joined #mojo
19:42 dvinciguerra joined #mojo
20:00 Tiger joined #mojo
20:01 nic bpmedley: yes, seems to work perfectly
20:01 nic redirected /yesterday to /
20:04 tm joined #mojo
20:05 nic diegok: Does bpmedley's example swing your boat?
20:30 diegok nic: hm... nop :)
20:31 BeDa joined #mojo
20:32 lukep joined #mojo
20:41 gryphon joined #mojo
21:10 zackiv31 joined #mojo
21:11 dvinciguerra joined #mojo
21:26 mezo joined #mojo
21:28 whitebook joined #mojo
21:37 Moataz-E joined #mojo
21:38 Moataz-E joined #mojo
21:40 jmmills joined #mojo
21:41 Moataz-E guys what are the best plugins for use with User login
21:43 Moataz-E i came across this one but it the developer warns against using it: https://github.com/koorchik/M​ojolicious-Plugin-UserManager
21:43 Moataz-E it is full of cool functions though, anyone know of a similar one?
21:50 whitebook joined #mojo
22:04 maxhq1 joined #mojo
22:11 yakubori joined #mojo
22:11 yakubori hello
22:12 sri o/
22:17 sri odd there are no really good jquery books... was just asked for a recommendation and couldn't name one
22:18 cfedde the online doc is no worse than any of the books.  and half of the books seem to be little more than the online docs.
22:18 cfedde or out of date.
22:18 sri yea, maybe the online docs are too good
22:19 yakubori for hotshots apparently: http://my.safaribooksonline.com/book/​web-development/jquery/9781849519106
22:19 cfedde even an old fart like me has pretty much given up on dead tree media.
22:19 cfedde the one pretty good tech book store in denver closed about a month ago.
22:20 * sri loves the no starch press tomes
22:22 sri the linux programming interface and the like
22:25 punter joined #mojo
22:49 yakubori can morbo be used for production deployments at all? or is it strictly for development?
22:56 sri http://mojolicio.us/perldoc/Mojol​icious/Guides/Cookbook#DEPLOYMENT
22:56 yakubori ya -- just started reading that. :P
22:57 yakubori the cookbook that is
22:59 punter I'm lost - I'm trying to find in the documentation how to write something to the log, but I can't find it. How do I find it? I don't want the actual URL, just want to know how I can find such information
23:00 punter I searched CPAN for mojolicious log, and only Mojo::Log came up
23:00 punter A, found it. Sorry :-)
23:00 Moataz-E punter: Also try mojocasts, i remeber it was mentioned
23:22 gryphon_ joined #mojo
23:23 Dandre joined #mojo
23:25 Averna joined #mojo

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