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

IRC log for #mojo, 2017-01-10

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

All times shown according to UTC.

Time Nick Message
00:03 PryMar56 joined #mojo
00:15 jberger <3 perl
00:16 genio bout time yahoo died off
00:26 aborazmeh joined #mojo
00:37 aborazmeh joined #mojo
00:37 Janos joined #mojo
00:40 aborazmeh joined #mojo
01:08 aborazmeh joined #mojo
01:08 zach is there a better way to write this?
01:08 zach http://pastebin.com/uCWfg1kz
01:09 zach I'm having to do that with mojo::pg::result to get actual values from selects
01:32 bpmedley zach : Sorry for my confusion.  What is your table structure and what data structure are you generating?
01:36 howitdo joined #mojo
01:39 bpmedley sri : Mojo::File tests ran via git clone.  OS X v10.11.6 pass
01:55 jberger looks like you can still get Windows upgraded 7 -> 10 for free: http://www.zdnet.com/article/heres-how-you-can-still-get-a-free-windows-10-upgrade/
01:55 jberger I know there were some attempts at this in this channel a while back
02:11 Janos joined #mojo
03:26 asarch joined #mojo
03:38 Janos joined #mojo
04:15 zach bpmedley: that's with SELECT password FROM users WHERE username = ?
04:16 bpmedley Are you building a hash of usernames and passwords?
04:23 bpmedley zach ^^
04:24 bossert joined #mojo
04:37 Janos joined #mojo
04:38 zach hold on
04:38 zach my $password = $pg->db->query('SELECT password FROM users WHERE username = ?', $username)->hashes->to_array;
04:39 zach all I care about is the value of the one column from the one row to use with a bcrypt comparison
04:49 sh14 joined #mojo
05:04 dboehmer_ joined #mojo
05:06 Grinnz zach: my $password = ($pg->db->query(..., $username)->arrays->first // [])->[0];
05:07 Grinnz the // [] is in case no rows are returned for that username
05:07 Grinnz no need to use ->hashes if you don't care about accessing columns in the results by name.
05:07 zach Grinnz: I'm having troubles with the bcrypt part of it now though
05:07 Grinnz (you only have one result column)
05:08 zach Grinnz: I even bothered to make the password the same as the username for an initial test, but it's not working
05:08 Grinnz what are you using for bcrypt?
05:08 zach well, for creating the users/pass Digest::Bcrypt
05:08 zach for reading, Mojolicious::Plugin::Bcrypt
05:09 zach though that's pretty much just a wrapper around the former
05:09 Grinnz you should use https://metacpan.org/pod/Crypt::Eksblowfish::Bcrypt instead of Digest::Bcrypt
05:10 Grinnz and i don't really see a reason to use that plugin. it is super simple to call bcrypt() directly
05:13 zach what's wrong with Digest::Bcrypt?
05:13 Grinnz iow, bcrypt() (or bcrypt_hash) is used for both hashing the password initially, and re-hashing the password later to validate
05:14 zach also, I need a better solution to my DB URI and password being in every module
05:14 Grinnz the module recommends not to use it. https://metacpan.org/pod/Digest::Bcrypt#NOTICE
05:14 Grinnz config file
05:15 zach I did that, didn't work
05:15 Grinnz see https://metacpan.org/pod/Mojolicious::Plugin::Config or https://metacpan.org/pod/Mojolicious::Plugin::JSONConfig
05:15 Grinnz what didn't work?
05:15 purl But it DID do exactly what you told it do.  :D
05:15 zach I used myapp.conf in the base dir and I had app->config->pg
05:15 Grinnz ->pg?
05:16 Grinnz maybe read https://metacpan.org/pod/Mojolicious::Guides::Cookbook#Adding-a-configuration-file as well
05:16 zach $self->helper(pg => sub { state $pg = Mojo::Pg->new(shift->config('pg')) });
05:17 zach in my startup sub in my main lib
05:18 Grinnz and you loaded the config plugin to read a config file?
05:19 zach ...fuck...
05:19 zach no
05:19 Grinnz :)
05:20 Grinnz remember ->config is a generic configuration stash, you don't actually need a config file to use it
05:20 Grinnz the plugins just facilitate reading a config file into it
05:23 zach so, I should be able to just have a pg helper object at the top now with that rather than in every sub
05:23 Grinnz loading the plugin should be done in startup if it's a full app
05:23 Grinnz only once
05:24 Grinnz just, before you actually try to use the config
05:24 zach it's a full app
05:24 zach but I have a lot of things that will want to use the DB in it
05:24 Grinnz then you can use ->config in the helper like you mentioned above
05:25 zach ok, thanks
05:30 zach Grinnz: actually what do you think of scrypt vs bcrypt?
05:31 Grinnz don't know anything about scrypt
06:04 Janos joined #mojo
06:37 tuna joined #mojo
06:38 tuna Dancer user here.  Trying out mojo was wondering if there is a way to define routes outside of the startup method?
06:39 preaction like, where would you do it? did you want to look at Mojolicious::Lite?
06:39 Vandal joined #mojo
06:40 preaction as far as i know, you can totally add/remove routes from the router at any time during runtime. however, in certain situations, this could result in some very, very weird behavior (like, in a forked situation, not all the children have the same routes)
06:42 Grinnz there's no supported way to change routes after startup. (in Mojolicious::Lite, startup is just all of the code between "use Mojolicious::Lite;" and "app->start;"
06:43 Grinnz but you can look at mojolyst if you're looking for a way to define routes in each controller
06:44 preaction but if you explain what you're trying to achieve, we might be able to help
07:04 dod joined #mojo
07:11 dod joined #mojo
07:34 inokenty-w joined #mojo
07:58 AndrewIsh joined #mojo
08:06 Dandre joined #mojo
08:27 rshadow joined #mojo
08:33 sri bpmedley: lol, os x is one of the few operating systems i can test on too ;p
08:33 sri what would be nice is a test run of github master on windows
08:36 trone joined #mojo
08:37 Janos joined #mojo
08:52 dod joined #mojo
08:55 haarg sri: have you looked at appveyor?  travis-ish for windows.
08:56 sri nope
08:57 sri interesting, any perl projects using it?
08:57 haarg i've used it for some
08:58 haarg i have this setup https://github.com/moose/Moo/blob/master/.appveyor.yml https://github.com/moose/Moo/blob/master/.appveyor.cmd
08:58 sri asking because i'd like to see example configs
08:58 sri ouch, that looks complicated
08:59 haarg well, it's generalized
08:59 haarg because that's how i tend to approach things
09:00 haarg also it's an attempt to cover activeperl and strawberry
09:00 haarg and cygwin
09:01 haarg if you wanted something more limited, it would be more simple.
09:01 haarg i could probably work something up for mojo if you went over what you wanted to cover.
09:14 nic jberger++  # thanks for Windows upgrade link
09:38 sri not actually sure what i would want to cover
10:07 sri anyway, 7.15 will be released in an hour
10:07 cpan_mojo Mojo-Webqq-2.0.2 by SJDY https://metacpan.org/release/SJDY/Mojo-Webqq-2.0.2
10:10 cpan_mojo Mojo-Weixin-1.2.7 by SJDY https://metacpan.org/release/SJDY/Mojo-Weixin-1.2.7
10:48 rshadow joined #mojo
10:48 coolo joined #mojo
10:55 Janos joined #mojo
11:05 stryx` joined #mojo
11:10 bpmedley sri : I assumed you were on macOS I'm one version behind that..
11:30 tchaves joined #mojo
11:41 good_news_everyon joined #mojo
11:41 good_news_everyon [mojo] kraih tagged v7.15 at 378267f: https://git.io/vM4p0
11:41 good_news_everyon left #mojo
11:43 good_news_everyon joined #mojo
11:43 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vM4po
11:43 good_news_everyon mojo/master 5a5639a Sebastian Riedel: bump version
11:43 good_news_everyon left #mojo
11:44 castaway joined #mojo
11:46 bpmedley sri : I'm testing with Windows 10.  There are several line ending test differences.  Also "t/mojo/file.t .............................. 1/? file.t: No such file or directory at C:\git\blib\lib/Mojo/File.pm line 104"
11:46 castaway joined #mojo
11:48 sri your timing is impeccable
11:48 rshadow joined #mojo
11:48 castaway me?
11:48 purl it has been said that castaway is very helpful and is also working on docs or an alien from pluto or a female (say wow and mst will chainsaw you) or a operaite or yoda or a nonexistant bug magnet or insane again or seems an early riser or reading the manual for the masses or emacs incarnate  or volunteering to apply my patch over nopaste/irc ;) or translating mst to english since 2006 or http://www.flickr.com/photos/jessrobinson/
11:48 castaway join a channel and the network implodes..
11:48 bpmedley My apologies.  I had to install in a VM..
11:50 pink_mist castaway: no. bpmedley.
11:51 bpmedley sri : generate lite_app and daemon seem functional
11:51 castaway ah fairynuff
11:52 castaway I came to ask what're probably dumb questions cos.. docs--
11:53 castaway first one.. what does a coderef used for has get passed? eg has schema => sub { .. } .. whats @_ in there?
11:54 sri fair question, it's the invocant
11:54 sri i guess that's a hole in the docs
11:55 castaway erm.. the invocant? english? ;)
11:55 castaway (for dummies preferably)
11:55 sri the instance the attribute accessor was called on
11:55 castaway or.. better question.. if I have an attr that relies on another attr ...
11:55 castaway does shift->other_attr dwim?
11:56 sri it should
11:56 castaway woo, ta
11:56 sri bpmedley: well, my lunch break is over, so whatever is broken now will stay broken until the evening ;p
11:56 bpmedley sri: https://gist.github.com/anonymous/8fcb03eecdb4501723ab1894f35e91e3
11:57 bpmedley I'll keep the VM around, so feel fee and ask me to run stuff
11:58 sri but i'm sure the pull requests will be piling up by then if breakage is bad enough
11:58 sri castaway: suggestions/pull requests for how to mention it in the docs would be very welcome
12:09 castaway first I have to not go crazy ;)
12:09 castaway problem with docs.. usually written for "person starting from scratch".. less so for "someone trying to understand existing code"...
12:11 aborazmeh joined #mojo
12:37 Janos joined #mojo
12:55 sri bpmedley: line ending test fails make me believe you borked your vm though, i don't think anything there changed at all
12:57 pink_mist on windows perl does add the :crlf PerlIO layer by default afaik
12:57 pink_mist which would certainly affect line endings
12:58 sri we bypass PerlIO mostly
12:59 bpmedley sri : Not sure how I could have borked it.  I have a fresh install.  Although, more data points would be nice..
13:02 stephan48 where did you get your git from?
13:02 stephan48 Git for Windows allows you to specify an option which replaces \n with \r\n on checkout and vice versa on push
13:02 stephan48 i think this might be the default option
13:03 pink_mist oh yes, I've been bitten by that once on windows too
13:03 bpmedley stephan48 : that could be the issue
13:03 bpmedley be back later
13:04 stephan48 open git gui and go to settings - or reinstall git for windows and select the corresponding option should allow you to fix this
13:04 stephan48 (theres a config in %USERPROFILE%\ somewhere which also allows you to do this)
13:16 zivester joined #mojo
13:55 asarch joined #mojo
14:19 gizmomathboy joined #mojo
14:29 Janos joined #mojo
14:50 Pyritic joined #mojo
14:58 zivester joined #mojo
15:14 dikim joined #mojo
15:18 coolo where is batman when you need him?
15:18 coolo can someone light the sign?
15:19 pink_mist maybe just ask the question you wanted; he may see it when he comes around, or possibly someone else may be able to give a useful answer
15:20 coolo pink_mist: well, I want to say "YOU BROKE MY TESTS!". Not sure it helps to yell it into the thin air :)
15:20 pink_mist oh, lol :P
15:29 foursixnine joined #mojo
15:48 kes joined #mojo
15:48 kes Hi. It is not documented: http://mojolicious.org/perldoc/Mojolicious/Controller#url_for
15:49 kes May I relay on that that $c->url_for without arguments return Mojo::URL for current request?
15:49 sh14 joined #mojo
15:51 pink_mist kes: http://mojolicious.org/perldoc/Mojolicious/Guides/Routing#Named-routes <-- it's documented in this section
15:51 pink_mist "To refer to the current route you can use the reserved name current or no name at all."
15:53 kes pink_mist: ok, thank you. So I may relay on this behavior
15:53 pink_mist *rely
15:53 pink_mist yes
16:02 dod joined #mojo
17:09 foursixnine joined #mojo
17:27 disputin joined #mojo
17:36 lluad joined #mojo
17:48 sri odd to ask us to file a bug report with the url living standard https://github.com/kraih/mojo/issues/1023#issuecomment-271611521
17:50 sri whole ending doesn't make a whole lot of sense to me
18:02 jberger yeah, I'm not sure where to take that
18:02 jberger I do think its interesting that it doesn't roundtrip
18:02 jberger but I don't know if that is per the spec or not
18:04 disputin joined #mojo
18:19 disputin joined #mojo
18:28 sri he was supposed to find out
18:28 sri but i guess he couldn't
18:30 sri oh well, i'm sure someone will do it some day
18:30 asarch joined #mojo
18:44 stryx` joined #mojo
18:49 disputin joined #mojo
18:57 sri i mean, there are very simple solutions
18:58 sri $url->fragment could become a method that only unescapes when it actually gets called
19:00 rshadow joined #mojo
19:06 sri hmm, someone is trolling my google analytics -.-
19:06 sri the 4 most used languages by visitors of mojolicious.org are en-us, ru, en-gb and "Vitaly rules google ☆*:。゜゚・*ヽ(^ᴗ^)ノ*・゜゚。:*☆ ¯\_(ツ)_/¯(ಠ益ಠ)(ಥ‿ಥ)(ʘ‿ʘ)ლ(ಠ_ಠლ)( ͡° ͜ʖ ͡°)ヽ(゚Д゚)ノʕ•̫͡•ʔᶘ ᵒᴥᵒᶅ(=^ ^=)oO"
19:07 pink_mist heh
19:09 Grinnz lol
19:21 sri the whole list https://twitter.com/kraih/status/818899605672890368
19:22 PryMar56 joined #mojo
19:22 sri aha, i guess this might be the windows patch we were expecting https://github.com/kraih/mojo/issues/1030
19:32 good_news_everyon joined #mojo
19:32 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vMRfe
19:32 good_news_everyon mojo/master d69f603 Sebastian Riedel: fix Windows bugs in Mojo::File (closes #1030)
19:32 good_news_everyon left #mojo
19:34 zivester joined #mojo
19:35 sri the fact that abs_path is inconsistent in such a major way makes me favor rel2abs for now
19:46 genio https://metacpan.org/changes/release/DAGOLDEN/Path-Tiny-0.098#L112  :/
19:50 sri how is not resolving symlinks buggy?
19:50 Janos joined #mojo
20:02 Grinnz xdg: if you remember the details, can you clarify?
20:02 xdg I think that's the wrong citation.  I think your change may be comparable to https://metacpan.org/changes/release/DAGOLDEN/Path-Tiny-0.098#L222
20:03 xdg Looking at the symlink issue, that's actually for abs2rel, I think.  I should fix that in the Changes file.
20:06 xdg The symlink issue for relative paths is described in the docs here: https://metacpan.org/pod/Path::Tiny#relative
20:12 xdg (with the same damn typo.  Fixing that now.)
20:24 batman joined #mojo
20:31 jberger I got my first breakage due to Mojo::File, if people are curious about it
20:31 jberger $home->rel_file now returns an object not a string
20:32 jberger and Log::Dispatch uses Params::Validate::XS which doesn't allow objects which stringify in place of a stirng
20:32 sri interesting
20:34 jberger personally I think this is a bug in the validation in Log::Dispatch
20:34 jberger but it happened nonetheless
20:35 sri if there is demand for making rel_file return strings we'll just deprecate the whole method :)
20:39 sri perhaps that's the right choice anyway
20:40 Pyritic joined #mojo
20:49 trone joined #mojo
21:27 sri btw. https://github.com/kraih/mojo/issues/1023#issuecomment-271702940
21:28 Grinnz http://xkcd.com/1782/
21:31 sri i would be so happy if i could connect to the irc server at work with irccloud
21:51 sri the %INC stuff is a real wtf https://github.com/kraih/mojo/issues/1031#issue-199940137
21:53 genio o.O  I'm not in front of a windows machine now to provide any help, but I can test stuff later from home
21:56 Grinnz could you do splitpath on the %INC value instead of assuming it has /?
21:57 sri it's mixed / and \
21:57 Grinnz that is really weird...
21:57 Grinnz i'm sure other things assume / in %INC as well, there must be prior art
21:58 sri seems like it's just broken in windows perl
22:06 cpan_mojo Mojolicious-Plugin-PubSubHubbub-0.17 by AKRON https://metacpan.org/release/AKRON/Mojolicious-Plugin-PubSubHubbub-0.17
22:11 sri at least canonpath doesn't appear to cost much performance
22:22 sri his changes look terrible at first... but they make sense :S
22:23 cpan_mojo Mojolicious-Plugin-AssetPack-1.34 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-AssetPack-1.34
22:29 good_news_everyon joined #mojo
22:29 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vMREY
22:29 good_news_everyon mojo/master b4400a6 Sebastian Riedel: fix more Windows bugs (closes #1031)
22:29 good_news_everyon left #mojo
22:33 good_news_everyon joined #mojo
22:33 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vMREK
22:33 good_news_everyon mojo/master d5e61ce Sebastian Riedel: no need for backslash
22:33 good_news_everyon left #mojo
23:02 zivester joined #mojo
23:52 good_news_everyon joined #mojo
23:52 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vMRin
23:52 good_news_everyon mojo/master 1c82b93 Sebastian Riedel: bump version
23:52 good_news_everyon left #mojo

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