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

IRC log for #mojo, 2017-01-31

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

All times shown according to UTC.

Time Nick Message
00:25 kiwiroy joined #mojo
00:40 kiwiroy joined #mojo
00:44 firnsy joined #mojo
00:45 aborazmeh joined #mojo
00:54 marty joined #mojo
00:55 marty joined #mojo
01:07 marty joined #mojo
01:09 litwol jberger: imho too many :lite examples.
01:10 litwol me being imexperienced i find it challenging translating lite examples into full app.
01:12 litwol look at these documents: http://search.cpan.org/~akron/Mojolicious-Plugin-BlogSpam-0.09/lib/Mojolicious/Plugin/BlogSpam.pm
01:12 litwol side by side full vs lite syntax examples
01:14 litwol but otherwise mojo documentation is superb.
01:16 Grinnz The tutorial used to be the documentation for Mojolicious::Lite. I think it would be helpful to have a little more example of non-lite usage there but haven't really tried
01:22 marty joined #mojo
01:26 kiwiroy joined #mojo
01:34 jberger the problem with non-lite is that it typically requires several classes, often several files, and for no distinct advantage
01:35 jberger Mojolicious::Lite is a VERY thin layer
01:35 jberger https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Lite.pm 56 lines of code (with blank lines)
01:38 sawtooth joined #mojo
01:38 Grinnz right, but i mean say you have an example how to do something in Lite, which isn't a full app but just a line or two
01:38 Grinnz it might be appropriate to also have the full app example how to do that
01:38 Grinnz specifically for the difference in syntax
01:39 Grinnz it's obvious to me how to translate such things, but i think it's a difficulty when learning
01:50 kiwiroy joined #mojo
03:02 witch joined #mojo
03:40 noganex_ joined #mojo
03:56 sawtooth joined #mojo
04:10 kiwiroy joined #mojo
05:02 disputin joined #mojo
05:04 dboehmer joined #mojo
06:01 inokenty-w joined #mojo
06:03 witch joined #mojo
06:32 dod joined #mojo
06:36 eseyman joined #mojo
06:38 dod joined #mojo
07:01 dod joined #mojo
07:06 kiwiroy joined #mojo
07:21 Vandal joined #mojo
07:27 sdeseille joined #mojo
07:35 dod joined #mojo
07:38 sdeseille hello
07:48 AndrewIsh joined #mojo
07:55 mishanti1 joined #mojo
08:08 trone joined #mojo
08:23 sugar joined #mojo
08:50 Petru joined #mojo
08:54 rshadow joined #mojo
09:01 rshadow joined #mojo
09:17 dod joined #mojo
09:21 sugar joined #mojo
09:38 rshadow joined #mojo
09:40 bpmedley sdeseille : Morning
09:44 sdeseille o/
10:13 dod joined #mojo
10:16 sugar joined #mojo
10:48 sugar joined #mojo
10:59 msestak joined #mojo
11:07 tchaves joined #mojo
11:51 sugar joined #mojo
12:14 gregf_ joined #mojo
12:25 kes joined #mojo
12:40 sword_smith joined #mojo
12:59 kes joined #mojo
13:09 sugar joined #mojo
13:13 nic even some hints & tips for making the translation would help
13:14 nic Grinnz gave some goods hints a few days back (eg most of the body of a lite app is what goes in startup)
13:16 nic an example of what I found tricky was the naming of routes
13:16 nic once you have some working examples it starts to feel obvious, but I remember wasting a bit of time failing to spot the obvious
13:17 nic also... inside a Mojolicious, $self is the same as what you get from app() in a Lite
13:18 nic it's a long time since I read Upgrading, so maybe those problems are outdated
13:26 Ryoga joined #mojo
13:35 bpmedley http://mojolicious.org/perldoc/Mojolicious/Guides/Growing <-- What about this?  A lot of those concerns are addressed, right?
14:00 marty joined #mojo
14:02 Petru joined #mojo
14:03 marty joined #mojo
14:14 marty joined #mojo
14:22 gryphon joined #mojo
14:26 sugar joined #mojo
14:51 gregf_ joined #mojo
14:51 sugar joined #mojo
15:01 Pyritic joined #mojo
15:04 dikim joined #mojo
15:24 kwa batman: around? (Working on a PR for JSON::Validator and have a quickquestion.)
15:34 kwa batman: Basically, I'm looking at fixing the implementation of the default keyword. It seems the priority is wrong. If JSON::V honours the default at https://github.com/jhthorsen/json-validator/blob/master/t/openapi.t#L42-L46 then L65 wouldn't be missing the huntingSkill property, right? (I'm going to remove that test, so just checking.)
15:35 Lee kwa: might want to ask in #swagger
15:36 kwa Lee: Were those tests lifted from something swagger-y?
15:37 Lee dunno, but generally a lot more talk about OpenAPI/Swagger/JSON::Validator tends to happen in that channel
15:38 Lee i'm not sure your logic is correct though
15:38 kwa Lee: hmm, how so?
15:38 Lee AFAIK it's not the validator's job to honour the default (i may be wrong)
15:39 Lee because that would involve modifying the input struct?
15:39 kwa You could be right. But what's the point of default then?
15:40 Lee i would assume it's a documentation thing
15:40 kwa Don't think so - https://github.com/json-schema-org/JSON-Schema-Test-Suite/blob/master/tests/draft4/default.json
15:40 Lee i.e. "if you don't pass this then we will assume the default"
15:41 kwa I could be misinterpreting it.
15:42 kwa http://json-schema.org/latest/json-schema-validation.html#rfc.section.6.2 - This keyword can be used to supply a default JSON value associated with a particular schema. It is RECOMMENDED that a default value be valid against the associated schema.
15:43 kwa I wonder then if what is submitting the data should use this keyword to set a default value... I'll try #swagger
15:44 Lee given that fall under the "Metadata keywords" i'm not sure it's something for pure validation
15:44 Lee seems like one of the more hand wavy bits of the schema
15:46 kwa Lee: JSON::V is trying to set a default (but in the wrong place IMO) https://github.com/jhthorsen/json-validator/blob/master/lib/JSON/Validator.pm#L596-L598
15:47 Lee oh, that looks wrong
15:47 kwa But if it's more of a "you might want to set the data instance to this value if it doesn't exist/is null". That means you'd have to validate, get the pointer for the data, extract the default, update the data instance, then revalidate it.
15:48 Lee yeah
15:48 kwa If that's the case, I'd have to write a superset of JSON::Validator to do my bidding.
15:49 kwa Coz I want default to DWIM. :)
15:49 Lee i recently uploaded JSON::Schema::ToJSON to do much of the same thing, although it doesn't support the default keyword (yet)
15:49 kwa Lee: Ah, I read that this morning actually.
15:51 kwa Is quite a nice idea. What do you primarily use the generated dummy data for? Inserting into a DB or something?
15:51 Lee emulation
15:51 purl i guess emulation is Some IRC kid that said: <Emulation/#Perl> just to let u know.. i've been to possibly every single little perl webpage, or cgi webpage.. i have lots of them bookmarked
15:52 Lee see the linked talk in the blog post
15:53 kwa Will do. Brew and a watch.
15:56 disputin joined #mojo
16:24 Pyritic joined #mojo
16:36 kwa Lee: Makes sense. You've clearly funked with more than your fair share of APIs. :)
16:37 kwa The name JSON::Validator::ToJSON is a tad confusing, but I can't think of a better name, so...
16:46 sugar joined #mojo
16:46 kwa I suppose technically the data is called an "instance" so JSON::Validator::ToInstance, but that's even more confusing. *shrugs*
17:05 lluad joined #mojo
17:11 sugar joined #mojo
17:19 msestak joined #mojo
17:32 Pyritic joined #mojo
17:41 VVelox joined #mojo
17:45 dod joined #mojo
18:08 sh14 joined #mojo
18:28 Petru joined #mojo
18:44 Ryoga joined #mojo
18:44 Petru joined #mojo
18:50 Pyritic joined #mojo
18:56 gryphon joined #mojo
19:16 Petru joined #mojo
19:16 howitdo joined #mojo
19:19 dod joined #mojo
19:29 PryMar56 joined #mojo
19:34 sugar joined #mojo
19:39 Petru joined #mojo
19:50 blonewolfs joined #mojo
19:57 jberger I'm a little out of my depth on this question, can someone check me? https://www.reddit.com/r/perl/comments/5r8kwh/reading_post_form_data_without_first_slurping_it/dd5o9we/
19:58 Grinnz i was thinking about commenting on that question but... yeah
19:59 Grinnz that's not an easy thing
19:59 Grinnz the example you linked is probably the best option
20:00 Grinnz provided the JS or whatever can initiate the multipart upload... i dont really know how any of that works
20:00 Grinnz i guess the browser can do it?
20:01 Petru joined #mojo
20:04 pink_mist if I spot a typo in the docs, should I do a PR to fix, or should I just report it here? or should I just ignore it?
20:04 pink_mist I mean, a PR is a bit much for just a little typo
20:05 Grinnz for language or example typos, here is probably fine
20:06 pink_mist well alright, the link jberger gave in that reddit answer, http://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#Streaming-multipart-uploads ... it's missing a "the" between "some of" and "hardest"
20:15 good_news_everyon joined #mojo
20:15 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vDtxP
20:15 good_news_everyon mojo/master 515f363 Sebastian Riedel: fix pink_mist's typo
20:15 good_news_everyon left #mojo
20:17 pink_mist hah, thanks :P
20:17 sri not my best example app
20:17 sri especially the fact that the route doesn't have a closure to do something is kinda not great
20:18 sri i'd welcome patches if somone has an idea for how to make it more fun
20:21 * sri vaguely remembers having a more crazy example there
20:23 sugar joined #mojo
20:23 sri our test case is not great either https://github.com/kraih/mojo/blob/master/t/mojolicious/upload_stream_lite_app.t
20:25 sri guess ideally you'd want to pass data to the action
20:25 sri not even sure how i would recommend to do that
20:38 DavidSouza joined #mojo
20:52 blonewolfs joined #mojo
21:11 sugar joined #mojo
21:24 tchaves joined #mojo
21:38 tchaves joined #mojo
21:38 tchaves1 joined #mojo
21:53 marty_ joined #mojo
21:56 sugar joined #mojo
22:42 sugar joined #mojo
22:59 sugar hi all
23:00 sugar guys, i have an mojo app, not lite, i want to is it from script
23:00 sugar need to access the database
23:00 sugar *i want ot use it
23:00 sugar how can i do it?
23:01 sugar like a Test::Mojo does it
23:03 Grinnz Commands are a good way
23:03 Grinnz https://metacpan.org/pod/Mojolicious::Guides::Cookbook#Adding-commands-to-Mojolicious
23:04 Grinnz write your script as a command, then you have the application to call things on
23:07 sugar oh, thank you, nice way
23:07 sri please vote if you care about this https://github.com/kraih/mojo/pull/1046
23:09 pink_mist nice
23:09 pink_mist just voted +1
23:38 zach joined #mojo
23:38 zach would it be crazy to use websockets internally but rest externally?
23:41 sugar joined #mojo
23:50 jberger Internally?

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