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

IRC log for #mojo, 2014-02-05

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

All times shown according to UTC.

Time Nick Message
00:00 good_news_everyone joined #mojo
00:00 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/6UIr_w
00:00 good_news_everyone mojo/master 47a747c Sebastian Riedel: made Mojo::DOM::HTML a tiny bit faster
00:00 good_news_everyone left #mojo
00:08 sri i hate it when i want to optimize things by using List::Util::first instead of grep and the subroutine overhead makes it more costly...
00:16 sugama joined #mojo
00:48 d4rkie joined #mojo
00:49 marty joined #mojo
01:02 rem_lex joined #mojo
01:08 jzawodn someone needs to make an xs version of List::Util
01:14 davido_ jzawodn: It is XS.
01:15 davido_ Yeah, first is kind of a disappointment unless your list is really big.  ...and when it isn't "really big", I suppose the biggest advantage is semantic meaning.
01:16 jzawodn WAT?
01:16 purl Watt?  Watt?  I can't hear you, there's this buzzing noise where my brain should be.
01:16 davido_ tempire: If you please. ;)
01:17 davido_ jzawodn: It's part of the Scalar::Util distribution, included in the core, and dual-lifed on CPAN.  Check the source.  XS.
01:18 jzawodn davido_: interesting... I guess sri's code is already so good that even that slows it down
01:19 davido_ I don't want to put words in his mouth, but I think his point was that grep often beats first, even though first will stop looking as soon as it finds what its looking for, whereas grep must finish the entire list before it stops.
01:20 davido_ Even though first is written in XS, it doesn't enjoy some of the benefits of being built into perl itself.
01:20 dvinciguerra joined #mojo
01:24 marty joined #mojo
01:25 sri jzawodn: http://mail.pm.org/pipermail/melbourne-pm/2007-May/002324.html
01:25 sri good explanation
01:25 jzawodn ah, thanks
01:25 btyler joined #mojo
01:26 davido_ 'first' shouldn't "suffer from a high cost of entering a subroutine for each list element" any more than grep does, since it's using MULTICALL, which reuses the same call stack frame over and over again.
01:28 davido_ That's a good to-do list item though; walk through the internals of each and try to learn what is really making the difference.
01:29 davido_ http://perl5.git.perl.org/perl.git/blob/a0ed822e862cc055fe2ab98cf3bb96909dae186d:/pp_hot.c  and http://perl5.git.perl.org/perl.git/blob/a0ed822e862cc055fe2ab98cf3bb96909dae186d:/pp_ctl.c
01:36 ka2u joined #mojo
01:59 * sri kinda likes the grep/return trick
02:08 sri but too bad perltidy doesn't like it as much
02:08 sri wish i could figure out to make it collapse multiple blocks on one line
02:09 sri like this one https://github.com/kraih/mojo/blob/master/lib/Mojo/DOM.pm#L234
02:13 marty sri:  thank you.   My problem was I was doing a hot reload of hypnotoad after setting my environment variable.  I had to completely stop it and then things worked as expected.
02:15 sri don't use env variables with hypnotoad
02:16 sri and if you do BEGIN { delete $ENV{MOJO_LOG_LEVEL} }
02:16 sri in your app to get rid of it without shutdown
02:17 marty good advice.  thanks sri.  \o/
02:18 marty btw.. sri with evil horns...  http://c2.glitch.bz/avatars/2011-11-07/263a81724b314a781fcb48015ff924ee_1320703593_172_flip.png
02:18 marty :)
02:18 sri :D
02:18 sri that's me!
02:22 klapperl joined #mojo
02:28 laouji joined #mojo
02:28 sri fir future reference, MOJO_LOG_LEVEL is unlike other env vars in that it's not a default value for the level attribute, but a global override, meant for oneliners and testing
02:28 sri s/fir/for/
02:29 sri you may be testing your app in testing mode, which raises the log level too high... then you use the env var to lower it without changing app state
02:37 marty ahh, that makes total sense.   I've now updated my conf file to set the level accordingly.
02:47 sri Test::Mojo actually uses it automatically :) https://github.com/kraih/mojo/blob/master/lib/Test/Mojo.pm#L23
02:47 sri for prove -v for example
02:54 cfedde joined #mojo
03:04 cfedde joined #mojo
03:25 radixo joined #mojo
03:26 radixo Hello guys.. I am with an serious problem using Mojolicious..
03:27 radixo I made a Mojolicious::Lite app
03:27 radixo and I execute a perl module I write to browse one website and return results for me in json
03:28 radixo the problem is that every request is processed only when the first request made ends..
03:28 radixo why?
03:30 keedi joined #mojo
03:45 radixo is ther somebody here?
03:53 keedi joined #mojo
03:57 marty radixo:  Yes, but I do not understand your question.
03:59 marty I'm assuming you are referring to synchronous -vs- asynchronous requests
04:13 radixo marty: yes.
04:13 radixo ops..
04:13 radixo no
04:14 radixo marty: the problem is while some person make a request other needs to wait this request terminates until his request starts to process
04:22 tianon have you read through all the guides and tutorials?
04:24 crab how are you starting your app
04:24 tianon I was thinking most specifically of the Cookbook: http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook
04:25 radixo crab: app daemon
04:25 radixo or morbo app
04:27 crab so that's a single-process server, use hypnotoad if you want multiple processes
04:28 radixo crab: I tried it to..
04:28 radixo but the result is the same
04:28 radixo crab: I will pastebin a code for you
04:30 radixo http://irclog.perlgeek.de/mojo/today
04:31 radixo crab: can you see the sleep at line 9?
04:31 radixo when I open two tabs in my browser and make 2 requests, I will wait 20 seconds and not 10
04:33 good_news_everyone joined #mojo
04:33 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/UoTqDA
04:33 good_news_everyone mojo/master d3e61cb Sebastian Riedel: tweaked web server recipes a little
04:33 good_news_everyone left #mojo
04:36 sri radixo: try http://tempi.re/a-mojolicious-non-blocking-web-service-why-
04:44 radixo sri: I can't understand why every route subroutine do not use threads..
04:44 sri bcause perl threads suck
04:45 radixo sri: ok.. and why do not fork?
04:47 good_news_everyone joined #mojo
04:47 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/QuN2Ww
04:47 good_news_everyone mojo/master f5e5d72 Sebastian Riedel: hint at architecture of the different servers
04:47 good_news_everyone left #mojo
04:47 radixo http://pastebin.com/gyLMwkge
04:48 radixo sri: How can i solve this sleep problem?? even in hypnotoad I need to wait 20 secs..
04:48 sri sorry, i don't think i'm qualified to help you
04:49 radixo sri: thanks guy
04:56 hesco thanks batman for clue on how to log in mojo
05:15 ka2u joined #mojo
05:18 good_news_everyone joined #mojo
05:18 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/8w8kkg
05:18 good_news_everyone mojo/master db81e0b Sebastian Riedel: more links and a better Hypnotoad description
05:18 good_news_everyone left #mojo
05:21 laouji joined #mojo
05:42 btyler sri: potentially excessive nitpick: I think most usages of 'parallel' in the doc are more accurately 'concurrent'. I have a pull req waiting for the 'submit' button if you're interested
05:44 sri btyler: agreed, no pull request necessary though
05:45 btyler ok
05:47 good_news_everyone joined #mojo
05:47 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/H9uJYg
05:47 good_news_everyone mojo/master 7d579de Sebastian Riedel: use the term concurrent instead of parallel
05:47 good_news_everyone left #mojo
05:47 sri btyler++
05:48 crab i have a serious bug to report: the mojo documentation doesn't contain "octopus" even once.
05:53 sri mango used the terms wrong too
05:53 cfedde joined #mojo
05:53 davido_ joined #mojo
05:59 cfedde joined #mojo
06:04 cfedde joined #mojo
06:09 cfedde joined #mojo
06:14 cfedde joined #mojo
06:20 cfedde joined #mojo
06:22 good_news_everyone joined #mojo
06:22 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/Gn4Ldg
06:22 good_news_everyone mojo/master 05e4c32 Sebastian Riedel: fixed another occurrence of the term parallel in the wrong context
06:22 good_news_everyone left #mojo
06:25 cfedde joined #mojo
06:30 cfedde joined #mojo
06:32 laouji joined #mojo
06:32 cpan_mojo Test-Mojo-Session 1.01 by Andrey Khozov - http://metacpan.org/release/AVKHOZOV/Test-Mojo-Session-1.01
06:35 cfedde joined #mojo
06:37 sri the use of _test in Test::Mojo::Session makes me want to yell
06:40 cfedde joined #mojo
06:45 nicomen joined #mojo
06:45 cfedde joined #mojo
06:46 Vandal joined #mojo
06:50 cfedde joined #mojo
06:55 cfedde joined #mojo
07:03 rem_lex joined #mojo
07:07 cpan_mojo Mojolicious-Plugin-MostTagHelpers 0.03 by HRUPP - http://metacpan.org/release/HRUPP/Mojolicious-Plugin-MostTagHelpers-0.03
07:09 cfedde joined #mojo
07:14 cfedde joined #mojo
07:18 basiliscos joined #mojo
07:19 cfedde joined #mojo
07:24 cfedde joined #mojo
07:26 hrupp joined #mojo
07:29 cfedde joined #mojo
07:33 dpetrov_ joined #mojo
07:34 cfedde joined #mojo
07:36 rem_lex joined #mojo
07:39 cfedde joined #mojo
07:44 abra_ joined #mojo
07:45 cfedde joined #mojo
07:50 cfedde joined #mojo
07:55 cfedde joined #mojo
07:56 eugen joined #mojo
07:57 rawler joined #mojo
07:59 good_news_everyone joined #mojo
07:59 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/sUE5Kw
07:59 good_news_everyone mojo/master a08584e Sebastian Riedel: added wrap_content method to Mojo::DOM
07:59 good_news_everyone left #mojo
08:00 cfedde joined #mojo
08:02 leejohnson joined #mojo
08:05 cfedde joined #mojo
08:05 maxhq joined #mojo
08:08 eseyman joined #mojo
08:09 punter joined #mojo
08:12 good_news_everyone joined #mojo
08:12 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/LBl3jg
08:12 good_news_everyone mojo/master 9ecfcd1 Sebastian Riedel: test case where content cannot be wrapped
08:12 good_news_everyone left #mojo
08:12 sri if anyone thinks i might be jumping the shark here, please stop me :)
08:12 sri wrap_content also solves the root problem from yesterday btw.
08:13 sri dunno if ->wrap() on the root element should automatically switch to ->wrap_content() though
08:15 cfedde joined #mojo
08:15 Lee joined #mojo
08:18 sri guess it's better than do nothing and return $self
08:19 good_news_everyone joined #mojo
08:19 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/wSsF9Q
08:19 good_news_everyone mojo/master fc47fbb Sebastian Riedel: improved wrap method in Mojo::DOM to allow wrapping of the root node
08:19 good_news_everyone left #mojo
08:20 cfedde joined #mojo
08:24 dod joined #mojo
08:25 cfedde joined #mojo
08:27 odc joined #mojo
08:29 trone joined #mojo
08:30 cfedde joined #mojo
08:35 cfedde joined #mojo
08:40 cfedde joined #mojo
08:41 rawler joined #mojo
08:45 cfedde joined #mojo
08:51 keedi joined #mojo
08:52 cfedde joined #mojo
08:53 keedi joined #mojo
08:57 cfedde joined #mojo
09:02 cfedde joined #mojo
09:07 cfedde joined #mojo
09:12 cfedde joined #mojo
09:17 cfedde joined #mojo
09:19 laouji joined #mojo
09:22 cfedde joined #mojo
09:27 cfedde joined #mojo
09:27 KindOne joined #mojo
09:29 bowtie_ joined #mojo
09:32 cfedde joined #mojo
09:41 cfedde joined #mojo
09:47 nic sri++  # wow, things are really moving along
09:47 cfedde joined #mojo
09:52 cfedde joined #mojo
09:55 laouji joined #mojo
09:57 cfedde joined #mojo
10:02 cfedde joined #mojo
10:03 jack joined #mojo
10:03 iankent joined #mojo
10:04 iankent hi all - anyone know if its possible to load/save sessions asynchronously - without having to define additional helpers that need to be called manually
10:05 iankent i.e. i want to just replace $app->sessions with my own module, but there doesn't appear to be any way to break out of the dispatch chain and prevent rendering
10:05 iankent the load part works async, but save always happens after the response has been sent to the client
10:05 iankent so, question is - is there any way to "pause" the dispatch chain from around_dispatch, after $next->() has been called
10:07 cfedde joined #mojo
10:10 dvinciguerra joined #mojo
10:12 cfedde joined #mojo
10:16 jack joined #mojo
10:17 cfedde joined #mojo
10:20 batman iankent: i think you're solving your problem with the wrong tool
10:20 fhelmber_ joined #mojo
10:21 fhelmber_ joined #mojo
10:22 cfedde joined #mojo
10:24 hide72 joined #mojo
10:25 hide72 s
10:27 cfedde joined #mojo
10:32 cfedde joined #mojo
10:33 * malikai just realized the futurama references in mojo
10:34 Dandre joined #mojo
10:34 malikai i think i've seen that show like twice
10:35 malikai at least now i know it wasn't just sri's love of LSD
10:37 cfedde joined #mojo
10:44 ryozi joined #mojo
10:45 cfedde joined #mojo
10:48 radixo joined #mojo
10:50 cfedde joined #mojo
10:54 iankent batman: i'm solving handling billions of session load/saves to memcached a year in a supposedly "asynchronous" web framework
10:54 iankent worth mentioning that this is easy and takes less than 5 mins dev time in scala/play
10:55 cfedde joined #mojo
10:56 batman i'm not saying you're solving the wrong thing, i'm just saying i think you're using the wrong tool
10:56 iankent when you say wrong tool.... you mean mojolicious?
10:56 batman no. i mean $app->sessions
10:57 iankent ah, but why wasn't it designed to be async? there's no reason it can't be, other than it appears the rest of mojo internals aren't built to support it
10:57 batman because it works on a cookie, it doesn't need to be?
10:58 iankent thats rather short sighted imo
10:58 batman i disagree.
10:58 radixo joined #mojo
10:59 iankent then at least we agree on disagreeing - still, the alternatives make for horrible code, replacing sessions is cleanest, but useless in any enterprise scenario where the built-in session/cookie stuff isn't secure/resilient enough
10:59 batman what you probably want is to use the data from $c->session (like a unique key) to lookup session data in memcache. this can be done async in a around_dispatch hook
10:59 iankent back in a bit, got a meeting - you're right, could potentially do that, but we still probably need to replace sessions, so then we have two solutions
11:00 batman you're way off. too bad i don't have time to explain it to you :(
11:00 cfedde joined #mojo
11:00 batman no, you don't!
11:00 batman why do you always need to use a hammer?
11:01 batman figure out the problem, isolated it, and use the RIGHT TOOL FFS!
11:03 radixo Hello guys.. Someone can help me with parallels requests?
11:05 cfedde joined #mojo
11:10 cfedde joined #mojo
11:15 cfedde joined #mojo
11:17 crab when are session cookies not secure/resilient enough?
11:19 hide72 joined #mojo
11:20 cfedde joined #mojo
11:35 radixo joined #mojo
11:36 radixo Hello guys.. I made an lite_app to test mojo concurrency.. and even using hypnotoad with 2 requests to server, I wait 20 secs..
11:36 hide72 joined #mojo
11:36 radixo http://pastebin.com/AbKDKeR7
11:41 batman radixo: sleep(10); is blocking
11:42 batman crab: no idea :)
11:43 radixo batman: is there a way to have a sleep and no block?
11:43 batman radixo: yes. Mojo::IOLoop->timer(10 => sub { warn "ten seconds later..." });
11:45 iankent batman: friendly advice as always
11:46 * batman gives up
11:46 iankent this is a bit ott: "figure out the problem, isolated it, and use the RIGHT TOOL FFS!"
11:46 iankent seriously, FFS to you too
11:47 hide72 joined #mojo
11:47 malikai heh
11:47 malikai arrogance is no substitute for incompetence
11:54 radixo batman: It is the same..
11:55 batman it's _not_ the same
11:55 radixo batman: I got 20 secs.. using hypnotoad.. mojolicious is always blocking me
11:55 * batman will be quite now, since i can't follow up
11:59 dod joined #mojo
12:01 stephan48
12:15 radixo :(
12:16 radixo In .NET was working.
12:18 crab iankent: when are session cookies not secure/resilient enough?
12:20 crab oh, he got annoyed and quit.
12:20 batman crab: sorry :/
12:24 mire__ joined #mojo
12:34 d4rkie joined #mojo
12:39 stl joined #mojo
12:44 dod joined #mojo
12:53 KindTwo joined #mojo
12:56 cfedde joined #mojo
13:06 denis_boyun joined #mojo
13:06 hummeleBop joined #mojo
13:28 dvinciguerra joined #mojo
13:35 sri joined #mojo
13:35 dod joined #mojo
13:42 dod joined #mojo
14:01 zM joined #mojo
14:09 aleksey joined #mojo
14:15 sh4 joined #mojo
14:22 kwa radixo: After adding the timer, are you making two requests to the ->same<- url in two separate tabs/windows in the ->same<- browser and it's taking a total of 20 seconds?
14:24 dvinciguerra joined #mojo
14:39 mire__ joined #mojo
14:54 asarch joined #mojo
14:56 meshl joined #mojo
14:59 btyler joined #mojo
15:01 marty joined #mojo
15:02 nicomen radixo: I already showed you, using siege, that everything works as expected. Browsers do strange stuff, you won't be able to run more than "number of child" amount of requests, and if all childs are busy, a new request will have to wait for a child to finish the 10 second sleep, and that request itself will take 10 secs, which in turn is 20 secs. I also showed you how to run siege with 5 concurrent requests to show you that
15:03 nicomen but like I said earlier, I would still recommend not spending 10 seconds blocking, and either optimize what you are doing, or put a reverse-proxy like varnish in-front
15:10 punter joined #mojo
15:20 bluescreen joined #mojo
15:27 marty joined #mojo
15:27 marty joined #mojo
15:29 btyler_ joined #mojo
15:34 gnephiak joined #mojo
15:36 gnephiak Hi, I'd like to ask how to do integration test on my Mojo/Mango app?
15:40 zackiv31 joined #mojo
15:42 davido_ joined #mojo
15:46 zackiv31 joined #mojo
16:02 dvinciguerra joined #mojo
16:15 * ponycorn prances
16:23 * sri yells at perltidy
16:24 crab why?
16:24 sri why won't it keep sub { map {} @_ } on a single line
16:27 asarch joined #mojo
16:42 davido__ joined #mojo
16:48 * nicomen is converting angualr to TT using Mojo::DOM, fun ;)
16:52 Akron joined #mojo
17:07 ka2u joined #mojo
17:11 radixo joined #mojo
17:12 cfedde joined #mojo
17:32 good_news_everyone joined #mojo
17:32 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/QUGYuw
17:32 good_news_everyone mojo/master 88291bb Sebastian Riedel: merged text_before and text_after
17:32 good_news_everyone left #mojo
17:40 mishantil joined #mojo
17:45 cfedde joined #mojo
17:49 good_news_everyone joined #mojo
17:49 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/wuFnsg
17:49 good_news_everyone mojo/master 20deffc Sebastian Riedel: a little more code reuse in Mojo::DOM
17:49 good_news_everyone left #mojo
17:50 beyondcreed joined #mojo
17:50 cfedde joined #mojo
17:54 sri i still do wonder if there's a better name for ->to_xml and ->inner_xml though
17:55 cfedde joined #mojo
17:57 tempire Pretty standard names.
17:57 tempire Meaning is apparent.
17:57 tempire Seems fine to me
17:57 sri both can generate html or xml though
17:58 sri and i recently made changes that cause it to generate more idiomatic html like "<form><input selected></form>"
17:58 sri so it's not always valid xml
17:59 sri maybe i'm overthinking it...
17:59 crab ->to_ml
17:59 sri https://github.com/mojombo/toml # ;p
17:59 tempire You could be perfectly correct and name it to_sgml
18:00 crab certainly not
18:00 tempire !!
18:00 sri yea, lets do to_sgml
18:00 cfedde joined #mojo
18:01 sri ...NOT
18:01 * tempire votes to keep to_xml
18:01 tempire it's close enough
18:01 tempire to_markup
18:02 sri to_markup is not bad, but not sure it's better than to_xml
18:02 tempire it makes sense, but it's not as apparent when looking through docs
18:03 sri to_string would be obvious there
18:03 sri but ->inner_string looks awkward
18:03 tempire to_string and inner_markup?
18:05 sri don't look so good compared to to_xml and inner_xml
18:05 cfedde joined #mojo
18:08 tempire lulz
18:08 nicomen sri: ->dump ?
18:08 purl it has been said that ->dump is damn handy
18:08 tempire re: TOML - Seriously? yep.
18:10 cfedde joined #mojo
18:12 nicomen if ->xml wasn't taken, I'd use just ->html and ->xml (and madee sure the XML one actually produces valid xml)
18:13 russum joined #mojo
18:13 malikai seeing this on cent6: Can't locate object method "sysread" via package "FileHandle" at /usr/local/share/perl5/Mojo/Util.pm line 255, <DATA> line 522.
18:13 malikai i'm pretty sure that's a slurp i'm calling that's triggering it
18:14 malikai possible test needed?
18:15 cfedde joined #mojo
18:20 cfedde joined #mojo
18:24 sri oh, docker now works on os x
18:25 sri oh, virtualbox
18:25 purl somebody said virtualbox was probably the easiest/fastest/best VM  or http://www.virtualbox.org
18:26 cfedde joined #mojo
18:31 cfedde joined #mojo
18:32 tempire I've never looked into docker
18:32 tempire is it awesome?
18:32 sri can confirm
18:36 cfedde joined #mojo
18:41 cfedde joined #mojo
18:46 cfedde joined #mojo
18:51 cfedde joined #mojo
18:56 cfedde joined #mojo
19:00 DaniBunny joined #mojo
19:01 davido__ tempire: I was afk yesterday when you mentioned OW. ...
19:01 cfedde joined #mojo
19:03 ka2u joined #mojo
19:06 cfedde joined #mojo
19:09 sri hahahaha... we could just have to_xml, to_html, to_string, inner_xml and inner_html ;p
19:10 sri (to_string would pick whatever ->xml says and be used for overloading "")
19:10 sri any DOM tree can be rendered to both forms anyway
19:11 cfedde joined #mojo
19:11 sri my $html = ->xml(0)->to_xml; my xml = $dom->xml(1)->to_xml
19:15 sri [20:13:02]  <@hugmeir> sri: http://paste.scsys.co.uk/300081 :)
19:15 sri apparently mojolicious just works on the new android port of perl
19:15 sri \o/
19:16 cfedde joined #mojo
19:21 cfedde joined #mojo
19:22 priodev joined #mojo
19:26 cfedde joined #mojo
19:26 mire__ joined #mojo
19:29 sri oops... inner_xml is not a thing...
19:29 sri it's $dom->content_xml
19:35 tempire I like inner_xml better than content_xml
19:35 Adura joined #mojo
19:37 sri would be inconsistent though
19:37 sri we use _content for everything
19:37 sri replace_content/append_content/prepend_content
19:40 good_news_everyone joined #mojo
19:40 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/xDablg
19:40 good_news_everyone mojo/master ca54968 Sebastian Riedel: use more generic variable names in Mojo::DOM examples
19:40 good_news_everyone left #mojo
19:41 btyler joined #mojo
19:49 cfedde joined #mojo
19:49 malikai joined #mojo
19:55 cfedde joined #mojo
19:57 sri hmmmmm.... i guess text_after and text_before could be deprecated
19:57 sri now that we have Mojo::DOM::Node for even more power
20:00 cfedde joined #mojo
20:04 sri all_contents makes the cookbook recipe look silly
20:05 cfedde joined #mojo
20:11 rem_lex|pivo joined #mojo
20:11 cfedde joined #mojo
20:17 cfedde joined #mojo
20:17 good_news_everyone joined #mojo
20:17 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/LXdtfw
20:17 good_news_everyone mojo/master af606a5 Sebastian Riedel: deprecated Mojo::DOM::text_after and Mojo::DOM::text_before in favor of Mojo::DOM::contents
20:17 good_news_everyone left #mojo
20:17 sri booyah!
20:21 hesco does mojolicious offer any helpers for crafting an option list for a form select tag from a database query?
20:21 moritz hesco: perldoc Mojolicious::Plugin::TagHelpers => select_field
20:22 hesco thanks moritz: looking at that now
20:27 cfedde joined #mojo
20:27 hesco yes, moritz: that looks like exactly what I was searching for.
20:31 sri and that new all_contents recipe is why i'm so happy the nodes are in the right order, unlike ->find('*')->contents->flatten :) http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Web_scraping
20:32 sri makes extracting stuff recursively sooo much easier
20:42 punter joined #mojo
20:50 denisboyun joined #mojo
21:20 meshl joined #mojo
21:34 sri so, i guess ->to_xml and ->content_xml is the best we can come up with? :o
21:43 trone joined #mojo
22:08 good_news_everyone joined #mojo
22:08 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/V0iFcw
22:08 good_news_everyone mojo/master cad4da1 Sebastian Riedel: no need to use length in boolean context
22:08 good_news_everyone left #mojo
22:33 drift joined #mojo
22:39 sri here's a quick proposal for the to_xml/content_xml thing :)
22:39 sri http://pastie.org/8702900
22:39 sri it doesn't even break any tests
22:40 lukep joined #mojo
22:40 tianon :D
22:51 sri http://pastie.org/8702928 # with complete docs and tests
22:52 * sri pokes marcus, tempire, crab and jberger
23:01 Akron I like it. Looks consistent (regarding the content thing). Don't know if I like so many methods for nearly the same thing though, but I prefer the current solution to something like to_markup and I think it's more correct than to_xml with non-xml output.
23:03 sri yea, only downside is the number of methods
23:04 sri but i really can't think of a name that would cover both
23:05 sri and this might even bring some added convenince in case you have to generate xhtml for some reason
23:05 Akron I would be fine with to_string and the flag parameter.
23:05 sri there's content_xml too
23:05 sri content_string? i don't think so!
23:05 Akron lol.
23:08 Akron Well - content_to_string wouldn't be so bad. Or ->serialize and ->serialize_content ...
23:09 sri doesn't sound or look good at all imo
23:09 Akron I really had the assumption, content_xml would be similar to js' inner_html - but it's just a renderer, so content_to_string is my favourite I guess.
23:13 sri another option would be to deprecate replace_content and merge it with content_xml into a new ->content method ;p
23:14 Akron That is what inner_html does in js - so, why not? or why not call this ->inner_string?
23:15 sri that sounds terrible
23:15 Akron Well - the merge idea is nice.
23:16 sri content would be consistent with the Mojo::DOM::Node method
23:16 Akron Right.
23:17 * sri wonders if it would clash with ->contents somethow
23:17 sri or if it makes the distinction more obvious
23:20 Akron It's pretty obvious to me. You could support ->contents([]) also for consistency (although it may not be very useful). ;)
23:22 mattastrophe joined #mojo
23:37 sri holy deprecation batman
23:38 sri http://pastie.org/8703040
23:38 sri Akron: like that?
23:43 Akron Not bad - and absolutely correct.
23:44 Akron The consistency with ::Node is nice.
23:45 Akron Oh - and it looks great in pluck!
23:48 good_news_everyone joined #mojo
23:48 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/CCaN0g
23:48 good_news_everyone mojo/master f44ad68 Sebastian Riedel: merged and replaced a few more methods in Mojo::DOM
23:48 good_news_everyone left #mojo
23:49 sri think i like it too
23:49 Akron sri++
23:50 sri Akron++
23:53 good_news_everyone joined #mojo
23:53 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/v761ew
23:53 good_news_everyone mojo/master ea0ad16 Sebastian Riedel: rephrase content description
23:53 good_news_everyone left #mojo

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