Camelia, the Perl 6 bug

IRC log for #mojo, 2011-03-14

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

All times shown according to UTC.

Time Nick Message
00:10 mateu gslin: you can use Plack::Builder like normal.
00:12 mateu builder { enable "StackTrace"; app->start };  # something like that
00:12 gslin yes, you're correct :-)
00:14 gslin hmmm
00:14 gslin if I do so, then "script/myapp daemon" won't work
01:45 Alias joined #mojo
01:53 ispy_ joined #mojo
02:18 daviddelikat1 joined #mojo
02:23 daviddelikat left #mojo
04:44 crab well, that's not surprising, is it?
04:44 crab if you want it to keep working, make two startup scripts, one for plackup and one not
05:07 espent_ joined #mojo
05:08 minimalist gslin, You can also run your scrip under the Plackup development daemon
05:08 minimalist plackup -L Shotgun scripts/your_app
05:08 minimalist then you'll have your site at http://localhost:5000
05:09 espent left #mojo
05:13 perlrocks Twitter: "Catalyst is so subtle compatibility with the company's infrastructure, Mojolicious considering a framework. I still do not understand much, but is this version of Rails Perl It's not as signs of unlikely. . ." (ja) --JunichiIto77 http://twitter.com/JunichiIt​o77/status/47163370125791232
05:24 giwi left #mojo
05:40 giwi joined #mojo
06:20 ysyrota joined #mojo
06:38 kaare joined #mojo
06:51 marcus moin
06:53 koban joined #mojo
06:57 crab hi marcus
07:02 koban hi all
07:03 marcus crab, koban :)
07:10 crab i like tabindex.
07:25 cosmincx joined #mojo
07:31 fhelmber_ joined #mojo
07:32 minimalist left #mojo
07:34 Christian joined #mojo
07:34 Christian morning
07:43 marcus Christian: yes it is.
07:43 marcus purl: .aq?
07:43 purl well, .aq is antarctica
07:43 marcus o_O
07:43 Christian i'm in germany :)
07:44 marcus ah. underlined g looking like a q
07:44 marcus purl: .ag?
07:44 purl it has been said that .ag is antigua and barbuda
07:45 marcus Christian: I would have preferred being in antigua
07:46 Christian :D
08:00 ver joined #mojo
08:19 perlrocks Twitter: "Like the Struts MVC Mojolicious only want support for the VC. Model would come looking for other frameworks, please implement it yourself, it feels? Document as the official one I saw, Model could not find a description of. . ." (ja) --JunichiIto77 http://twitter.com/JunichiIt​o77/status/47210241561067520
08:25 sri good morning fellow dinosaurs
08:35 marcus sri:  model will come looking for other frameworks!
08:35 sri :o
08:41 perlrocks Twitter: "Ge, mojolicious Nariagatsu up to you what version of the dispatch behavior Toruyan Wow" (ja) --rin1024 http://twitter.com/rin1024​/status/47215711516504064
08:41 stephan48 i thought for models you just use a helper... which then delivers a object of a class?
08:41 koban is making async request with user agent as easy as "$self->ua($url=>sub{...})" now?
08:42 stephan48 sri: your bot translates the japanese tweets?
08:42 sri koban: it is
08:42 sri stephan48: it does
08:42 koban cool :)
09:00 * crab wonders if this message will cause sri to say "it will"
09:11 sri it will
09:19 Drossel left #mojo
09:27 Kulag joined #mojo
09:42 crab :-)
09:54 Kulag left #mojo
10:02 koban left #mojo
10:28 baton8 left #mojo
10:30 Kulag joined #mojo
10:32 lee7 left #mojo
10:57 koban joined #mojo
10:57 perlrocks Twitter: "The Session will change 過Ginaki Mojolicious Holding. I wonder if my imagination." (ja) --rin1024 http://twitter.com/rin1024​/status/47249970969067520
11:03 perlrocks Twitter: "Trying out Mojolicious" --fruit90210 http://twitter.com/fruit902​10/status/47251416787587072
11:03 crab "it is. it does. it will" <- mojolicious bottom-line
11:09 sri think i'll release 1.13 today
11:09 sri want useragent out there
11:09 spleenjack joined #mojo
11:10 GitHub183 joined #mojo
11:10 GitHub183 mojo: master Sebastian Riedel * f5f1cb8 (1 files in 1 dirs): release preparation - http://bit.ly/htLAKn
11:10 GitHub183 left #mojo
11:15 sri think i've made a mistake discouraging too simple plugins :/
11:16 sri people just don't get it that they can simply *use* a module
11:21 sri we need more of those
11:22 sri plugins that just instantiate a dbh and put it into a helper
11:25 tholen left #mojo
11:25 tholen joined #mojo
11:29 perlrocks Twitter: "#mojolicious needs more simple plugins, like instantiate a dbh and put it into a helper, to point people in the right direction. #perl" --kraih http://twitter.com/kraih/status/47257980755914752
11:29 koban left #mojo
11:29 koban joined #mojo
11:32 crab hm, i never posted my article about mojo and db handler
11:32 crab s/r$/s
11:32 sri shame on you!
11:38 koban left #mojo
11:39 sri marcus also did not publish his article yet
11:40 * sri cracks the whip
11:40 crab what is marcus writing about?
11:41 sri a really cool introduction to mojolicious
11:42 koban` joined #mojo
11:54 tholen left #mojo
11:54 tholen joined #mojo
11:55 fhelmbe__ joined #mojo
11:55 sri damn, i love HARNESS_OPTIONS=j3
11:56 sri and tagged 1.13
11:58 perlrocks Twitter: "Mojolicious 1.13 by KRAIH - http://frepan.org/~kraih/Mojolicious-1.13/" --cpan_new http://twitter.com/cpan_ne​w/status/47265414035685377
11:59 fhelmber_ left #mojo
12:00 perlrocks Twitter: "Released #mojolicious 1.13 with the new useragent module, enjoy! :) #perl" --kraih http://twitter.com/kraih/status/47265727236931584
12:34 lee7 joined #mojo
12:43 GitHub193 joined #mojo
12:43 GitHub193 mojo: master Sebastian Riedel * e9a2784 (3 files in 3 dirs): fixed typos - http://bit.ly/eWOFEw
12:43 GitHub193 left #mojo
12:50 perlrocks Twitter: "Good examples for how simple using web services in #mojolicious apps has become, blocking and non-blocking. http://t.co/70697nJ #perl" --kraih http://twitter.com/kraih/status/47278329618898944
12:52 ispy_ left #mojo
13:04 crab sri: well, i can't compete with that
13:04 crab but http://toroid.org/ams/etc/mojolicious-db-handles
13:11 sri crab++
13:11 sri the question just came up on the mailing list again too
13:11 sri http://groups.google.com/group/mojolicio​us/browse_thread/thread/b217f49044c02c7d
13:15 crab should i post the url to the list?
13:15 sri i've not taken a closer look at it yet, but if it contributes to the topic sure
13:16 perlrocks Twitter: "This is one of the simple #mojolicious plugins that needs to be written! ;) http://t.co/zxc1Ams #perl" --kraih http://twitter.com/kraih/status/47284971018260480
13:19 mattastrophe left #mojo
13:27 koban` left #mojo
13:27 koban joined #mojo
13:41 jfuller joined #mojo
13:41 jfuller Is there a xml renderer for mojolcious?
13:43 sri don't think so
13:43 sri what would it do?
13:46 jfuller sri: Basically what the json render does. Take a hash ref, convert it to xml, set the content type, serve xml to user
13:46 sri perl data structures map very poorly to xml
13:46 sri i've thought about it but generating xml with a template has always been more pleasant
13:46 jamesw evidence: xml-simple
13:46 purl xml-simple is kinda crappy, but it's really easy to deal with the generated structures.
13:47 jamesw oh silly purl
13:47 purl LA LA LA LALAL CAN'T HEAR YOU LALALA
13:47 * sri kisses purl
13:47 * purl swoons!
13:48 jfuller jamesw: Indeed, I'm basically porting an app that used xml-simple for doing the data transformations. Mayhaps I'll just use templates.
13:48 sri or use... xml-simple
13:49 jfuller sri: Is there a default mapping for the content type? Can I say format => 'xml', or do I need to add another mime type for it?
13:50 sri there is
13:50 jfuller sri: Thanks
14:01 kaare left #mojo
14:13 moritz when testing with text_like, do I have to chose the selector to only return a single element?
14:13 moritz I'm trying
14:13 moritz $t->get_ok('/') ->status_is(200) ->text_like('li' => qr/./);
14:14 moritz and the test fails
14:14 moritz although there are several <li>s with text content
14:14 sri it will only try the first
14:15 moritz the first one isn't empty :(
14:15 moritz i'll try to reduce it to a simple test
14:16 sri maybe it doesn't contain text children
14:16 moritz it does (though the first child is not text)
14:16 giwi left #mojo
14:16 sri you can test selectors with the get command
14:16 sri ./myapp.pl get li text
14:17 sri or
14:17 sri ./myapp.pl get li 1 text
14:18 moritz can I somehow recursively extract all text?
14:18 sri ./myapp.pl get li 1 all
14:18 moritz thanks
14:19 moritz wow, that's very handy
14:19 moritz the testing, I mean
14:19 sri the cookbook has a good overview
14:19 moritz 'all' too :-)
14:20 sri http://mojolicio.us/perldoc?Mojoli​cious/Guides/Cookbook#Command_Line
14:35 kaare joined #mojo
14:36 moritz sri: https://gist.github.com/869209 I don't see why I should be getting that warning (test file is at the bottom). Any ideas?
14:39 sri moritz: all is not css3
14:40 sri you can't get all text content
14:40 sri what you need is more specific selectors
14:41 sri like "li > span"
14:41 sri and "li > span:nth-child(2)"
14:41 vel joined #mojo
14:41 moritz sri: why does it work on the command line, but not in the tests?
14:41 sri only the first argument on the command line is a css selector
14:42 sri the rest is a mini dsl
14:43 moritz can we please get that in the tests too? :-)
14:43 sri no we can not ;p
14:44 moritz I don't actually care about the exact HTML structure (which will change a lot)
14:44 alnewkirk-away joined #mojo
14:44 moritz I just care that certain things should appear somewhere in the tree
14:44 sri selectors can be quite clever
14:45 moritz thus they require me to be clever :(
14:45 sri anyway, if you don't care about the tree don't select
14:45 sri use ->content_like(qr//);
14:45 sri it's a sledgehammer :D
14:45 moritz hm
14:46 moritz so I should use $thing->tx->res->dom('li') =~ qr/.../ ?
14:46 sri wait
14:46 moritz I do care that it should be below a certain list item
14:46 sri you said you don't care about the tree
14:46 moritz sorry, too imprecise
14:46 sri hmm
14:46 moritz I do care that in a certain li, the information needs to be buried somewhere in a text node
14:46 aleksey joined #mojo
14:47 sri ->tx->res->dom('li')->all_text =~
14:47 sri that would work
14:47 moritz makes sense
14:47 moritz thanks
14:47 sri i also wouldn't really mind new tests
14:47 sri if they make sense
14:47 sri like ->all_text_like(li => qr/.../);
14:48 moritz Can't locate object method "all_text" via package "Mojo::DOM::_Collection" at t/web.t line 22
14:48 sri oh right
14:49 sri ->tx->res->dom('li')->[0]->all_text =~
14:49 sri or ->tx->res->dom->at('li')->all_text =~
14:49 moritz then I need to select single elements again :(
14:50 moritz well, I can use join() then
14:50 sri of course, there are multiple results
14:50 sri you could also just select the parent element
14:50 moritz right, the ul
14:51 moritz thanks, works now
14:51 moritz it's clumsy, but that's OK for now
14:51 moritz I'll worry later about beauty
14:51 sri i actually like more precise dom tests
14:52 sri but i mostly just test if specific elements exist
14:52 sri like input fields
14:52 sri not actual text that changes a lot
14:52 moritz sri: btw I use  app->start unless caller;  in my lite apps, so that require-ing the app doesn't start it
14:52 moritz sri: do you think that's a sensible default for the defaulte lite_app template?
14:53 sri when is it necessary?
14:55 sri in the test harness it will just show its options and shut up
14:55 sri we have a test case for it
14:56 ana-tech joined #mojo
14:56 moritz I don't like the showing of the options
14:56 sri ok, most people won't ever see it though
14:57 moritz I run my tests directly with  perl t/foo.t  when writing the tests
14:57 sri have you tried your hack with plackup?
14:57 sri i can imagine it going very wrong there
14:58 alnewkirk-away left #mojo
14:58 moritz no, just with the built-in daemon
14:58 moritz didn't think of other modes - then it's probably not worth the trouble testing it on all platforms
15:16 janus left #mojo
15:16 janus` joined #mojo
15:26 Akron joined #mojo
15:36 fmerges joined #mojo
15:49 ver left #mojo
15:51 perlrocks Twitter: "http://toroid.org/ams/etc/mojolicious-db-handles # Mojolicious and DB handles" --gslin http://twitter.com/gslin/status/47324044860731392
15:52 aleksey left #mojo
15:54 Christian cu all
15:55 * sri waves
15:56 Christian left #mojo
15:57 Akron left #mojo
16:05 koban left #mojo
16:13 crab wtf. now that ironman perl thing has picked up one of my posts that has clearly nothing to do with perl.
16:13 crab it does contain "perl", though. as in "properly"
16:14 sri lol
16:15 cosmincx left #mojo
16:40 perlrocks Twitter: "Mojolicious-Plugin-Database v0.01 by MADCAT - http://frepan.org/~madcat/Mojo​licious-Plugin-Database-v0.01/" --cpan_new http://twitter.com/cpan_ne​w/status/47336408360300544
16:41 sri \o/
16:41 sri that didn't take long
16:54 stephan48 cool would be to make somsort of keepalive
16:59 sri for?
16:59 purl for fun.
17:04 vel left #mojo
17:08 dotan joined #mojo
17:25 fmerges left #mojo
17:25 xris joined #mojo
17:26 fhelmbe__ left #mojo
17:38 marcio_ferreira joined #mojo
17:54 spleenjack left #mojo
18:02 dotan left #mojo
18:04 ZadYree joined #mojo
18:05 ZadYree Hello mojo mastaz
18:05 * sri waves
18:06 ZadYree got a lil question: May you indicate me a page where I could get all template methods (like <% text_field ... %>
18:06 ZadYree )
18:07 sri http://mojolicio.us/perldoc?M​ojolicious/Plugin/TagHelpers
18:07 ZadYree ah thanks! Once more, you made my day
18:08 sri glad i could help
18:17 ysyrota left #mojo
18:18 minimalist joined #mojo
18:41 sigue left #mojo
18:41 sigue joined #mojo
18:42 perlrocks Twitter: "Sao Paulo Perl Mongers: Scraping with Mojolicious easy (and Atom feeds!): Http://sao-paulo.pm.org/equinocio/2011/mar/12" (pt) --dvinciguerra http://twitter.com/dvincigue​rra/status/47366974380064768
18:44 marcio_ferreira garu++ #article in SPPM
18:47 baton8 joined #mojo
18:58 jwang joined #mojo
18:58 garu :D
18:59 garu marcio_ferreira: btw now that 1.13 is on cpan, we need to s/Client/UserAgent/g to keep it up to date :)
19:01 ryanc left #mojo
19:04 marcio_ferreira garu: you refresh or i can replace ?
19:06 ryanc joined #mojo
19:34 alnewkirk-away joined #mojo
19:38 ana-tech left #mojo
19:38 alnewkirk-away is now known as ana-tech
20:00 alnewkirk-away joined #mojo
20:01 ana-tech left #mojo
20:01 alnewkirk-away is now known as ana-tech
20:01 ana-tech is now known as aboutaboy
20:17 aboutaboy left #mojo
20:29 baton8 left #mojo
20:36 perlite_ joined #mojo
20:40 perlite left #mojo
20:40 perlite_ is now known as perlite
21:07 marcio_ferreira left #mojo
21:18 ZadYree Another question: Has mojo a handy way to handle scheduled redirections, w/o using JS?
21:18 sri what?
21:19 ZadYree like   sleep(3), $self->redirect_to('page');
21:20 sri i guess you could just do "sleep(3); $self->redirect_to('something');"
21:20 sri but i don't see how that would ever be useful
21:22 ZadYree Well, I'd do that the let the user have the time to read a message before
21:23 * sri doesn't follow
21:23 sri how do you redirect then?
21:24 sri http based redirects are 302 responses
21:24 sri i don't see how the behavior you are expecting would be possible
21:26 ZadYree yeah
21:26 ZadYree so I gotta use meta balises?
21:39 kaare left #mojo
22:13 garu so you really should do this via javascript :)
22:13 garu or render the message page with a button or something
22:13 garu so the user can redirect whenever he/she wants
22:14 garu (I might read slower than you, for instance)
22:43 tempire lulz
22:44 tempire I totally agree for the need for m:p:database
22:44 tempire but it's kind of  funny after using helpers directly.
23:44 alnewkirk-away joined #mojo
23:48 alnewkirk-away is now known as alnewkirk
23:48 s0va sri: i've tested ae ioloop implementation with mojo::userAgent
23:48 s0va all tests pass :)
23:48 sri :)
23:49 s0va did i mention that some tests fail withh mojo::client?
23:49 s0va :)
23:49 sri no code changed there at all
23:49 s0va yeah :)
23:50 s0va i know that, but they failed with mojo 1.1 to
23:50 s0va and mojo 1.0
23:50 s0va so my conclusion is: you used ioloop in a wrong way.
23:50 sri oh wait, so you're saying it got better with useragent?
23:50 s0va just kidding
23:50 s0va :)
23:50 s0va YEP
23:50 sri :D
23:51 s0va i've been reviewing useragent code...
23:51 s0va btw, why the hell you need blocking operations?
23:51 sri it's what perl people are used to
23:52 s0va ppl were not used to mojo's coolness too.
23:52 s0va i have problem here.
23:52 s0va let's say that anyevent loop is already running...
23:53 s0va and i start daemon instance in already running perl process
23:53 s0va and fire up client in blocking mode.
23:53 s0va right now i have a dumb check if AE is already running
23:53 s0va ... so, if we're already running i cannot block.
23:54 s0va ... which sux donkey's balls :)
23:54 sri that kinda stuff always makes my head hurt
23:54 s0va and idea how to cope with this situation?
23:54 sri if people mix blocking and non-blocking i expect them to know what they are doing
23:54 s0va ;))
23:54 s0va that's one way of coping with situation :)))
23:55 sri i don't care anymore, you go blocking or non-blocking, everything in between is unsupported by me ;p
23:56 sri i don't think you can handle it without going crazy on the way :)
23:56 s0va i guess you're right.
23:56 s0va i'm preparing to release my stuff to cpan.
23:56 s0va the more i look to the code, the more ugly it looks to me :)
23:57 s0va but it works :)
23:57 s0va i hope the source formatter will help, but i have a bad feeling.
23:57 * sri wants to clean up the useragent code some more too
23:58 sri but mongodb gets priority now
23:58 s0va sri: mongodb?
23:58 purl it has been said that mongodb is pretty cool
23:58 s0va ?!
23:58 s0va i have 2TB mongo db
23:58 sri i'm building a pure perl client
23:58 s0va fucking hillarious stuff...
23:58 s0va sri: nice effort...
23:58 purl i think nice effort is underway
23:58 sri already have a full bson implementation
23:59 s0va yeah, i noticed on twitter...
23:59 s0va but!
23:59 s0va AnyEvent::MongoDB, AnyMongo....
23:59 sri it will have blocking and non-blocking modes too ;)

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