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

IRC log for #mojo, 2015-11-17

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

All times shown according to UTC.

Time Nick Message
00:01 rwp joined #mojo
00:16 mattastrophe joined #mojo
00:30 cpan_mojo joined #mojo
00:42 janus joined #mojo
00:52 mattastrophe joined #mojo
00:59 jontaylor joined #mojo
01:08 mattastrophe joined #mojo
02:05 Zoffix joined #mojo
02:31 kaare joined #mojo
02:45 voldemortensen joined #mojo
03:14 Mikey joined #mojo
03:16 sri hmm, i would apply this if the patch wasn't so ugly https://github.com/kraih/mojo/pull/874
03:26 sri so, do i, a) apply a patch with code i don't agree with, and apply fixes on top, b) rewrite everything myself and apply that (with attribution in Changes), or c) vote -1 and hope it gets fixed at some point in the future?
03:28 buu Can't you just respond to him with the changes you'd like to see?
03:28 noganex_ joined #mojo
03:28 genio a or buu
03:28 mattastrophe joined #mojo
03:28 sri i don't know exactly what i want to see changed
03:28 sri i'm sure the code can be much cleaner
03:29 sri certainly doesn't help that he crammed all those little changes in one pull request
03:31 buu oh, ,one of those
03:31 good_news_everyon joined #mojo
03:31 good_news_everyon [mojo] kraih pushed 5 new commits to master: http://git.io/v4Rnt
03:31 good_news_everyon mojo/master 639ed92 jamadam: fixed test descriptions
03:31 good_news_everyon mojo/master 1027731 jamadam: reduced perl errors when :nth-* equation is zero
03:31 good_news_everyon mojo/master a9a466c jamadam: added tests for pseudo-class case-insensitivity
03:31 good_news_everyon left #mojo
03:32 sri this is gonna suck if i run out of tuits in the process
03:33 sri he didn't perltidy it either :S
03:36 buu smite him mightily
03:36 sri also untested changes
03:54 fitnerd joined #mojo
03:55 cpan_mojo Test-Mojo-Role-Debug-1.003004 by ZOFFIX https://metacpan.org/release/ZOFFIX/Test-Mojo-Role-Debug-1.003004
03:56 Zoffix sri, BTW, I saw you befuddled by where people getting that P6 is faster than P5. There's a blurb in the FAQ that I think those people are reading too much from: http://doc.perl6.org/language/faq#Is_Perl_6_fast_enough_for_me%3F
03:57 Zoffix (the bench in the answer runs the same on both languages and P6 wins by a tiny sliver on the box of the person who created it)
03:57 Zoffix s/on/on my box for/;
04:03 Zoffix huh? P6 is 3x faster: http://fpaste.scsys.co.uk/501577
04:03 Zoffix I wonder if it's the latest changes or my box is broken.
04:03 buu Is the p5 optimized?
04:04 Zoffix buu, what does that mean? :)
04:04 Zoffix I have v5.22.0 installed with perlbrew
04:04 Grinnz using Moose is not optimized for single-run
04:04 Zoffix And I did run that bench a few weeks ago.
04:05 Zoffix But I think that's the point of the answer :) That P6 has a lot more stuff build in
04:05 Zoffix *built
04:05 Grinnz Mojo::Base and Class::Tiny would probably run that much faster
04:06 Zoffix Of course they would.
04:07 Zoffix Mojo::Base finishes in real0m0.821s
04:07 Zoffix (vs 30 of Moose)
04:08 good_news_everyon joined #mojo
04:08 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/v4R00
04:08 good_news_everyon mojo/master 0e9eb7f Sebastian Riedel: clean up pseudo-class handling
04:08 good_news_everyon left #mojo
04:08 Grinnz what i mean is that's a useless benchmark for Moose, not even considering any comparison
04:08 Grinnz because using Moose for programs like that is silly
04:09 Zoffix It's not a benchmark for Moose. It's a benchmark for Perl 6.
04:09 * Zoffix gives up before this goes off the rails.
04:12 sri jamadam is right about the performance though, it was wasteful to rewrite the pseudo-class on every match
04:21 jamadam joined #mojo
04:22 inokenty-w joined #mojo
04:23 jamadam sri: I'm so sorry about the PR. Next time I'll split the topic one by one.
04:23 sri jamadam: appreciated, thanks for the fix
04:24 sri still trying to think of a more elegant way to handle the pseudo-class step of _compile
04:25 jamadam Tanks :)
04:25 asarch joined #mojo
04:28 mattastrophe joined #mojo
04:28 jamadam I wished if I could unit test _equation so the [-1, 1] part for last-* is move into it.
04:30 good_news_everyon joined #mojo
04:30 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/v4R2x
04:30 good_news_everyon mojo/master 204cb1c Sebastian Riedel: just modify the selector
04:30 good_news_everyon left #mojo
04:30 Zoffix FWIW, I amended the P6 FAQ to include the much-faster Mojo::Base version as well, to show a more honest perspective (site will update on next repo build round).
04:33 jamadam Talking about perltidy, I'd like to know the proper way to apply it. I did "find lib/ -name '*.pm' -print -exec perltidy -pro=.perltidyrc -nst -b -bext='/' {} \;" which was found in IRC log
04:34 sri well, i have a shortcut in my editor
04:34 sri but if a new version of perltidy comes out and i want to see if anything changed in mojolicious, i do use that one-liner
04:34 sri on lib and t
04:35 sri someone should make a one-liner that covers both, modules and tests ;p
04:36 jamadam oh I see, I didn't apply it to tests. sorry.
04:40 sri oh, actually some .pm files in t/ can't ru through perltidy
04:40 sri since we test syntax errors too ;p
04:41 jamadam ok
04:42 sri you can still run it over all .t files though
04:42 sri just combining the two one-liners would be hard
04:43 good_news_everyon joined #mojo
04:43 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/v4Rr4
04:43 good_news_everyon mojo/master b660963 Sebastian Riedel: perltidy can be a bit picky
04:43 good_news_everyon left #mojo
04:44 sri complains about operator in print statement
04:46 sri it's funny how those selector equations never really had a name
04:46 sri the css4 spec actually fixes that
04:47 sri now it's the "An+B notation"
04:54 good_news_everyon joined #mojo
04:54 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/v4R6O
04:54 good_news_everyon mojo/master 804c89d Sebastian Riedel: handle :first-* and :last-* separately
04:54 good_news_everyon left #mojo
05:12 good_news_everyon joined #mojo
05:12 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/v4RD0
05:12 good_news_everyon mojo/master b05eb88 Sebastian Riedel: handle unknown pseudo-classes gracefully
05:12 good_news_everyon left #mojo
05:13 sri just 15 commits to go until we hit 10000
05:19 crab i can't wrap my head around lite syntax sometimes
05:19 sri that seems odd)
05:20 crab get '/etc(*expr)' => {expr => '', format => [qw(html atom)]} => sub {
05:20 crab is that correct? if i want to provide an empty default for expr and restrict formats to html and atom?
05:20 sri nope
05:20 sri that's not really lite specific though
05:20 sri full apps use the same data structures
05:21 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Tutorial#Optional-placeholders
05:21 sri vs
05:22 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Tutorial#Restrictive-placeholders
05:22 sri hash vs array
05:28 crab oh, so i can't actually do what i was trying to.
05:29 sri of course you can
05:56 melo joined #mojo
06:02 val joined #mojo
06:03 Averna joined #mojo
06:26 mattastrophe joined #mojo
06:26 good_news_everyon joined #mojo
06:26 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/v40eG
06:26 good_news_everyon mojo/master 22ff20f Sebastian Riedel: fix typo in comment
06:26 good_news_everyon left #mojo
06:43 dod joined #mojo
06:51 Vandal joined #mojo
06:58 crab i guess i'm just slow.
06:59 dod joined #mojo
07:02 crab if i use get '/etc/(:expr)' => {expr => ''} => [format => [qw(html atom)]] => sub … (instead of get '/etc(*expr)' …), then the format restriction works
07:02 dod joined #mojo
07:02 crab or maybe when you say "of course you can", you meant => {} => [].
07:03 melo joined #mojo
07:03 crab of course, the *expr thing eating the format makes sort of sense. i just wasn't expecting it.
07:04 crab rather than trying to write a route that matches /etc and /etc/anything i'll just name the sub and call it from two separate routes
07:05 crab or something
07:06 sri yes, i had no idea what you meant
07:17 ichi joined #mojo
07:52 bjakubski joined #mojo
07:58 osfabibisi joined #mojo
08:09 Jonis joined #mojo
08:10 bpmedley joined #mojo
08:17 eseyman joined #mojo
08:28 trone joined #mojo
08:31 melo joined #mojo
08:33 AndrewIsh joined #mojo
09:00 sue joined #mojo
09:50 coolo can I get the current controller object through the app (or elsewise in the database models)?
10:16 dod joined #mojo
10:17 dod joined #mojo
10:18 marty_ joined #mojo
10:28 cpan_mojo Mojolicious-Plugin-I18NUtils-0.19 by RENEEB https://metacpan.org/release/RENEEB/Mojolicious-Plugin-I18NUtils-0.19
10:35 gregf joined #mojo
10:51 melo joined #mojo
11:01 Zoffix_ joined #mojo
11:21 jontaylor joined #mojo
11:33 nic I have a form_for n with text_field 'forename'
11:34 nic Upon submit, it does a GET url_for('n')->query(forename => 'something')
11:35 nic Is there a way (without js) to GET url_for('n', n => 'something) instead?
11:36 crab ...and presumably without renaming your text_field?
11:36 nic Currently in the controller I'm detecting if it has param('forename'), that means it was via query param, and redirecting to the desired url_for
11:37 nic which is a waste if I could have sent them to the right place from the form
11:37 nic This is just because I have /serial/:serial
11:37 nic and so having /serial?serialcode=something gets problematic
11:38 nic Sorry, that's a terrible expression of the question...
11:38 nic (a) I post to a route defined with an optional placeholder
11:39 nic (b) the post is actually a GET using query param
11:39 nic I'm wondering if there's a way to not use query param, but go directly to the route with placeholder
11:40 nic url_for can instantiate placeholder values; I'm really asking if that's possible with form_for
11:41 nic (but the instantiated value would be from a text_field, which makes me guess this isn't possible)
11:44 buu You want to do something based on user input without asking the server?
11:44 nic heh!  yes, I'm an idiot
11:44 nic k, that was a gentler answer than it deserved :D
11:45 buu Nothing wrong with a nice 302
11:46 nic yeah, now I realise I'm looking for something that doesn't adhere to the Laws of Physics, a 302 isn't so bad :)
11:46 buu hack the planet man
12:01 neilhwatson joined #mojo
12:12 kaare joined #mojo
12:17 cpan_mojo Test-Mojo-Plack-0.09 by NICOMEN https://metacpan.org/release/NICOMEN/Test-Mojo-Plack-0.09
12:18 nic joined #mojo
12:22 eseyman joined #mojo
12:28 nic This is all to avoid /serial/123?serialcode=124
12:29 nic but I think the right way to solve that is ->redirect_to(url_with(...
12:29 nicomen reminds me of /en/foo?lang=de { Accept-Language: it }
12:30 nic Was that also written by someone kept awake all night by a coughing child?
12:30 nicomen (and of course "Cookie: lang=fr"
12:30 nicomen nic: nah, I have written stuff like that several times, just need to keep things in the right order ;D
12:45 hernan605 joined #mojo
12:47 jberger nicomen: does your test module handle the psgi simple form?
12:47 jberger I don't see it
12:48 jberger And it also doesn't seem to handle streaming response though it says it does
12:50 nicomen jberger: what does psgi simple form mean?
12:50 nicomen jberger: where does it say that?
12:51 nicomen jberger: even after your fixes I couldn't get a simple post request with json to work here, so I simply tried to fix what we need here
12:51 hernan606 joined #mojo
12:51 nicomen but I'm considreing wether we should put modules on CPAN, because I can still not download it via cpanm :-((
12:52 jberger The simple arrayref form
12:53 jberger And I don't understand what you mean about cpan
12:53 nicomen jberger: simple as in this? https://github.com/nicomen/test-mojo-plack/blob/master/t/01-main.t#L28
12:54 carneirao joined #mojo
12:54 nicomen jberger: I uploaded our local changes to cpan, but even 30 minutes later I can not use it in our continuous integration cpanm installation of dependencies
12:54 jberger Hmmm yes
12:54 jberger I guess I don't see in your coffee where that gets handled
12:54 jberger Hahaha
12:55 jberger s/coffee/code/
12:55 nicomen auto-complain sugars!
12:55 jberger (I think swipe type is trying to tell me something)
12:57 jberger Woah
12:58 jberger Does $array_ref->(sub {...}) work?
12:58 nicomen where do you see that?
12:59 jberger https://metacpan.org/source/NICOMEN/Test-Mojo-Plack-0.09/lib/Test/Mojo/Plack.pm#L104
13:00 nicomen I did all this over a year go, but if I remember correctly psgi pases around subrefs that accept subrefs
13:01 jberger Unless it returns an array ref
13:01 nicomen aha
13:01 jberger But I wonder if the magical dispatcher is handling that for you
13:05 nicomen jberger: most of the code is glued together pieces from: L<Plack::Test> and L<Catalyst::Test>
13:06 jberger nicomen: that test you showed me isn't using strict/warnings
13:06 jberger And I still don't know what you meant about putting things on cpan
13:09 stephen joined #mojo
13:11 nicomen jberger: our systems use modules from CPAN. Then it makes sense to put our own code into CPAN modules if they are stand alone and can be shared with the world. But in this case, it takes so long for a newly uploaded CPAN module to be available for cpanminus et al. That maybe we should just use Pinto or similar
13:11 jberger if you use the metacpan mirror it doesn't take that long
13:12 buu nicomen: Surely the speed is entirely dependent on what mirror you use?
13:13 buu You could just set up your own mirror ?
13:13 nicomen hm
13:14 nicomen good point
13:14 jberger so, this doesn't work:
13:14 jberger perl -E 'my $ar = [1, 2, 3]; $ar->(sub{ say for @{$_[0]} });'
13:14 jberger so that I'm at a loss as to how that test would pass (the simple arrayref form)
13:15 nicomen jberger: that would fail is psgi_app->($env) returned an arrayref, do you have an example when it does that?
13:16 jberger isn't that the test you showed me?
13:16 nicomen ah haha
13:17 jberger anyway, that's like the basic usage of psgi
13:17 nicomen if (ref $app_class eq 'CODE') {
13:17 nicomen $t->{psgi_app} = sub { my $res = $app_class->(shift); sub { shift->($res); } };
13:17 jberger perhaps all frameworks actually use the delayed form in practice
13:18 flamey joined #mojo
13:18 nicomen https://github.com/nicomen/test-mojo-plack/blob/master/lib/Test/Mojo/Plack.pm#L26
13:18 jberger what?!
13:19 jberger that makes no sense at all
13:20 jberger and why are you using framework specific handling in the lines below that?
13:22 nicomen because that was the approach I used at the time: https://github.com/nicomen/test-mojo-plack/blob/master/lib/Test/Mojo/Plack.pm#L177
13:22 glauber joined #mojo
13:23 jberger there's a Plack::Util:: for that
13:24 jberger and the idea of if its a bare coderef to wrap it in another coderef makes no sense to me
13:24 hernan605 joined #mojo
13:25 flamey Hi guys! I wanted to try running Galileo (mojolicious based blog) on Cloud9 platform. It starts on 127.0.0.1:3000, but on Cloud9 apps need to run on 0.0.0.0:8080 in order for them to be visible via subdomain they provide.. Is there a way to change the host to 0.0.0.0 ?
13:26 jberger but I guess maybe it works
13:26 nicomen I think the point was, to handle both bare psgi and framework specific in the same way, and wrapping a sub wround it allowed to alter date before passing it to the app
13:27 jberger flamey: http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Built-in-web-server
13:27 nicomen like the dancer part does
13:27 jberger -l to the daemon
13:27 nicomen date=data
13:28 jberger nicomen: its bending my brain a bit :-P
13:28 nicomen hey bro, I put a sub in your sub, so you could sub your sub!
13:30 flamey @jberger, thank you!
13:30 jberger np
13:31 gryphon joined #mojo
13:34 jberger nicomen: this is my equivalent code: https://github.com/marcusramberg/Mojolicious-Plugin-MountPSGI/blob/master/lib/Mojolicious/Plugin/MountPSGI/Proxy.pm#L14-L43
13:34 jberger and I guess if I could figure out how to nicely send the arrayref form into the $responder I could save code
13:36 jberger ref $plack_res eq 'ARRAY' ? $responder->($plack_res) : $plack_res->($responder)
13:36 jberger kinda insane
13:37 ajr_ joined #mojo
13:39 jberger or even more crazy
13:39 jberger ref $plack_res eq 'ARRAY' ? $plack_res->$responder : $plack_res->($responder)
13:40 bd i don't get that reference *badumts* *crickets*
13:41 * jberger slaps bd with a comically large fish
13:41 jberger I'm still trying to figure out how nicomen's form doesn't need a dispatcher hack
13:44 jberger anyway, I think my brain is overheating I'm going to let it slide
13:44 jberger but one other question
13:44 jberger nicomen: it was you who sent me the failing test in Test::Mojo::Role::PSGI, why were you using that if you have your own?
13:45 bd jberger: dang you, there was this webcomic using a "if reallife was more like irc" line with the trout. and i can not remember it's name
13:46 jberger :p
13:46 bd did find http://megatokyo.com/strip/9 though
13:48 bd jberger: ha! http://www.reallifecomics.com/. can't find the episode though
13:51 jberger when I try to google site search that site there's a massive amount of spam somewhere in ti
13:53 jberger nicomen: I'm still not convinced that your code is right
13:57 jberger notice how I call the psgi_res as a subref here https://github.com/marcusramberg/Mojolicious-Plugin-MountPSGI/blob/master/lib/Mojolicious/Plugin/MountPSGI/Proxy.pm#L43
13:57 jberger I don't see how your code ever invokes a subref form psgi response
13:58 jberger (it certainly doesn't handled psgi.streaming form)
13:59 jberger anyway, the whole thing is moot since it doesn't use the role composition form and since it uses private methods in Test::Mojo
14:07 jberger :o https://github.com/nicomen/test-mojo-plack/blob/master/t/lib/FakeDancerApp.pm
14:11 jberger so a few things
14:11 jberger sub Dancer::dance { goto &Dancer::start } ... sub Dancer::start { goto &Dancer::_start } ...
14:12 jberger but more importantly, looking at Dancer::_start I have no idea if your fake dancer app tests anything like a real dancer app
14:12 jberger anyway, I'm going to lay off now
14:12 jberger sorry about that
14:12 nicomen jberger: my modules wasw failing, so I tried to use yours, it failed, two days later it was fixed. I tried it again, it still failed, so instead of bugging you, I looked at what I needed to do to get the existing modules to work
14:12 jberger nicomen: mine still fails for you?
14:13 nicomen jberger: yes of course, I wouldn't have bothered fixing the existing onw if I could switch with a working one
14:14 jberger but ... but ...
14:14 jberger sigh
14:14 nicomen I tried looking at your code, but ended up spending more time than fixing the small IO::String fix I had to do
14:14 nicomen if I knew how to fix your code, a PR would've been made
14:15 jberger but as it is, I don't even know that something is broken
14:15 nicomen oh, wait a minute and I'll expand the test I gave you
14:18 y1mmm joined #mojo
14:20 jberger oh, getline?
14:22 nicomen https://github.com/jberger/Test-Mojo-Role-PSGI/compare/master...nicomen:master
14:22 nicomen suspecting body content length or some \r\n missing or something, but not sure
14:25 jberger I suspect that the problem is that marcus implemented his own IO class
14:25 jberger and it implements read wheres psgi seems to actually use getline
14:25 jberger and probably it would just be best to open a handle to the scalar
14:34 kwa I've updated from 6.14 to 6.31 and my json_is('/some/key' => '1') boolean test is no longer working. -- $got = 1 / $expected = '1';
14:35 nicomen I noticed Catalyst tried like 6 different ways to parse a psgi.stdin
14:35 kwa I've read through the Changes log to see if anything obvious has changed, but can't see anything.
14:36 nicomen kwa: if it's a boolean you should perhaps test against a Mojo::JSON::true ?
14:36 kwa nicomen: Hmm, cheers, will try that.
14:36 nicomen it could very well be the implementation details have changed
14:38 jberger the implementation details have indeed changed
14:39 jberger nicomen: yes your test fails under existing Mojolicious::Plugin::MountPSGI but if I just open a handle to the body instead of wrapping it in a class of marcus' design it passes
14:40 jberger I suspect that some early plack runner used the read method, but the spec says to use an IO::Handle-like object
14:40 kwa nicomen: perfect, thanks
14:40 jberger and I can see that Plack::Util::foreach uses the getline method, which the existing code does not implement
14:52 jberger so the question is, is that sufficient?
14:53 jberger it certainly wouldn't work for a true streaming request body
14:53 jberger then again, neither would the current implementation
14:55 ashimema any recommendations on Caching modules... such a plethora on cpan it's hard to know where to start.. I've tended to just use Mojo::Cache so far, but I'm starting without a persistent app this time so I don't 'think' Mojo::Cache will do the trick/
14:57 sue joined #mojo
15:01 ashimema looks like CHI has the most +'s on cpan.. I'll have a play with that
15:03 jberger ashimema: CHI's compute method is the best
15:04 jberger ashimema: https://metacpan.org/pod/CHI#compute-key-options-code
15:04 jberger just do note that some backends do funny things
15:05 jberger so be sure to choose your backend wisely
15:05 edu joined #mojo
15:05 ashimema cheers jberger.
15:06 jberger marcus / nicomen / sri: is this anything close to correct? the more I read it the more I don't know what it's trying to do: https://github.com/marcusramberg/Mojolicious-Plugin-MountPSGI/blob/master/lib/Mojolicious/Plugin/MountPSGI/Proxy.pm#L106-L121
15:06 ashimema just the sort of high level advise.. where to start looking kinda stuff I was hoping for :)
15:07 jberger I'm inclined to remove the existing _IO class and replace it with a handle to a scalar ref, even if there is something better later, just because I don't think the existing code works at all
15:07 ashimema compute looks perfect :)
15:07 jberger ashimema: inorite
15:07 ashimema now to investigate the back ends..
15:08 ashimema CHI certainly seems to be the 'right' choice for the interface to it :)
15:08 jberger I once had a long debate at $old_python_job about how our get_from_cache method should just allow a function to set if not found
15:08 mattp Is it possible to use anyevent::util::run_cmd with mojo?
15:08 jberger they didn't believe me, but lo-and-behold there it is in CHI
15:08 ashimema :)
15:09 mattp I'm trying to use it to asynchronously pass stdout to stream response, but it doesn't seem to be working as expected
15:09 ashimema I have an IOLoop with a bunch of UA calls in it.. aim is the add caching to that basically :)
15:14 mattp The stdout cb fires once but only once
15:16 stigo joined #mojo
15:17 nicomen jberger: I don't about other implementations right now, but Catalyst seems to support stringified objects, and arrayrefs for content
15:17 jberger so this is the spec: https://metacpan.org/pod/distribution/PSGI/PSGI.pod#Body
15:18 jberger I think the easiest is this patch:
15:19 Grinnz mattp, you can't run the Mojo ioloop and AnyEvent at the same time. you either will have to use the mojo backend for anyevent (which doesn't appear to exist) or use a different method
15:19 jberger http://pastie.org/10562960
15:19 Grinnz https://metacpan.org/pod/Mojo::IOLoop::ReadWriteFork is a native mojo one, but stdout and stderr are currently combined
15:19 jberger Grinnz: AnyEvent usually JustWorks(TM) via the EV loop
15:20 jberger but then again AnyEvent is crazy
15:20 Grinnz ah yeah you could use EV for both
15:20 jberger mattp: you might look at Mojo::IOLoop::ReadWriteFork on CPAN
15:20 Grinnz i try not to think about AnyEvent
15:20 jberger ah, and you beat me to it Grinnz
15:21 jberger oh I forgot that stdout and stderr get merged
15:21 Grinnz i still need to find time to see if i can fix that
15:21 Grinnz most of my usecases for it require capturing stderr alone
15:22 jberger and I still mostly just use ForkCall
15:22 jberger (which isn't really an alternative here)
15:22 Grinnz i use that a lot, but it doesn't work for usecases where you run a command and want to view output as it happens
15:23 jberger I suppose that when you open a pipe from a command it pipes from stdout not stderr right?
15:23 jberger mattp: is that enough for you?
15:24 neilhwatson joined #mojo
15:24 Grinnz jberger, you mean open(my $pipe, '-|') sort?
15:24 Grinnz yeah
15:25 Grinnz IPC::Open3 lets you do it with stdout and stderr separate, i use that now usually
15:25 Grinnz but that's still not hooked up to event loop callbacks
15:25 jberger https://github.com/jberger/Mojolicious-Plugin-TailLog/blob/master/lib/Mojolicious/Plugin/TailLog.pm#L16-L22
15:25 mattp What does it mean to support EV but not anyevent
15:25 jberger this example is a little insane because it has to avoid dup
15:25 jberger but the principles work out just fine
15:26 sh4 joined #mojo
15:26 mattp So my only option is to use readwritefork I'd i understand correctly ?
15:26 jberger AnyEvent support comes from EV support generally
15:26 Grinnz there's lots of options, but readwritefork is the cleanest
15:27 jberger AnyEvent chooses a backend, often EV
15:28 mattp If j use the EV backend with mojo I don't understand why my code with ae doesn't work :) I'm sure there are reasons, just trying to understand
15:28 jberger well, that's where we get to AnyEvent is crazy part
15:29 Grinnz you know how anyevent claims to be the DBI of event loops? that's sort of like Esperanto claiming to be a global language
15:30 jberger because AnyEvent assumes that it is the only event loop does things that are evil
15:31 asarch joined #mojo
15:32 jberger mattp: if you are just watching the output of some process you might try the open trick I linked to
15:32 genio no progress on Perl + libuv, huh?
15:33 mattp I think readwritefork will do what I need
15:33 Grinnz https://metacpan.org/pod/Mojo::Reactor::UV exists but i can't say how well it works
15:34 mattp It's unfortunate things don't "just work" though, given mojo docs advertise as being ae compatible
15:34 Grinnz if they do, that's because of the EV loop
15:34 jberger mattp: yeah, it mostly is compatible, but AE cheats because it thinks it can get away with it
15:34 jberger don't tell the author that though
15:35 Grinnz more "i don't know or want to know how to diagnose what issue you're actually having in AE"
15:35 mattp Jberger: happy to try poking mlehmann about it, can you elaborate on what ae does that it shouldn't?
15:36 Grinnz have you poked mlehmann before?
15:36 mattp a bunch of times. He's actually super helpful and nice when I've talked to him
15:36 Grinnz k, just making usre
15:37 jberger using condvars inside running loops usually doesn't dwym
15:37 jberger and AE::Util does that continuously
15:38 jberger for that to actually work, you'd need Coroutines (see Coro) and I'm sure that's how mlehmann does it
15:38 jberger but in a Mojo (or any other nonblocking framework) you can't do that
15:39 jberger perhaps I'm misremembering, and perhaps I'm slandering mlehmann's good name, but I've had trouble with AE::Utils before
15:40 jberger that's why I ported the fork_call function away from it
15:40 cpan_mojo Clustericious-1.04 by PLICEASE https://metacpan.org/release/PLICEASE/Clustericious-1.04
15:40 jberger (I've highly modified mine since then, but it started as an almost straight port)
15:40 Grinnz he does enough for his own name...
15:41 jberger (there may have been some irony there)
15:42 genio I can't get the man to acknowledge a simple patch for documentation.  oh well
15:44 jberger https://metacpan.org/pod/AnyEvent#CONDITION-VARIABLES
15:44 jberger "Therefore, condition variables are good to export to your caller, but you should avoid making a blocking wait yourself, at least in callbacks, as this asks for trouble."
15:44 jberger in run_cmd he uses several
15:45 jberger not following his own advice
15:45 mattp Jberger : does that happen in fork-call?
15:45 jberger not in mine certainly, I don't recall in his
15:46 jberger something about his wasn't portable though
15:46 cpan_mojo Mojo-UserAgent-Mockable-1.04 by POPEFELIX https://metacpan.org/release/POPEFELIX/Mojo-UserAgent-Mockable-1.04
15:47 jberger but looking over his I can't recall atm
15:47 jberger that was a few years ago I ported it
15:49 voldemortensen joined #mojo
15:49 jberger mattp: I certainly am not asking you to report anything to him on my behalf, indeed please don't
15:50 jberger I had more cogent reasoning back a few years ago, if I got into a debate about it with him now I'd look like an idiot
15:52 lluad joined #mojo
16:03 osfabibisi joined #mojo
16:16 d4rkie joined #mojo
16:18 mattp jbeeger : sure. I'm just trying to isolate what the actual problem with run_cmd is so maybe I can fix it or get it fixed :)
16:21 mattp jberger* sorry. irc from mobile is annoying
16:55 buu joined #mojo
17:16 batman sri: why doesn't script/myapp use FindBin to locate the lib directory anymore?
17:16 jberger ?
17:16 jberger that's only in the installable form
17:17 sue joined #mojo
17:17 buu FINDBIN
17:18 buu THAT'S THE MODULE
17:18 buu I knew there was an easier way to find a lib dir
17:18 Grinnz_ buu: clearly you need FindFindBin
17:18 batman jberger: mojo generate app; grep -i find my_app/script/my_app; # no result
17:19 buu wow
17:25 batman jberger: yeah, guess you would know :) https://github.com/kraih/mojo/commit/2ccaefe4c0b44c4324fa322fffea454c46cd8512
17:40 padd173 joined #mojo
17:40 padd173 when will sri start making mojolicious for perl 6?
17:41 sri short answer: when there's funding
17:42 padd173 will you do crowdsourcing campaign?
17:43 sri i don't think that would work at the moment, judging by ribasushi's campaign
17:44 gryphon How much time/$ (best guess) would it take?
17:44 sri 6 months for a prototype, a year for something serious i'd imagine
17:45 gryphon Is that FT?
17:45 sri ye
17:45 gryphon Could that be dropped to 3 and 6 with moar peeps?
17:46 gryphon The reason I ask is that I'm preparing a pitch for a new biz, and it's not insane to think we could bake-in the cost of mojo on p6.
17:46 gryphon (It's slightly crazy, but not insane.)
17:46 sri mojolicious 1.0 took 2 years
17:47 sri better to be conservative with estimates, perl6 has a lot of new paradigms that want to be used, figuring those out will take time
17:48 gryphon Yeah, understandable.
17:49 sue joined #mojo
17:50 padd173 i'd chip in with a few hundred
17:51 gryphon sri: How large a team would you want/need?
17:52 buu gryphon: Are you counting the baristas?
17:52 gryphon No. We got in-house baristas covered.
17:52 gryphon It's mission critical.
17:53 sri think a team wouldn't help much in the beginning actually
17:53 gryphon Right, I'm thinking more second stage after you have a design and are into the depths of implementation and test coverage.
17:54 sri ideally you have a little community of early adopters that give you feedback
17:54 sri only later on you start to need help
17:55 gryphon We'd give you lots of feedback, but it'd be only a single data point, only reflective of our use-case.
17:56 sri growing a community shouldn't be a big problem
18:01 kes joined #mojo
18:02 fvox joined #mojo
18:02 PryMar56 joined #mojo
18:09 sri jberger: re your link from earlier, that code does not look right to me https://github.com/marcusramberg/Mojolicious-Plugin-MountPSGI/blob/master/lib/Mojolicious/Plugin/MountPSGI/Proxy.pm#L106-L121
18:10 sri "if ($_[0] = substr($self->[0], $self->[1], $_[1])) {"
18:10 sri what if $length passed to substr is 1, and the byte removed is "0"
18:40 jberger That's what I'm saying
18:40 jberger I think the existing code is wrong in either case
18:41 jberger Whether opening a handle to a scalar is the right thing is different
18:41 jberger *is a different question
19:13 trone joined #mojo
19:30 good_news_everyon joined #mojo
19:30 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/v4gNq
19:30 good_news_everyon mojo/master 2339a2e Sebastian Riedel: fix a few typos in tests
19:30 good_news_everyon left #mojo
19:40 dod joined #mojo
19:44 panshin joined #mojo
19:55 ichi joined #mojo
19:55 mtths joined #mojo
20:03 sri damn, almost an attack in germany, only a few kilomenters from where i live :(
20:04 stephan48 Hannover?
20:04 sri ye
20:04 stephan48 i was traveling to a friend who lives near hamburg today
20:04 stephan48 also passed throu the hamburg main station
20:04 stephan48 all ICEs had Security Personal from the Deutsche Bahn at all entrances(some where even closed) and which did ticket checks
20:05 jberger :o
20:05 stephan48 also i saw quite a few more Federal Police on the station and i think some even had machine pistols equipped
20:05 sri apparently they found an ambulance packed with explosives
20:05 stephan48 yea
20:06 stephan48 someone else already saied the same
20:06 stephan48 this is a sad world we live in... and sadly there is no viable solution in sight. :(
20:08 mtths joined #mojo
20:09 jberger sri: I thought you were in hamburg
20:10 jberger then again, even that is too close for comfort
20:10 sri between hamburg and hannover
20:11 stephan48 being on this world is currently too close for comfort - somewhen all this shit will explode. nobody can win this
20:11 sri it's all pretty close together
20:12 jberger stephan48: :s
20:13 stephan48 i am very apocalyptic/persimistic regarding the whole situation :)
20:19 jontaylor joined #mojo
20:23 cpan_mojo Mojolicious-Plugin-MountPSGI-0.07 by JBERGER https://metacpan.org/release/JBERGER/Mojolicious-Plugin-MountPSGI-0.07
20:24 melo joined #mojo
20:26 good_news_everyon joined #mojo
20:26 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/v42BJ
20:26 good_news_everyon mojo/master 5366665 Sebastian Riedel: :checked and :not are more common
20:26 good_news_everyon left #mojo
20:27 mtths joined #mojo
20:32 cpan_mojo Test-Mojo-Role-PSGI-0.05 by JBERGER https://metacpan.org/release/JBERGER/Test-Mojo-Role-PSGI-0.05
20:32 jberger nicomen: ^^
20:32 jberger care to give those a try?
20:57 genio ugh.  HPKP--
21:02 good_news_everyon joined #mojo
21:02 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/v42Ks
21:02 good_news_everyon mojo/master cd83dc2 Sebastian Riedel: just use two lines
21:02 good_news_everyon left #mojo
21:06 mtths joined #mojo
21:09 good_news_everyon joined #mojo
21:09 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/v42iE
21:09 good_news_everyon mojo/master 697e74b Sebastian Riedel: mention all pseudo-classes
21:09 good_news_everyon left #mojo
21:16 good_news_everyon joined #mojo
21:16 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/v421G
21:16 good_news_everyon mojo/master 1a635d6 Sebastian Riedel: the HTML Living Standard also mentions selectors
21:16 good_news_everyon left #mojo
21:16 sri i wonder if :required and :optional would make sense for Mojo::DOM https://html.spec.whatwg.org/multipage/scripting.html#selector-required
21:17 sri they are stable in browsers and mentioned in the living standard
21:18 sri cost is two lines
21:20 sri maybe not worth it, considering it only checks for a required attribute
21:35 mtths joined #mojo
21:40 jberger IMO its nice to have any practical selectors
21:40 jberger practical meaning :hover makes no sense
21:41 sri oh, there's going to be an RFC for this :o https://tools.ietf.org/html/draft-crocker-diversity-conduct-06
21:41 jberger if for no other reason than that I don't have to check to see if a particular selector is supported or not
21:49 gryphon joined #mojo
21:54 lluad Dave is *intimately* aware of the current problems in IETF development groups.
21:54 * lluad bets on it being a good, if rfcishly pedantic, document :)
22:51 panshin joined #mojo
23:16 ZoffixMobile joined #mojo
23:22 carneirao joined #mojo
23:44 Zoffix Yeah, no need, since [required] works as well.
23:45 Zoffix (and :not([required]) for :optional, I'm guessing
23:51 sri yea, it's not as convenient as say :checked
23:54 Zoffix Won't [checked] work for :checked as well?
23:55 sri no, it's "[checked], [selected]"
23:55 Zoffix Ah

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