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

IRC log for #mojo, 2014-01-09

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

All times shown according to UTC.

Time Nick Message
00:19 good_news_everyone joined #mojo
00:19 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/kxTKfw
00:19 good_news_everyone mojo/master d04d2de Sebastian Riedel: more diverse tag helper examples
00:19 good_news_everyone left #mojo
00:26 cfedde joined #mojo
00:38 marty joined #mojo
00:46 jberger__ joined #mojo
00:48 jberger joined #mojo
01:07 laouji joined #mojo
01:23 marty joined #mojo
01:33 ka2u joined #mojo
01:35 laouji_ joined #mojo
01:37 meshl hey, could someone tell me why to weaken $self here, please: http://hastebin.com/tewufuqewu.perl
01:37 meshl caution: I am new to weaken ...
01:49 d4rkie joined #mojo
02:16 laouji joined #mojo
02:49 klapperl_ joined #mojo
03:32 jack joined #mojo
03:49 tholen42 joined #mojo
04:33 preflex_ joined #mojo
04:48 rem_lex|pivo joined #mojo
04:58 ka2u joined #mojo
05:02 hesco joined #mojo
05:10 hesco joined #mojo
05:12 stl_ joined #mojo
05:15 rem_lex joined #mojo
05:17 stl__ joined #mojo
05:18 laouji joined #mojo
05:34 webart1 joined #mojo
05:46 tianon joined #mojo
05:53 stl joined #mojo
05:54 laouji joined #mojo
06:07 stl joined #mojo
06:10 stl_ joined #mojo
06:11 stl__ joined #mojo
06:12 stl___ joined #mojo
06:12 stl____ joined #mojo
06:13 stl_____ joined #mojo
06:13 stl______ joined #mojo
06:13 stl_______ joined #mojo
06:13 basiliscos joined #mojo
06:14 stl________ joined #mojo
06:15 stl_________ joined #mojo
06:15 stl__________ joined #mojo
06:17 stl___________ joined #mojo
06:17 stl joined #mojo
06:18 stl_ joined #mojo
06:19 stl__ joined #mojo
06:20 stl_ left #mojo
06:20 stl__ left #mojo
06:20 stl left #mojo
06:21 dod joined #mojo
06:22 dod joined #mojo
06:27 hummeleBop joined #mojo
06:34 dod joined #mojo
06:47 Vandal joined #mojo
06:58 stl joined #mojo
06:59 dpetrov_ joined #mojo
07:00 stl joined #mojo
07:24 marcus meshl: to avoid capturing $self inside the closure and create a circular reference.
07:25 batman meshl: i've updated the Cloudinary API on github, but i
07:25 batman oops
07:25 batman ...but i'm unable to upload it to cpan
07:26 batman got cpanm?
07:27 batman cpanm https://github.com/jhthorsen/cloudinary/archive/0.14.tar.gz # if you want the new version
07:28 stl_ joined #mojo
07:29 stl__ joined #mojo
07:29 marcus oh no, my karma!
07:29 marcus batman: it's all your fault!
07:30 batman marcus: what? when? how?
07:30 batman "i don't know what i did last summer"
07:30 batman s/summer/night/
07:30 marcus "batman--, marcus-- # it's activated by default"
07:30 marcus sri: I was at a pub with beers and no computers when the subject was broached
07:49 stl___ joined #mojo
07:52 stl___ joined #mojo
07:52 stl___ joined #mojo
07:53 stl joined #mojo
07:57 stl joined #mojo
07:57 wsri_ joined #mojo
07:57 marcus_ joined #mojo
07:59 marcus_ joined #mojo
07:59 wsri_ joined #mojo
08:00 basiliscos joined #mojo
08:15 dod joined #mojo
08:28 trone joined #mojo
08:43 laouji joined #mojo
08:44 arthas joined #mojo
08:44 odc joined #mojo
08:58 arthas joined #mojo
09:06 laouji joined #mojo
09:10 denisboyun joined #mojo
09:12 amirite joined #mojo
09:13 amirite i get a 'Can't locate object method "send" via package "Mojo::Transaction::HTTP"'
09:13 amirite when trying to test a websocket
09:13 stl joined #mojo
09:13 amirite bug or my problem?
09:13 amirite $t->websocket_ok( '/echo' )
09:13 amirite $router->websocket( '/echo' )->to( controller => 'Socket', action => 'echo' )
09:13 amirite should be straight forward
09:14 amirite and it used to work
09:14 irq joined #mojo
09:21 amirite any ideas
09:22 denis_boyun_ joined #mojo
09:23 laouji joined #mojo
09:28 laouji_ joined #mojo
09:33 espent joined #mojo
09:33 kwa joined #mojo
09:38 mishantil Anyonw here remember why folders for tests are usually called only 't' instead of something descriptive?
09:41 dpetrov_ joined #mojo
09:43 fhelmber_ joined #mojo
09:45 stl_ joined #mojo
09:48 stl joined #mojo
09:48 stl joined #mojo
09:50 stl joined #mojo
10:04 maxhq joined #mojo
10:21 dvinciguerra joined #mojo
10:31 stl joined #mojo
10:31 batman amirite: the controller code or routing is probably messed up. how does you routes look like? is this a lite or full app?
10:32 batman mishantil: probably historical reasons, before we had autocomplete in shell. it's like why is it called "ls", "cat", ...? :)
10:38 stl joined #mojo
10:43 irq joined #mojo
10:50 stl joined #mojo
10:50 stl joined #mojo
10:52 mishantil batman: It is lkike I thought then. Is there a significant move towards better naming, or do people still use only 't' for tests (generally speaking)?
10:53 moritz people still use t/ for tests
10:53 mishantil Just wondering since there has been a push for better Naming Of Things within software development for the last couple of decades.
10:53 moritz there's significant tooling support for that
10:53 stl joined #mojo
11:15 nic mishantil: you're free to call 't' what you like; I call mine 'test'
11:16 nic but if you do that, doing ./myapp.pl test won't work
11:16 damaya If I have html in a variable, how can I render that html in my template? I am actually seeing the tags in the page, rather than headings, etc.
11:16 nic (but prove test will work)
11:17 damaya my $foo = '<h3>Hello World</h3>'; $self->render(heading => $foo); %= $foo (in template), results in <h3>Hello World</h3> being in the template
11:17 damaya rather than a heading.
11:18 damaya hurr, durr
11:18 damaya %==
11:19 damaya I looked right at it about 10 times
11:20 batman mishantil: i would NOT change the default "t" directory, because things like prove and smoking just works.
11:20 batman if you want a better name, make a symlink. or just don't
11:20 nic bah, renaming works fine; it's only the mojo 'test' command that doesn't like it
11:21 damaya I changed the 't' directory to 'test' and mojo test broke.
11:21 batman but it's just...it doesn't make any sense. the best name is a name that makes sense
11:21 nic I've never understood the benefit of the 'test' command anyway
11:21 batman the name that makes sense is "t", since -everybody- knows about it
11:22 batman once you start naming it "my-tests" or "unit-testststst" then people will get confused
11:22 nic I either do 'make test' or 'prove test' or 'perl test/12-some-test.t'
11:22 batman why not prove -l ? or prove -l t/some-test?
11:23 batman i also think adding numbers to tests are pretty annoying. a name is so much easier to remember than a number
11:23 batman and it shouldn't matter which order your tests are run anyway
11:23 nic say what you mean; ban the magic
11:23 batman if they do, then the test suite is broken
11:23 nic i disagree
11:24 nic I want to test the fundamentals before I test the intricacies
11:24 nic I don't want someone telling me some detailed feature broke when in fact something quite basic was missing
11:24 batman i bet you do, but it should not matter
11:24 batman but you run all of them anyway, so it doesn't matter
11:25 nic Some of us like to know the important stuff first, not buried in a random part of the message
11:28 batman i don't get what you're saying. but that's fine.
11:28 batman what i mean is that "buried in a random part of the message" is not something i've seen
11:29 nic If you believe there's only one way to do things, perl is a strange choice of language
11:29 batman no, i just believe some things are not worth doing.
11:31 nic not worth doing in your environment, but you know nothing of who is working with my code, with which coding standards, etc
11:31 batman it should not matter to your test suite
11:33 stl joined #mojo
11:34 nic Looks like we provided mishantil a decent argument list
11:38 KindOne joined #mojo
11:40 stl joined #mojo
11:54 suy Speaking of tests... I'm completely new to testing, and quite new to mojolicious. Can the user agent in tests be used to test an external application? I mean not even written in Perl/Mojolicious.
12:05 crab if i understand correctly what you mean, you want to use Test::Mojo against a remote/non-mojo web app: no, that isn't possible.
12:05 crab because Test::Mojo needs an App. i suppose you could make a shim app that just proxies to a remote url... might even be worth doing
12:07 Adurah joined #mojo
12:15 marcus hmm
12:18 crab what do you think, most noble colleague?
12:19 crab i don't think Test::Mojo *should* directly support testing against remote sites, but a separate module that lets you do it might be nice.
12:20 nic I've used Test::Mojo to test an in-house php app
12:20 marcus Then I suspect it works
12:20 nic by which I mean I used the ua and the convenience functions
12:21 marcus Right, but not actually Test::Mojo
12:21 nic the convenience functions were from there
12:21 marcus I think it would be nice if Test::Mojo would allow remote testing too.
12:22 nicomen I guess it shouldn't be TOO hard to wrap an app around an external site
12:23 nic ah, I see what you mean... $t->get_ok('/login')
12:24 nic I mis-spoke; it didn't use Test::Mojo
12:31 suy OK, thank you. I suppose I could try just running the user agent itself. It is, unfortunately, a PHP app from work. :-(
12:33 nic but you get to have fun with UserAgent and Test::More \o/
12:44 dsteinbrunner joined #mojo
12:48 mishantil Thanks everybody for the arguments wrt naming.
13:17 hrupp joined #mojo
13:31 basiliscos joined #mojo
13:40 batman is there any way to know if i'm running single process daemon, morbo or hypnotoad?
13:41 batman i think i've asked this a million times before.
13:41 batman if so: ignore me
13:42 batman nevermind. it doesn't matter.
13:44 rem_lex|pivo joined #mojo
13:57 rem_lex joined #mojo
14:02 d4rkie joined #mojo
14:08 laouji joined #mojo
14:10 dvinciguerra joined #mojo
14:11 ka2u joined #mojo
14:17 mishantil One of my devs (skilled .NET-guy) who I am forcing to do perl is loving Test::Mojo.
14:18 hellyna joined #mojo
14:22 hrupp Has anyone had touble with travis ? A test under perl 5.(10|12) fails on travis, on a local brewed perl 5.(10|12) everything is ok.
14:23 hrupp *trouble
14:26 russum joined #mojo
14:32 sh4 joined #mojo
14:38 batman yeah... blame travis...
14:38 batman :)
14:41 batman mishantil: it's one of my favorite things with mojo as well. unit testing with catalyst is awful.
14:46 bluescreen joined #mojo
14:56 good_news_everyone joined #mojo
14:56 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/Zb19Bw
14:56 good_news_everyone mojo/master d894d39 Sebastian Riedel: more consistent WebSocket tests
14:56 good_news_everyone left #mojo
15:01 romel hi everyone. did anybody notice mojo's strange behaviour when trying to use $app->renderer->default_handler('mason') after loading a plugin? the server just hungs and doesn't answer but still listens the tcp port
15:01 romel *hangs
15:05 good_news_everyone joined #mojo
15:05 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/gA4brw
15:05 good_news_everyone mojo/master 1a97f64 Sebastian Riedel: added example for running tests against remote host
15:05 good_news_everyone left #mojo
15:06 sri marcus, crab, nic, suy: *cough*
15:07 sri it would be very very hard *not* to support remote testing
15:10 sri oh my, pause is down for 1.5 days now
15:11 sri no updates on the blog... hmm
15:13 suy sri: Oh, great to hear then. I'll try it ASAP.
15:15 gryphon joined #mojo
15:18 hrupp batman: testing is hard :)
15:18 * hrupp goes shopping
15:18 batman hrupp: hahahahahaha :D
15:19 batman best response all day.
15:23 mishantil We are in the process of writing tests for one of our apps so that we can start moving to a more recent mojo-version.
15:23 mishantil We are quite afraid to do the switch before we have a test-suite running for the most important bits, as there has been quite a few breaking changes.
15:23 mishantil (mostly *good* breaking changes)
15:36 basiliscos joined #mojo
15:43 bjakubski joined #mojo
15:45 btyler joined #mojo
15:46 batman mishantil: do not fear. at least you got tests :)
15:46 dod joined #mojo
15:48 toebu joined #mojo
15:49 toebu I am trying to write a mojo app that accepts uploads > 10 GB of data ... over a slow link this means that the sending will be going on for quite some time
15:50 toebu is there also some sort of callback mechanism for receiving the large POST request without tying up the process ?
15:51 batman toebu: how do you handle if the connection breaks?
15:51 toebu :-) that would be for future consideration ...
15:51 batman the answer is to your question is that it's built in. it won't tie up the process.
15:51 toebu hmmm
15:52 mire__ joined #mojo
15:53 toebu ran my example with prefork ... and after few seconds it complains that Worker 5900 has no heartbeat, restarting.
15:53 toebu https://github.com/oetiker/upload-service
15:54 toebu https://github.com/oetiker/upload-service/blob/master/backend/lib/UploadService.pm
15:55 toebu running with  --heartbeat-timeout=600 things work
15:55 toebu but I guess this is not the idea
15:55 sri what server are you using?
15:55 toebu prefork
15:56 sri ok, then the code makes no sense
15:56 toebu glad to hear
15:57 batman toebu: you're changing globals. that seriously mess things up
15:57 batman you can't make a worker change uid and mess around with %ENV
15:57 batman what happens when it tries to handle two users at the same time?
15:58 batman also it require the server to run as root, which is an awful idea
15:58 toebu the uid change happens inside the controller
15:59 sri the code terrifies me
15:59 toebu grin
15:59 batman toebu: you should seriously start over.
16:00 batman 1. do not change user inside a controller
16:00 toebu how would you create something that receives uploads for multiple users and places them in their own file space ?
16:00 sri i can't overstate how bad this is "data   => $file->slurp"
16:00 batman 2. do not change %ENV inside a action
16:00 batman 3. do not change user inside an action
16:00 batman 4. do not change user inside an action
16:01 sri here's a hint for streaming very large files http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Custom_responses
16:01 sri but really, there is so much more wrong
16:01 toebu sri the part with slurp has no connection with the upload
16:02 sri you included it anyway
16:02 toebu and I am aware that this is realy bad for large files
16:02 toebu do you have an example for large uploads ?
16:06 sri what makes large uploads special?
16:08 Dandre Hello,
16:08 toebu when running the script with prefork, the prefork server is unhappy about not receiving any heartbeats from the process involved with receiving the upload
16:08 sri btw. it is etiquette around here to make a minimal example that only covers the stuff you want to ask about, not to link/paste your whole app
16:09 toebu sorry ...
16:12 Dandre I have an application with several packages. I am looking for a plugin to internationalise my app and I have found Mojolicious::Plugin::I18N. This plugin search for lexicons in MyApp::I18N. Is there any way to get lexicons from other packages?
16:25 mishantil Aaand I just served my keyboard a cup of tea. :) Guess I must be a very generous person.
16:28 nic think of it as a type of unit test :)
16:28 nic "chaos monkey"
16:30 lucs seen crab
16:30 purl crab was last seen on #mojo 4 hours, 11 minutes and 10 seconds ago, saying: i don't think Test::Mojo *should* directly support testing against remote sites, but a separate module that lets you do it might be nice.
16:31 nic My laptop and tablet have conspicuous damage from parenting-related disasters
16:31 nic If it's mentioned in meetings I dismiss it as part of our testing process
16:32 * sri yells at PAUSE
16:35 dvinciguerra joined #mojo
16:39 hesco Is /public/js/jquery-1.10.2.min.js an appropriate home for a javascript library, addressed in the template like so:  <script type="text/javascript" src="/js/jquery-1.10.2.min.js"></script> ???
16:41 hesco or rather public/js/jquery-1.10.2.min.js
16:50 good_news_everyone joined #mojo
16:50 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/fA45vg
16:50 good_news_everyone mojo/master 90564a4 Sebastian Riedel: mention active mode in title of not found and exception pages
16:50 good_news_everyone left #mojo
17:07 meshl joined #mojo
17:13 good_news_everyone joined #mojo
17:13 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/jKakVg
17:13 good_news_everyone mojo/master 8a14514 Sebastian Riedel: more consistently colored tables
17:13 good_news_everyone left #mojo
17:19 nic hesco: yes
17:35 dod joined #mojo
17:42 nic I'm torn between "class attributes are bad" and "awwbut some things were easier when we could do that"
17:44 amirite_ joined #mojo
17:44 meshl jberger (or anyone who cares about Mojo::IOLoop): I would really appreciate your insight on these 10 lines of code: http://perl.nopaste.dk/p71880 - could you please let me know why when I comment out the $self->render() call (line 8, highlighted), the on_finish() sub (ie the single argument of Mojo::IOLoop->delay) is called TWICE? (the second time, after about 10~15s delay, like if some sort of
17:44 meshl timeout occurred)
17:47 batman meshl: could you please use Mojo::IOLoop->delay like this instead? http://p.thorsen.pm/f79b3527955c
17:50 batman almost the same: http://p.thorsen.pm/f4677adfa7ff
17:52 meshl why? I was following jberger's latest tut...
17:53 meshl to my understanding, the behavior should be the same, but I'll try it out
17:53 batman meshl: because it's easier to read. this happens, then this happens, ...
17:53 beyondcreed joined #mojo
17:53 batman instead of do this last when something might have happen
17:54 denisboyun joined #mojo
17:58 meshl batman: exactly the same behavior: if I don't render, the first sub (on_finish) is called twice. WHY?
18:00 batman maybe it's because the loop fail?
18:00 batman which mojo version are you running?
18:01 batman Can't call method "text" on an undefined value
18:09 meshl hmmmm, Mojolicious 4.53, Perl 5.12.3
18:10 meshl I don't see any reason why this call happens twice, even though the situation is, I agree, unusual. Calling on_finish twice is actually dangerous
18:15 dod joined #mojo
18:15 sri meshl: bullshit, i've tried it and nothing is called twice
18:22 meshl ok, sorry if that is the case, let me try it in the most simplified app I can. Please also know that for dev purposes I am on Win32...
18:33 dvinciguerra joined #mojo
18:35 sri nic: btw. numbered tests are bullshit in an age where we run them concurrently anyway
18:35 * sri will only answer stuff for the rest of the day if "bullshit" fits into the sentence :)
18:36 batman sri++
18:36 mishantil sri: What kind of bullshit are you working on these days?
18:36 sri just the usual bullshit
18:36 mishantil that's bullshit
18:37 mishantil But I guess someone has got to do it.
18:37 sri i hope you're not bullshitting me
18:37 bpmedley As a specific example; perl and python are ...
18:37 mishantil Oh! I know this one! ... gay!§
18:38 bpmedley :)
18:38 mishantil Did I win something? :)
18:40 batman this is probably one of my worst commits, since toadfarm evilness: https://github.com/Nordaaker/convos/pull/50 :P
18:40 batman sri: ^ i'm pretty sure "bullshit" fits that pr
18:44 meshl bullshit not
18:44 meshl not on my platform, at least...
18:45 meshl code: http://hastebin.com/sivolabeti.perl
18:46 meshl app log: http://hastebin.com/jejunadugo.text
18:48 meshl unless... Win32 is bullshit. But this I already knew... Anyway, could anyone try this code on Linux and double-check it's platform specific?
19:04 irq joined #mojo
19:09 meshl please :D
19:15 nornagest joined #mojo
19:19 meshl if anyone cares, this is the result of setting MOJO_EVENTEMITTER_DEBUG to 1: http://hastebin.com/vebeyutaka.text
19:20 meshl details: this is for a single request to /t1 <- it must probably give some hint about why the double call is performed?
19:22 meshl it actually shows "Emit finish in Mojo::IOLoop::Delay (1)" twice for that single request...
19:40 zackiv31 joined #mojo
19:59 rem_lex|pivo joined #mojo
20:31 lukep joined #mojo
20:35 batman joined #mojo
20:35 elvis joined #mojo
20:36 batman joined #mojo
20:36 batman *back*
20:36 elvis joined #mojo
20:40 batman ssd feels good :)
20:40 batman my server got new disks now. too bad it's not the pause server :/
20:43 irq_ joined #mojo
21:05 elvis joined #mojo
21:05 batman joined #mojo
21:10 tempire cool
21:10 tempire the dallas fort worth perl mongers is using the sri-created raptor for their logo
21:13 sri nice way to write a book... http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world
21:14 sri oh, i forgot bullshit...
21:14 trone joined #mojo
21:14 sri at least nobody noticed -.-
21:18 marcus sri: bullshit
21:35 sri tempire: if you're there, say hi from me
21:46 sri oh, new mastering perl is out
22:02 Adurah Gotta if ($@) 'em all.
22:03 maxhq joined #mojo
22:04 gryphon joined #mojo
22:14 genio joined #mojo
22:14 jason_ joined #mojo
22:29 dsteinbrunner joined #mojo
22:43 bowtie_ joined #mojo
22:45 denis_boyun joined #mojo
23:13 dsteinbrunner joined #mojo
23:20 jason_ how can I use a global variable in my template under __DATA__ @@index.html.ep i tried <%= $myvar %> but I get Global symbol "$myvar" requires explicit package name at template index.html.ep from DATA section
23:32 jason_ please?
23:40 rem_lex joined #mojo
23:41 marty jason_:   sounds like $myavar was never declared.
23:41 go|dfish jason_: http://mojolicio.us/perldoc/Mojolicious/Controller#stash
23:41 jason_ well, I declared it in the global scope with my $myvar = "test";
23:42 jason_ i havent actually declared my template as a variable
23:43 marty <%= $myvar %> is correct syntax
23:49 jason_ i cant figure out why it is not working
23:51 go|dfish don't you need to pass it using the stash?
23:51 jason_ http://pastebin.com/hE7XVfrB
23:51 jason_ line 3 is declared
23:51 jason_ line 76 is used
23:51 jberger joined #mojo
23:52 marty that is very wrong.
23:52 marty scope...
23:52 purl scope is, like, same
23:53 marty you have to use the stash to pass variables to your templates.   The link go|dfish gave you has the answers
23:53 jberger meshl around?
23:54 jason_ how do i set $c to the local template
23:57 marty jason_: I'm not sure what you mean by "setting $c to the local template"
23:57 jason_ well, if you look on that pastebin, the template starts @ line 28
23:57 jason_ declared by @@ index.html.ep
23:58 jason_ in the stash examples, $c is associated to a template object
23:58 jason_ im just trying to figure out how to get $c associated to the @@ index.html.ep
23:59 jason_ Also, in this example for Form Validation, it looks like $validation is being used the same way i was attempting to use my variable...
23:59 jason_ http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Form_validation

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