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

IRC log for #mojo, 2017-02-05

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

All times shown according to UTC.

Time Nick Message
00:22 bit_shifter This seems to be working: http://sprunge.us/FVGj?pl  Does that seem reasonable?
00:45 good_news_everyon joined #mojo
00:45 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vDcwG
00:45 good_news_everyon mojo/master 49f3f78 Sebastian Riedel: add open method and tempfile function to Mojo::File
00:45 good_news_everyon left #mojo
00:45 sri it looks a little awkward still, but much less than before ;p
00:46 sri curious if it passes tests everywhere
00:49 sri pass on activeperl, so far so good
00:52 disputin joined #mojo
01:19 good_news_everyon joined #mojo
01:19 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vDcrP
01:19 good_news_everyon mojo/master f85c841 Sebastian Riedel: separate the three cases
01:19 good_news_everyon left #mojo
01:22 sri 2 lines less code, more test coverage, and a little more readable code
01:22 sri think it's a clear win
02:00 jabberwok joined #mojo
02:02 jberger when did CORE::open become possible?
02:03 jberger other than that, I'm +1
02:03 sri passes on travis... so ;p
02:05 jberger works for me
02:38 bpmedley bit_shifter : Looks good, although without the rest of the code as context I can not be 100% certain..
03:34 noganex joined #mojo
03:48 aborazmeh joined #mojo
04:41 Javeh joined #mojo
05:04 dboehmer_ joined #mojo
05:48 zach if you want to have a mojo app use a specific ssl cert, how would you do it?
05:53 disputin joined #mojo
06:04 disputin1 joined #mojo
06:06 disputin2 joined #mojo
06:32 disputin joined #mojo
07:27 Vandal joined #mojo
08:40 dod joined #mojo
08:44 dod joined #mojo
09:23 sh14 joined #mojo
09:33 polettix joined #mojo
09:38 dotan_convos joined #mojo
09:45 sdeseille joined #mojo
09:47 marcus Watching a talk about grpc at fosdem
09:47 marcus Interesting stuff!
09:47 purl interesting is relative
09:49 marcus https://github.com/joyrex2001/grpc-perl
09:51 kirby joined #mojo
10:07 marcus Java is still as horrible as I remember tho.
10:11 marcus https://imgur.com/gallery/iHDPB
10:21 bpmedley zach : http://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#Built-in-web-server <-- but you can specify all listen locations supported by "listen" ...
10:59 sri btw. re Mojo::File additions from yesterday
11:00 sri please review https://github.com/kraih/mojo/blob/master/lib/Mojo/File.pm#L80
11:00 sri specifically IO::File::open vs CORE::open
11:00 sri i've picked IO::File first because it can handle more modes
11:01 sri specifically constants from Fcntl
11:05 irqq_ joined #mojo
11:05 pink_mist would you consider checking what File::Open does? it allows you to use 'r', 'w', 'a' modes instead of '<', '>', '>>' ones, which I find more readable
11:06 sri IO::File does that too
11:06 pink_mist ah, cool
11:06 * pink_mist looks closer at the new ->open then
11:06 sri "ANSI C fopen() mode string ("w", "r+", etc.)"
11:07 sri "Perl mode string (">", "+<", etc.)"
11:08 sri "a numeric mode"
11:08 sri "a mode that includes the ":" character, it passes all the three arguments to the three-argument "open""
11:08 sri it covers quite a bit
11:12 pink_mist alright, after checking it, IO::File's open is perfectly good too, so I have no complaints =)
11:12 pink_mist sri++
11:22 good_news_everyon joined #mojo
11:22 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vDcAe
11:22 good_news_everyon mojo/master 62d0440 Sebastian Riedel: document and test all open variants
11:22 good_news_everyon left #mojo
11:24 sri <3 appveyor, Mojo::File just wouldn't have happened without automatic windows testing \o/
11:25 sri btw. there is one variant i do not test, because i have no idea how to do it on windows
11:25 sri my $handle = $path->open(O_RDWR, 0666);
11:26 aborazmeh joined #mojo
11:30 pink_mist what is it you'd want to test about that? that it simply gives you a filehandle you can read and write from? because I'm pretty sure that would work on windows too ... just don't try to check the modes afterwards :P
11:30 sri the mode
11:30 purl Tempus es iocundum, o virgines, modo congaudete vos iuvenes.
11:31 pink_mist well crap .. right :P
11:32 sri at least these pass \o/ https://ci.appveyor.com/project/kraih/mojo
11:33 * sri wonders if haarg got around to fixing strawberry support
11:33 * pink_mist started packaging mojolicious for slackware btw =)
11:45 good_news_everyon joined #mojo
11:45 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vDcxf
11:45 good_news_everyon mojo/master 61e53e4 Sebastian Riedel: try to reuse slurp
11:45 good_news_everyon left #mojo
11:50 haarg sri: not yet.  i don't think it will be too hard, but it hasn't been a priority and i'm in the midst of an intercontinental move.
11:54 sri hmm, wonder why i cared about that in 2015 Oo https://github.com/kraih/mojo/commit/ec7920ea74e9fdb8316037316d3c08cf195a9e0b
11:55 sri nothing on irc either that day
12:03 bpmedley sri : Would allowing an optional hash ref at the end of spurt/slurp be desirable?  This way, they could use the new Mojo::FIle::open and spurt could have an append mode, amongst other things.
12:05 good_news_everyon joined #mojo
12:05 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vDcpI
12:05 good_news_everyon mojo/master fe96caf Sebastian Riedel: not using a second file descriptor is a lot faster
12:05 good_news_everyon left #mojo
12:12 mib_st52xu joined #mojo
12:14 sri curious
12:14 sri slurp with a -s on the handle is a bit faster
12:16 itaipu joined #mojo
12:22 sri ah, but it doesn't work reliably "On Linux, read() (and similar system calls) will transfer at most 0x7ffff000 (2,147,479,552) bytes, returning the number of bytes actually transferred"
12:24 good_news_everyon joined #mojo
12:24 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vDcpA
12:24 good_news_everyon mojo/master f331bc0 Sebastian Riedel: consistent quotes
12:24 good_news_everyon left #mojo
12:26 sri technically it's a bug fix :)
12:26 good_news_everyon joined #mojo
12:26 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vDchv
12:26 good_news_everyon mojo/master 3135677 Sebastian Riedel: update Changes
12:26 good_news_everyon left #mojo
13:36 dboehmer joined #mojo
13:36 hartenfels joined #mojo
13:41 marcus So Stevan loves attributes now apparently.
13:56 sri ?
13:58 * sri wonders if this belongs in Mojo::File https://github.com/kraih/mojo/blob/master/lib/Mojo/Asset/File.pm#L44-L76
14:08 Sebbe Time for the Mojolicious part of https://fosdem.org/2017/schedule/event/webdev_perl6/ :)
14:09 jberger marcus this is Stevan's "oh dear gods finally the last mop" mop?
14:13 Sebbe jberger: Stevan just had a talk at FOSDEM talking about UNIVERSAL::Class, B::CompilerPhase::Hook, BEGIN::Lift, MOP, Method::Traits and Moxie.
14:25 jberger Neat. I'm assuming there will be video?
14:26 jberger I joke but I've been following this project excitedly for a long time
14:27 Sebbe Yeah, there should be a video up. They're livestreaming as well. It was a pretty exciting talk.
14:27 Sebbe He said that he'd have released a first version of Method::Traits + Moxie today, but he had to finish his slides, heh.
14:28 Sebbe https://fosdem.org/2017/schedule/track/perl/ - shows what talks are left; there's a link to the live stream on the talk pages.
14:28 Sebbe Time's 15:28 atm
14:33 itaipu joined #mojo
14:42 jberger Sebbe cool thanks
14:49 pink_mist sri: imo it seems a bit too specialised for a generic file module .... but that said, I don't know a better place for it to be :P tl;dr: dunno :P
14:56 stryx` joined #mojo
14:59 sri i hate how perl6 and perl5 share the same track
15:00 Sebbe Yeah. Well, it's all with the Perl5/Perl6 name weirdness. Different languages, same name, heh.
15:01 sri perl6 just bores me now
15:01 jberger remember, perl5ers aren't allowed to complain about sharing space with perl6
15:01 jberger the reverse does not apply
15:07 Sebbe Time for SawyerX :)
15:21 marcus Sawyer us
15:22 marcus is a good presenter even.
15:22 Sebbe Yep.
15:31 tchaves joined #mojo
15:46 Sebbe He's totally on fast-forward this time though, heh.
15:46 marcus :D
15:46 marcus I like that
15:47 mishanti1 Wut? O_o https://www.congress.gov/bill/115th-congress/house-bill/861/all-info?r=5
15:49 sri trump's wall will protect your environment in the future!
15:49 jberger I had to step away for a sec and just saw the tail end about something about a company that lost $400M, what was that?
15:49 jberger believe me, if that actually comes up for a vote the protests will be YUGE
15:50 jberger also, the right loves to bash the EPA but they just pulled a bill off the table to sell off some public land because outdoorsman use it
15:50 jberger the right has plenty of people who would realize that they like the EPA if they had to think about it
15:50 mishanti1 Gotta keep 'em Mexicans out, or they'll steal your jobs, cars and women.
15:52 hartenfels jberger: It was Knight Capital Group, somehow they went bankrupt after dead legacy code was revived.
15:52 kirby joined #mojo
15:54 jberger hartenfels: thanks, that led me to this: https://en.wikipedia.org/wiki/Knight_Capital_Group#2012_stock_trading_disruption
15:58 hartenfels > The incident was embarrassing for Knight CEO
15:58 hartenfels That's an understatement for going from market leader to bankruptcy in 45 minutes.
15:59 good_news_everyon joined #mojo
15:59 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vDCLC
15:59 good_news_everyon mojo/master 10c0118 Sebastian Riedel: use Mojo::File in Mojo::Log
15:59 good_news_everyon left #mojo
16:02 jberger hartenfels: when I worked at $giant_bank I was always terrified of the code I wrote
16:04 hartenfels It sounds pretty spooky when reading about the incidents. Although working for a hospital or something would probably be even more so, but I don't wanna go down reading about code failures there.
16:12 itaipu joined #mojo
16:14 bpmedley sri : https://github.com/kraih/mojo/compare/master...brianmed:master <-- is something like this what you had in mind for issue #1048
16:17 sri bpmedley: do the tests pass on windows?
16:18 bpmedley Reinstalling Windows 10 or Windows 7 will be required for me testing there.  I can do so, will just take some time.
16:19 sri #1048 is already resolved though
16:19 sri was just curious, because it doesn't look like it would pass at all
16:21 noganex_ joined #mojo
16:33 itaipu joined #mojo
16:43 kes joined #mojo
16:54 polettix joined #mojo
17:40 dikim joined #mojo
17:45 dod joined #mojo
17:48 dod joined #mojo
17:49 dod joined #mojo
17:52 dod joined #mojo
17:53 litwol What is '//=' in perl ?
17:53 pink_mist just like += except // instead of +
17:53 pink_mist and // is the defined-or operator
17:53 litwol http://mojolicious.org/perldoc/Mojolicious/Plugin/DefaultHelpers.txt
17:54 litwol sub _content {
17:54 litwol I dont understand the 'else' clause
17:54 litwol Oh so // in  return Mojo::ByteStream->new($hash->{$name} // '');
17:55 litwol will either send defined content from hash, or empty string.
17:55 dod joined #mojo
17:55 litwol $hash->{$name} //= _block($content)
17:56 litwol Does this mean... keep value of hash->{name} if _block($content) is not defined?
17:56 litwol otherwise, if defined, set it into hash?
17:56 hartenfels litwol: it basically means $hash->{$name} = _block($content) if defined $hash->{$name}
17:56 pink_mist hartenfels: no
17:56 hartenfels Uh, s/if/unless/
17:56 pink_mist if not defined
17:56 hartenfels Yes.
17:56 litwol ohhh
17:57 litwol so if hash has value, it will *not* be overriden ?
17:57 hartenfels Yes.
17:57 hartenfels It avoids writing $hash->{$name} twice.
17:57 pink_mist it means give it a value if it doesn't already have one
17:57 litwol meaning, using 'content' helper will set value once and ONLY once for the given /named/ hash.
17:57 litwol ok cool
17:58 litwol ty
17:58 dod joined #mojo
17:58 litwol dod: fix your connection.
18:23 litwol When using migrations lib. For example this: https://github.com/kraih/mojo-pg/blob/master/examples/blog/migrations/blog.sql
18:23 litwol Why would i want to specify a 'down' step ?
18:23 litwol meaning, is it good practice for every '1 up' to create a matching '1 down' ?
18:39 mishanti1 litwol: For reverings your deployed changes, if you realize that something you deployed need to be reverted. Granted your change is of the revertible kind.
18:39 batman litwol: yes
18:39 batman It's for rollback, if you don't like your database schema changes.
18:39 mishanti1 I need to work on reading what I type.
18:40 litwol I'm just wondering for a production environment. even in cases of 'oops, this is not the best or exactly what i wanted'...
18:40 litwol having a matching 'drop table' doesn't make a lot of sense to the 'create table'
18:41 batman Then just don't roll back :)
18:44 litwol k :)
19:01 tyldis litwol: That's just he basic example. It doesn't have to be a 1:1 operation.
19:02 litwol ty
19:02 sri some people also like to be able to uninstall an app without destroying the whole database
19:03 sri in Mojo::Pg migrations have names, so you could run multiple apps sharing the same database, all using their own migrations
19:04 sri common use case is running minion alongside another app
19:20 good_news_everyon joined #mojo
19:20 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vDCcK
19:20 good_news_everyon mojo/master 233712e Sebastian Riedel: more consistent imports
19:20 good_news_everyon left #mojo
19:28 good_news_everyon joined #mojo
19:28 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vDCcp
19:28 good_news_everyon mojo/master 1128def Sebastian Riedel: show how to combine constants
19:28 good_news_everyon left #mojo
19:29 itaipu joined #mojo
19:34 sri this one seems deadlocked in the vote https://github.com/kraih/mojo/pull/1046
19:38 sri jberger: you really believe that's the correct solution?
19:38 jberger I believe that the way it is implemented makes tx and dom attributes very consistent
19:39 sri and you don't believe there are better ways, like extending the transaction level APIs?
19:39 jberger the other ways I could think of to make Mojo::DOM elements more testable would probably involve refactoring Test::Mojo to extract the dom-like tests into a reusable class, like Test::Mojo::DOM or so
19:40 jberger sri: I don't know what you mean by that
19:40 jberger can you elaborate?
19:40 sri $t->tx->res->dom(Mojo::DOM->new) or whatever
19:41 jberger other than for testing, when would you replace a transaction's response dom value?
19:42 sri right now we have one use case which is $t->dom(Mojo::DOM->new($t->tx->res->json('/some/html/value')))
19:42 jberger I mean, I guess it can be done to replace the response content for a request ...
19:42 sri you can always make a fake transaction
19:42 sri so technically this is already all doable
19:43 sri what i'm wondering is if this is really common enough to need to be in core, instead of a Test::Mojo role
19:44 jberger how would the role implement this though?
19:44 jberger I guess by installing a fake transaction
19:45 sri yes
19:46 sri fake transaction, add message body, assign to $t->tx(...)
19:46 jberger I don't think I like the idea that we would recommend setting $t->tx->res->dom(Mojo::DOM->new(...)) because then it would be hard to describe that the dom-like tests refer to the response's dom element and not its body content
19:46 jberger doing it at the $t level makes that eminently clear
19:47 jberger but I suppose installing a fake transaction with body content does that too
19:47 jberger one sec, I'm cooking something, back in just a few
19:50 sri https://github.com/kraih/mojo/pull/1046#issuecomment-277544031
19:58 jberger ok, well, I can't really argue against that
20:17 PryMar56 joined #mojo
20:30 polettix joined #mojo
20:39 bit_shifter joined #mojo
21:10 good_news_everyon joined #mojo
21:10 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vDCB1
21:10 good_news_everyon mojo/master 71a7882 Sebastian Riedel: bump version
21:10 good_news_everyon left #mojo
21:16 simak joined #mojo
21:17 simak left #mojo
21:22 dikim joined #mojo
21:28 dboehmer joined #mojo
21:51 dboehmer joined #mojo
23:13 cpan_mojo Mojolicious-Plugin-AssetPack-1.40 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-AssetPack-1.40
23:17 kirby joined #mojo
23:24 sri the bot doesn't pick up mojo releases anymore
23:45 good_news_everyon joined #mojo
23:45 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vDCaF
23:45 good_news_everyon mojo/master d815ed2 Sebastian Riedel: functions look better in examples
23:45 good_news_everyon left #mojo
23:47 good_news_everyon joined #mojo
23:47 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vDCax
23:47 good_news_everyon mojo/master 789b94c Sebastian Riedel: forgot two examples
23:47 good_news_everyon left #mojo

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