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

IRC log for #mojo, 2015-09-25

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

All times shown according to UTC.

Time Nick Message
00:20 sri oh, Cpanel::JSON::XS already accepts JSON::PP::true/false
00:21 sri just the other way around doesn't work yet, it doesn't generate subclasses of JSON::PP::Boolean
00:28 asm35 joined #mojo
01:04 risugg joined #mojo
01:09 asarch joined #mojo
01:15 stephen joined #mojo
01:35 risugg joined #mojo
01:36 mattastrophe joined #mojo
01:53 risugg joined #mojo
02:11 Janos joined #mojo
02:17 Janos hey there, question, I have the following route $auth_routes->post('/login' => [format => [qw(json)]])->to('auth#login'); the idea here is attach two different methods for the same route, one to be used when 'Content-type: application/json' and the other for 'Content-type: application/x-www-form-urlencoded' but this selection is not happening and I'm getting a 404, i'm missing something or do I have to handle the content-type header myself ?
02:18 Janos it does work if I post to /login.json as stated in the docs, but I was wondering if mojo supported content negotiation base on the content-type header for post
02:18 Zoffix Janos, I may be mistaken, but I think `format' depends on what the extention is.
02:18 * Zoffix looks in the docs
02:18 Grinnz_ joined #mojo
02:19 Zoffix Bender, trust me
02:19 Bender But I don't trust you in #mojo, Zoffix
02:19 Zoffix Bender, c'mon, baby! We've been through so much together!
02:22 Janos it definitively work when using .json, but I was wondering if I would consider content-type or not
02:22 Zoffix Janos, I think you can solve that with something from here: https://metacpan.org/pod/distribution/Mojolicious/lib/Mojolicious/Guides/Tutorial.pod#Conditions
02:22 Zoffix So you'd just specify a HeaderCondition https://metacpan.org/pod/Mojolicious::Plugin::HeaderCondition
02:22 Zoffix Sorry, too many beers in me right now to be more helpful :)
02:24 bpmedley_ Janos: http://mojolicio.us/perldoc/Mojolicious/Plugin/DefaultHelpers#accepts <-- Will this help you?
02:24 asarch joined #mojo
02:27 Janos Zoffix, I think that does it, thanks a lot
02:27 Janos bpmedley_, I'll definitively used that too on the response
02:27 Janos thanks a lot everyone
02:27 Zoffix \o/
02:28 Repaster joined #mojo
02:36 bpmedley_ Howdy, anyone get a chance to look at my RateLimit plugin?
02:36 sri how has nobody linked to this yet? http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Content-negotiation
02:37 bpmedley_ sri: I may have mis-understood, i thought they were trying to use the Content-type header for negotiation.
02:37 Zoffix I've not yet read the docs :P
02:38 bpmedley_ $c->content_for(head => '<meta name="author" content="sri">');  <-- I had not seen this before!
02:38 bpmedley_ Sorry, I'm confused.  Long day.
02:39 Zoffix Janos, ^
02:41 noganex joined #mojo
02:41 Zoffix sri, BTW, I recall awhile ago you said you disliked Perl 6's inability to do have new lines with method calls. Apparently this is the the Perl 6's way to do that sort of stuff: https://en.wikipedia.org/wiki/Fluent_interface#Perl_6
02:42 Zoffix A bit verbose for my liking, but I'm loving that class{} definition.
02:42 Grinnz i think that's exactly what was posted when that was being discussed
02:42 sri i hate that example
02:43 Zoffix Oh
02:43 sri the given block makes no sense in the context
02:43 sri it's like someone wanted to make perl6 look bad
02:43 sri a proper fluent interface example would have done the exact same the ruby example did
02:44 sri like, do you actually do "for ($foo) { $_->bar; $_->baz; $_->yada }" in perl5 just because you can?
02:44 Zoffix hahaha
02:44 sri would you call that a fluent interface?
02:45 Zoffix sri++ fair enough.
02:45 Grinnz some people do. but thats definitely not fluent
02:45 Grinnz there's no method chaining at all
02:45 Grinnz so i dunno why that example's even there, really
02:46 Zoffix I'm not 100% sold on the whole 'chaining methods' thing yet though.
02:46 sri the argument for doing that was that accessors returning the invocant makes no sense in perl6, but that's a terrible argument, as you can see in the ruby example, which is beautiful
02:46 sri https://en.wikipedia.org/wiki/Fluent_interface#Ruby
02:47 sri you can do the exact same in perl6
02:47 Grinnz well i guess it's that accessors in perl6 are properties, more than methods
02:47 Grinnz reminds me of coding in java
02:49 inokenty-w joined #mojo
02:49 * sri is super grumpy right now because he broke his glasses :(
02:50 Grinnz ouch
02:50 sri right in the middle
02:51 kaare_ joined #mojo
02:55 Zoffix Hm, at least there's this: http://fpaste.scsys.co.uk/499262
02:55 Zoffix Still. Weird.
02:55 Grinnz yeah.. wtf is the point of the backslashes
02:55 Zoffix http://design.perl6.org/S02.html#Unspaces
02:56 Zoffix Seems like a major flaw to me.
02:56 Grinnz i'm not sure how $var \n .attribute is ambiguous
02:57 Grinnz in that they would require it to be on the same line normally
02:58 Grinnz i thought . wasn't even a concatenation operator anymore in perl6, or is it?
02:58 Grinnz yeah it's ~
02:58 sri it's a postfix operator
02:58 sri the .
02:58 Grinnz right i mean, thats the only reason i could think of it being ambiguous
02:59 Grinnz i guess i'm just not into the perl 6 thinking
02:59 sri i hate that part of perl6
03:01 sri doubt i could ever get used to unspaces there
03:02 sri has the same appeal as the php namespace separator
03:03 sri and i bet that's what people will compare it to
03:04 sri is there actually anything in perl5 that just feels that wrong?
03:05 bpmedley_ These days Modern Perl is very exciting.
03:06 sri i guess map/grep without block have the same odd look
03:07 Zoffix Personally, I'm sick and tired of typing "use 5.020" and "use experimental BLAH", but I've no idea whether I'd bother switching to a whole 'nother language just because of that.
03:07 sri that's not so bad, you can make it go away with modules
03:08 sri i specifically meant things that just don't fit into the language, like the php namespace separator
03:08 buu sri: Module'Names
03:09 sri namespace Foo\Bar\subnamespace;
03:09 sri buu: !
03:09 buu I would hate that far less if it was /foo/bar/
03:09 sri yea, i guess there's some perl4 legacy
03:10 bpmedley_ sub attributes have always seemed odd to me.
03:10 sri the implementation of them is odd
03:10 buu There's definitely a bunch of perl4 bits and pieces left over, we just mostly never see them in code written by competent people
03:10 sri but they look fine
03:10 buu sub prototypes are super janky
03:11 buu &sub; probably should have done something else
03:11 buu typeglobs still exist, etc
03:12 Zoffix modules won't make the whole "say 'foo'; **awww**dang**^H^H^H^H^H^H^H;print "foo\n"", while, say, debugging a module meant for CPAN
03:13 Zoffix I think Perl 5 has to let go of "make things backcompat at all costs" at some point. It's one of the reasons I decided to do the whole "most recent perl + previous version" support for XTaTIK.
03:13 Zoffix We have perlbrew and things. It's time to get closer to the bleeding age. The people who still run 10+ year old scripts need to move on.
03:13 Zoffix s/age/edge/;
03:21 jb360 joined #mojo
03:23 sri i guess perl6 is actually really bad for fluent interfaces, i've not really thought about that before
03:24 Zoffix And seems that won't have a chance of getting fixed either: http://irclog.perlgeek.de/perl6/2015-09-25#i_11272551
03:26 sri kinda kills perl6 for me actually, all my apis are fluent
03:27 sri that puts the ruby port of mojolicious above the perl6 port on the todo list ;p
03:28 Zoffix :D
03:28 sri we have to get grammars into perl5 :S
03:32 sri i've not yet looked much for perl6 warts
03:33 sri eeep... "has $.x;" does not mean you can do "$.x = 1", you have to do "$!x = 1"
03:35 sri you'd think this very common stuff would be designed well in a new language
03:36 sri some funny stuff in there http://doc.perl6.org/language/traps
03:39 sri i like the .elems on an empty array sometimes returning 1 and sometimes 0
03:40 sri i'm assuming that "my @array = []" is equivalent to "my @array = ([])" in perl5
03:48 Grinnz Zoffix, while for personal projects i'd agree, in a corporate environment you don't always have those freedoms
03:48 Grinnz re: just use latest version of perl
04:47 kanishka joined #mojo
05:03 panshin joined #mojo
05:26 batman bpmedley_: Which code?
05:43 melo joined #mojo
05:59 panshin joined #mojo
06:18 dod joined #mojo
06:29 bpmedley_ https://ssl.thorsen.pm/paste/8431e618169c
06:36 batman bpmedley_: the idea is that it should merge two hashes. i only need two level merging though
06:36 batman i might have solved it so i don't need merging, so it's not a big deal
07:00 CandyAngel Is there a reason why Mojo::Collection->uniq doesn't take a subroutine to "key-ify" the items?
07:00 mattastrophe joined #mojo
07:00 CandyAngel I don't see how you can uniq, say, a bunch of arrays in a Mojo::Collection
07:03 batman CandyAngel: you can't unless the array refs point to the same memory chunk
07:03 batman it's pretty much the same logic as https://metacpan.org/pod/List::MoreUtils#uniq-LIST
07:13 panshin joined #mojo
07:15 eseyman joined #mojo
07:18 trone joined #mojo
07:20 sue joined #mojo
07:21 CandyAngel Unless you put them in an arrayref object which stringifies to the key you want to uniq on..
07:22 batman :)
07:28 CandyAngel I feel a patch coming on :P
07:30 batman CandyAngel: i think you want $col->grep(sub {})) instead
07:33 CandyAngel And have a %seen thing outside it so it only greps the first one? Hmm
07:34 CandyAngel Could do
07:54 CandyAngel I'm thinking something like this (untested): http://pastebin.archlinux.fr/1595115
07:56 batman not sure if i think that's a good idea. sounds hard to document :/
07:58 McA joined #mojo
08:00 batman are you sure it's not just faster to write your own grep? (faster, as in "time consumed")
08:02 marcusr I kind of like the idea. Be the best uniq that you can be.
08:04 marcusr traceroute bad.horse is amazing. #offtopic
08:08 batman marcusr: wow! haha :)
08:08 CandyAngel It seems like it's just randomly missing. A bunch of other ones take a sub that determines modification/grepping behaviour, but uniq doesn't
08:09 CandyAngel WHich means you'll have to figure out that a grep is grabbing uniq stuff, rather than just seeing $coll->uniq(sub{}); and knowing it is uniq'ifying the collection
08:10 CandyAngel LIke umm
08:10 McA joined #mojo
08:10 CandyAngel The docs says "Create a new collection without duplicate elements" but you have no way to tell uniq what makes an element unique
08:11 CandyAngel [1] is the same as [1], even if it is in a different bit of memory
08:11 CandyAngel Just like '1' is the same as '1'
08:12 marcusr or make it use dumper if there's a reference? :)
08:12 marcusr possibly too much magic
08:13 CandyAngel Yeah
08:13 CandyAngel You might have a massive hashref, but only 2 of the top level keys makes it actually unique
08:13 sue joined #mojo
08:13 CandyAngel For example, say you have a bunch of URLs you have scraped from a site
08:13 CandyAngel http://www.example.com/page1?query=param
08:14 CandyAngel http://www.example.com/page1?query=param2
08:14 CandyAngel http://www.example.com/page1?query=param3
08:14 CandyAngel If you just stringfy them, they are all unique
08:14 CandyAngel But you might only be interested up to:
08:14 CandyAngel http://www.example.com/page1
08:15 * batman is pretty sure we have discussed this before
08:16 marcusr no batman, this discussion is uniq
08:16 marcusr :D
08:16 batman haha!
08:17 batman btw... not before as in "let's not do it again", but maybe there was something clever said
08:17 CandyAngel Mhm
08:17 marcusr yeah, I'm digging in the logs
08:17 marcusr http://irclog.perlgeek.de/mojo/2014-12-15#i_9809824
08:18 Vandal joined #mojo
08:18 batman CandyAngel: seems like sri has been asking that question quite a lot without getting much feedback
08:18 batman also http://irclog.perlgeek.de/mojo/2014-07-24#i_9072483
08:20 CandyAngel Hm
08:20 CandyAngel I don't think two different versions are needed, just the "preparser" callback
08:22 CandyAngel I've mainly come across this when using Mojo::Collection outside of Mojo
08:25 CandyAngel Where I will, say, parse a bunch of files to get hashrefs, and then want to uniq just on one key, but keep the hashref (as they have another key I want to use while processing the uniq list)
08:27 CandyAngel Oops
08:27 CandyAngel My patch is wrong, doh!
08:28 CandyAngel The CODE one has no post-increment ;P
08:28 CandyAngel :P*
08:29 marcusr CandyAngel: Probably needs a proper pull request with tests and docs to get consideration
08:29 panshin joined #mojo
08:30 CandyAngel Oh, of course
08:33 berov joined #mojo
08:50 sue joined #mojo
08:50 panshin joined #mojo
08:52 CandyAngel I'll be happy to do that if it isn't a definite "no"
08:59 batman i'm neutral for now.
09:01 CandyAngel Also, it'd be really cool to contribute someone other than "helpz! ididn'treadthedocsproperly"
09:01 CandyAngel something*
09:07 meshl joined #mojo
09:29 nic how do you peeps define attributes in lite apps?
09:29 nic app->has(a => 'A'); is working for me, but I suspect I'm over-complicating it
09:36 jontaylor joined #mojo
09:38 batman nic: i just use a helper instead
09:39 nic a helper you define or am I forgetting a standard helper?
09:39 nic (I don't use lite apps v often; I'm sure it's simpler than I'm doing, but I can't remember what, and I'm not seeing it in the Tutorial)
09:39 batman helper foo => sub {"too cool"}; # this can be called as an $app->foo or $c->foo
09:39 batman s/as an/as/
09:40 nic oh, you're saying you use helpers in place of attributes?
09:40 batman yes.
09:41 nic so instead of app->has(ua => sub { Mojo::UserAgent->new } what would you have as a helper?
09:42 batman ua is in conflict with a method, but... anyway: helper ua => sub { state $ua = Mojo::UserAgent->new };
09:44 nic ah, 'state', had forgotten about that
09:44 nic and thanks for the name-clash warning
09:45 nic (I've actually called it 'agent' in my code)
09:46 nic Stepping into Minion is quite a funny experience
09:46 nic It feels like you must have missed some of the documentation
09:46 nic after a minute it sinks in, oh maybe it really is that simple to use :)
09:47 asarch joined #mojo
09:49 batman nic: when ever i need to have an extra user agent, i try to tie it to $c. like this: helper ua => sub { shift->stash->{ua} ||= Mojo::UserAgent->new };
09:53 nic that ties it to the current req, not $c
09:54 nic If I was making it $c-specific I might put it in app->{ref($c)}{ua}
09:54 asm35 joined #mojo
09:56 batman nic: $c _is_ the current request
09:56 batman or a "temp" controller object if called on $app
09:57 nic I thought you meant controller-specific
09:58 nic If it's tied to the current req, I don't need it in a helper
09:58 batman i think you're missing something here... $app->some_helper() ... which object do you think $self is inside some_helper() ?
09:59 jontaylor joined #mojo
09:59 batman as if you say ref($self) or whatever...
09:59 nic we're talking about different things
09:59 batman ok. then i will stop.
10:01 stephen joined #mojo
10:02 panshin joined #mojo
10:03 risugg joined #mojo
10:03 batman uhm... that question came out condescending. i just wanted to know if we were at the same page. sorry :/
10:03 batman nic: ^
10:04 nic batman: sometimes you sound like you're looking for a fight, but I've known you long enough to know you don't mean it like that :)
10:04 batman nic: yeah. trying every day to be a better person.
10:04 nic currently my own head is full of 'wrong' and can't code for anything, so I wouldn't trust anything I've typed so far today :(
10:05 * batman is looking forward to getting the new assetpack out in the wild. (been taking way too much time)
10:05 marcus "Always be yourself, unless you can be Batman. Then always be Batman." -- Bill Murray
10:05 nic :D
10:05 batman haha
10:05 CandyAngel Batman looking for a fight? Never.
10:08 asm35 joined #mojo
10:11 nic [For anyone pondering "app->has(..)", it's complete nonsense; I really need some coffee]
10:26 nic [should have been "app->attr(agent => sub { Mojo::UserAgent->new })"; mmm, nice coffee]
10:31 Kripton joined #mojo
10:35 nic "D
10:47 Zoffix Grinnz, that in no way means that newer perls must preserve backcompat
10:48 Zoffix zealously I mean
10:48 Zoffix If you have 10-year old scripts you don't want to update, throw 5.8.8 in with perlbrew and let that thing rot further.
10:49 nic If perl let go of some of the back-compat angst, I wonder if there would be fewer laggers or more
10:50 nic and would there be more adopters/retainers of perl (vs alternative languages)
10:50 * nic hunts for the crystal ball
10:51 * nic finds a couple of marbles and a supermarket receipt
10:53 * marcus hands nic a turban
10:53 marcus nic: Glad you found those marbles, I was worried you had lost them.
10:53 Zoffix As I've mentioned elsewhere, people who think Perl is ugly and horrible usually do so because they find an ancient book or an ancient ugly script from 1990 and then run it on their new and shiny perl and never realize that their book/script is ancient
10:54 nic In the sysadmin realm, there is a lot of really horrible perl code
10:55 nic In the places I've been, I've heard a lot of sysadmins evangelising about how unreadable it is, and their code being mocked by devs who happen upon it
10:55 nic (the same people were producing terrible bash scripts too, but that had little impact to anything)
10:56 nic In the early days, the most use made of perl was as systems tools, and that image is still hurting p5
10:58 nic Zoffix: is your point that if there was an incompatibility gap, and some of those scripts stopped working, it would help perceptions of modern perl?
11:05 neilhwatson joined #mojo
11:06 jabberwok re: http://mojolicio.us/perldoc/Mojolicious/Guides/Routing#Reversibility : ...what code exactly, would one use to turn extracted placeholders back into a path?
11:07 amon joined #mojo
11:07 jontaylor joined #mojo
11:22 nic jabberwok: I think I use url_for for that
11:22 Zoffix nic, on global scale, yes. I think a good comparison for this can be made with Internet Explorer. There are ancient corporate apps that work only in ancient, horribly broken Internet Explorer. Now, if the modern IE preserved all those bugs, those apps would still work but invariably some modern stuff would need some sort of, oh, I don't know "<!-- use IE 10.001; -->".
11:23 Zoffix I think I've lost my train of thought because I'm realizing I'm running late :)
11:24 nic yeah, that's the usual argument, that back-compat is hindering current & future code
11:24 nic I was just wondering if there's an additional argument re perceptions (which is arguably more important)
11:26 CandyAngel It doesn't work either way
11:26 CandyAngel Best way is new name :P
11:26 CandyAngel perl scripts continue to run in Perl
11:26 CandyAngel perl-ng scripts run in perl-ng
11:27 CandyAngel Or whatever
11:27 batman CandyAngel: #!/usr/bin/env perl + plenv = <3
11:27 Zoffix We have that and it's called Perl 6 :P
11:27 CandyAngel Zoffix: Like python3 is called python3?
11:27 jabberwok nic: thx
11:28 CandyAngel batman: Yeah, I use #!/usr/bin/env perl too
11:29 CandyAngel (but with perlbrew)
11:29 jabberwok perl6 is perl5 on lsd
11:29 batman CandyAngel: same shit, different wrapping, hehe :)
11:30 CandyAngel Yeah
11:31 CandyAngel The only problem of using env I am aware of is the inability to pass arguments via the shebang
11:31 CandyAngel But.. I never do that :P
11:31 CandyAngel And don't know why you would
11:32 pink_mist -C is sometimes useful
11:33 CandyAngel On the shebang? Why not just 'perl -C script.pl'?
11:33 pink_mist err, not /just/ -C by itself; you'd supply it with flags too
11:34 pink_mist CandyAngel: because I don't want to haveto do that every time?
11:34 pink_mist CandyAngel: also then I can't do it by just running ./script.pl directly
11:35 CandyAngel Hm
11:36 nic There is a reason for not using env
11:36 CandyAngel I try to only put stuff in the code if it will "always" be there
11:36 nic which is why it gets replaced at deploy-time
11:36 nic I don't remember the reason; perhaps a security vulnerability
11:37 CandyAngel One of the reasons why I reaaaaaaally like Devel::Dwarn
11:37 CandyAngel nic: The only reason I have read about is not being able to pass arguments to the found binary
11:37 CandyAngel Like umm
11:38 CandyAngel -Ilib or something
11:40 cpan_mojo Mojolicious-Plugin-Riotjs-0.05 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-Riotjs-0.05
11:44 ZoffixMobile joined #mojo
11:45 ZoffixMobile back :)
11:46 CandyAngel Welcome back
11:49 ZoffixMobile nic, it will improve perceptions as well. First, when acient things start breaking, people will be motivated to connect to the community, which *is* Perl's strength and marketable point. Also, those wanting to learn the language would not be learning from terrible old code, since it will no longer work. Those sysadmins you mentioned will stop making fun of the perl, because it'd be similar to making fun of Windows 10 because your copy of Doom from 1998
11:50 ZoffixMobile hm. that filled my entire screen. sorry for being so verbose :)
11:54 dvinciguerra joined #mojo
11:55 nic yep, so we've almost fixed the world, if only we could come up with a name for perl7
11:57 CandyAngel It's obviously per7
11:58 CandyAngel Or
11:58 ZoffixMobile candyAngel++
11:58 CandyAngel Or umm
11:58 nic hmm, Cookbook#Making-your-application-installable says "Every CPAN module needs a version"
11:58 nic and yet most Mojolicious modules...
11:58 ZoffixMobile should say "distribution"
11:59 CandyAngel 7red
12:00 CandyAngel 7jed (closest I can think of to upside-down "perl" in ASCII)
12:04 ZoffixMobile .oO( 7 jedish code... )
12:05 nic CandyAngel: re 'env'... https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/issues/58
12:14 nic lol, just got to the end and saw "Grinnz commented 2 days ago"
12:16 nic My interpretation is it's about deploying in a portable way -- there's no mention of any security implications -- so I guess your use is fine
12:16 Grinnz It's about installing, not deploying
12:16 Grinnz installed scripts get rewritten so that running the script is equivalent to /path/to/perl /path/to/script
12:17 Grinnz env perl on the other hand uses whatever perl is at the beginning of your path, regardless of where the script is
12:17 nic Grinnz: what do you understand by 'deploy'?
12:18 nic CandyAngel: The top answer here has more discussion: http://unix.stackexchange.com/questions/29608/why-is-it-better-to-use-usr-bin-env-name-instead-of-path-to-name-as-my
12:21 Grinnz IMO, using a specific perl is more predictable than trusting the user's path to have the right perl, especially with multiple users
12:21 nic swings & roundabouts
12:21 Grinnz for deployment, i tend to explicitly specify the perl either way
12:22 nic while developing, I favour env, but as soon as it goes to integration testing I favour a defined binary
12:30 mattastrophe joined #mojo
12:32 tcohen joined #mojo
12:33 ajr_ joined #mojo
12:35 mattastrophe joined #mojo
12:38 risugg joined #mojo
12:38 jontaylor joined #mojo
12:45 Dandre joined #mojo
12:46 plicease joined #mojo
12:50 nic metacpan.org is now unavailable on http?
12:52 Grinnz redirects to https for me, always have used https for it anyway
13:15 nicomen how do you implement job dependencies with minion?
13:15 Grinnz sri was just discussing that yesterday
13:16 jontaylor i had that problem in my app from a few weeks back, and had to model it in my application
13:16 Grinnz http://irclog.perlgeek.de/mojo/2015-09-24#i_11268990
13:16 nic nicomen: What kind of constraints are you looking for?  Don't launch C till A and B have completed successfully?
13:17 nicomen nic: yes
13:17 nicomen Grinnz: hehe nice ;)
13:17 jontaylor on my problem I was doing rollups of aggregated data, and I had to have the minutes aggregated, before doing hours, before doing days, before doing weeks etc
13:17 Grinnz nic == niczero?
13:18 Grinnz or do we have 3 nics
13:18 nicomen I think I would need depencies of a type of a job rather than a job id, but I'm not sure. I am investigating wether something here could be replaced by minion
13:19 jontaylor resque which i’ve used in the past could do it by job type
13:19 jontaylor on the command line you’d give it a list of types a worker was allowed to process
13:19 jontaylor and it would do all of the first type, before the second etc
13:19 dvinciguerra joined #mojo
13:25 melo joined #mojo
13:32 irqq joined #mojo
13:42 bpmedley joined #mojo
13:44 Grinnz joined #mojo
13:52 asarch joined #mojo
13:53 Kogurr joined #mojo
13:56 irqq_ joined #mojo
13:56 asm35 joined #mojo
13:58 panshin joined #mojo
14:07 asm35 joined #mojo
14:12 hernan605 joined #mojo
14:14 asm35 joined #mojo
14:20 stephen joined #mojo
14:24 sri waiting for new glasses sucks
14:28 genio I hate that I have to go to the optometrist once a year to get new contacts when I have the same prescription every year.  What's the point?  Just let me have more contacts
14:30 Grinnz some peoples eyes change a lot i guess
14:30 pink_mist maybe the contacts have a best before date for some reason
14:31 genio ~1hr of time, dialated eyes that can't see in the light for several hours, ~$150USD, same prescription, same contacts
14:31 genio pink_mist: They do have an expiration, yes.  But, I argue that I should be able to order more contacts without having to revisit because it's been longer than a year since my last visit.
14:31 sri my eyes have not changed a bit over the last 10 years, my glasses just break :(
14:32 genio I can buy new glasses without a visit if I know my info
14:32 genio sri: Considered LASIK?
14:32 sri stay away from my eyes with your lasers!
14:33 genio My wife had it done and I'm kind of envious
14:33 * sri doesn't trust it
14:33 asm35 joined #mojo
14:34 genio I know my eyesight will deteriorate with age anyway, but a few years of no contacts/glasses would be really nice
14:34 jberger you don't want this near your eyes? https://pbs.twimg.com/profile_images/1818255902/401002_10100215793674869_32800612_44156443_1078677408_n.jpg
14:34 sri i don't mind wearing glasses at all
14:35 sri it would just be nice to get quality ones for a change... it seems like all brands are made by one big copany in china
14:35 sri +m
14:36 sri luxottica... the monsanto of glasses
14:36 batman i don't trust lasers enough to bother. i like my glasses :)
14:36 sri or the nestle of glasses?
14:36 sri all evil anyway
14:36 batman i think marcus is quite satisfied with the laser operation
14:36 genio evilcorp
14:37 batman sri: http://www.quickmeme.com/img/ea/ea19cc7c5c80c10727c886f89640721a406fcc1e2125cdd192bffed4ab1439b0.jpg
14:37 sri i literally tried duct tape earlier :D
14:38 sri it did not work, too thin
14:38 batman hehe
14:38 batman buy two cheaper pairs
14:39 AndrewIsh joined #mojo
14:39 batman i once laid down on my glasses. didn't brake :)
14:39 sri kicking myself in the butt right now for putting off getting a proper backup pair
14:40 genio hrm.  Checking my insurance to see what optometrist I can see and what do I see? An add where my insurance is offering $800 off LASIC in a limited-time offer
14:40 genio with free enhancements for life
14:40 batman i know the feeling... i only have one pair as well. but i have backup sun glasses!
14:40 batman going to look really cool if i brake my glasses during winter ;)
14:40 pink_mist http://4.bp.blogspot.com/-ExSBio5ZII0/T_svEe_GsDI/AAAAAAAACrw/Y4TYTlB8BfQ/s1600/WD40+Duct+Tape+Flow+Chart.jpg <-- I don't suggest putting either Duct Tape or WD40 in your eyes 0_o
14:41 pink_mist genio: sounds great =)
14:41 batman *break
14:42 genio lasik, too.  sheesh. *removes the C key*
14:42 asm35 joined #mojo
14:42 sri CandyAngel: do you have a patch to propose yet?
14:43 CandyAngel sri: Not yet, I've only just gotten home
14:43 CandyAngel Does it need to be a github pull or just a patch file?
14:44 gryphon joined #mojo
14:44 sri both are fine
14:44 CandyAngel Awesome
14:45 sri pull request is the official way though, if you want to trigger a vote
14:45 CandyAngel Ah okie, I'll do it that way then
14:45 sri patch works only when i'm here and interested in the topic
14:45 CandyAngel Well you're here.. interest is yet to be seen :P
14:46 CandyAngel Just going to have a poke around and see if I can fix my VM's audio (it just suddenly cut out again)
14:46 sri i tend towards +1 though, if the patch is good
14:46 CandyAngel And then I'll send it a request
14:46 CandyAngel send in*
14:47 batman perltidy annoys me sometimes: https://ssl.thorsen.pm/paste/034ec51790bf
14:49 * sri thinks he might try an online optimetrist to get a new backup pair of glasses
14:49 sri s/i/o/
14:49 CandyAngel batman: Ew, that's not nicely laid out
14:50 sri batman: that doesn't look so bad
14:50 batman hehe
14:50 ZoffixWork joined #mojo
14:50 sri think you can do "unlink if -f and ..." though
14:50 batman seems like perltidy doesn't like it.
14:50 batman i'll try again
14:51 batman oh. it worked.
14:51 batman not sure what was going on earlier :(
14:51 CandyAngel Bleh, nothing in dmesg in the host or guest about the audio
14:51 sri if i don't like how it formats something into multiple lines i just extract stuff, like putting the values into an array
14:51 CandyAngel It's just lolnoping
14:51 * CandyAngel blames systemd
14:56 batman i wonder if any of my modules will ever hit 1.00
14:57 Grinnz thats up to you :P
14:57 jberger I've been meaning to update (re: add) a twitter cover pic, that laser image reminded me: https://twitter.com/joelaberger
14:57 cpan_mojo Mojolicious-Plugin-AssetPack-0.65 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-AssetPack-0.65
14:58 ZoffixWork \o/
14:58 * batman is scared
14:58 genio no in-network optometrists have availability today.  *sigh*
14:58 sri no reason to be scared of 1.0, you can always bump to 2.0 if you have to
14:59 cpan_mojo Mojolicious-Plugin-Bootstrap3-3.3503 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-Bootstrap3-3.3503
14:59 PryMar56 joined #mojo
14:59 pink_mist just wait until Net::FullAuto starts depending on Mojolicious, then you'll see someone afraid of bumping to 1.0
14:59 sri did that with Mojo::Pg when i noticed that i screwed up and needed to make a breaking change :)
15:00 jberger I can say with absolute certainty, I don't care at all what Net::FullAuto depends on
15:00 sri Minion will go 2.0 when postgres 9.5 gets released
15:00 sri for the SKIP LOCKED change
15:01 batman sri: hehe
15:02 panshin joined #mojo
15:02 Grinnz Net::FullAuto doesn't depend on anything, because its Makefile.PL essentially installs an entire operating system
15:03 Grinnz what would it need CPAN modules for
15:03 * genio is still in favor of a forced change of namespace for that thing.  Acme::FullAuto
15:04 Grinnz hehe
15:04 jberger I just can't wait until he runs out of precision on his version number :-P
15:04 ZoffixWork :P
15:06 genio Is there something akin to coveralls.io for GitHub integrated coverage testing (like TravisCI, but for coverage testing)
15:07 ZoffixWork I've noticed this account commenting coverage yesterday: https://github.com/coveralls?tab=activity
15:07 jberger genio: isn't that what coveralls is? I haven't used it, so I could be wrong
15:07 asarch joined #mojo
15:08 ZoffixWork Not sure what it belongs to.
15:08 sri jontaylor: re job dependencies, doing it based on job type seems crazy
15:08 genio jberger: Yes, but it doesn't do Perl
15:08 jberger genio: PDL has it
15:09 jberger https://coveralls.io/github/PDLPorters/pdla
15:09 jberger pdla is the "agile" branch of pdl
15:09 sri jontaylor: you have a distributed system with delays between checking different queues, anything can happen in that time
15:09 genio sri: While I'm thinking about it, would this be a good time to update the .travis.yml to include more Perls?  https://github.com/houseabsolute/Log-Dispatch/blob/master/.travis.yml#L9 for example
15:10 sri genio: i don't think it's fair to put that much load on travis
15:11 disputin joined #mojo
15:11 genio jberger: hmm.  I'll have to look at how they did that.  thanks
15:11 Grinnz genio, that's using travis-perl-helpers, which installs each of those perls per build
15:11 sri if you're building a bunch of perls just to get your latest typo fix tested you're not a good person
15:12 sri in fact, i've switched to the docker stack on travis to make everything faster
15:14 jberger sri: you should see the load that FrameworkBenchmarks puts on it :o
15:14 Grinnz 5.22 still waiting on https://github.com/travis-ci/travis-cookbooks/pull/482
15:14 jberger mojo doesn't hold a candle to that
15:15 jberger https://travis-ci.org/TechEmpower/FrameworkBenchmarks/builds
15:15 sri and that's why we can't have nice things
15:16 Grinnz wow
15:17 marcus <3 Freakin' lasers
15:17 jberger marcus: the us govt asked us if our lasers could be used against airplanes in flight, ie might people steal them and use them for terrorism ...
15:18 sh4 joined #mojo
15:18 sri jberger: so you tried it to find out? :)
15:18 marcus I'm hurrying up to build my quadcopter now before the first drone bombing comes and the us bans them.
15:18 jberger the answer was, "if you could move it and all of its supporting equiment outside and have it still function given the air currents, vibrations, humidity and temperature fluctuations ... "
15:18 jberger " ... then still no"
15:19 jberger it was really funny
15:19 sri aww
15:19 jberger its key feature is the shortness of its burst with high instantaneous power
15:20 CandyAngel sri: Should this just be one patch that updates the code/docs/tests in one go or separate tests for each bit changing?
15:20 jberger ~100 fs pulses delivering an average of a few watts means a ton of energy per pulse
15:21 jberger but still only a few watts :-P
15:21 sri CandyAngel: one
15:21 CandyAngel Thankies
15:21 sri try to replicate the surrounding style, re docs and tests
15:22 CandyAngel Yeah, I will
15:22 CandyAngel I tried to do that with my little example patch
15:28 sri i've not seen a patch
15:29 asm35 joined #mojo
15:29 CandyAngel It's fine, it wasn't tested or anything anyway
15:33 CandyAngel Also.. apparently, it wasn't to the latest version. this code is slightly different
15:34 jberger <3 rebase
15:36 CandyAngel Like.. instead of my ($self, $cb) = (shift, shift), it's the (expected) my ($self, $cb) = @_
15:37 jontaylor sri: I wasn’t suggesting that minion use the same mechanisms, i was just demonstrating what some of the alternatives do, i’m quite happy treating it like a dumb queue and handling the complexity in my app
15:51 CandyAngel Umm
15:51 CandyAngel sri: Do I just need a single passing test..?
15:53 CromeDome joined #mojo
16:00 berov left #mojo
16:14 sri CandyAngel: if that covers all functionality
16:22 jb360 joined #mojo
16:35 asm35 joined #mojo
16:40 mattastrophe joined #mojo
16:44 impish joined #mojo
16:46 impish hi everyone, how do I get all params? i know my $name = $c->param('name') but I want all param values in a hash, or a string and I can't figure out how.
16:48 CandyAngel impish: I think it may be in $c->stash->{'mojo.captures'}
16:49 bwf http://mojolicio.us/perldoc/Mojo/Message/Request#params
16:49 CandyAngel Judging from the source in Mojolicious::Controller
16:49 sri CandyAngel: mojo.* stash values are private
16:50 CandyAngel sri: I see, thanks for letting me know
16:50 * CandyAngel is the oddest mix of not reading the docs properly or reading the source too much :P
16:51 sri http://mojolicio.us/perldoc/Mojolicious/Controller#stash
16:51 CandyAngel You didn't have to make demonstrate it again. I know, I know!
16:52 sri good :)
16:52 Grinnz_ given the state of most docs on CPAN, reading the source is a common necessity
16:52 CandyAngel make demonstrate.. ahh, the joys of changing what you want to type in the middle of typing it
16:52 Grinnz_ make; make demonstrate;
16:52 CandyAngel error: CandyAngel hasn't read the docs enough
16:52 CandyAngel exit code: 666 - sri is annoyed
16:53 sri Grinnz_: writing a daft punk song?
16:53 Grinnz_ :)
16:55 impish ok, I was trying $c->params when I should have been doing $c->req->params, got it
16:57 genio Yay.  Found an optometrist that can see me now! \o/
16:57 CandyAngel Yay
17:08 * CandyAngel facepalms
17:11 CandyAngel I guess I have some bad coding habits or something
17:12 * batman is jhthorsen
17:12 batman CandyAngel: ^
17:12 CandyAngel You're comment is 100% spot on and I have no idea why I used map >.<
17:12 CandyAngel Your*
17:13 batman :)
17:13 sri is your test case wrong?
17:13 sri how could a map work instead of a grep?
17:13 batman sri: because of ()
17:14 CandyAngel The code is valid, it's just not optimal
17:14 CandyAngel Or.. clear
17:14 dod joined #mojo
17:14 CandyAngel Which is ironic considering I said I didn't want to use $c->grep because it wasn't immediately clear that it was doing $c->uniq
17:14 sri oh, i'm sure it could be golfed down anyway
17:14 CandyAngel Grrr
17:16 CandyAngel I think I may have not used grep because I *never* use grep
17:16 sri expected "return $self->new(grep { !$seen{$cb ? $cb->($_) : $_}++ } @$self);" or so
17:16 CandyAngel Now I'm wondering if that is because I don't need it, or because I'm an idiot^W^Wjust using map instead
17:17 sri the whitespace above the test needs to go too
17:17 CandyAngel sri: I separated it because it redefines $collection
17:18 sri other tests do that too and are grouped
17:18 sri just imitate the surrounding style
17:19 CandyAngel Okie
17:19 CandyAngel So what should I do? make another commit to that branch and resubmit a pull?
17:19 Grinnz_ github PRs automatically update to the branch
17:19 ZoffixWork joined #mojo
17:20 sri yea, just commit away
17:20 * CandyAngel nods
17:20 CandyAngel Will do!
17:20 CandyAngel (thanks for your patience)
17:20 ZoffixWork I usually rebase :)
17:20 Grinnz_ you can commit and then rebase -i to squash it
17:20 Grinnz_ and then force push to your branch
17:21 CandyAngel Won't that make batman's comment about map make no sense?
17:21 Grinnz_ it'll hide it probably
17:21 Grinnz_ and thats fine
17:21 ZoffixWork It'll change it to "comment on an outdated diff"
17:21 CandyAngel Okies
17:21 sri says something like "comment for old commit" or so in the history and hides it otherwise
17:23 batman sri: i think your version is slower, since it has to check if $cb is a ref on each grep{} iternation
17:23 batman *iteration
17:24 sri yea, but does it matter?
17:24 batman guess LoC matter more..? ;)
17:24 batman depends on the number of elements, but it doesn't really matter if you do a db query :D
17:24 sri i don't know, some should do a benchmark *hint hint*
17:24 sri +one
17:25 * batman will drink beer
17:25 sri like herding cats
17:26 CandyAngel Meow
17:26 CandyAngel ^..^
17:26 CandyAngel (I'll benchmark it)
17:27 sri http://mojolicio.us/perldoc/ojo#n
17:27 sri really nice for these kinds of quick benchmarks
17:28 * lb did websockets today for internal demo
17:28 lb thwarted by nginx support for wss requiring it to be configured
17:29 lb worked fine for ws through nginx on my laptop
17:30 sri CandyAngel: don't think you need to check the type of $cb, so it can be a little shorter :)
17:30 lb the web: we'll fuck you in production, just you wait
17:32 CandyAngel sri: I just copied code from similar functions
17:32 ZoffixWork So yesterday we were talking how it were a pain to add \ at end of lines in Perl 6 to write fluent interfaces... Today I'm coding in AutoIt3 and you can't move anything onto a new line, unless you add "space underscore" at the end of previous line: http://fpaste.scsys.co.uk/499285
17:32 CandyAngel See, I *can* do it
17:33 good_news_everyon joined #mojo
17:33 good_news_everyon [mojo] kraih pushed 2 new commits to master: http://git.io/vnNGk
17:33 good_news_everyon mojo/master d8980b3 CandyAngel: add callback to uniq method of collection
17:33 good_news_everyon mojo/master eaec9b5 Sebastian Riedel: Merge pull request #847 from CandyAngel/collection_uniq_callback...
17:33 good_news_everyon left #mojo
17:34 lb today i discovered that anyevent::dns is super slow if you claim a hostname is an ip-adress
17:34 CandyAngel <3
17:34 * CandyAngel does a little dance
17:35 CandyAngel yayyyy
17:35 ZoffixWork CandyAngel++
17:35 sri do you have a real name for the credits section?
17:35 lb frankly i feel its reluctance to give an actual answer is a little condescending
17:36 Grinnz_ lb: for once, its documentation isn't
17:36 lb Grinnz_: it was a pretty dumb mistake ;)
17:36 Grinnz_ there's no rant, how is this a mlehmann dist :P
17:36 sri (don't be alarmed if i change the example)
17:37 lb Grinnz_: i was hacking some dnskey support on top of anyevent::dns
17:38 lb doing nic-work, it's a good idea to supply nameservers, and in my api i expected ip's, and in my client, i supplied hostnames, result: not fast
17:38 Grinnz_ heh
17:38 * lb doesn't like anyevent because of mlehmann, but the alternatives are annoyingly low level
17:40 CandyAngel sri: I don't mind if you change the example and I'd prefer to just be noted as CandyAngel if that's okay?
17:40 lb CandyAngel is CandyAngels strippername
17:40 Grinnz_ Net::DNS::Native and Net::LibAsyncNS are the two generic ones i know of, then there's POE::Component::Resolver but that's really just forking getaddrinfo
17:41 sri sure, real names are not required, it's just customary to ask
17:41 Grinnz_ LibAsyncNS doesn't bundle the lib unfortunately, so it requires you to have it installed
17:41 sri lb: that's inappropriate
17:41 lb Grinnz_: net::dns is not async, i used net::dns::sec first, but it's obviously a resource hog
17:41 * CandyAngel prods lb
17:41 CandyAngel No
17:41 Grinnz_ lb: Net::DNS::Native is different
17:41 CandyAngel Just.. no :P
17:42 CandyAngel http://www.joesparks.com/radiskull/
17:42 lb that's inappropriate
17:43 lb Grinnz_: looked into that one a few weeks ago, see also: too low level
17:44 lb i don't want to resolve an ip, i want strange rr's
17:44 Grinnz_ any higher level and you have to decide on an event loop though
17:44 lb true
17:45 lb i wouldn't mind mojo::ioloop
17:46 Grinnz_ there's https://metacpan.org/pod/IO::Async::Resolver::DNS and https://metacpan.org/pod/IO::Async::Resolver::LibAsyncNS for higher level usage in IO::Async
17:46 lb as one of my comp sci teachers once said, you'll have to integrate over pain
17:46 lb and currently mlehmann is in the sweet spot :(
17:46 Grinnz_ the former again just forks
17:47 * lb did some nasty interpolation of Anyevent::DNS and magic from Net::DNS::SEC today and it seems to work
17:47 lb eventually i might do a cpan release
17:48 lb but thanks for the pointers, i'll check them out monday
17:50 good_news_everyon joined #mojo
17:50 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vnNln
17:50 good_news_everyon mojo/master 7e9cd70 Sebastian Riedel: update Changes
17:50 good_news_everyon left #mojo
17:51 sri i can't actually think of a better example :/
17:51 CandyAngel sri: It's about 3% faster to have just the one check on $cb (rather than checking each time)
17:51 sri ah, interesting
17:51 CandyAngel For 15 and 500 elements
17:53 sri guess we'll keep it
17:54 panshin joined #mojo
17:54 sri more consistent with the other methods too
17:57 jberger I was just going to suggest "if $cb"
17:58 sri :)
17:58 jberger then when I went to check if it was short enough, it was already there
17:58 hernan605 joined #mojo
18:01 jberger if only grep took a subref
18:01 jberger (not the first time I've wished for that)
18:03 CandyAngel Oh, rather than a code block?
18:03 jberger yeah
18:03 jberger grep $sub @_
18:03 neilhwatson joined #mojo
18:04 jberger and likely it can't because of grep EXPR, LIST ... which I hate too
18:04 jberger one of the few places in perl(5) where you can defer evaluation without a subref
18:05 jberger (or at least a block)
18:05 lb grep { $sub->($_) } @list; # hardly any more punctuation
18:06 CandyAngel Would be a pretty short helper?
18:09 jberger http://pastie.org/10443817
18:09 jberger I don't like that, but I think I would like it if I could 'grep $sub @$self'
18:10 lb i agree, send to p5p :)
18:10 lb ditto map, i assume
18:11 jberger and sort
18:11 lb sort is a strange one
18:12 risugg left #mojo
18:17 genio yay, eyes!
18:26 asm35 joined #mojo
18:28 meshl joined #mojo
18:29 Kundun joined #mojo
18:38 irqq joined #mojo
18:59 mattastrophe joined #mojo
19:12 marty joined #mojo
19:13 marty joined #mojo
19:23 absolut_todd joined #mojo
19:26 abra joined #mojo
19:27 neilhwatson joined #mojo
19:35 mattastrophe joined #mojo
19:37 HtbaaPi joined #mojo
19:53 panshin joined #mojo
19:56 bwf joined #mojo
20:18 sri hmmm
20:18 sri i guess it would make sense to allow $collection->first('foo') instead of $collection->first(sub { $_->foo })
20:18 sri it requires no additional code
20:18 sri only problem is documentation
20:19 sri same for grep and uniq
20:20 jberger $_->$cb() vs $cb->($_)
20:20 jberger yeah,
20:21 sri $collection->first(matches => '[foo]')
20:21 sri if someone can forumulate a coherent sentence for the method description we can do it
20:22 sri it's basically like the map description with added regex
20:24 jberger oh, I like that example
20:41 sri possible patch https://gist.github.com/anonymous/9ffca1d93315fe498a99
20:42 sri it's actually kinda neat for uniq too
20:42 sri like ->uniq(attr => 'id')
20:43 sri ->uniq('tag')
20:44 Grinnz_ i was about to suggest checking for Regexp but i didnt know how reliable that was, or if you still wanted to be able to pass strings as regexes :P
20:45 sri :)
20:47 good_news_everyon joined #mojo
20:47 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vnAEq
20:47 good_news_everyon mojo/master 168b13b Sebastian Riedel: improve first and grep methods in Mojo::Collection to be able to call methods
20:47 good_news_everyon left #mojo
20:47 sri my main worry is confusion
20:48 sri even though we've done the same for Mojo::Collection::map and Mojo::Base::tap before
20:48 sri so, from a consistency point of view it is an improvement
20:48 Grinnz_ i think maybe adding an example that uses ->first
20:48 Grinnz_ whoops
20:48 disputin joined #mojo
20:49 Grinnz_ ->first('thisisamethod') would help with the potential confusion
20:49 Grinnz_ (not with that method name of course :P)
20:50 Grinnz_ i guess map and tap don't have an example like that either
20:51 Grinnz_ but yes i like the consistency of adding that functionality
20:51 bwf ->first('first')
20:51 Grinnz_ :mind blown:
20:51 sri yo dawg
21:08 jberger mojo and elasticsearch together are so nice
21:10 bpmedley sri: For minion and dependencies..  If there are three task groups in the queue (image_process, email_list, and movie_encode).  Does it matter if a job from image_process is ran while the movie_encode group is also running?  As long as each group is processed in order, does anything else matter?
21:10 sri bpmedley: what?
21:11 Grinnz_ i think he's asking, is it dependent on the task starting or finishing
21:11 jberger bpmedley: there is no ordering, there are no dependencies
21:11 Grinnz_ in the theoretical implementation of ordering that isn't happening
21:11 Grinnz_ :P
21:12 bpmedley Grinnz_: I think that's correct.
21:13 SmokeMachine joined #mojo
21:15 bpmedley Let's say there are 4 jobs for two groups.  One group is image_process and another is movie_encode.  Let's say the four tasks are resize_image, crop_image, transcode_audio, and transcode_video.
21:15 bpmedley Does that make sense?
21:15 Lucas1 joined #mojo
21:15 sri i never proposed anything like that, why are you asking me?
21:15 Grinnz_ lol
21:16 bpmedley I've read some of the logs; however, I'm trying to get up to speed on the situation.
21:30 meshl joined #mojo
21:31 bpmedley_ joined #mojo
21:37 stephen joined #mojo
22:12 panshin joined #mojo
22:25 Grinnz_ "Now you can attach PDF, Word, Excel, PowerPoint, and text files to your comments on Issues and Pull Requests."
22:25 Grinnz_ heh
22:43 tianon because, you know, this PR comment thread was definitely missing a good ol' ppt to get the point I'm trying to make across
22:43 * tianon sets himself on fire
22:46 kanishka joined #mojo
23:08 mattastrophe joined #mojo
23:09 PopeFelix A little help wordsmithing?
23:10 PopeFelix This module I'm doing records and plays back Mojo::UA transactions.
23:11 PopeFelix And so in playback mode, when I get a request for the first time, I check it against the first request in the queue.
23:11 PopeFelix And if it matches, I play back the recorded response.
23:11 PopeFelix And I do that for the second, and the third, and so on.
23:11 PopeFelix How do I say that in a more concise and precise way?
23:12 Grinnz_ i'd call it a "cache" rather than a queue
23:12 PopeFelix OK, that's easy enough.
23:13 Grinnz_ "In playback mode, if the request is found in the cache, the recorded response is played back."
23:13 PopeFelix OK
23:14 PopeFelix I want to emphasize that the order matters, though.
23:14 PopeFelix If you send request 3 when it's expecting request 2, it won't play back response 2 or response 3.
23:14 Grinnz_ the hmm, thats more complex than i thought then
23:14 Grinnz_ -the
23:15 PopeFelix Yeah.
23:15 CandyAngel So it responds in lockstep?
23:15 PopeFelix CandyAngel, yes.
23:15 panshin joined #mojo
23:16 PopeFelix It's intended to be used for testing against 3rd party web services where you might not want to make the actual call every time the test runs, but you want to make sure your code is responding properly.
23:16 CandyAngel I think I get what you are doing
23:16 CandyAngel It's like umm.. semaphored replay :P
23:17 PopeFelix CandyAngel, That's accurate. :)
23:18 CandyAngel or .. oh!
23:18 CandyAngel It's kind of like Expect
23:18 PopeFelix CandyAngel, it's exactly like Expect.
23:19 PopeFelix I think.
23:19 * PopeFelix hasn't actually played with Expect all that much. :)
23:19 CandyAngel I haven't either :P
23:19 CandyAngel it's a "scripted cache"
23:19 PopeFelix Yes, precisely.
23:20 Grinnz_ so more like "For each request, if it matches the request in the cache at that index, the recorded response is played back."
23:21 PopeFelix yes.
23:21 Grinnz_ but with a better way to say "at that index"
23:21 PopeFelix Yes.
23:21 CandyAngel If it matches the expected request in the cache, according to the script..?
23:22 CandyAngel Which.. is actually kinda saying the same thing twice
23:22 CandyAngel "For each request, the recorded responde is played back if the script is being met.
23:22 CandyAngel response*
23:23 PopeFelix I've got something, let me know how it sounds.
23:23 CandyAngel Sure, I'm rarely short of opinion :P
23:23 CandyAngel (which is a given, I am on the internet)
23:23 shadowpaste "PopeFelix" at 217.168.150.38 pasted "wordsmithing" (20 lines) at http://paste.scsys.co.uk/499296
23:26 CandyAngel I'd understand that
23:27 PopeFelix Cool.  I like the idea of a "Theory of operation" section sometimes to explain the mechanics.
23:59 asarch joined #mojo

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