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

IRC log for #mojo, 2016-03-15

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

All times shown according to UTC.

Time Nick Message
00:00 disputin joined #mojo
01:14 bpmedley I just wanted to say thanks to everyone who is involved with Mojo.. and this thank you has been brought to you by ???? .. :-0
01:16 asarch joined #mojo
01:37 disputin joined #mojo
02:06 bradjm joined #mojo
03:38 noganex_ joined #mojo
04:07 mcsnolte joined #mojo
04:34 inokenty-w joined #mojo
04:40 irqq joined #mojo
04:48 zivester joined #mojo
04:49 bpmedley A shared app object is amazing .. I'm developing some custom code and you can add it to the lib and have access to all kinds of awesome with elegance.. :)
06:09 Vandal joined #mojo
06:29 cpan_mojo Test-Mojo-Role-TestDeep-0.007 by PREACTION https://metacpan.org/release/PREACTION/Test-Mojo-Role-TestDeep-0.007
07:01 dod joined #mojo
07:07 dod joined #mojo
07:09 noize joined #mojo
07:22 ichi joined #mojo
07:56 osfabibisi joined #mojo
08:09 AndrewIsh joined #mojo
08:35 trone joined #mojo
08:54 arthas_ joined #mojo
09:13 noize left #mojo
09:51 irqq joined #mojo
10:01 kes joined #mojo
10:44 sergun joined #mojo
11:06 coolo_ joined #mojo
11:11 coolo_ joined #mojo
11:17 melo joined #mojo
12:01 melo joined #mojo
12:06 melo joined #mojo
12:13 lluad joined #mojo
12:18 dotan joined #mojo
12:21 mcsnolte joined #mojo
12:31 McA joined #mojo
12:55 ramortegui joined #mojo
12:56 kaare_ joined #mojo
12:58 asarch joined #mojo
13:17 McA joined #mojo
13:27 McA joined #mojo
13:27 aborazmeh joined #mojo
13:39 McA joined #mojo
13:58 neilhwatson joined #mojo
14:04 sri is bountysource actually trustworthy?
14:04 sri they've been withholding payments for two weeks now and support is stonewalling me
14:06 sri something doesn't seem right, are they going out of business or something?
14:07 sri anyone who thought about donating, please wait until this is sorted out!
14:10 meredith recent arrival to cpan:  https://metacpan.org/pod/Mojolicious::Plugin::ExposeControllerMethod
14:11 meredith i'm curious how it's being used. everything i can think of, i'd just place in the stash
14:55 Lee the stash or helpers
14:56 jberger meredith: that plugin is totally pointless
14:57 jberger the controller is already available in templates
14:57 jberger $c or $self
14:57 jberger documented at the end of http://mojolicious.org/perldoc/Mojolicious/Guides/Rendering#Embedded-Perl
14:59 jberger oalders: is that one yours?
14:59 Lee jberger: i think it's Trelane's
14:59 oalders jberger: that's Mark Fowler's
15:00 jberger oh I saw this one which isn't the same https://github.com/maxmind/Mojolicious-Plugin-ExposeController
15:00 Lee the perldoc says "Exposes *selected* methods" so perhaps that's the use case
15:01 jberger no that is the same
15:01 jberger the documented issue tracker is wrong :s
15:02 oalders jberger: where are you seeing the wrong issue tracker?
15:02 jberger under SUPPORT in the documentation
15:03 Lee no, Mojolicious::Plugin::ExposeControllerMethod has the wrong issue tracker
15:03 Lee probably copy paste issue
15:03 * ashimema embarks on understanding Mojolicious::Plugin::OAuth2::Server
15:03 Lee ashimema: any questions feel free to ask me :)
15:03 ashimema :)
15:03 ashimema I started getting to grips with it a whilst back.. then had to drop it again due to other issues
15:03 ashimema i'ts nice to be getting back to it
15:04 ashimema I have a feeling I got to a point of 'wanting to add one of the other flows'
15:04 oalders oh, the repo name is not correct
15:04 * ashimema will report back once he's got a grip again
15:05 jberger I've opened two issues
15:05 jberger one for the url (correct it either way) and one for documenting the differences between it and using $c/$self
15:07 jberger I guess the more I read the more I see that there is a difference between usages
15:08 jberger but still perhaps a nod to the $c/$self existence would prevent confusion for those who see the module before understanding the built-in
15:08 oalders jberger: it's meant to be used in tandem with https://github.com/maxmind/MooseX-MojoControllerExposingAttributes
15:09 jberger I guess its just such a different pattern than what I'm used to that I don't see utility, but that's probably my lack of understanding showing :)
15:10 jberger I've gotten very deeply into the terse style that mojo uses internally
15:11 oalders i'll send Trelane over here later to explain himself :)
15:11 jberger haha
15:11 jberger nah, I'm not arguing for the existence of the module
15:12 jberger my only fear is that people would see it, not know about $c/$self, and end up thinking that this is the only way to have access to controller methods
15:13 jberger and have to setup the proxy stuff
15:13 oalders yeah, that needs to be cleared up in the docs
15:21 gryphon joined #mojo
15:24 asarch Is there any module to convert: "Meine Großmutter ist schön" into "Meine Großmutter ist schön" (to render HTML entities into plain text)?
15:25 lluad HTML::Entities, probably
15:26 pink_mist that does seem likely to do it
15:32 asarch Thank you!
15:32 asarch Thank you very much :-)
15:41 sri found 3 others having trouble with bountysource in the last two weeks, seems like they might be going belly up :(
15:44 jberger :o
15:48 PopeFelix joined #mojo
15:51 PopeFelix When I turn on MOJO_USERAGENT_DEBUG, I see a lot of bytes and some random characters. What am I seeing? I recognize \x0d as CR, but that's the only one I recognize off the bat.
15:51 sri gzip compression or a binary file?
15:51 PopeFelix Of course!
15:52 PopeFelix It's gzipped.
15:52 sri :)
15:52 PopeFelix I saw the content-encoding header, but it didn't register.
15:52 PopeFelix I'm sure there's a pun there somewhere.
15:52 PopeFelix ;)
16:25 disputin joined #mojo
16:39 Trelane jberger: you need to say my nick three times in front of a mirror if you want me to come online
16:40 Trelane So...we've just started using it, but not in anger
16:41 Trelane The idea was to expose moose attributes to Mojo in a way where you don't have to stash them every single time
16:41 Trelane but in a way that's a little more clear cut than just randomly grabbing bits of the controller as you feel like
16:42 Trelane ...if this turns out to be a flop...well, it'll be like 80% of the rest of the CPAN
16:46 jberger yeah, I got it after a couple readings
16:46 jberger I just think it might be helpful to mention that your module is for advanced usage and that $c/$self are built-in for common cases
16:47 jberger Trelane: ^^ (Trelane ^^, Trelane ^^) :-p
16:48 Trelane Is it too late to blame olaf for not making rough documentation I wrote for internal use into awesome CPAN like documentation
16:49 Trelane jberger: actually what would be really helpful, is a gh issue
16:52 jberger Already there
16:59 bwf joined #mojo
17:00 bwf joined #mojo
17:48 punter joined #mojo
17:51 trone joined #mojo
17:53 irqq joined #mojo
17:57 sri has anyone made a patch yet for deprecating Mojo::Util::files?
18:18 patrickz joined #mojo
18:30 dod joined #mojo
18:31 jberger been much too busy at work
18:31 jberger :s
18:44 punter joined #mojo
18:56 rwp left #mojo
18:58 sri if you want to do it you should get it over with soon and upload a new release, before more people start to use it
18:59 sri it's so new, prolly nobody discovered it yet
19:05 meta_ joined #mojo
19:22 disputin joined #mojo
19:24 sri not that i have an opinion on the decision, personally i find that function useful
19:27 sri i don't want to use File::Find for quick one-liners, nor do i need the power of Path::Tiny very often
19:27 sri the idea was that files() and slurp() make for a good solution for many small tasks
19:29 sri if you think it's not useful enough, i guess Mojo::Home::list_files might also not be useful enough
19:37 jberger I wasn't the one that said to deprecate it
19:37 jberger if it has value to end users and is used even once in the core that's ok to keep from my perspective
19:39 sri dunno, seems awkward if it is used just once
19:46 sri think the original idea to make it a generic function was inspired by perl6
19:46 sri there you use the dir function https://doc.perl6.org/language/io#Getting_a_directory_listing
19:46 sri which is not quite the same, but quite similar
19:50 ichi joined #mojo
19:51 stephan48 joined #mojo
19:56 sri batman: why do you want to get rid of it so badly?
20:00 sri btw. i think my solution, had i worked on this, would just be a $skip_hidden option for Mojo::Util::files
20:01 sri it's useful for Mojo::Home::list_files too
20:02 sri like, on os x you prolly don't want to include .Dstore files
20:02 Grinnz_ that sounds reasonable to me
20:28 dod joined #mojo
20:35 kaare_ joined #mojo
20:39 kaare__ joined #mojo
20:39 batman sri: the point about .Dstore (and the like) makes me question files(). i just think it's too specialised.
20:40 batman i think files() with a callback could be useful, i just haven't been able to figure out what the api should be
20:41 batman since i really want $_ and $File::Find::file when no_chdir=>0 :/
20:42 batman and re-implementing File::Find in mojolicious would be a bit too much ;-)
20:44 batman i also think Mojo::Util should have as few functions as possible. but that's a very argument. just a personal opinion to keep the module thin(er)
20:45 sri batman: i think you're wrong
20:45 sri it's not very specialised at all
20:46 sri it just gets you a list of files recursively, something that comes up in projects all the time
20:46 kaare__ joined #mojo
20:47 batman i most often just need readdir
20:47 sri batman: so, you would basically remove Mojo::Home::list_files too?
20:47 jberger its just a different paradigm, you post-process the entire list rather than never push certain files into the list
20:47 sri and you find readdir easier to use? Oo
20:48 batman sri: no. but it sucks doing recursive find if you only want the files in a given directory ;)
20:49 sri i wouldn't even mind find('/etc', {no_recurse => 1})
20:49 sri umm
20:49 sri files(...)
20:50 sri for use in Mojo::Home::list_files
20:50 jberger https://metacpan.org/pod/File::Next
20:50 jberger File::Next calls that a descend filter
20:50 batman the only way i would like files() to stay and get more complex would be if we need it many places in mojolicious...
20:51 sri so, you do want Mojo::Home::list_files gone too?
20:51 sri because that's a user facing api, meaning most useful enough additions are fair game
20:52 sri batman: you're completely inconsistent if you can accept Mojo::Home::list_files, but not Mojo::Util::files
20:53 Grinnz_ http://mojolicious.org/perldoc/Mojo::Home#list_files second example is missing a closing parenthesis. but I don't follow what it's trying to do either. rel_file takes a single filename, list_files returns an arrayref?
20:54 batman i think jberger mentioned that maybe files() could take a filter callback..?
20:54 sri Grinnz_: it's a typo, "$home->rel_file(" needs to be removed
20:54 batman what if we did that, but the default filter would skip \. and \.Dstore kind of files?
20:54 sri copypasta error i suppose
20:54 Grinnz_ ahh
20:55 pink_mist {no_recurse => 1, show_hidden => 1}
20:55 batman do we need no_recurse in core?
20:56 sri batman: a default filter would annoy me a lot
20:56 sri imagine how that looks in the docs
20:56 batman sri: list_files() used to have a default filter
20:56 sri batman: no, you're conflating issues
20:57 batman sure it did. i linked to the diff in the issue
20:57 sri it used to skip dotfiles, but what you want is a filter option with default filer, that's completely different
20:57 batman i don't se the difference.
20:57 sri so, if someone makes their own filter, they have to understand that they need to ignore dotfiles manually again
20:57 sri and now you have to tell them how
20:58 sri that's bad api design imo
20:58 batman i think your mind is set, so i will stop arguing.
20:58 batman history tells me that it will turn out pretty great :)
20:58 sri not at all, i'm just disagreeing with you ;p
20:58 batman haha
20:58 batman <3
20:58 batman sorry. too much wine :P
20:59 batman i think File::Find is messed up.
20:59 batman the more i read the code, the more it annoyed me :(
21:00 kaare__ joined #mojo
21:00 batman i don't get why $File::Find::file and $_ has to be different when no_chdir is changed.
21:01 sri could someone please fix the typo https://github.com/kraih/mojo/blob/master/lib/Mojo/Home.pm#L118
21:02 Grinnz_ i always was annoyed at File::Find's choices of variable names
21:02 good_news_everyon joined #mojo
21:02 good_news_everyon [mojo] jhthorsen pushed 1 new commit to master: https://git.io/vaEgn
21:02 good_news_everyon mojo/master 2430734 Jan Henning Thorsen: Fix typo in list_files() example
21:02 good_news_everyon left #mojo
21:02 batman Grinnz_: which one?
21:03 pink_mist all of them? :P
21:03 sri batman: umm, you broke it again
21:03 batman sri: perl -c said it was ok :/
21:03 sri say for @{$home->list_files('templates/layouts')};
21:03 sri that's what it's supposed to look like
21:04 sri yours doesn't work
21:04 batman right. i just fixed the missing ) :)
21:04 sri rel_file returns a scalar
21:04 pink_mist batman: but it wasn't missing :P
21:04 jberger Grinnz_: what other names could it use?
21:04 Grinnz_ jberger: it's just inconsistent. I don't like the use of $_ to begin with
21:05 good_news_everyon joined #mojo
21:05 good_news_everyon [mojo] jhthorsen pushed 1 new commit to master: https://git.io/vaE2J
21:05 good_news_everyon mojo/master 74c5b05 Jan Henning Thorsen: Fix invalid list_files() example
21:05 good_news_everyon left #mojo
21:05 Grinnz_ i've been using Path::Rule::Iterator for most of those cases lately, anyway. so that kind of avoids the problem :P
21:05 Grinnz_ Path::Iterator::Rule *
21:05 batman pink_mist: yeah, the ")" was missing in the originale example
21:06 pink_mist batman: no no, that's the thing; the end of the expression was correct, the beginning of it was wrong =)
21:06 batman pink_mist ;)
21:06 genio say $home->rel_file($_) for @{$home->list_files('templates/layouts')};  # misleading since it says relative to the home directory above it
21:07 kaare joined #mojo
21:07 batman Grinnz_: could've used $_{name}, $_{path} and $_{path} :)
21:07 sri say $home->rel_file($_) for ... would make sense for the example too
21:07 batman oops. s/path/dir/
21:08 Grinnz_ batman: that would be a little better.
21:08 Grinnz_ well, $_->
21:08 batman why -> ?
21:08 pink_mist because using %_ is surprising?
21:08 sri big question, does anyone here actually use Mojo::Home::list_files?
21:08 batman %_, @_ and $_ are all global
21:09 pink_mist @_ isn't quite
21:09 Grinnz_ it could be perfectly fine to use %_, but nobody really has
21:09 batman sri: i don't
21:09 pink_mist I don't
21:10 sri there are two uses in core
21:11 batman sri: so... replacing those with Mojo::Util::files() makes the utility function more "valid" to me
21:11 batman but i don't want to remove list_files(), since it's been around "forever".
21:11 sri that's not how mojolicious works, we remove stuff that doesn't work out
21:15 sri batman: i think our differences are philosophical
21:16 sri you want Mojo::Util::files to be a 100% solution or to be gone
21:16 kaare_ joined #mojo
21:16 sri while i want a 90% solution
21:16 sri most of mojolicious is 90% solutions
21:18 sri it will never be an alternative to File::Find
21:18 sri and that's ok with me
21:18 sri just like slurp is not the end all answer for reading files
21:19 jberger I like our slurp though because its just bytes always
21:20 sri if it's a 90% solution to a problem nobody has, then i think we should get rid of both, Mojo::Util::files and Mojo::Home::list_files
21:20 jberger there's so much magick around other file reading solutions
21:22 sri in fact, it's much worse for Mojo::Home, because it's a user facing api
21:22 batman url_escape() is a nice example for how i would like files() to work: it has a good default, that you can override if you like.
21:22 sri Mojo::Util is just for internal use anyway
21:22 batman sri: i think you underestimate the power in Mojo::Util.
21:23 pink_mist I ... use Mojo::Util a lot
21:23 batman there's a bunch of Mojo::Util functions i use a lot
21:23 sri batman: allright, if you really believe in that soltuon, make a documentation mockup
21:24 sri i want to see if it works
21:24 sri also interested in how you would skip directories from your filter
21:26 batman sri: i think i need to write the code and run some benchmarks first
21:27 batman "skip directories" = simple readdir() ?
21:27 sri core doesn't need skip directories
21:27 sri we are talking about your filter callback now
21:28 sri which is a documentation problem imo, not implementation
21:28 batman i don't want/need it to skip directories. i just said that to explain why i don't find the other function/method useful
21:28 sri wait a minute
21:28 batman ah. thanks for explaining.
21:29 batman nevermind what i said
21:29 sri you mean my reference to skip directories?
21:29 batman yes
21:29 sri i meant not recursing into some directories
21:29 * batman is confused
21:29 sri controlled by your filter callback
21:29 batman yeah. that won't happen, since it's not a File::Find feature
21:30 batman won't happen = not something i would implement
21:31 sri yes, of course it is
21:31 sri $File::Find::prune = 1;
21:32 sri that excludes the current directory
21:32 sri just set it from inside your wanted callback
21:34 sri very shitty api, but it's there :)
21:36 * sri wanted to link to File::Find docs... but couldn't find anything good :S
21:38 sri hahaha, so yea, i discovered you can use emoji in repo descriptions... has science gone too far? https://github.com/kraih?tab=repositories
21:39 jberger you're using a Pear for Mango :-P
21:40 batman oh. i thought prune meant skip the rest of the files in the current directory :(
21:41 sri did you really just go... "wait... that's not a mango?!"
21:42 sri i totally thought nobody would notice
21:43 sri guess it could also use flames
21:44 sri going up in flames... like the data you stored in mongodb! *rimshot*
21:44 jberger oh see I was liking the pear for pear -> php -> wat ->mongo -> mango
21:45 jberger :-P
21:45 sri lol
21:46 sri oh, or the see no evil monkey
21:47 pink_mist seems better for Mojo::Mysql
21:56 sri batman: but back on topic, i think prune actually matters quite a bit, since your default filter would ignore dotdirectories
21:57 sri and you have to somehow make it easy to understand in the docs
21:57 sri so, you need a simple api
22:10 batman so... i'm trying different things, but it ends up with files() going from 1.6s on 535320 files to 4~5 seconds when trying to skip dotfiles
22:10 batman the reason: $_ is not the filename, so i need to use basename() or splitpath()
22:10 batman got any alternatives?
22:15 batman why is $_ = $name if $no_chdir; there? :(
22:23 PryMar56 joined #mojo
22:24 batman why isn't $File::Find::skip_pattern documented?
22:27 sri for the record, this is basically what i had in mind https://gist.github.com/anonymous/f1f50faf6d6c80878abe
22:28 batman sri: have you benchmarked it?
22:29 sri oops, there was a typo https://gist.github.com/anonymous/9361af3ad5d786c10179
22:29 sri what would i benchmark?
22:30 batman i thought speed was an issue for morbo
22:30 sri against the old version?
22:30 batman https://github.com/kraih/mojo/issues/934#issuecomment-196007279
22:30 sri of course it's a little slower
22:30 sri please be more specific
22:31 batman "a little"? my code isn't identical, but close, and it's half the speed.
22:32 batman i could very much be wrong, but if speed was the issue, then we should take it into consideration. if it's not... then we can more fun things
22:33 batman oh... maybe we can ask someone if $File::Find::skip_pattern is going to go away?
22:34 batman it makes it so much faster
22:34 batman local $File::Find::skip_pattern = qr/^\./ if $args->{skip_hidden};
22:35 sri what is skip_pattern?
22:36 sri omg
22:36 sri it has a global default
22:37 batman omg indeed :(
22:38 batman +1 on unless $args->{hidden}
22:39 sri i do see your point though, this is so much faster https://gist.github.com/anonymous/739ea3dc2ca3866188d5
22:39 sri and less code
22:39 batman \o/
22:40 batman so... who's bff with core? :)
22:40 sri and an interesting argument against a filter callback
22:40 sri lol
22:40 batman not sure, since it't not documented
22:41 batman but how likely is it that it will go away?
22:41 jberger p5p will never break File::Find
22:41 sri hmmm
22:41 batman but is it "breaking" to chage that variable into a my() ?
22:41 sri http://grep.cpan.me/?q=%5C%24File%5C%3A%5C%3AFind%5C%3A%5C%3Askip_pattern
22:42 jberger Well that is surprising
22:43 jberger I guess we could ask in #p5p
22:43 batman i don't see why it's surprising, since it's not documented
22:44 jberger But I'd bet money that they would never break any possible interface in a core module like that
22:44 batman https://github.com/kraih/mojo/blob/master/lib/Mojo/Reactor/Poll.pm#L52 <-- i guess we can also live with using $File::Find::skip_pattern ? :)
22:44 batman jberger: yeah, not betting against you :)
22:45 batman but i won't give it a +1 with when ETOOMUCHWINE
22:45 batman s/with//
22:45 jberger CPAN isn't darkpan, and I'm also guessing that that api is there because someone needed it
22:47 TonyC $skip_pattern was added in 7e47e6ffb69fd89d20f9c6c3eefbb75792cc109e to simplify MacOS support
22:47 batman nice
22:48 sri when was 7e47e6ffb69fd89d20f9c6c3eefbb75792cc109e?
22:48 TonyC 2001
22:48 sri hehe
22:48 sri TonyC++
22:49 batman TonyC: <3
22:53 sri either way, it does seem worth the risk
22:53 sri like IO::Poll::_poll ;p
22:53 jberger If mojo uses it, I'd be more likely to become a documented feature
22:53 * sri documents jberger
22:54 jberger Kinda evil, but as i said, i doubt they would remove it anyway
22:54 * jberger wonders about the writing that appeared on his face
22:54 * sri tests jberger by poking him with a stick
22:54 jberger Eeeeeeep
22:55 * batman like evil
22:57 batman if we use it... should it be part of Mojo::Util::files() or set to a custom value in list_files() and/or morbo?
23:10 sri think this might be reasonable https://gist.github.com/anonymous/01efc910e10a73f433c5
23:10 sri (not incluing the new dotfiles for tests, because i keep forgetting how to inglude those in git diffs ;p)
23:13 mdom joined #mojo
23:13 Grinnz_ git diff-tree --patch
23:14 Grinnz_ (don't actually know if that works for uncommitted changes
23:14 Grinnz_ )
23:15 sri nope
23:27 good_news_everyon joined #mojo
23:27 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vauvN
23:27 good_news_everyon mojo/master fce71fa Sebastian Riedel: fix bug where Morbo would not ignore hidden files (closes #934)
23:27 good_news_everyon left #mojo
23:27 sri since i can't figure out how to make a patch :S
23:31 sri batman: now, if you still want to get rid of it, that would be step 2
23:35 sri haha, now everyone is sick of the topic ;p
23:35 sri "JUST MAKE IT GO AWAY"
23:43 batman +1 on closing it :)
23:44 batman File::Find is less annoying with skip_patterns
23:44 batman Still don't think $_ changing is a good idea though
23:44 batman At least have another global variable for the file name :/
23:45 batman Anyway. I'm happy with the commit.
23:45 batman sri++
23:45 sri batman++
23:45 batman aaaw:)
23:46 sri it's the least controversial solution i think
23:46 batman I'm really happy about the morbo test.
23:46 batman Makes it less likely for a regression :)
23:47 batman Not sure why I care though...
23:47 batman Real men don't use temp files!
23:47 * batman hides
23:47 sri i don't even know where atom hides temp files
23:48 batman I think it's an issue if you start caring about those things
23:48 batman Issue = bad editor
23:49 * batman need sleep
23:50 sri travis looks good too https://travis-ci.org/kraih/mojo/builds/116261384
23:54 sri wonder if there's a way to avoid the -d check too
23:55 sri something to make File::Find not execute the wanted callback for directories

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