Camelia, the Perl 6 bug

IRC log for #mojo, 2012-11-18

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

All times shown according to UTC.

Time Nick Message
01:09 mire__ joined #mojo
01:11 davido joined #mojo
01:16 Mike-PerlRecruiter_ joined #mojo
01:19 jayallen joined #mojo
02:32 * dross stirs
02:33 davido joined #mojo
02:41 Caelum I want to learn more about mojolicious (want to use it for a REST API) where should I start? also, can I use it with modperl::registry?
02:46 inokenty Caelum: http://mojolicio.us/perldoc
02:48 Caelum ok thanks
02:48 Caelum is there something like Catalyst::Controller::REST?
02:52 inokenty RESTful routes are out of the box
02:54 Caelum what that does is choose a serializer based on the accept header
02:54 Caelum so like, you could have the same code to serve json or html
02:55 inokenty http://mojolicio.us/perldoc/Moj​olicious/Controller#respond_to
02:56 Caelum oh nice
02:57 inokenty You can also watch http://mojocasts.com
02:59 Caelum thank you, I will do some reading over the next week
03:01 Caelum one last question to determine if I can use this. The way our app is set up right now is we .cgi files that use TT, and the developers run these in eclipse (which only supports cgi) so I'd need to write this new portion as a .cgi file with an apache location override that runs it under modperl::registry, would this be possible?
03:01 Caelum is the mojolicious cgi mode compatibly with registry?
03:02 inokenty Yes, I think
03:02 inokenty If you will run your application as cgi
03:03 inokenty Not a daemon
03:04 Caelum great, thank you
03:20 Averna joined #mojo
03:26 noganex_ joined #mojo
03:48 dross I'm having some trouble :/
03:48 dross $r->route('/(*path)')->to( 'route#process', { engine => $engine, path => '' } );
03:48 dross what additional line must I use to serve from static say I match "public/"? I'm using Morbo for dev.
03:53 inokenty Mojolicious serves static automatically under 'public' directory
03:54 dross inokenty: my line matches everything...
03:54 inokenty Comment this line =)
03:54 dross hmm, actually, I didn't check to see if routes or public is matched first
03:55 dross ah nevermind :3
03:55 dross public is matched first
03:56 dross hmm
03:56 dross I wonder if there's a way to modify that behavior
04:00 dross hardcoded in to mojo
04:01 inokenty Read about hooks
04:02 dross inokenty: I'm guessing you're talking about before_dispatch
04:02 dross I see it right here in mojolicious.pm
04:03 dross inokenty: I'm writing a CMS, I'm just trying to ensure I can create an isolated area. I'll probably just make a static/ or pub/ directory and keep all application data there, else a static.acme.com
04:08 inokenty https://metacpan.org/module/Mo​jolicious::Plugin::RenderFile
04:09 inokenty Render static file from any directory, not only from public
04:34 dross inokenty: you'd think that plugin would be included with mojo
04:34 dross that has to be one of the more used feature examples for web dev
04:34 dross especially the content disposition
04:57 xaka joined #mojo
05:21 iskyee joined #mojo
05:22 ryozi joined #mojo
05:35 laouji joined #mojo
05:37 laouji_rouge joined #mojo
05:40 Foxcool joined #mojo
06:31 rem_lex|pivo joined #mojo
06:35 Adura joined #mojo
06:58 Vandal joined #mojo
07:41 memowe_ joined #mojo
08:16 sinkovsky joined #mojo
08:30 dod joined #mojo
08:40 connor_goodwolf joined #mojo
08:41 connor_goodwolf joined #mojo
08:44 connor_goodwolf joined #mojo
08:55 dod joined #mojo
08:58 sinkovsky joined #mojo
09:04 dbr joined #mojo
09:21 sinkovsky joined #mojo
09:32 d4rkie joined #mojo
09:33 d4rkie joined #mojo
09:40 dotan joined #mojo
09:42 dod joined #mojo
09:42 jayallen joined #mojo
09:45 Britzel joined #mojo
10:01 SmokeMachine joined #mojo
10:03 SmokeMachine joined #mojo
10:20 lukep joined #mojo
11:53 good_news_everyone joined #mojo
11:53 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/OwiaBw
11:53 good_news_everyone mojo/master aac4688 Sebastian Riedel: fixed description of name attribute
11:53 good_news_everyone left #mojo
12:20 dpetrov_ joined #mojo
13:13 human39 joined #mojo
13:17 Mike-PerlRecruiter_ joined #mojo
13:40 mire__ joined #mojo
14:02 * sri wonders why there is no pdf version of higher order perl with a table of contents
14:27 sinkovsky joined #mojo
14:35 sinkovsky joined #mojo
14:48 Demnogonis joined #mojo
14:48 Demnogonis Hello
14:49 dpetrov_ hi :)
14:49 Demnogonis got a question about Mojo::UserAgent
14:51 Demnogonis how can I let him download images from <img> tags, that have been found in the DOM?
15:00 dpetrov_ em I am not quite sure, probably someone else could give you better solution
15:01 dpetrov_ but you can go throu find('img')->each element
15:01 dpetrov_ and just download it?
15:04 marcus_ joined #mojo
15:06 dpetrov_ Demnogonis: I was thinking something like http://paste.scsys.co.uk/214551 which would probably work
15:09 Demnogonis it would work on a linux machine. I am using strawberryperl on windows, so I don't have wget available. Does Mojolicious have a similar feature to wget?
15:10 dpetrov_ see the docs
15:10 dpetrov_ I think it's documented
15:11 dpetrov_ http://mojolicio.us/perldoc/Mojo/UserAgent
15:11 Demnogonis yes, I found "move_to". Does that work for any kind of file?
15:13 dpetrov_ sure :)
15:14 Demnogonis ok I'll give it a try
15:50 gryphon joined #mojo
15:57 zivester joined #mojo
15:57 Demnogonis hm... it seems that this doesnt work with a direct url
16:04 SmokeMachine joined #mojo
16:16 d4rkie joined #mojo
16:38 sinkovsky joined #mojo
17:10 d4rkie joined #mojo
17:40 zivester joined #mojo
17:45 coff joined #mojo
17:49 mire__ joined #mojo
17:50 zivester joined #mojo
17:50 coff How old are people here?
17:57 Britzel coff: This is not Facebook, or AOL.
17:57 Britzel :)
18:07 coff Oh I know. I was just sitting here thinking about the good old days.
18:08 coff When there were babes aplenty on irc and we actually did use it as a hunting-ground.
18:12 zivester joined #mojo
18:14 zivester joined #mojo
18:14 dog_chocolate joined #mojo
18:16 zivester joined #mojo
18:17 zivester joined #mojo
18:18 Britzel oh my,,, 'hunting'...
18:19 kongelaks_ joined #mojo
18:23 * sri shoots at coff
18:24 zivester joined #mojo
18:25 coff left #mojo
18:37 SmokeMachine joined #mojo
18:47 sinkovsky joined #mojo
19:03 murray joined #mojo
19:10 murray "is there a way from within a Mojolicious app to get at the ip/port the "server" is listening on?  Mojo::Server::Daemon->listen looks close, but I'm not groking how I get hold of the M::S::Daemon from within my app … pointers?
19:12 sri you can't
19:14 jayallen joined #mojo
19:15 murray so if the app, say, wanted to send an email with a http link back to itself … either use DNS rather than an IP, or store that ip/port details in the config and try to ensure they remain correct?  Or is there a better way?
19:16 baton8 joined #mojo
19:23 marcus joined #mojo
19:35 SmokeMachine joined #mojo
19:36 ZadYree http://r33b.net/
19:37 sinkovsky joined #mojo
19:41 marcus joined #mojo
20:30 sinkovsky joined #mojo
20:36 lukep joined #mojo
20:43 dabudabu joined #mojo
21:04 sinkovsky joined #mojo
21:12 dog_chocolate joined #mojo
21:21 dog_chocolate Hi, I'm probably missing the obvious, but is it possible to get access to the stash generated by a request to a Test::Mojo->app?
21:24 sri no built-in way
21:25 sri you could hook into the app, but if you really need that you should know how it works already :)
21:26 sri oh, this is already being discussed in another channel...
21:43 dog_chocolate Not intentional just mst appeared
21:52 dog_chocolate I have another question, is it possible to decode a signed cookie via Test::Mojo, I had a bit of trouble doing this hence me going down the "try to access context specific stash" route
21:52 sri no built-in way
21:52 dog_chocolate ok cheers
22:06 gryphon joined #mojo
22:31 * sri wonders if extracting information like the stash in tests should be documented, or if it's too risky
22:31 sri http://pastie.org/5398480 # patch
22:32 * sri pokes tempire, marcus and crab
22:32 sri the question keeps comping up, but generally for the wrong reasons
22:33 marcus well, it's pretty clean the way you do it, but I agree, you usually shouldn't be needing this.
22:53 ghandi joined #mojo
22:53 ghandi Hi there.
22:54 ghandi Where can i set the session-expiration app-wide? I tried it in the startup-Method, but i only get an empty Hash-back. And the doc let's me guess, that i only can access the session in a controller...but i don't want to write in any controller something like "$c->session(expires...)"?
22:56 ghandi Ahh...i could probably set it after a successfull login...which would be a working work-around. but in general: isn't there a way to just configure this?
22:59 marcus ghandi: http://mojolicio.us/perldoc/Mojoli​cious/Sessions#default_expiration
22:59 dog_chocolate $self->sessions->default_expiration(x); in startup seems to be working for me
22:59 ghandi Setting the session expiration should also affect the cookie-lifetime, or?
23:00 dog_chocolate still picking this up but it looks like it's affecting my cookie lifetime (presumably as well as the signed internal expiry time)
23:00 dog_chocolate just done a 90 secs test
23:01 jzawodn joined #mojo
23:02 ghandi $self->session->default_expiration gives me: "Can't call method "default_expiration" on unblessed reference at script/../lib/SIA.pm line 33."
23:02 dog_chocolate sessions
23:03 ghandi ohh...sessions?
23:03 ghandi hmm..indeed :D
23:04 sri marcus: yea, i can't really come up with good use cases besides advanced diagnostics
23:06 ghandi Yeah, it really works when using $self->sessions :D
23:06 dog_chocolate YAY!
23:06 ghandi Maybe this should be noted a little bit clearer in the docs, that there is a difference bettwen $c->session and $app->sessions :D
23:07 dog_chocolate sri: how about where your backend records a state which isn't passed back to your frontend, perhaps for security reasons.  Or are you suggesting that would be tested elsewhere
23:08 sri ghandi: like http://mojolicio.us/perldoc/Mojolicious#sessions ?
23:08 ghandi Well...yeah...just like that :D
23:09 sri dog_chocolate: that state surely would influence the result though, and is therefore already testable
23:10 dog_chocolate by result you mean response?
23:10 sri yes
23:11 sri if it doesn't influence the response, why is it there?
23:12 dog_chocolate I dunno, maybe a bit contrived but off the top of my head, on login, if a username is incorrect you might want to return exactly the same response as if the password is incorrect
23:12 sri then you have two tests, wrong and correct username
23:12 dog_chocolate I dunno I can see both sides, you can argue about what it is you should be  testing here
23:13 sri right
23:13 dog_chocolate I guees the argument for may be that it simplifies tests somewhat, the con being, not necessarily for the best
23:14 sri and the question is not if we should allow it, it will always be possible, just if we should document it
23:14 sri (explicitly)
23:15 sri you could argue that the other hook example already hints at it
23:17 Averna joined #mojo
23:19 dog_chocolate I think I'd go TMTOWTDI
23:19 dog_chocolate Document and let people make the choice with a caveat that perhaps they may want to rethink
23:20 dog_chocolate I dunno I'm still unsure whether testing both ends is good practice or not
23:21 dog_chocolate If you know what I mean

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