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

IRC log for #mojo, 2015-09-21

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

All times shown according to UTC.

Time Nick Message
00:03 meshl joined #mojo
01:36 PryMar56 joined #mojo
02:03 jnbek joined #mojo
02:45 noganex_ joined #mojo
03:01 kaare joined #mojo
03:19 sue joined #mojo
03:30 good_news_everyon joined #mojo
03:30 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vnW5l
03:30 good_news_everyon mojo/master fdd6933 Sebastian Riedel: show all node types
03:30 good_news_everyon left #mojo
03:31 sri maybe a bit much, but i think the information is valuable http://mojolicio.us/perldoc/Mojo/DOM#type
03:33 inokenty-w joined #mojo
05:02 stephen joined #mojo
05:04 melo joined #mojo
05:25 trone joined #mojo
05:25 davido_ joined #mojo
05:43 jb360 joined #mojo
05:46 inokenty-w joined #mojo
05:50 inokenty-w joined #mojo
05:56 inokenty-w joined #mojo
06:18 inokenty-w joined #mojo
06:21 McA joined #mojo
06:55 panshin joined #mojo
07:02 dod joined #mojo
07:06 eseyman joined #mojo
07:07 dod joined #mojo
07:14 AndrewIsh joined #mojo
07:27 trone joined #mojo
07:29 vanHoesel joined #mojo
07:33 vanHoesel1 joined #mojo
07:45 punter joined #mojo
07:55 salva joined #mojo
08:04 sue joined #mojo
08:07 asm35 joined #mojo
08:13 Vandal joined #mojo
08:28 panshin joined #mojo
08:30 absolut_todd joined #mojo
08:52 panshin joined #mojo
08:59 njlg joined #mojo
09:12 meshl joined #mojo
09:24 da5id joined #mojo
09:24 cpan_mojo Mojo-IRC-0.27 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojo-IRC-0.27
09:39 melo joined #mojo
10:01 coolo joined #mojo
10:09 panshin joined #mojo
10:21 ribasushi joined #mojo
10:33 panshin joined #mojo
10:37 amon joined #mojo
10:43 nic joined #mojo
10:45 nic bpmedley: I've adapted your commandline: PERL5OPT='-d:Trace' bin/myapp eval 1 2>&1 >/dev/null | cut -d: -f1 | uniq
10:47 nic (needs neither 'perl' nor 'grep')
11:12 bpmedley nic: Sweet
12:12 panshin joined #mojo
12:23 cpan_mojo Crypt-MagicSignatures-Envelope-0.09 by AKRON https://metacpan.org/release/AKRON/Crypt-MagicSignatures-Envelope-0.09
12:28 * sri yawns
12:33 neilhwatson joined #mojo
12:34 yt7fms joined #mojo
12:39 * jberger yawns # spreading
12:40 pink_mist damnit
12:40 * pink_mist yawns too
12:56 jberger Sad, my article didn't make the perl weekly
12:56 jberger batman++ did get a mention
12:58 ajr_ joined #mojo
13:02 mattastrophe joined #mojo
13:03 jnbek joined #mojo
13:07 absolut_todd joined #mojo
13:07 batman jberger: Yeah... That's weird. It was a great article.
13:10 arthas joined #mojo
13:13 jberger There is some hope that it will go in next week
13:17 absolut_todd joined #mojo
13:31 dvinciguerra joined #mojo
13:42 nicomen heh https://github.com/bevacqua/promisees
13:48 PryMar56 joined #mojo
13:50 bwf joined #mojo
13:52 panshin joined #mojo
13:57 hernanGOA joined #mojo
13:58 hernanGOA joined #mojo
14:02 genio joined #mojo
14:05 gryphon joined #mojo
14:39 hernanGOA joined #mojo
14:54 absolut_todd joined #mojo
14:56 bayashi joined #mojo
14:58 disputin joined #mojo
15:02 ZoffixWork joined #mojo
15:03 Kogurr joined #mojo
15:05 dod joined #mojo
15:09 bpmedley Question: I have a model where I'm defining SQL in a package named App::Model::$pkg.pm.  The SQL is basically a hash defined by "friendly name" => SQL.  The $pkg variable is retrieved from "caller" in the model object and the SQL is then executed via Mojo::SQLite.  This allows me to do things like $model->query("ins_account") and $model->hash("account") where each key is based on the package context it is ran from.  Does this sound
15:09 bpmedley like a good approach?
15:10 sri this is how i handle it https://github.com/kraih/mojo-pg/blob/master/examples/blog/lib/Blog/Model/Posts.pm
15:11 sri anything involving caller sounds like a pretty bad idea
15:11 meshl joined #mojo
15:11 bpmedley Understood.  I was using SQL embedded like that.  I'm not sure I like that approach, though.
15:11 sri it's simple and clean
15:11 bpmedley I agree it's simple; however, I don't think it's the cleanest approach.
15:12 sri i don't understand the desire to have all sql in a central data structure
15:12 spicyjack fire and forget
15:12 spicyjack until you need to make changes, that is
15:12 bpmedley Sorry for the confusion, there is one data structure per package.
15:13 sri looks like we disagree on it being clean
15:14 sri i guess some people don't like mixing languages, i'm totally fine with it
15:14 bpmedley Understood.  Just different approaches, in my opinion.
15:14 sri to me the sql is nothing else than css selectors in Mojo::DOM
15:15 bpmedley The issue is that when there's lots of SLOC the SQL sometimes can get crazy.  At least, in my experience.  Although, the craziness could be due to lack of time and communication.. :)
15:16 sri i consider this still clean https://github.com/kraih/minion/blob/master/lib/Minion/Backend/Pg.pm
15:16 sri and there's some pretty big sql queries in there
15:17 sri if all the sql was extracted into a central data structure, or even files, it would be a nightmare to read
15:18 bpmedley I agree the Pg.m is very clean.  Hrmm.  I'm simply experimenting on different approaches with my apps.
15:18 sri Minion::Backend::Pg is nothing else than a model class
15:19 Grinnz_ it's a tradeoff between "huge strings in my code" and maintainability
15:19 sri Grinnz_: huge strings?
15:19 sri you mean the sql?
15:19 Grinnz_ some people don't like having those everywhere i guess
15:19 bpmedley Grinnz: Which do you think is more maintainable?  The embedded SQL or an alternate approach?
15:19 sri then i have to say you got it wrong
15:20 Grinnz_ embedded is more maintainable
15:20 Grinnz_ otherwise you have to go look up what query is actually running whenever you have a problem
15:20 sri and now i'm confused ;p
15:20 sri yea, so we agree after all :)
15:20 Grinnz_ sri: thats why i said tradeoff :P
15:20 sri where is the tradeoff?
15:21 Grinnz_ for people who don't like having huge strings in the code
15:21 sri hmm
15:22 Grinnz_ anyway i dont care about the strings either
15:22 bpmedley Thanks for the input.
15:22 Grinnz_ mine are worse at work :)
15:22 Grinnz_ sometimes i extract them into a hash, but its always nearby to the code running it
15:23 Grinnz_ i have some queries that are 30-40 lines
15:23 sri i'd prefer SQL::Abstract over a central dictionary of sql any day
15:24 Ptolemarch joined #mojo
15:24 sri if you really hate embedded strings so much
15:25 bpmedley sri: I actually prefer using sql strings.  I'm just not sure of the best placement and access.
15:43 sh4 joined #mojo
15:49 good_news_everyon joined #mojo
15:49 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vnBU1
15:49 good_news_everyon mojo/master 19222ed Sebastian Riedel: be more specific about return values
15:49 good_news_everyon left #mojo
15:49 sri the remove description sounds a little odd, but i have no idea how to explain it better
15:50 sri calling ->remove on the root
15:50 Grinnz_ looks fine to me
15:50 sri it's odd because it's equivalent to ->replace('')
15:50 sri which makes more sense to call on the root
15:51 * sri shrugs
15:51 sri i doubt anyone will ever use it like that... but i'm a sucker for consistency ;p
15:52 asarch joined #mojo
15:52 sri $root->content(''), $root->remove and $root->replace('') are all doing the same
15:58 berov joined #mojo
15:59 good_news_everyon joined #mojo
15:59 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vnBLX
15:59 good_news_everyon mojo/master 3d6fc30 Sebastian Riedel: root can be quoted
15:59 good_news_everyon left #mojo
16:07 jabberwok left #mojo
16:11 sri oh, $root->parse('') is also equivalent
16:13 absolut_todd joined #mojo
16:28 asm35 joined #mojo
16:46 PopeFelix Tell me a little bit about the IO Loop, please.  In particular, what's the difference between doing a GET request with the loop running and without?
16:47 berov left #mojo
16:50 jberger PopeFelix: your question is worded a little funny
16:50 gryphon joined #mojo
16:50 jberger can I answer a related question?
16:50 jberger Q: What is the difference between a blocking and non-blocking GET request
16:51 jberger A: when doing a blocking request, ie, one with no callback and without a (visible) running ioloop, no other work can be performed while the response comes back
16:52 PopeFelix jberger, I'm a little funny. ;)
16:52 jberger with a nonblocking call, ie with a callback and a running ioloop, the request is made and the callback is scheduled to run when the response is received
16:52 sri http://mojolicio.us/perldoc/Mojolicious/Guides/FAQ#What-is-the-difference-between-blocking-and-non-blocking-operations
16:52 PopeFelix In all seriousness, that makes sense as an explanation for blocking vs non blocking,
16:53 sri http://mojolicio.us/perldoc/Mojolicious/Guides/FAQ#What-is-an-event-loop
16:54 jberger there is a pedantic reason that your original question is strange, and one that you don't need to worry about yet, but it turns out that the useragent always has an ioloop running, it just might look like blocking :-P
16:54 PopeFelix :)
16:55 PopeFelix Well, I'm trying to sketch out the record portion of my Mojo::UserAgent::Mockable, and I was trying to figure out why Mojo::IOLoop->stream($connection_id) wasn't returning an object.
16:56 PopeFelix It turns out that the IO Loop isn't running (visibly) in my callback.
16:56 PopeFelix :b#
16:56 PopeFelix oops. sorry
16:56 bpmedley PopeFelix: You can have dozens or hundreds of GET requests concurrently active with the IOLoop event loop.
16:58 shadowpaste "PopeFelix" at 217.168.150.38 pasted "use 5.014; use Mojo::UserAgent" (40 lines) at http://paste.scsys.co.uk/499034
16:58 PopeFelix oops. forgot the summary.
16:58 jberger PopeFelix: ah, so you do actually have to worry about this thing then
16:58 PopeFelix But I'm trying to get at those read and write events.
16:59 jberger in a blocking request, the ua use a different instance of the ioloop, not the singleton
16:59 PopeFelix Oh, I see.
16:59 jberger that way when THAT loop is started it blocks the singleton loop which MIGHT be running at the time
17:00 PopeFelix jberger, that makes sense.
17:00 jberger so you can do a blocking request
17:00 PopeFelix OK, so how do I get to that loop?
17:00 Grinnz https://metacpan.org/pod/Mojo::UserAgent#ioloop
17:01 PopeFelix you know, I really should learn to read the docs before I ask obvious questions.
17:01 Grinnz :)
17:01 * PopeFelix really tries to keep the stupid questions to a minimum.
17:04 bpmedley PopeFelix: May I ask your goal?  Are you trying to get JSON, the response body, or something else from the GET request?
17:06 PopeFelix bpmedley, I'm writing a Mojo UA that works similarly to LWP::UserAgent::Mockable.  It will record and play back HTTP transactions (WebSocket too, maybe). Intended for use in unit testing.
17:06 jberger bpmedley: he (assuming he from Felix) is trying to get the entire message to record/playback
17:06 bpmedley That's cool.
17:07 jberger PopeFelix: btw when you get to the testing side of things, are you going to be hacking into the Test::Mojo instance? if so consider Test::Mojo::WithRoles role integration
17:07 PopeFelix From "Felix", I could be a cat, happy, or "of the noble fruits offered to the gods".
17:07 PopeFelix ;)
17:07 jberger PopeFelix: also true
17:08 PopeFelix jberger, when I get to the testing side of things, I'll consider it.  I don't know if I'll be hacking into Test::Mojo or not yet.
17:08 jberger I just try to be careful about assuming gender
17:08 disputin joined #mojo
17:08 PopeFelix jberger, that's a good strategy.  I assumed my friend Ari was female until I asked him his preferred pronoun. :)
17:08 sri felix is clearly a cat
17:09 HtbaaPi joined #mojo
17:09 * PopeFelix grins.
17:09 PopeFelix I will confirm your assumption, however, jberger, and say that I do identify as male.
17:10 * pink_mist would have assumed 'he' from 'Pope' ... not many female popes I've ever heard of :P
17:10 * jberger thinks that should change too
17:11 PopeFelix pink_mist, in my tradition (Discordia) every man, woman, and child is a genuine and authorized Pope.
17:11 meredith finally, cool hats for all
17:11 PopeFelix meredith, exactly!
17:12 jberger Mrs. Pope Graham from Tinker Tailor Soldier Spy
17:12 PopeFelix And anyone who is neither a man nor a woman is also included, because regardless of gender, they were children at one point in their lives.
17:13 sri https://s-media-cache-ak0.pinimg.com/236x/9d/d0/ac/9dd0ac58a5e444d307eca2bf4597b554.jpg
17:13 * jberger ponders shiny red shoes
17:13 jberger sri++
17:14 Grinnz has a pope ever been fired?
17:14 PopeFelix sri++
17:16 PopeFelix Well, Benedict XVI resigned, which seemed odd to me. I thought Popes tended to die in office.
17:18 PopeFelix And according to Slate, a Pope hasn't resigned since Gregory XII in 1415.
17:33 Kogurr joined #mojo
17:35 dvinciguerra_ joined #mojo
17:42 Akron joined #mojo
17:46 cpan_mojo Mojo-SQLite-0.018 by DBOOK https://metacpan.org/release/DBOOK/Mojo-SQLite-0.018
17:50 bpmedley https://bitbucket.org/snippets/bpmedley/pR5Xy <-- Could something like this be used for simple GET/POST requests for the record and playback?
17:55 sri bpmedley: don't depend on private methods
17:56 sri Bender: trust Akron
17:56 Bender sri, I already trust Akron
17:56 sri :)
17:56 bpmedley sri: Hrmm.. back to the drawing board..
17:58 Akron \o/
17:58 sri the easiest way to do it would be to overload Mojo::UserAgent::start, and just serialize the resulting Mojo::Message::Response somehow, and then reuse that on recurring requests
17:59 sri of course there's lots of side effects to take care of
17:59 sri ike all the events that won't fire
18:01 sri there are good reasons most people just use https://mitmproxy.org/
18:01 sri LWP doesn't have those problems because it's a lot less powerful
18:05 Ptolemarch joined #mojo
18:09 Ptolemarch joined #mojo
18:21 panshin joined #mojo
18:26 * sri wonders if people prefer Link headers or <link> tags for prefetching
18:28 trone joined #mojo
18:30 sri ah, looks like the tags are better supported by browsers
18:43 ZoffixWork joined #mojo
18:46 ZoffixWork There isn't a simple way to do something like  $t->post_ok('/foo' => form_from_dom => $t->tx->res->dom->at('form') ); with Test::Mojo, is there?
18:47 ZoffixWork Meaning, all the form fields will be automagically selected from the form refrenced by the Mojo::DOM object
18:47 ZoffixWork And submitted as POST request
18:48 sri hehe, not anymore
18:49 ZoffixWork aww :)
18:49 sri was a big topic at the time
18:49 ZoffixWork How come it was removed?
18:49 sri the whole Mojo::DOM::val thing
18:50 sri nobody could figure out how to do it right
18:50 ZoffixWork Copy the way jQuery does it :)
18:50 * ZoffixWork is always reminded of jQuery when using Mojo stuff
18:52 sri i think quite a few people would like the feature, so please feel free to make a proposal
18:52 ZoffixWork Would it be a proposal to Mojo::UserAgent then?
18:52 sri i don't know
18:53 ZoffixWork k
18:53 sri we never found a good solution ;p
18:53 sri https://github.com/kraih/mojo/commit/3a29749ea383b8d61f61c51bb337a1ffd382f74b
18:53 sri that was the last version of ::val
18:54 jberger I think it probably has to start in ::DOM, but I could be wrong
18:55 sri the original version actually supported entire forms https://github.com/kraih/mojo/commit/3564dd174aedd8cc1b13254a879004bfb060ae34
18:56 sri there you get a few correctness problems though, such as the button you use to submit a form adding more values
18:57 sri so, do you only collect the defaults, or take a selector for the submit button?
18:58 sri and then there's fields that may contain one or more values (<select>)
18:59 sri i'll totally +1 a good proposal
18:59 sri but it will have to hold up to scrutiny :)
19:00 ZoffixWork :)
19:00 sri and i've destroyed my own proposal remorselessly
19:01 sri this is still kinda cute though *sob* https://github.com/kraih/mojo/commit/3564dd174aedd8cc1b13254a879004bfb060ae34
19:03 sri ZoffixWork: which jquery api were you referring to anyway?
19:04 sri this was actually based on https://api.jquery.com/val/
19:04 ZoffixWork http://api.jquery.com/val/
19:04 ZoffixWork Ah. Well.
19:04 ZoffixWork Then I think I'll first start with making Test::Mojo::Role::FormMunger :P
19:04 sri :(
19:06 jberger actually, I don't hate that idea, at least for a start
19:06 jberger perhaps best to find out what is needed
19:07 jberger ZoffixWork: I encourage you to start that way, but before you release to CPAN check in again and see if it can be factored back into core
19:07 jberger (not as a test role, but dom)
19:07 sri anyone remember why we didn't go with mixed string/arrayref return values for ::val?
19:07 jberger I seem to recall that lots of the conversation was around back-compat, was it not?
19:07 sri hmm, could be
19:08 jberger or possibly just the annoyance of having to check the return type
19:08 ZoffixWork Which idea? A separate Role? RE: <jberger> actually, I don't hate that idea, at least for a start
19:08 jberger ZoffixWork: yes
19:08 ZoffixWork Oh, I misread.. I though you said you hated it
19:08 sri it works for jquery
19:09 sri strings for everything but select
19:09 jberger sri: is there any sanity to having a separate class for input types?
19:09 jberger Mojo::DOM::Input ?
19:09 neilhwatson joined #mojo
19:09 sri how would that work?
19:09 jberger a storage container that has methods for selecting default value vs selected values etc
19:10 sri Oo
19:10 jberger $dom->at('input')->input->options
19:10 jberger $dom->at('input')->input->default
19:10 sri how could selected values differ from defaults?
19:11 jberger not sure yet, this just came into my head
19:11 cpan_mojo Toadfarm-0.67 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Toadfarm-0.67
19:11 sri lol
19:13 jberger the logic that got me there is that it could be used to smooth over the differences between input types using methods
19:14 jberger val vs every_val
19:14 sri ah http://irclog.perlgeek.de/mojo/2014-11-02#i_9600056
19:14 sri that's how it went down
19:16 sri also https://github.com/kraih/mojo/issues/684
19:16 jberger hehe, I suggested every_val
19:16 jberger at least I'm consistent
19:16 * sri still hates it ;p
19:16 jberger consistency++
19:17 sri it was all about the <select>
19:17 sri honestly, i don't hate the idea of always returning an arrayref there
19:18 * sri shrugs
19:18 sri i guess at the time it was impossible for backcompat reasons
19:18 jberger I think your issue with that was that was adding HTML specific logic when this was supposed to just be tag soup
19:19 sri yea, there's also html specific code in ->text though
19:19 jberger I guess val is that anyway though
19:19 sri <pre>
19:19 jberger ah
19:19 sri i don't love it, but it's nothing new at least
19:20 sri batman liked ::val a lot, maybe he has an opinion
19:21 jberger I think targeting to mechanize-like functionality is a good idea
19:21 jberger that's a subset of usage where we have no answer
19:22 sri being close to jquery is good too
19:22 jberger yes
19:23 sri hahaha, that was a funny hack https://github.com/kraih/mojo/commit/3564dd174aedd8cc1b13254a879004bfb060ae34#diff-24fe40937fb0bc295d664900b1a94f0eR190
19:23 sri it used the first button it found
19:23 sri (version with <form> support)
19:23 ZoffixWork it missed type="image"
19:24 sri i think that was added later
19:25 sri i didn't manage to find the commit where <form> support was removed yet
19:25 jberger actually, I think it might be interesting to just take a form dom element and distill it to the the proper hashref to post(... form => ...) might be awesome
19:26 jberger or hell, even create a tx from it
19:26 ZoffixWork That was my plan right now ( the hashref ).
19:26 sri ah https://github.com/kraih/mojo/commit/d602e07298945fefbb03afdddbd9360e7eb20224
19:26 ZoffixWork Until one of the gazillion CIFS shares froze my box :(
19:26 jberger $ua->start($dom->at('form')->to_tx)
19:26 sri i'll play a bit with the simplest version of ::val later
19:26 jnbek yea Texas!!
19:28 Akron joined #mojo
19:29 * sri learned recently that there are lots of germans in texas
19:30 sri with sausage festivals and everything
19:30 jberger sri: http://www.shiner.com/beer/bock
19:31 batman sorry. i don't have an opinion about val()
19:31 batman my interest died with the code.
19:31 Ptolemarch joined #mojo
19:34 sri :O
19:39 Ptolemarch joined #mojo
19:41 Kogurr joined #mojo
19:44 jberger I guess swagger takes over from there?
19:45 spicyjack sri: there's big german festivals in most larger American cities
19:45 spicyjack sri: San Diego has two I think, and Los Angeles, probably about 5 or 6
19:45 spicyjack (10+ million people love beer and brats)
19:48 sri https://gist.github.com/anonymous/138d1b6559b3a7f612e8
19:48 sri this is what i had in mind
19:49 sri oops, forgot to fix some docs
19:52 sri ok
19:52 sri https://gist.github.com/anonymous/024ba816f1690606f450
19:52 sri that one
19:52 mgrimes joined #mojo
19:52 sri pretty much equal to the jquery version i think
19:54 sri the arrayref is actually rather convenient with Mojo::UserAgent
19:55 sri $ua->post(... => form => {foo => $dom->at('select')->val})
19:55 ZoffixWork You'll need to special-case type="image" though; its name should be expanded to name.x/name.y
19:55 sri if you were to use it like that
19:56 sri ZoffixWork: please elaborate
19:56 sri names seem completely irrelevant here actually
19:56 ZoffixWork K, ignore me :)
19:57 sri it won't get <form> support
19:57 sri jquery doesn't have that either i believe
19:59 ZoffixWork I'm gonna model http://api.jquery.com/serialize/ in my Test::Mojo Role, I think
19:59 sri it's a primitive for your more comprehensive solution
19:59 * ZoffixWork glances at the time... .oO( perhaps tomorrow )
20:01 ZoffixWork With addition of clickable buttons... It'll just add one method ->click() and you give it a selector for which button to click (or if you give the form itself then it's submitted as if nothing's clicked)
20:06 sri allright, i'll drop the ::val thing
20:06 ZoffixWork Noooo :)
20:06 ZoffixWork I think ->val() can be useful regardless of what I'm doing
20:07 jberger sri: I like that paste
20:07 ZoffixWork Here's actually the bit of the test I wrote just today; note the ->attr('value'); http://fpaste.scsys.co.uk/499041
20:08 ZoffixWork And I at first checked whether val() existed, like in jQuery :)
20:18 sri :S
20:19 sri would a <select> with no values return an empty array or undef?
20:20 ZoffixWork an empty array would be better IMO, since with undefs you have to deal with the whole "deref on undef" issue
20:20 jnbek derefdef!
20:20 ZoffixWork s/array\K/ref/;
20:21 sri the code is easier for empty array ref
20:22 d4rkie joined #mojo
20:22 jberger I would say empty unless that does something bad when resubmitted using form =>
20:24 sri MOJO_USERAGENT_DEBUG=1 perl -Mojo -E 'h("mojolicio.us" => form => {foo => []})'
20:25 sri no problems, just gets skipped
20:26 jberger yeah, cool
20:31 good_news_everyon joined #mojo
20:31 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vnRFy
20:31 good_news_everyon mojo/master 75d1990 Sebastian Riedel: add val method to Mojo::DOM
20:31 good_news_everyon left #mojo
20:31 ZoffixWork \o/
20:31 ZoffixWork sri++
20:31 sri (not entirely sure about it yet though)
20:32 sri Zoffix++
20:32 sri jquery returns null for a <select> without values btw.
20:37 sri another opinion would help i guess
20:37 * sri pokes marcus, tempire and Grinnz
20:37 marcus o/
20:38 sri oh, that was quick :)
20:38 sri \o
20:38 marcus sri: Seems like an useful addition to me.
20:39 Grinnz_ i don't do much form crawling, but in the context of jquery i think it's nice to have
20:41 ZoffixWork I think one of the questions at hand is whether to return undef or an empty arrayref for <select>s that do not have any <option>s selected.
20:42 Grinnz_ if arrayrefs make it work better, and there's no ill effect, that works for me
20:42 Jonis joined #mojo
20:43 mishantil joined #mojo
20:43 Grinnz_ have to keep in mind that undef in perl and null in JS get treated way differently
20:43 jberger I like the idea that select would always return an arrayref
20:43 sri opinions on both points are helpful, feature as a whole and the return value
20:44 Ralesk joined #mojo
20:44 sri <textarea> is also a funny case, since the value can never be undef, there's always at least the empty string
20:44 sri (not implying a problem)
20:45 sri just mentioning it so everyone can think about it
20:45 jberger I don't see that as a problem
20:45 jberger its still falsy
20:45 sri we've been very wrong with the return values before, so i'd rather be double careful
20:45 jberger true
20:47 jberger I'm not sure what else the answer could be
20:48 mishanti1 joined #mojo
20:48 sri oh noes, i found a nice name for descendant_nodes in the nokogiri docs :o
20:48 sri traverse
20:49 sri (breaks with the _node convention though... so....)
20:50 sri interesting to compare every now and then though https://github.com/sparklemotion/nokogiri/wiki/Cheat-sheet
20:53 dvinciguerra joined #mojo
21:01 neilhwatson joined #mojo
21:02 jberger unifying on _nodes was such a huge win, I don't worry about it
21:07 Ptolemarch joined #mojo
21:23 panshin joined #mojo
21:25 meshl joined #mojo
21:26 mattastrophe joined #mojo
21:28 mattastrophe joined #mojo
21:30 ZoffixWork jberger, here, you wanted to take a look before I release: https://github.com/zoffixznet/Test-Mojo-Role-SubmitForm  The __val() bit sri's implementation and I'll use Mojo::DOM's ->val, once that's released
21:30 ZoffixWork Would you say I'm a slow coder? It took me an hour to write the module + test + docs. I never had a chance to compare myself time-wise to other coders and you guys seem to write stuff uber fast
21:31 ZoffixWork ...keeping in mind I'm still new to Mojo and had to look at the docs for both ::Controller, Test::Mojo, and Mojo::DOM :)
21:31 jberger ZoffixWork: I never consider speed of coder as quality
21:31 ZoffixWork Ah, good :)
21:32 jberger in fact, too fast is worse than too slow sometimes
21:32 jberger (to a point of course)
21:32 jberger anyway, what I was mostly interested in was what sort of selector functionality you needed in order to implement it
21:33 jberger if you are using the recent val implementation (and if you find it sufficient/useful) then that's good
21:33 ZoffixWork Yeah, it works rather well :)
21:49 cpan_mojo Test-Mojo-Role-SubmitForm-1.001001 by ZOFFIX https://metacpan.org/release/ZOFFIX/Test-Mojo-Role-SubmitForm-1.001001
21:52 Grinnz_ ZoffixWork: you still should add [MetaJSON] to your bundle :P
21:53 ZoffixWork K. I'll take a look into that :)
21:53 ZoffixWork \Thanks.
21:53 Grinnz_ it should be drop-in. just generates a META.json which is much better for things to use than META.yml
21:53 Grinnz_ using meta-spec 2.0
21:54 cpan_mojo Mojolicious-Plugin-FormChecker-1.001003 by ZOFFIX https://metacpan.org/release/ZOFFIX/Mojolicious-Plugin-FormChecker-1.001003
21:56 Grinnz_ i was going to comment that you seem to have a number of odd build_requires, but then i remembered META.yml doesn't actually have a test_requires so that's why they're there :)
22:09 Ptolemarch joined #mojo
22:25 good_news_everyon joined #mojo
22:25 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vn0zc
22:25 good_news_everyon mojo/master a11d4c9 Sebastian Riedel: use the :checked pseudo-class
22:25 good_news_everyon left #mojo
22:26 sri jberger talking about selectors reminded me of that ;p
22:26 d4rkie joined #mojo
22:37 good_news_everyon joined #mojo
22:37 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vn0a1
22:37 good_news_everyon mojo/master e985701 Sebastian Riedel: use the same order as the spec
22:37 good_news_everyon left #mojo
22:41 mattastrophe joined #mojo
22:50 jberger sri: spec order trumps alphabetical?
22:56 sri normally i'd say no, but try ordering those operators ;p
22:57 sri s/operators/combinators/
22:58 d4rkie joined #mojo
23:04 Ptolemarch joined #mojo
23:11 cpan_mojo XML-Loy-0.42 by AKRON https://metacpan.org/release/AKRON/XML-Loy-0.42
23:29 ajr_ joined #mojo
23:58 Ptolemarch joined #mojo

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