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

IRC log for #mojo, 2016-01-20

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

All times shown according to UTC.

Time Nick Message
00:20 sri in the meantime, you can filter $c->validation->input yourself
00:25 absolut_todd joined #mojo
00:47 absolut_todd joined #mojo
01:00 jontaylor joined #mojo
01:11 zivester joined #mojo
01:24 lluad joined #mojo
01:53 bpmedley joined #mojo
02:40 kaare joined #mojo
03:11 zivester joined #mojo
03:22 binlei joined #mojo
03:28 jnbek joined #mojo
03:38 da5id joined #mojo
03:47 noganex joined #mojo
03:55 binlei joined #mojo
03:59 ZoffixWin joined #mojo
04:01 binlei joined #mojo
04:09 sri oh, another solution... $validation->filters('trim', 'squish'); $validation->optional('foo'); $validation->required('bar')
04:10 sri you can at any time reset the filter list, and it they will run on required/optional
04:10 sri s/it//
04:11 c--__ joined #mojo
04:12 jberger sri: that seems simple enough
04:12 sri just gets messy again with arguments
04:13 sri ->filters(foo => [arg1, arg2...], bar => [...])
04:13 jberger Are arguments a required feature?
04:14 sri i don't know!
04:14 sri so far i couldn't actually think of a filter with args
04:15 sri what i've seen so far is trim, squish, upcase, downcase
04:15 sri maybe it could be left out until there is a need
04:15 * sri shrugs
04:18 jberger Without them the options for specifying filters get easier
04:19 jberger I'd still prefer them as options to required for example
04:19 sri without args that wouldn't look too bad i guess
04:20 sri $validation->optional('foo', 'trim')->size(5, 23)
04:56 inokenty-w joined #mojo
05:08 good_news_everyon joined #mojo
05:08 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://github.com/kraih/mojo/commit/1a3ccef03e3e03aa316e74d6cad5ce68ee3ac729
05:08 good_news_everyon mojo/master 1a3ccef Sebastian Riedel: bring back support for validation filters
05:08 good_news_everyon left #mojo
05:08 sri another try
05:12 good_news_everyon joined #mojo
05:12 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://github.com/kraih/mojo/commit/5eee9fd1bf8891067bb6ebf9096fd7bb023cfe99
05:12 good_news_everyon mojo/master 5eee9fd Sebastian Riedel: test multiple filters too
05:12 good_news_everyon left #mojo
05:19 zivester joined #mojo
05:20 binlei joined #mojo
05:48 melo joined #mojo
06:24 crux joined #mojo
06:42 good_news_everyon joined #mojo
06:42 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://github.com/kraih/mojo/commit/f0d068b94d251601ab816237c780502b9f8a6838
06:42 good_news_everyon mojo/master f0d068b Sebastian Riedel: another filter example
06:42 good_news_everyon left #mojo
07:09 dod joined #mojo
07:12 absolut_todd joined #mojo
07:14 dod joined #mojo
07:15 salva joined #mojo
07:19 berov joined #mojo
07:21 good_news_everyon joined #mojo
07:21 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://github.com/kraih/mojo/commit/f105b2c4382c471d1b4ce3d1a5716d3347c53dde
07:21 good_news_everyon mojo/master f105b2c Sebastian Riedel: filters can remove the whole value
07:21 good_news_everyon left #mojo
07:25 dod1 joined #mojo
07:32 dod joined #mojo
07:38 dod1 joined #mojo
07:52 osfabibisi joined #mojo
08:11 binlei joined #mojo
08:12 Vandal joined #mojo
08:18 Averna joined #mojo
08:23 binlei joined #mojo
08:26 trone joined #mojo
08:32 sugar joined #mojo
08:33 AndrewIsh joined #mojo
08:38 odc joined #mojo
08:58 berov joined #mojo
08:58 cpan_mojo Mojolicious-Plugin-Model-0.07 by AVKHOZOV https://metacpan.org/release/AVKHOZOV/Mojolicious-Plugin-Model-0.07
09:05 kes joined #mojo
09:10 esh joined #mojo
09:31 binlei joined #mojo
09:48 jontaylor joined #mojo
10:45 mishanti1 mojo always re-reads it's configfile when you -SIGUSR2 it right?
10:46 nic are you asking because you changed stuff while it was running?
10:50 mishanti1 Asking to check if all changes to configfile will be honored if I tell mojo to restart.
10:51 nic nope
10:51 nic a full restart, of course
10:52 nic a hot restart of hypnotoad, not everything can be changed
10:53 mishanti1 Thanks. :) I'll make sure to stop and start it then. Is it the only the hypnotoad stuff that is "locked", and the other application-specific things will be re-read?
10:53 mishanti1 I don't foresee a need here to change details in hypnotoads operation. Primarily the application-specific things that are of interest.
10:54 nic hot restarts only apply to hypnotoad, yes
10:54 nic on linux you can simulate it using port sharing, but that's a road I've never gone down
10:56 tyldis Hmm.. I have created (in lib/some/where/mycmd.pm) a Mojo::Base 'Mojolicious::Command' module, but how do I actually load that one? I can see that the run-sub is never executed...
10:57 mishanti1 nic: Thank you for the input.
10:57 nic np, glad it was of some use
10:58 nic tyldis: it is run from the 'body' of a Mojolicious (or Mojolicious::Lite) app
10:58 nic First check you can load it   "perl -MMy::Module -E'say 1' "
10:59 tyldis Yep,it is loadble
10:59 nic Is its name something like    Mojolicious::Command::something   ?
10:59 tyldis No, different namespace
11:00 tyldis It has to be that namespace?
11:00 nic so your app will have to add that namespace, then you can call it
11:00 nic This is all in the docs of course, so I'll bow out now
11:00 tyldis Hehe, thanks
11:01 nic but before I go, I strongly recommend you    "cd /tmp; mojo generate lite_app abc"  and study the resulting files while reading the docs
11:02 tyldis Will do, thanks
11:03 lluad joined #mojo
11:04 punter joined #mojo
11:08 mishanti1 tyldis: I recommend doing the same for a full app as well, so you can see how the two compare. Useful if you expect the app to grow and see the need to convert the lite app to a full app.
11:20 berov joined #mojo
11:21 ZoffixWin joined #mojo
11:36 binlei joined #mojo
11:44 vytas` joined #mojo
11:54 kaare joined #mojo
11:58 punter joined #mojo
12:05 coolo joined #mojo
12:22 ZoffixMobile joined #mojo
12:34 tyldis mishanti1: This is a full app, but I didn't catch the details of how commands where found.
12:35 tyldis The mojo documentation is extremely comperehensive, however sometimes it is hard to find the glue between them.
12:38 nic http://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#Adding-commands-to-Mojolicious
12:39 nic tyldis: Is there any improvement to the above that you can propose?
12:40 jberger mishanti1: almost all configuration can be changed on hot restart
12:40 jberger Just not hypnotoad pid file
13:04 lluad joined #mojo
13:12 mishanti1 jberger: port as well?
13:12 mishanti1 Not that I need it, but just curious.
13:16 ajr_ joined #mojo
13:34 panshin joined #mojo
13:53 tyldis nic: It was just my lack of understanding of how things work internally in Mojo. Partly I expected the namespace to be declared before executing start_app (from the Mojo boilerplate app) and partly that I had an unrelated fail in my startup sub at the very end - and expected to see the command in action before startup returned. Now I know a whole lot more, and thanks for the lesson :)
13:54 nic glad you're on track :)
14:00 bowtie_ joined #mojo
14:02 binlei joined #mojo
14:06 bowtie_ joined #mojo
14:07 zivester joined #mojo
14:09 elik joined #mojo
14:17 neilhwatson joined #mojo
14:26 cpan_mojo Mojolicious-Command-listdeps-0.08 by PDURDEN https://metacpan.org/release/PDURDEN/Mojolicious-Command-listdeps-0.08
14:33 orev joined #mojo
14:35 pink_mist <mishanti1> jberger: port as well? <-- sure
14:37 genio joined #mojo
14:53 bowtie joined #mojo
15:04 jabberwok joined #mojo
16:10 sri mishanti1, pink_mist: but it can't close the old port
16:12 jberger of course, in the case of changing ports, zero downtime restart is really not a whole lot different than starting hypnotoad on another port and then gracefully shutting down the first one
16:14 Grinnz_ except the pidfile...
16:14 zivester joined #mojo
16:22 jberger hmmm, true
16:28 Kogurr joined #mojo
16:31 sri so, everyone ok with the current version of validation filters? https://github.com/kraih/mojo/commit/1a3ccef03e3e03aa316e74d6cad5ce68ee3ac729
16:39 jberger I am
16:39 jberger then again, it was more of less my proposed fix, so it might be nice if someone else weighed in
16:46 * lb will have a look
16:47 * lb didn't get to read the entire backlog, but I suppose it's represented in code ;)
16:58 nicomen sri: jberger: can you set a filter that is valid for the entire $validation object. So that you can set it once, and never care anymore? (as adding it for every param, then you couldd as well have trimmed every param yourself, no?)
16:59 jberger nicomen: yes, except that trimming on your own is harder to get at
16:59 jberger yes meaning yes you could trim on your own but ...
16:59 nicomen yeah sure, I was more thinking from the perspective of that guy that was here the other day
16:59 lb nicomen: that's rather against the spirit of mojo validation
16:59 nicomen and I think it makes to think: "I want to trim all my input params, except..."
17:00 nicomen but just because I ask something, doesn't mean other considerations weigh more and hence it is not a good proposition.
17:01 lb not sure i can parse that right :)
17:03 nicomen like you said, perhaps going against its spirit is a good enough reason to not have a validator-wide filter applied
17:04 asarch joined #mojo
17:05 lb i think the entire topic thing hinges on state being reset when one is declared, otherwise it gets very hard to follow for complex stuff
17:06 lb sri: i have some reservations about not being able to filter inline, but I think I like it
17:08 lb pretty hard to come up with a good example for needing to do a check before a filter, though I remember drawing some up on a whiteboard two years ago :)
17:09 lb i do have so many ideas for filters for our app, though
17:11 lb mostly uc+lc
17:11 lb pretty_ipv6
17:11 lb (pretty_mac)
17:12 lb can filters possibly see earlier validated values?
17:13 lb canonical_phone_number
17:14 lb heck, "unwordify" for people who paste word-documents into wysiwyg-textareas ;)
17:34 sri filter after check is bad, we are not going to do it
17:34 sue joined #mojo
17:36 Grinnz_ lb: when people do that, i get the frontend to put a hack in their wysiwyg :P
17:53 lb frontend can never ensure insanity doesn't reach backend ;)
17:58 ajr_ joined #mojo
18:00 Grinnz_ no, but if it does still reach the backend, we can blame the user
18:01 lb the user is always to blame, unless they give us money in which case they're always right
18:02 lb it's complicated
18:03 dod joined #mojo
18:13 bowtie_ joined #mojo
18:19 bowtie_ joined #mojo
18:20 trone joined #mojo
18:23 sri joined #mojo
18:27 bowtie joined #mojo
18:38 sri lb: so, is that a -1 vote on validation filters?
18:53 meredith joined #mojo
19:01 lb sri: not at all
19:02 lb i'm just not entirely sure it's the best way, but I think any filters are better than none :)
19:05 trone joined #mojo
19:08 panshin joined #mojo
19:34 panshin joined #mojo
19:48 good_news_everyon joined #mojo
19:48 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vzR2n
19:48 good_news_everyon mojo/master 3471dd8 Sebastian Riedel: test both arguments
19:48 good_news_everyon left #mojo
19:48 sri lb: there have been no better proposals
19:48 ajr_ joined #mojo
19:49 sri actually, i think the only other proposal that would work was my $validation->filters('trim')->required('foo')->size(1, 23)
19:55 sri nobody gotten their stickers yet? i want to see pictures!
20:00 jberger mine says the 26th!
20:00 sri :o
20:01 good_news_everyon joined #mojo
20:01 good_news_everyon [mojo] kraih tagged v6.41 at 050e456: https://git.io/vzRro
20:01 good_news_everyon left #mojo
20:02 good_news_everyon joined #mojo
20:02 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vzRrp
20:02 good_news_everyon mojo/master f0cedc5 Sebastian Riedel: bump version
20:02 good_news_everyon left #mojo
20:04 lb sri: you might be right, but i think it's a matter of being least flawed :)
20:05 * lb can suggest other solutions, each more horrible in their own way
20:06 lb so i accept the wisdom of filtering before optional/require, whatever the syntax
20:06 lb clearly filters being declared before the topic they apply to is insane
20:06 lb $validation->filters('trim')->required('foo')->size(1, 23)->optional('bar'); # is bar filtered?
20:08 sri yes
20:08 sri it would apply until you call ->filters()
20:09 lb i would completely hate that
20:10 lb declaring a topic is starting over, or mojo-style validation is meaningless
20:10 lb imvho
20:11 PryMar56 joined #mojo
20:13 sri oh wow, i almost completely forgot about meteor https://www.discovermeteor.com/blog/the-state-of-meteor-part-1-what-went-wrong/
20:13 * lb no longer feels bad when he forgets about stuff that never mattered :)
20:33 absolut_todd joined #mojo
20:50 lluad joined #mojo
20:53 disputin joined #mojo
21:24 RichardPearse joined #mojo
21:33 disputin joined #mojo
21:41 sri heh, kimoto even forgot another case for parameters name=&name=foo :) http://blogs.perl.org/users/yuki_kimoto/2016/01/validation-logic-is-more-complex-than-you-expect.html
21:42 sri (both values fail validation in that case with mojo)
22:09 ZoffixWin joined #mojo
22:23 cpan_mojo Mojolicious-Plugin-ReCAPTCHAv2-0.4 by HJANSEN https://metacpan.org/release/HJANSEN/Mojolicious-Plugin-ReCAPTCHAv2-0.4
22:27 punter joined #mojo
22:34 disputin joined #mojo
23:57 genio joined #mojo

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