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

IRC log for #mojo, 2015-07-06

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

All times shown according to UTC.

Time Nick Message
00:04 mib_yv2w4q joined #mojo
00:57 PryMar56 joined #mojo
02:05 Grinnz_ joined #mojo
02:20 noganex joined #mojo
02:56 hshong joined #mojo
03:36 Repaster joined #mojo
03:51 Grinnz joined #mojo
03:58 sri hahaha, now that's a well deserved hack... http://www.csoonline.com/article/2943968/data-breach/hacking-team-hacked-attackers-claim-400gb-in-dumped-data.html
04:43 melo1 joined #mojo
04:48 absolut_todd joined #mojo
05:14 absolut_todd joined #mojo
05:33 absolut_todd joined #mojo
05:36 absolut_todd joined #mojo
05:55 kaare joined #mojo
06:06 Lee joined #mojo
06:55 McA2 joined #mojo
07:01 dod joined #mojo
07:06 dod joined #mojo
07:12 Vandal joined #mojo
07:13 trone joined #mojo
07:17 AndrewIsh joined #mojo
07:25 ans joined #mojo
07:26 ashimema joined #mojo
07:39 marcusr sri :)
07:40 kyshtynbai joined #mojo
07:41 marcusr wonder how impossible it would be to get mojo running under rperl
07:42 marcusr otoh I hate the font on their faq :p
07:50 odc joined #mojo
08:07 marcusr k, rperl didn't understand use Mojo::Base 'Mojolicious'; # gives up
08:08 marcusr bpmedley: (tests passed here)
08:13 berov joined #mojo
08:16 dod joined #mojo
08:35 mattastrophe joined #mojo
08:39 stephen joined #mojo
08:49 mtj ^ sri, cheers for that link, it made my day :0)
09:13 coolo joined #mojo
09:30 bpmedley marcusr: May I ask the OS / Perl version you're using?
09:35 coolo joined #mojo
09:46 dod joined #mojo
09:58 jontaylor joined #mojo
10:04 marcusr bpmedley: 5.20.1 on Fedora 21
10:05 marcusr (work machine)
10:05 bpmedley Hrmm.. I must be lagging behind.  My CentOS 6 VMs don't have a recent g++ (I think) and OS X has some odd error.
10:43 jontaylor With everyone singing praises to how good postgres is, i’ve decided to give it a go
10:43 jontaylor but its harder than mysql right from the start
10:44 jontaylor so I download and install it, create a new user with the rights to create dbs
10:44 preaction eh, the docs told me to run a couple admin commands and then i had a db i could use without auth
10:45 jontaylor look up the man page for psql, to see how to specify user, find out its -U
10:45 jontaylor but if I do psql -Unewuser
10:45 jontaylor it tells me there is no DB called newuser
10:45 jontaylor and errors out
10:46 jontaylor even though I never asked it to look for a DB called that, I just specified which user I wanted to connect as
10:48 marcusr jontaylor: create it? (createdb)
10:48 marcusr or create another database and specify it =]
10:49 jontaylor I kind of want my apps migrations scripts to create the DB itself using SQL, since i’ve given it a user with the permission to create its own databases
10:49 jontaylor can you not login to postgres without specifying a DB?
10:50 dvinciguerra joined #mojo
10:51 jontaylor more reading of the man page tells me it will just takes its best guess at what you mean
10:51 lb specify template1 and switch?
10:51 jontaylor so if you do -Uusername
10:51 jontaylor it’ll guess you mean thats the DB you want
10:52 jontaylor lb: doing that works
11:01 jontaylor Postgres looks like its got all the power in the world, but the tooling looks nuts
11:01 jontaylor like it puts binaries on my system called createuser
11:01 jontaylor as if there are no other programs on here that might want to create a user
11:02 preaction no worse than postfix
11:02 pink_mist they're usually in a specific path that is separate from your normal /usr/bin etc
11:03 pink_mist so you'd only have that if you specifically set your PATH properly for postgresql
11:03 preaction right, but prefix is prefix
11:07 eitz joined #mojo
11:08 jontaylor this will all be stuff thats a total non-issue once you’ve learned it
11:08 jontaylor but its counter-intuitive for a newbie like me
11:08 jontaylor its non-obvious that you always have to connect to a particular DB
11:09 jontaylor whereas in mysql you can just connect, and if you then try and run something it tells you that there is no DB selected
11:09 jontaylor but you can still create database blah; etc
11:10 pink_mist if you followed instructions you would have created a db for your username when you created your user, so it'd be a nonissue; from there you can create some other db and switch to it if you want
11:10 jontaylor i did follow the instructions, and I have that DB, but I then created an extra user
11:10 jontaylor and at that point I got tripped up
11:11 bobkare jontaylor: fwiw I tend to separate db creation and schema migrations, otherwise it's easy to end up having to do weird things to make several databases with the same schema on the same machine
11:11 jontaylor bobkare: thanks, i’ll try and stick with that pattern too, i’ll do the create manually on the command line
11:12 bobkare also installation instructions that starts with "just give me all the rights in the world to the db server" makes me a bit more nervous than something that can easily be isolated in a database
11:37 bpmedley jontaylor: I can't tell; did you get your postgres install working to your satisfaction?
11:38 jontaylor bpmedley: yep :), I’ve just gotta learn all the postgresisms, and things that initially seem counterintuitive
11:38 jontaylor it’ll just take me some time
11:38 bpmedley Did you have to edit pg_hba.conf?
11:40 jontaylor bpmedley: nope, but homebrew might have modified it on my behalf
11:47 Mikey its counterintuitive compared to mysql
11:47 Mikey which has its own warts
11:49 bpmedley Are there any issues with me connecting Mojo::IRC to irc.perl.org while developing an app?
11:50 pink_mist probably better to ask in a network-related channel 0_o
11:50 btyler beware accidental while (1) { $irc->write(<stuff>) }
11:51 bpmedley pink_mist: How do I find those types of channels?
11:51 pink_mist I'd start with #magnet see if that exists, if not, #help
11:51 bpmedley Thanks
11:57 ans joined #mojo
12:03 neilhwatson joined #mojo
12:06 dod joined #mojo
12:14 Caldrin joined #mojo
12:14 Caldrin Hi!
12:19 Caldrin Is there a way to find out which template a function will be looking for? I have some functions that call $self->render. Others fall of the end and hope that Mojolicious will pick the right template from the DATA section. This used to be Mojolicious::Lite based and it worked. Now I use $route_handler->any($method)->to(%params) to define routing. Even though the correct method for each URL is found and puts the expected values on the stash, it look
12:21 Caldrin I am unsure whether this is because the right template is no longer picked or because Mojolicious does not realise that it's now time to render.
12:21 Caldrin Any ideas?
12:22 bpmedley Caldrin: http://mojolicio.us/perldoc/Mojolicious/Renderer#template_for
12:25 Caldrin bpmedley: Thanks, I'll try whether that helps
12:27 zypper joined #mojo
12:44 absolut_todd joined #mojo
12:46 arthas joined #mojo
12:46 Caldrin It does, at least I now know that the template name has changed (somehow)
12:46 Caldrin So thanks a lot
13:07 ajr_ joined #mojo
13:14 genio joined #mojo
13:14 absolut_todd joined #mojo
13:31 wingfold joined #mojo
13:34 gryphon joined #mojo
13:40 dod joined #mojo
13:44 zivester joined #mojo
13:45 jabberwok joined #mojo
13:48 jabberwok To be consistent with the use of $app in documentation examples, should Guides::Growing, under "Simplified Application Class" replace »sub startup {  my $self = shift;« with  …»{ my $app = shift« ?
13:48 zypper joined #mojo
13:50 Caldrin One more issue I need help with: I added my __PACKAGE__ to $renderer->classed like described here: http://mojolicio.us/perldoc/Mojolicious/Renderer
13:50 Caldrin The __DATA__ section of this class has a @@foo.html.ep
13:50 d0as8 joined #mojo
13:50 Caldrin Still I get foo.html.ep not found
13:51 Caldrin Can anyone please suggest where to look for my error?
13:56 frederico joined #mojo
14:00 absolut_todd joined #mojo
14:09 Caldrin In http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering every example with templates in __DATA__ uses Mojolicious::Lite. Is putting templates into __DATA__ a Lite feature?
14:13 CandyAngel Caldrin: I think Lite just adds extra helpers by default and stuff
14:13 Craftsmanship joined #mojo
14:13 CandyAngel Are you 'use'ing the module the template is in?
14:14 jabberwok Caldrin: yes, the __DATA__ templates are a Lite feature.  It's possible, of course, to use them with 'Full' as well, somehow, but until now that feature hasn't been documented separately.
14:14 absolut_todd joined #mojo
14:14 Caldrin CandyAngel: No, require
14:15 theo /win 1
14:16 CandyAngel Hm, okies. Just there is a note that the clases need to have already been loaded during app startup to be detected
14:16 CandyAngel Thought that might be tripping you up
14:18 Craftsmanship Perl 5.20.0 (versions as old as 5.10.1 can be used too, but may require additional CPAN modules to be installed) ... will cpanm do that by magic?
14:19 mst yes, cpanm will install dependencies
14:20 mst at this stage, mojo is mostly-dependency-free by accident due to having already built its own versions of things that would normally be dependencies rather than because it's a major problem
14:20 mst this is perl. don't be scared of cpan :)
14:20 Craftsmanship I'm not scared of cpan
14:21 mst so trust to cpanm to install dependencies
14:21 Onigiri I dislike combining cpan with system packages
14:21 mst try and avoid imagining extra problems that don't exist - programming is hard enough when you only have to deal with the real ones.
14:21 Craftsmanship $ curl -L https://cpanmin.us | perl - -M https://cpan.metacpan.org -n Mojolicious
14:21 mst Onigiri: that's why local::lib exists
14:21 Craftsmanship this complains about not finding an index in my homeidr ...
14:21 Craftsmanship -M ... a url... seems odd
14:21 mst Onigiri: sudo cpan == evil
14:21 Craftsmanship or is that -M to cpanm...
14:21 mst Craftsmanship: that should be -M to cpanm, which selects a mirror
14:22 Craftsmanship ah
14:22 mst I just ran exactly that command at my shell, and it worked
14:23 Craftsmanship I cpanm --sudo'ed something yesterday that likely ruined the permissions in that dir
14:23 Craftsmanship or sudo cpanm ... whichever way 'round ...
14:23 mst oh jeez, right, wipe ~/.cpanm then
14:23 mst if you ran sudo without setting home dir you'll've buggered up the permissions in your home, yes
14:23 Craftsmanship nah, it's happy now
14:24 mst but basically if you're doing 'sudo cpanm' or 'cpanm --sudo' you are Doing It Wrong
14:24 mst local::lib is a much better idea
14:24 Craftsmanship the /tool/ said it wanted it that way
14:25 mst what?
14:25 Craftsmanship the output of cpanm, suggests 3 things, the first being that.
14:25 mst and one of the others is local::lib which is the right answer
14:27 y1mmm joined #mojo
14:27 Craftsmanship yeah - so i have mojo installed now, so i'm going to go play with that instead
14:27 absolut_todd joined #mojo
14:27 Craftsmanship thanks for the pointers though
14:27 genio learn about local::lib first
14:28 jabberwok or Perlbrew
14:28 purl well, Perlbrew is just so nice.
14:28 Craftsmanship or i could stay here, and justiy running sudo on my own machine
14:28 Onigiri I don't have sudo installed, hah
14:29 jabberwok yes, except modifying the system Perl could well bork, oh, let's say Cups or the system updater and then you have a mess.
14:30 Craftsmanship jabberwok: looks like I got lucky this time
14:30 Craftsmanship owing to not having those things.
14:31 Craftsmanship so, experimental signatures, is that a thing I should be grabbing from cpan then?
14:31 jabberwok http://perlbrew.pl/  -- use it
14:32 Craftsmanship ah - so the "get the bits from cpan" earlier wasn't the whole truth
14:32 genio or even Perl::Build
14:32 Craftsmanship maybe it's just this example
14:32 mst signatures are in perl 5.20+
14:32 mst they are a perl feature
14:32 mst the 'get bits from cpan' was the whole truth about getting Mojolicious
14:33 jabberwok build your own Perl 5.22 from scratch and install everything from the ground up.  Then you are guaranteed of the latest, and a happy install, -- you might have to install various development modules with apt-get or yum depending on your flavor of linux
14:33 Craftsmanship it's a macintosh.
14:34 sri there's a reason we recommend perlbrew on the frontpage
14:34 PryMar56 joined #mojo
14:35 Craftsmanship it's a tad more than a recommendation
14:35 absolut_todd joined #mojo
14:36 sri no, it's exactly that, a recommendation
14:37 mst my test install was into a local::lib on a 5.14 system perl
14:37 mst works fine
14:37 Craftsmanship I managed to get an "I ♥ Mojolicious!", so there's that.
14:37 Craftsmanship mst: the exmaple (also on the front page) has a use 5.20 ... so you've gotta know that won't
14:37 mst I know it's frustrating getting your head around installing things when you've never done it before
14:37 Craftsmanship for the less cluey users who are copy/pasting, that might be discouraging
14:37 mst well, yes, the 'use 5.20;' is a clue it needs 5.20
14:37 Craftsmanship indeed it is
14:38 Craftsmanship as is the bit where it says "your perl is too old, bro" when you run it
14:38 mst basically, providing a second version of the examples would rapidly become cluttered
14:38 mst and showing the prettiest examples possible helps people who do take the perlbrew route get as much cool stuff as possible
14:38 mst it's all trade-offs
14:39 Craftsmanship so the "you might get away with an older perl" only extends to the hello world
14:40 Craftsmanship fair enough.
14:40 Craftsmanship so without the signature, i get $c from @_?
14:40 sri the lack of further instructions below the second example could also be interpreted as a hint for it not being meant to be copypasta'd
14:41 Craftsmanship it's on a web page, it's supposed to be copy/pasta'ed
14:41 sri follow the link below the second example
14:41 jabberwok point to ponder: Functions that use experimental signatures tend to be shiftless.
14:42 mst Craftsmanship: no, it extends to all of *Mojo's* features
14:42 Craftsmanship ah
14:42 Craftsmanship so i'm getting a new perl then
14:42 mst or you could just write code for the older perl
14:42 mst and Mojo will continue to work fine
14:43 Craftsmanship what, what's the "it" there then?
14:43 mst the "you might get away with an older perl" extends to *mojo* features
14:43 mst since they do, indeed, work fine on older perls
14:43 gryphon_ joined #mojo
14:44 Craftsmanship get '/' => sub {   my $c = shift; ...
14:44 mst I'd write 'my ($c) = @_;' but that's just habit
14:45 Craftsmanship I guess it's too much to ask for a cute comment about "folks with older perls hitting a snag when pasta'ing this example"
14:45 sri 5.22 almost made "my ($c) = @_;" with the SIGNATURE_OP optimization :/
14:45 sri +the standard
14:46 Craftsmanship will I find $message in @_
14:46 Craftsmanship that is, where do i find the docs of the stuff passed to these callbacks
14:47 sri Craftsmanship: it's not exactly a common complaint, so i don't see the need for a comment yet
14:47 mst and if you comment every complaint every user had ever you end up with unusuable documentation via death by a thousand cuts
14:47 mst as I said, trade-offs
14:49 sri can someone understand this? https://github.com/kraih/mojo/issues/816
14:50 sri i'm certain it's working as intended, since *a lot* of spec checking went into the to_abs logic... but i can't really understand the issue
14:51 genio I read it as he's confused about the purpose of ->base()  but it's kind of hard to follow
15:08 disputin joined #mojo
16:00 gryphon joined #mojo
16:04 good_news_everyon joined #mojo
16:04 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vqCoV
16:04 good_news_everyon mojo/master d1be31a Sebastian Riedel: mention that the secret needs to be encoded (closes #817)
16:04 good_news_everyon left #mojo
16:20 davido__ joined #mojo
16:49 batman sri: https://github.com/kraih/mojo/commit/d1be31ae712f4a90c6cb8364f98b8a1b4c6bbd03#commitcomment-12020803 <--- bytes cannot be "wide"...?
16:50 batman just so i understand it as well.
16:50 sri https://github.com/kraih/mojo/issues/818
16:51 sri batman: how would binary data contain wide characters?
16:51 batman sri: right. because it's just bytes...?
16:51 batman this makes my head spin each time :(
16:52 batman yeah. i think it get it from the documentation here: https://metacpan.org/pod/Mojo::Util#encode
16:56 sri it's really not hard
16:57 batman i guess it's not... it's just hard for me to remember what is what :/
16:57 absolut_todd joined #mojo
16:57 sri (this is simplified) but basically your scalar is either a character string in perl internal format (which you shouldn't care about), or raw binary data
16:58 sri all you need to know is which format your data is in at which time, and then convert back and forth with encode/decode
16:58 batman right.
16:58 sri bytes or chars, that's all you really need to know
16:58 batman :)
17:10 sri i guess if you want to think more abstract about it... you can imagine it as raw ones and zeroes (1010101010101010) vs a list of unicode code points (U+1F37B, U+1F42F, U+1F60E)
17:13 good_news_everyon joined #mojo
17:13 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vqWI1
17:13 good_news_everyon mojo/master 6a4f834 Sebastian Riedel: use the same format for all code names
17:13 good_news_everyon left #mojo
17:15 absolut_todd joined #mojo
17:17 sri jberger: this might be of interest to you https://github.com/kraih/mojo/issues/818#issuecomment-118928636
17:17 sri or anyone who cares about validation
17:18 sri as usual, i'll leave the issue open for a few days, and close it once it goes stale
17:18 sri would be nice to have those questions answered once and for all though
17:19 * sri pokes tempire, jberger, marcusr, batman, crab and Grinnz
17:20 mst sri: jberger said he was on holiday for a week
17:22 absolut_todd joined #mojo
17:23 batman sri: i don't care about 818, since i'm using swagger.
17:23 batman sorry :(
17:25 * Grinnz still hasn't used validation
17:26 Kogurr joined #mojo
17:26 absolut_todd joined #mojo
17:30 lluad joined #mojo
17:32 absolut_todd joined #mojo
17:37 absolut_todd joined #mojo
17:52 absolut_todd joined #mojo
17:52 Caldrin http://perlpunks.de/paste/show/559ac044.540b.23b
17:52 Caldrin Can anyone please advise what I do wrong in the code above?
17:52 Caldrin I get Template "affe.html.ep" not found
17:55 dod joined #mojo
18:02 absolut_todd joined #mojo
18:14 batman Caldrin: package Foo::Bar::Plugin::Baz != package Foo::Bar::Controller::Baz
18:16 sri lots of things wrong actually
18:19 absolut_todd joined #mojo
18:20 Caldrin sri: What else?
18:22 Caldrin batman: where does Foo::Bar::Controller::Baz come from?
18:22 Caldrin Does Mojolicious rename the package?
18:23 absolut_todd joined #mojo
18:24 trone joined #mojo
18:25 pink_mist he's saying /you/ should rename the package. because it has the wrong name to be used like you're using it.
18:27 absolut_todd joined #mojo
18:30 Caldrin Foo::Bar::Controller::Baz doesn't find the template either.
18:30 batman Caldrin: where did you learn that your controller classes should be named ::Plugin:: ?
18:31 Caldrin nowhere. I did not learn, that names are relevant at all.
18:32 batman Caldrin: then you should read this http://mojolicio.us/perldoc/Mojolicious/Guides/Tutorial
18:32 Caldrin We use Mojolicous to implement a REST API. Each url is handles by a plugin. So it seems to makes sense to call it plugin
18:33 jontaylor joined #mojo
18:34 good_news_everyon joined #mojo
18:34 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vqW12
18:34 good_news_everyon mojo/master d3da566 Sebastian Riedel: mention that classes also need to be added during application startup
18:34 good_news_everyon left #mojo
18:34 sri ^^
18:35 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Routing#Special-stash-values
18:38 absolut_todd joined #mojo
18:39 Grinnz Caldrin, urls are handled by controllers. plugins add functionality globally to the app, or perhaps add new routes; they do not handle specific requests, generally
18:39 Caldrin sri: Thanks. The patch explains whats missing
18:39 Grinnz of course plugins can really do whatever you want... but thats how it usually works
18:40 Caldrin I see.
18:47 Caldrin Well, thanks a lot to everyone who helped.
18:53 dod joined #mojo
19:03 jontaylor joined #mojo
19:10 cpan_mojo Swagger2-0.36 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Swagger2-0.36
19:10 batman berov: ^^ add blog example
19:11 batman started off as copy/paste from mojo-pg's blog example (thanks sri)
19:11 cpan_mojo Mojo-Redis2-0.19 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojo-Redis2-0.19
19:11 berov batman: I ma not there yet
19:12 batman berov: what do you mean?
19:12 batman i meant: i've added a blog example :)
19:12 batman not that you should do it, hehe
19:12 batman https://metacpan.org/pod/release/JHTHORSEN/Swagger2-0.36/lib/Mojolicious/Plugin/Swagger2.pm#DESCRIPTION <-- check it out
19:12 berov BTW I found that if I do not inatall YAML but YAML::XS there a lot of error when running tests
19:12 berov batman: Ah, ok , great, thanks
19:13 batman berov: yeah. that's because YAML.pm sucks :(
19:14 absolut_todd joined #mojo
19:14 batman i re-ordered the preferred yaml modules: https://github.com/jhthorsen/swagger2/commit/ff5d3fa0fd43a3ac0ebee1d4a25192fb169a4dba
19:14 berov batman: I mean I had to install YAML.
19:14 batman berov: please tell me what kind of errors you saw
19:14 berov I had YAML::XS and there were a lot of errors while running tests
19:15 berov for example instead of 200 ok  i had 500 or 400
19:15 berov but I have to remove YAML to reproduce it
19:16 berov let me try
19:16 batman that's very weird.
19:16 batman berov: https://ssl.thorsen.pm/paste/9f654c83e804
19:17 berov ok let me do the same and will paste there
19:17 batman thanks
19:17 batman i just did this: cpanm --uninstall YAML
19:24 berov batman: either the problem reveals only if there was not YAML at all installed or I did somethning wrong
19:24 berov very similar output to yours now https://ssl.thorsen.pm/paste/bd60f7490745
19:25 batman berov: please let me know if you can reproduce
19:25 batman s/can//
19:25 berov sure
19:26 batman also, let me know if you have feedback regarding the blog example
19:27 batman berov: looks fine here as well :/ https://travis-ci.org/jhthorsen/swagger2/builds/69780910
19:28 berov yes I even did my own tests there
19:29 batman :)
19:37 berov batman: something else:
19:37 berov what I am doing  wrong here https://ssl.thorsen.pm/paste/06655cee37cb and the petstore.yaml is from the distro
19:37 berov oh let me update Swagger2 :(
19:38 batman that's very weird... does "curl http://json-schema.org/draft-04/schema" work?
19:40 batman sounds like you don't have internet
19:40 batman but...i am chatting with you :)
19:40 batman also, i thought the json spec was bundled with the distro
19:43 berov let me see
19:46 berov no https://ssl.thorsen.pm/paste/a244e58c54ff
19:47 kyshtynbai joined #mojo
19:48 berov batman: and firefox downloads the file
19:48 batman y u no internet?
19:51 berov I have
19:51 berov just updated the paste https://ssl.thorsen.pm/paste/a9c8cd06082e but same result
19:52 berov seems like when the api specification file is not valid this happens  and when I try with the petstore.yaml from the distro it saya that the file is valid
19:53 batman that's because i've bundled a cached version of the spec: https://github.com/jhthorsen/swagger2/tree/master/t/data/cache
19:54 batman i should probably bundle draft-04...
19:54 berov I updated Swagger2 using cpanm :) obviously via internet :)
19:55 batman but why didn't curl work? sounds like you're behind a proxy
19:55 berov not sure what is wrong exactly. hmmm dont know :)
19:55 jontaylor joined #mojo
19:55 berov how to check
19:55 berov :)
19:56 batman env|grep -i proxy
19:57 berov batman: no out put from grep and pingin json-schema.org works
19:57 batman then i don't know. but i will make a new release soon... give me a sec
19:58 Phil21 hmm.. is there a "correct" way to do DBI w/ mojo?  e.g. right now I start a database connection on init, and it seems once that times out I need to re-start app
19:58 Phil21 (or write db reconnect code)
19:58 Phil21 started to write that code and realized there may be a better way
19:58 berov no worries batman: If I put the downloaded schema will it work now?
19:59 batman put where...?
19:59 * sri is not sure he likes the dismissive attitude of batman regarding validation in mojolicious
20:00 batman sri: just trying to explain why i won't engage in the discussion
20:01 sri but you are
20:01 sri actively
20:01 batman do you want me to delete the comment?
20:02 berov batman: the chemadraft is the same as your shema draft in t/data/cache
20:02 batman i tried not to be passive.
20:02 batman berov: yes. that's why the tests pass.
20:02 sri i'm trying really hard to get people to talk about validation, since multiple topics keep coming up
20:02 berov then ok Will wayt for the release
20:03 sri and you just throw in a "i use Swagger2 for this"
20:03 sri and here it's all "i don't care, use Swagger2"
20:03 jontaylor joined #mojo
20:03 sri if you don't want to discuss it, just shut up!
20:04 batman sri: just deleted the comment.
20:04 * batman backs off
20:04 mst further back. no, a bit further. a little fur-wait no watch out for that cli-bugger.
20:04 mst CLEANUP ON AISLE THREE
20:04 sri what bugs me is that your opinion had major impact on previously deferred validation proposals
20:05 sri (the upload stuff)
20:05 sri you were fightinh tooth and nail to keep it "generic"
20:06 sri s/h/g/
20:07 batman sri: sorry. i don't know what to do with your feedback.
20:07 ozzzo joined #mojo
20:08 sri well, if you tried to make me hate the word Swagger2, that was a success :)
20:08 ozzzo I'm trying to use WWW::Crawler::Mojo and am having trouble getting started
20:08 ozzzo https://metacpan.org/pod/WWW::Crawler::Mojo
20:08 sri but i think the bottom line here might be that solving the problem in the community failed, and validation needs more dictating
20:09 genio heh.  you should hate the word "swagger" regardless of swagger2 :)
20:09 ozzzo It looks like I need to populate $context but it's not obvious what should go there
20:09 batman sri: yeah, not sure how to read that sentence either, because of the smiley at the end... :(
20:10 sri batman: i'm annoyed with how the discussion went, not angry, so i can still smile about the silliness of it all
20:11 sri validation in mojolicious core needs direction
20:11 ozzzo is this the right channel for WWW::Crawler::Mojo help?
20:13 batman sri: i stand by my opinion on keeping validation generic.
20:14 batman sri: i also think it's very sad that it seems like it's only me and you in the core team that use validation.
20:14 batman i would not be sad at all if my opinion was voted down.
20:15 batman i really don't get how *the rest* validation input... Mojolicious::Validation is super smooth.
20:16 batman sri: is that ok that i stand by my opinion..?
20:16 batman *is it
20:17 sri batman: i hope you don't mind if i'm going to be a little more dismissive of your opinion in this matter, since you're not backing it up with actual arguments
20:18 sri you know, like how keeping it generic is good, or what we gain from it in the future, or where it should lead
20:18 sri so far we have only lost
20:18 sri like upload validation
20:19 sri if anyone here wants to participate in the validation discussion, please throw around some arguments!
20:19 neilhwatson joined #mojo
20:21 sri honestly, at this point i tend towards specialization, with upload validation and possibly other mojo specific stuff we might need in the future
20:22 sri i'll give it some time, in case people want to chime in, but i'm ready to dictate
20:23 batman sri: i think it's sad that i can't agree on your argument :(
20:25 sri validation in hapi.js looks kinda cool http://hapijs.com/tutorials/validation
20:25 sri of course you can argue about it being configuration centric
20:26 sri but Joi.number().integer().min(1).max(100).default(10) is a fun way to spec a reusable validation
20:50 * sri pokes tempire, jberger, marcusr, crab and Grinnz
20:52 cpan_mojo Mojo-Snoo-0.13 by CURTIS https://metacpan.org/release/CURTIS/Mojo-Snoo-0.13
20:52 mst DEATH BY MOJO::SNOO
20:54 batman sri: could we add $v->num($min, $max) or something like $v->between($min, $max) ?
20:54 batman if so... would it make sense to support ->num(undef, $max) ?
20:55 batman the reason why i don't like it is that is $min "<=" or just "<" ? :/
20:55 Grinnz generally $min implies <=, i think
20:56 Grinnz see SQL BETWEEN operator
20:57 batman also, default() would be cool. i supposed default() could set $topic..?
20:57 mst $v->number->at_least($min)
20:57 mst $v->number->more_than($not_inclusive_min)
20:58 Grinnz that could be a way to differentiate yea
20:59 sri ok, i might have derailed that a little with the link
20:59 sri the real question was if mojolicious validation should be generic or specialized
21:00 sri and how data strucutre or upload validation fit into it all
21:00 mst there's a case for forms that require both data structure and upload validation
21:00 mst consider e.g. a thing with an upload -and- a one-many rel that you do via subforms
21:01 sri data strucutre validation would be more oriented towards json input i imagine
21:01 mst right. but I'm saying I could see uses for it for forms too
21:01 absolut_todd joined #mojo
21:02 sri dunno, data strucutres and upload validation seem more like separate directions to me
21:03 sri data strucutres for generic validation, and uploads for more form oriented validation
21:03 sri haha, at least my typos are consistent
21:03 btyler any ideas worth stealing from OO type validation/constraint systems? e.g. https://metacpan.org/pod/Moose::Util::TypeConstraints or perl6 take on same
21:03 mst right, but at least handling 'many.0.field', 'many.1.field' type stuff might be really neat
21:03 mst btyler: Types::Standard is the one to look at theft from
21:03 mst M::U::TC is two generations back
21:04 sri btyler: how do any of those fit in here?
21:04 btyler cool, thanks. metacpan only knows my search terms
21:04 sri mst: yea, considered that, even made a proposal once, but it didn't pass the vote
21:05 sri thinking back, i am really disappointed with how those votes went
21:05 btyler sri: I was looking at the laravel form validation stuff, and it struck me as a similar-but-crappier version of the sort of the above sorts of type constraints
21:05 btyler let me say "sort" a few more times
21:05 sri btyler: we already have a validation system
21:05 btyler ok, then I misunderstood the question, as ever, my bad
21:06 sri we are not looking for a new one, just the direction we want to move into
21:06 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Form-validation
21:07 btyler right, know about it, but failed to understand the scope of this discussion. sorry, I do this almost every time I try to chime into a design discussion here
21:07 btyler apologies for derailing
21:14 absolut_todd joined #mojo
21:16 sri honestly, i don't see data structure validation fit in, so i guess that also makes me tend towards specialization with uploads
21:17 sri what mst said, the foo.0.bar stuff already works
21:17 sri you just have to filter out the strucutres yourself
21:19 sri handling the structures during validation is very complicated
21:24 absolut_todd joined #mojo
21:29 cpan_mojo Swagger2-0.37 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Swagger2-0.37
21:30 batman berov: let me know if 0.37 works/doesn't work for you. (i'll be back tomorrow)
21:31 ajr_ joined #mojo
21:31 berov batman: thanks I just used SWAGGER2_CACHE_DIR with the md5 as file name as I found in Swagger2 :), will try 0.37 now
21:32 batman cool :)
21:32 batman btw: the md5 has changed.
21:33 berov ah ok
21:38 batman g'night
21:42 disputin joined #mojo
21:49 berov batman: please ignore my cpan-report about bodytest.t I had DEBUG switched on
21:54 absolut_todd joined #mojo
22:01 disputin joined #mojo
22:50 absolut_todd joined #mojo
22:55 bpmedley Phil21: Did you get your question answered?
22:57 bpmedley ozzzo: Do you have the beginnings of a sample script?
23:01 bpmedley Would specialized validation allow for application business logic tests and filters?
23:07 Phil21 bpmedley: not yet, no
23:07 Phil21 did some googling and mostly saw code snippets of what I'm already doing :)
23:08 bpmedley Phil21: Did you say you were using Postgres?
23:08 Phil21 seems like something people have re-implemented 1000x so figured there may be a "mojo way"
23:08 Phil21 bpmedley: I'm actually using MySQL for this one, but I'd imagine any DBI call would have the same issue
23:08 Phil21 sorry, brain melting a bit - any database supported by DBI, that is
23:09 bpmedley Phil21: There is Mojo::mysql and you can roll your own with DBIx::Connector.  I can help with DBIx::Connector; however, it will block, I believe.
23:09 Phil21 if the answer is just "test your database connection and re-connect if it's gone" that's fine
23:09 Phil21 ok, cool I'll take a look
23:09 Phil21 how the @#$@#$ did I miss mojo::mysql
23:10 bpmedley There's so much Mojo, that it can be overwhelming.  <-- This is a good thing.. :)
23:10 Phil21 hehe, yeah
23:10 Phil21 I'm really enjoying it so far, but I also haven't written code in years so it's all a lot of getting up to speed again
23:11 bpmedley It's good times for Perl
23:11 Phil21 indeed
23:11 Phil21 first "framework" that hasn't immediately pissed me off
23:11 Phil21 and has largely made me go "wow" whenever I find a new/better way to do something
23:11 Phil21 co-workers are getting sick of me preaching about it :)
23:12 Phil21 like even the discussion above re: validation
23:12 Phil21 opened new doors
23:27 * tempire has been planning on using swagger for validation
23:28 * tempire is ok with dictation
23:31 ajr_ joined #mojo
23:32 ajr_ joined #mojo
23:32 ajr_ joined #mojo
23:32 hesco joined #mojo
23:32 ajr_ joined #mojo
23:33 tempire I'm not so concerned about upload validation. Seems like being able to validate json would be more important.
23:34 tempire But it's so easy to construct using pointers that I'm not all that concerned about it.
23:37 tempire I don't have any strong opinion on the matter, which is why I'm ok with dictation.
23:40 frederico joined #mojo
23:43 neilhwatson joined #mojo
23:55 sri the thing about json validation is that there are zero proposals for it
23:55 sri nobody ever proposed anything
23:57 lluad json validation as in JSON::Schema or something else?
23:59 jontaylor joined #mojo

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