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

IRC log for #mojo, 2017-12-12

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

All times shown according to UTC.

Time Nick Message
00:25 marty_ joined #mojo
00:37 Leffe joined #mojo
00:54 Leffe joined #mojo
01:01 Leffe joined #mojo
01:46 Leffe joined #mojo
02:08 exp-innit joined #mojo
02:23 Zx3_ joined #mojo
02:42 jberger sri: why did you make it so that -strict was required when importing Mojo::Base?
02:55 jberger symmertry?
02:57 ilbot2 joined #mojo
02:57 Topic for #mojo is now 🍩 nom nom | http://mojolicious.org | http://irclog.mojolicious.org | http://code-of-conduct.mojolicious.org
03:37 jamesaxl joined #mojo
03:47 jamesaxl joined #mojo
04:55 jberger anyone available want to proofread/comment on my next post?
04:55 jberger it kinda changed topics as I went and I don't feel quite as comfortable as I usually do about it
05:21 jberger https://twitter.com/joelaberger/status/940451552317276160
05:21 jberger posted
05:21 jberger also, oh my gods I'm only halfway
05:30 aborazmeh joined #mojo
05:39 Leffe joined #mojo
05:41 mohawk jberger, "streamlined with lots of extra goodies" - ;-)
05:42 jberger yeah, well, you know
05:43 jberger hey it's late and I'm writing a lot
05:43 mohawk i would PR this but maybe not for just one letter: "briegly"
05:43 mohawk i know very well how much effort goes into writing these things
05:43 mohawk took me 2-3 hours to get not finished yet :-)
05:45 jberger I started at 7ish, its almost midnight
05:45 jberger that's probably close to par for me
05:45 jberger its been a thing :-P
05:59 mohawk perl salutes your sacrifice, son
06:04 inokenty-w joined #mojo
06:06 Leffe joined #mojo
06:27 mohawk sri, this report http://www.cpantesters.org/cpan/report/fbc9493a-dead-11e7-b4f0-d5eb3f9123c3 (with Mojolicious 7.58) shows "Can't locate object method "wait" via package "Mojo::Promise" - any ideas?"
06:37 dod joined #mojo
06:58 Seth joined #mojo
07:03 dod joined #mojo
07:11 karjala_ joined #mojo
07:12 dod joined #mojo
07:14 Vandal joined #mojo
07:20 mib_9kbal4 joined #mojo
07:20 jkp joined #mojo
07:31 jkp joined #mojo
07:49 batman sri: i could never figure out a good way to calculate the time diff without javascript, which means that if i rely on javascript for that, then i can just do the time rendering on client side anyways.
07:50 batman either way... my very small set of user feedback told me that they didn't like it. they want to actually see the time.
07:54 McA joined #mojo
07:55 kaare joined #mojo
07:55 McA Hi all. Mojolicious is havily based on naming conventions. Is there a chance to create an app with a name like 'xxx::Yyy' breaking the conventions?
07:56 preaction you can make mojolicious find your modules, if that's what you mean
08:00 preaction $app->routes->namespaces, $app->renderer->classes, $app->plugins->namespaces, $app->commands->namespaces. the attributes on the Mojolicious object, basically
08:02 McA @preaction: Thank you
08:02 McA Can I force 'mojo generate app xxx::Yyy' to generate an app stib with a name not conforming to the naming conventions?
08:05 preaction looks like no. not sure why that requirement is there, really. but then i don't use mojo generate ever
08:05 preaction keep forgetting it exists, really
08:06 preaction there isn't really that much boilerplate to getting a mojolicious app started
08:08 McA @preaction: Ok. Is there a central place where I can overwrite the mechanism of "snakanizing" and "camelizing"?
08:08 preaction why would you want to do that?
08:09 McA I thought I have to do that when I declare controllers ->to('foo#bar') so that the right module is found
08:09 McA Or is this exactly done by the $app->routes->namespaces
08:09 preaction 'foo#bar' isn't the only way to specify which controller to use
08:10 McA ok
08:10 preaction no, that isn't what is done with $app->routes->namespaces
08:11 McA That means that I have to forgo these fancy declarations in that special case?
08:11 preaction yes
08:11 McA :-)
08:12 McA Once again thank you for the quick reply and start point for my inquiry
08:25 trone joined #mojo
09:04 rcz If I just run my baseline app (http://ix.io/D0Q) like domain.com/mojo/app.pl, it works fine. But when I add a '/' in the URL after app.pl, it loads the 'index' template fine but all other resources (css, js) fail with a 404 - they're in /mojo/public/*, not /mojo/app.pl/public/*. How should I fix this? :)
09:20 nic joined #mojo
09:21 geospeck joined #mojo
09:25 Leffe joined #mojo
09:41 itaipu joined #mojo
10:27 Knotz joined #mojo
10:36 sri jberger: i like how you introduced fluent interfaces
10:47 girlbeach joined #mojo
10:47 girlbeach http://www.triphile.com/2017/06/bamburg-hotel_16.html ,the 3rd picture is me
10:51 tchaves joined #mojo
10:52 mtths joined #mojo
11:41 schelcj joined #mojo
12:23 tchaves joined #mojo
12:36 rcz What's the best way of loading static data into a controller? In this case, a json file
12:39 CandyAngel Is it configurable?
12:43 tchaves joined #mojo
12:46 rcz CandyAngel: what do you mean?
12:47 CandyAngel As in, will you need to change the contents of the JSON file? What is it for?
12:48 nic rcz have you looked at the Config plugin?
12:55 rcz CandyAngel: it's a long list of data I need to display in a view, it's static and won't change
12:56 rcz Not enough for a reason to put it in a database at least
12:58 CandyAngel Sounds like it should just be a template?
12:58 CandyAngel Is the controller manipulating it, or just serving it?
12:58 CandyAngel Or serving it as part of another page?
13:00 jberger Personally, the way I'd do it is put the path to the file in a configuration file
13:00 jberger Then I'd slurp that file using Mojo::File
13:01 jberger Then decode it with Mojo::JSON
13:01 CandyAngel Then take over the world!
13:02 rcz jberger: Sounds like what I need :)
13:10 jberger Great, enjoy!
13:19 McA A beginner's question: Where can I change the whole error page behaviour?
13:20 CandyAngel McA: http://mojolicious.org/perldoc/Mojolicious/Guides/Rendering#Rendering-exception-and-not_found-pages
13:22 McA @CandyAngel: Thank you. I start to get blind by all the docs I'm reading.
13:22 CandyAngel No worries
13:30 McA joined #mojo
13:45 Leffe joined #mojo
14:11 gizmomathboy joined #mojo
14:22 McA Is it possible to suppress standard console logging of a route in development mode?
14:28 Pyritic joined #mojo
14:29 jberger McA: easiest way is to make a directory named log in the project root
14:30 McA @jberger: But this would redirect all debug messages to that log file, wouldn't it?
14:30 jberger so you just want to change the log level?
14:31 jberger MOJO_LOG_LEVEL=info
14:31 McA I really only want to supress the log messages of ONE route.
14:31 jberger oh
14:31 jberger not sure that that is easily possible
14:32 McA Can I install something like a log filter?
14:32 jberger sure
14:32 jberger Mojo::Log just works off of an event
14:32 McA can you give me a hint where to look at?
14:32 jberger you could unsubscribe from it and install your own handler that does the same thing unless it is your route
14:32 McA aha
14:32 jberger http://mojolicious.org/perldoc/Mojo/Log#message
14:33 McA @jberger: Thank you.
14:33 jberger I'm not sure why you'd want that though, I wonder if you have an A/B problem
14:34 McA It's simple. I'm behind a proxy. This proxy makes a request on a regular basis and is filling my cosole while I'm really interested in seeing the "normal" log in development.
14:35 McA These are the "still alive?"-requests from the proxy
14:36 jberger ah
14:36 jberger makes sense
14:37 McA I'm happy that the use case seems not to be too stupid...  ;-)
14:38 * CandyAngel is jealous
14:39 McA @CandyAngel: Of whom?
14:39 purl Of whom is the bust?
14:39 CandyAngel You, having sane use cases :)
14:39 McA Be sure the rest is insane...  :-))
14:40 CandyAngel \o/
14:46 jberger the other way would be to pipe to an inverse grep I suppose
14:46 jberger so console level rather than app
14:48 Leffe joined #mojo
14:49 karjala_ joined #mojo
14:59 jberger a little love on r/programming would be helpful
14:59 jberger https://www.reddit.com/r/programming/comments/7jb8bk/half_way_through_the_mojolicious_web_frameworks/
14:59 jberger (not sure what reddit's rules are on upvoting from a link)
15:06 Pyritic joined #mojo
15:41 weirdo joined #mojo
15:43 keret joined #mojo
15:44 mib_1i8f7y joined #mojo
15:44 gryphon joined #mojo
15:44 mib_xhjfn3 joined #mojo
15:52 ChmEarl joined #mojo
16:01 jnbek joined #mojo
16:03 mib_r2xigv joined #mojo
16:19 Leffe joined #mojo
16:26 jkp joined #mojo
16:32 jabberwok joined #mojo
16:35 sh14 joined #mojo
16:42 Lee joined #mojo
16:49 McA I there a way to grab the full raw request content from a request?
16:55 batman McA: $c->req->text or ->body
16:55 batman i think you want ->body
16:56 McA @batman: Thank you
16:57 McA It seems that this is the request body.
16:57 McA I need the raw bytes comming in.
16:57 McA including the header and the request body
16:59 CandyAngel McA: If I recall correctly, Mojo doesn't store it
17:00 McA Can I hook somewhere to get the stream?
17:00 CandyAngel (and I have basically reimplemented Mojolicious to do a non-web server stuff :P)
17:01 CandyAngel Hmm
17:02 CandyAngel I think you'd need to implement your own Mojo::Message::Request and do something around 'parse'
17:02 dod joined #mojo
17:03 dod joined #mojo
17:05 karjala_ joined #mojo
17:07 McA @CandyAngel: I helpe myself with a tcpdump
17:07 CandyAngel Oh, a debugging thing.. I thought you wanted it for your app :P
17:08 McA s/helpe/helped/
17:08 McA It would have been simpler...  :-)
17:08 CandyAngel http://mojolicious.org/perldoc/Mojo/Server/Daemon#DEBUGGING
17:09 McA aaaaaah
17:09 McA Very nice.
17:09 CandyAngel A good reminder to ask for what you want, not how you want to implement it
17:10 CandyAngel https://meta.stackexchange.com/a/66378
17:11 McA I have the feeling that there is a bug lurking around. But as a total newbee I want to be sure before formulating such a thing.
17:12 CandyAngel Aw.. maybe I could lose my sri-ire crown
17:12 CandyAngel Maybe you should ask >.>
17:15 mohawk well said CandyAngel
17:15 mohawk (re asking for what you really want)
17:15 mohawk so it's #nobigdeal but i got a PR accepted on graphql-js
17:15 mohawk w00t
17:16 CandyAngel Nicely done mohawk :)
17:17 mohawk c'est gentil, thanks!
17:21 McA I try: $c->req is a Mojo::Message::Request; Mojo::Message::Request inherits from Mojo::Message and therfore inherits the method to_string. In my understanding I should get the whole request with calling to_string. When I'm doing this on a request which was done with a HTTP 1.0 (NOT 1.1) client leaving out the header fiels 'Host:' which is not defined an necessary on HTTP 1.0 requests I get shown an empty Host:
17:21 McA header which is IMHO wrong and I get the warning: Use of uninitialized value $_ in concatenation (.) or string at /opt/drumedar/cpan/lib/perl5/Mojo/Headers.pm line 147.
17:25 CandyAngel I think Mojolicious follows RFC's for HTTP 1.1
17:25 CandyAngel And an empty Host: is the same as omitted, so it shouldn't matter?
17:26 CandyAngel This is what I mean by Mojolicious not storing the raw.. to_string is showing you what Mojolicious would sent out, for that parsed request
17:26 CandyAngel For example, through ::UserAgent
17:27 CandyAngel would send*
17:28 McA yes: There is no Host:-header in the original request. And after parsind and glueing together the parsed pieces there is more than before.
17:34 geospeck joined #mojo
17:41 asymp joined #mojo
17:47 CandyAngel Mhm
17:56 Leffe joined #mojo
18:17 asymp left #mojo
18:27 itaipu joined #mojo
18:31 geospeck joined #mojo
18:58 trone joined #mojo
19:28 berov joined #mojo
19:51 preaction here's a draft of a blog post about getting started using Yancy with Mojolicious: http://preaction.me/draft/2017/12/10/start-a-new-yancy-app/ jberger does this sound appropriate for your calendar?
19:53 jberger looks neat
19:53 jberger sounds good to me
19:54 jberger I'm finishing up the post from yesterday tonight, roles
19:54 jberger but maybe as soon as tomorrow?
19:54 jberger if you want
19:55 preaction no rush, up to you. whenever you need a fill
19:55 preaction i'm not sure i like that the whole example is repeated multiple times, and i've got some bugs to fix revealed by writing that post
19:56 jberger actually, that's a good point, I'm going to be busy thursday (sadly not at Chicago.pm, sorry) so maybe make it the friday post (thursday night)
19:58 preaction sounds good
20:01 Ya_ALLAH_Ya_Muhmd joined #mojo
20:01 Ya_ALLAH_Ya_Muhmd left #mojo
20:29 Ya_ALLAH_Ya_Muhmd joined #mojo
20:29 Ya_ALLAH_Ya_Muhmd left #mojo
20:35 geospeck joined #mojo
20:36 geospeck joined #mojo
20:37 Ralesk joined #mojo
20:40 cng joined #mojo
20:40 gizmomathboy joined #mojo
20:40 schelcj joined #mojo
20:43 exp-innit joined #mojo
20:46 jacoby joined #mojo
21:06 karjala_ joined #mojo
21:14 jacoby joined #mojo
21:50 exp-innit joined #mojo
21:50 disputin joined #mojo
21:54 Grinnz preaction: a sqlite backend for yancy would probably be a trivial copypaste of the mysql one
21:54 preaction probably yes
21:59 preaction i'd accept a PR for one. i'm trying to make auth work right now
22:14 ghenry joined #mojo
22:16 Kharec_ joined #mojo
22:18 ghenry joined #mojo
22:30 Kharec joined #mojo
22:43 Ya_ALLAH_Ya_Muhmd joined #mojo
22:43 Ya_ALLAH_Ya_Muhmd left #mojo
23:14 ghenry joined #mojo
23:20 Seth joined #mojo
23:21 bobkare joined #mojo

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