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

IRC log for #mojo, 2017-02-15

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

All times shown according to UTC.

Time Nick Message
00:00 Rando http://pastebin.com/raw/rHkysdVY
00:00 bpmedley This one shows $VAR1 = {}; above <-- Is that output from the app, or input in the DATA section?
00:02 Rando it's in the data section
00:02 Rando it doesn't matter what's there, 'cause there's no key in the result
00:04 bpmedley Rando : I get the same results you do with morbo.
00:05 Rando Jinkies!
00:08 bpmedley Rando : I added a "package main;" right above 'use Mojolicious::Lite' and I got the same results in morbo and daemon.
00:13 px80 jberger: what do you mean with putting the callback into the write operation?
00:13 Rando that seems odd.
00:13 px80 are there some examples?
00:14 jberger px80: http://mojolicious.org/perldoc/Mojo/IOLoop/Stream#write1
00:15 px80 ah
00:15 px80 so the callback there is basically mandatory
00:15 bpmedley Rando : https://github.com/kraih/mojo/blob/master/lib/Mojo/Server.pm#L54  <-- I'm guessing it's the sandboxing
00:16 jberger px80: well, kinda, if you call $end->() before you've finished writing, who knows what's going to happen
00:16 px80 whats the difference between handle at stream?
00:16 jberger a handle is a perl provided object
00:16 jberger Mojo::IOLoop::Stream wraps that object
00:17 Rando bpmedley: yep, that'd do it alright
00:17 px80 but it outputs same thing to the TCP socket?
00:18 px80 so I dont really need to care
00:20 Janos joined #mojo
00:20 px80 there are a handful of events for writing to the stream object
00:21 px80 I wonder if it makes sense to register to all of them, to make sure that nothing goes wrong
00:22 jberger error yes, drain no, others maybe
00:34 marty joined #mojo
00:35 px80 jberger: does that make sense for a starter: https://gist.github.com/anonymous/922818c9062eb0303f6990610ca4d988
00:38 px80 ah the stream objects are only available inside the client callback
00:40 px80 so ideally I would need to check $client and $stream
00:40 px80 thats a lot of chcks
00:49 px80 so probably more like this then: https://gist.github.com/anonymous/c96e764801e9dfd45f8dfe517bb10be5
00:54 stryx` joined #mojo
00:59 marty joined #mojo
01:00 px80 interesting
01:00 px80 it can open up one connection and stream
01:00 px80 but no more, it dies with
01:00 px80 Mojo::Reactor::Poll: I/O watcher failed: Can't locate object method "connect" via package "a11783da9f87d2838a4051d51f64c7bf" (perhaps you forgot to load "a11783da9f87d2838a4051d51f64c7bf"?)
01:02 px80 maybe I should stick with sequential connections
01:07 bpmedley px80 : I would think that setting up the close/error/timeout event handlers would be desirable outside of the connect callback.
01:11 bpmedley px80 : Sorry, I've only loosely followed your project.  May I ask what you're coding at a high level?
01:19 px80 bpmedley: its basically just some glue to process things I fetch from network gear. On part is sending events via TCP to our NMS
01:20 px80 its late now (2:20AM) need to get some sleep
01:20 px80 good night!!
01:36 sugar joined #mojo
01:44 kiwiroy joined #mojo
02:21 castaway joined #mojo
02:39 iamb joined #mojo
03:01 genio sri: I'm going to bite the bullet I think and just get a 2015 MBP
03:02 genio my wife has OKed it
03:04 genio 15" 2.8 quad core i7. 2015 MBP with retina display. 16GB ram and 512GB SSD
03:06 genio although I really hate that I can't upgrade the ram
03:21 jberger px80: clearly Mojo::IOLoop::Client can open more than one socket ... I think that assuming otherwise is kinda silly
03:22 jberger I'm assuming you are calling a method with the wrong arguments someplace
03:36 noganex_ joined #mojo
05:04 dboehmer_ joined #mojo
05:51 inokenty-w joined #mojo
05:56 coolo sri: https://gist.github.com/coolo/e82e4d99187f04d90f32e3ced0b131a9
06:54 dod joined #mojo
07:36 mib_p8rww4 joined #mojo
07:55 kiwiroy joined #mojo
08:05 foursixnine joined #mojo
08:06 kivilahtio How does one rethrow a Mojo::Exception?
08:06 kivilahtio $_->throw  loses the error message and context
08:07 kivilahtio specifically I need to rethrow it inside a Try::Tiny catch {} block
08:08 kivilahtio There is no rethrow-method
08:08 kivilahtio apparently by just calling die on it
08:09 kivilahtio die $_
08:09 AndrewIsh joined #mojo
08:16 blumbi joined #mojo
08:27 kiwiroy joined #mojo
08:31 stryx` joined #mojo
08:37 rshadow joined #mojo
08:47 sri coolo: hahaha
08:49 inokenty joined #mojo
08:51 Vandal joined #mojo
08:54 trone joined #mojo
08:58 sri some are pretty cringy, like "Subroutine "new" called using indirect syntax"
09:02 marcus I think bare returns are perfectly ok tho.
09:03 coolo we had that discussion yesterday :)
09:04 sri marcus: you're very wrong with that!
09:06 marcus (in methods that don't have a return value)
09:07 sri that is actually true
09:15 mib_ypnwco joined #mojo
09:23 ribasushi joined #mojo
09:45 cpan_mojo Mojolicious-Plugin-Restify-0.07 by KWAKWA https://metacpan.org/release/KWAKWA/Mojolicious-Plugin-Restify-0.07
10:24 sugar joined #mojo
10:27 dod joined #mojo
10:35 dod joined #mojo
10:36 rshadow joined #mojo
10:47 tchaves joined #mojo
10:48 dod joined #mojo
11:13 metasoft joined #mojo
11:18 metasoft As anybody come across the situation where a request as been recieved and whilst during the processing of the request in the controller the client disconnects. I’m getting the error “Can't call method "res" on an undefined value at local/lib/perl5/Mojolicious/Controller.pm line 221” Also I’ve noticed that for example a Mojo::Tempate object as not been cleared up from the heap, there may be other items also left hanging around. I know
11:18 metasoft version of Mojo we are using is old, 5.47. But it would be good to know that should we spend time on upgrading our app to the latest version that such situations would have been fixed
11:34 nic I might be misunderstanding, but I'm surprised you expect the template to be removed from the cache (other than by being displaced by more recent templates)
11:38 sri metasoft: 5.48 was an emergency release for security issues... so no matter what, upgrading would be a very good idea ;)
11:39 metasoft sri: thanks for that.
11:39 sri and there have been more since then
11:44 coolo sri: so the perlcritic policy is most likely unreliable?
11:45 sri coolo: yea
11:46 sri the usual problem with perlcritic :)
11:47 sri most rules are reasonable, but depend on conditions the perlcritic system is not smart enough to detect
11:48 sugar joined #mojo
11:50 pink_mist coolo: I'd suggest Grinnz's Perl::Critic::Freenode set of policies
11:52 coolo pink_mist: that's what we're talking about :)
11:52 pink_mist oh :P
11:52 pink_mist thought you were talking about the default policies =)
11:53 metasoft sri: I’ve also noticed a large number of Mojo::IOLoop::Stream objects being left on the heap and not being cleaned up during normal conditions. Is this to be expected?
11:54 sri metasoft: no, we've fixed many leaks since then
11:55 sri pink_mist: i was talking about both i guess :)
11:55 sri like the strict/warnings policy, well meaning, but doesn't cover Mojo::Base
11:56 sri or the other strict/warnings enablers
11:56 sri so yea, you should never see it as more than a hint in the right direction
12:02 metasoft sri: Thanks for this, I’ll go away and persuade the “management” that we should spend time and effort in upgrading
12:03 pink_mist sri: https://metacpan.org/source/Perl::Critic::Utils::Constants#L117 <-- sure it does
12:04 sri pink_mist: Oo
12:38 sugar joined #mojo
13:04 marty joined #mojo
13:18 Janos joined #mojo
14:09 sugar joined #mojo
14:19 rshadow joined #mojo
14:19 gryphon joined #mojo
14:24 gizmomathboy joined #mojo
14:30 rshadow joined #mojo
14:31 Janos joined #mojo
14:31 Pyritic joined #mojo
14:37 rshadow joined #mojo
14:43 rshadow joined #mojo
14:51 Lutim joined #mojo
14:51 rshadow joined #mojo
14:52 Lutim Hello !
15:07 sri o/
15:08 sri this seems to be a real bug, someone should take a look https://github.com/kraih/mojo/issues/1054
15:10 Lutim We made a script based on mojolicious and using postgresql but when we run that script we have an error
15:11 Lutim undefined symbol: Perl_xs_handshake
15:12 Lutim Concerning opt/postgres/fork_lutim/local/lib/perl5/x86_64-linux-gnu-thread-multi/auto/EV/EV.so
15:12 jberger sri: is that the "not my stream" bug from ForkCall
15:13 jberger I expect that it is, because didn't you just revert half of this? https://github.com/kraih/mojo/commit/0dd25840d43efef9e165bde13d1a6189b0bd2288
15:14 jberger yes: https://github.com/kraih/mojo/commit/9d9ed3bd3b5ff3603539ba61d34aafe24ef80fcd
15:14 jberger so the other bit has to go back too I think
15:15 sri wtf
15:16 Lee if a before_dispatch hook calls ->redirect_to should we still be getting into the before_routes hook?
15:18 Lee hmmm, i guess logically yes
15:18 * Lee moves stuff into around_action
15:21 sri jberger: please fix
15:22 mat is there a way to get all the params that $self->param() can return, but like, as a hash ?
15:22 jberger sri: I was never able to write a useful test for it
15:22 mat (for debugging purposes)
15:22 sri jberger: then leave the test out and reference the issue
15:23 jberger ok, I'll do that, but it is literally just going to be those two lines
15:24 sri ok
15:24 jberger I'm first seeing if there was discussion at the time
15:24 jberger I think there was
15:26 jberger starts here: http://irclog.perlgeek.de/mojo/2016-08-26#i_13096567
15:26 jberger and therein references further back to discussions on forkcall from way back
15:29 sri i now understand the problem, the second forked process inherits the stream to the first from the parent
15:29 jberger yea
15:29 jberger http://irclog.perlgeek.de/mojo/2016-08-27#i_13101743
15:29 sri prolly didn't get it back then
15:30 sri my brain was melting from the heat :)
15:30 jberger its a really odd bug to grok
15:30 jberger took me several times
15:31 jberger ok now that we have the background, I'm happy to put the lines back if you want
15:32 jberger (wow, mojo hasn't had a commit in 4 days, there used to be a release more often than that!)
15:33 jberger heh, $parent and $pid are both taken now
15:34 pink_mist 7.24 and 7.25 were pretty close together jberger =)
15:35 Pyritic joined #mojo
15:36 jberger $parent_pid or $own_pid or something ...
15:36 jberger it isn't really the $parent when its back in the parent-side callback
15:36 * jberger bikesheds himself
15:36 sri $me
15:36 sri ?
15:37 jberger works for me
15:37 rshadow joined #mojo
15:39 jberger I wonder if there should be a comment in the code to prevent future removal if we can't figure out how to write a test for this
15:41 sri jberger: theoretically, wouldn't adding a warn $err if $err to one of the multi subprocess tests be good enough?
15:41 sri in subprocess.t
15:42 sri or even die $err if $err
15:42 jberger the parent callback is called in the child of the first subprocess
15:42 jberger does that filter into the tap correctly?
15:42 sri right, so you would see warnings
15:42 jberger visually at least
15:43 sri STDERR
15:43 sri tap goes on STDOUT, no?
15:43 jberger yes
15:45 mat so, the bits I wanted are in $self->{stash}->{mojo.capture} wondering if there is some hash somewhere with all the parameters
15:45 Lee mat: http://mojolicious.org/perldoc/Mojo/Parameters#to_hash
15:46 jberger fyi: all mojo. stash variables are private
15:48 sh14 joined #mojo
15:49 blonewolfs joined #mojo
15:49 lluad joined #mojo
15:55 mat Lee, mmm, ok, but how do I get the $params it talks about ?
15:56 Lee $c->req->params->to_hash # IIRC
15:57 Lee (maybe don't need the ->req there)
15:58 mat Lee, need the ->req, and it only gives the parameters from the http request, not the ones the routing engine spit out
16:00 Lee oh, hmmmm
16:03 mat (sorry if I seemed a bit harsh with my answer)
16:06 tyldis You seemed a bit hash, at least. ;)
16:11 good_news_everyon joined #mojo
16:11 good_news_everyon [mojo] jberger created subprocess_fix (+1 new commit): https://git.io/vD1gc
16:11 good_news_everyon mojo/subprocess_fix 5c58240 Joel Berger: Exit early when the subprocess parent callback is in the wrong process...
16:11 good_news_everyon left #mojo
16:12 jberger https://github.com/kraih/mojo/pull/1055
16:13 jberger I'd like to have some people run the tests for that fix on other platforms if they wouldn't mind
16:13 jberger especially windows
16:13 jberger I added a test
16:14 sri eww, that test looks horrible
16:16 blumbi the documentation looks horrible as well, so pls fix it
16:17 rshadow joined #mojo
16:18 jberger blumbi: what was that?
16:20 jberger sri: you reminded me that TAP relies on STDOUT which is inherited
16:20 jberger so I tried just directly checking
16:21 jberger and indeed without the fix that test fails (twice!)
16:21 sri jberger: shouldn't it at least start the event loop and make sure the results are correct and stuff?
16:21 jberger :o
16:22 jberger ummm, well that's a kick in the pants
16:22 jberger how on earth did that work
16:22 jberger oh, because Mojo::IOLoop::Subprocess doesn't have a next_tick
16:22 jberger that wouldn't have done anything in ForkCall
16:23 jberger hahah, but that's all it needs of course, the other streams close!
16:23 jberger yes, the test should be cleaned up, but I understand why even that much was sufficient
16:31 disputin joined #mojo
16:37 rshadow joined #mojo
16:56 sugar joined #mojo
17:00 dod joined #mojo
17:14 itaipu joined #mojo
17:17 Grinnz sri: the ::Freenode policies are definitely not perfect, there's only so much you can do with static analysis and the limitations of PPI
17:17 sri yea
17:17 sri jberger: looks like we are in trouble https://travis-ci.org/kraih/mojo/builds/201921704
17:17 Grinnz I tend to err on the side of "try to notify about pitfalls but also make an effort to recognize legitimate cases"
17:22 sri i'm starting to get tired of IO::Socket::SSL breaking mojo all the time
17:23 Grinnz maybe https://metacpan.org/pod/Crypt::Perl could do SSL stuff :P
17:23 sugar joined #mojo
17:24 Grinnz (not a serious suggestion)
17:26 sh14 joined #mojo
17:28 sri the breaking change https://github.com/noxxi/p5-io-socket-ssl/commit/f1b51fda12080b4cda91cf44cb3040de574f9f51#commitcomment-20898106
17:28 PryMar56 joined #mojo
17:28 sh14 joined #mojo
17:31 good_news_everyon joined #mojo
17:31 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vDMe0
17:31 good_news_everyon mojo/master fb7e41a Sebastian Riedel: move blog to a new address, where it can be shared with other members of the core team
17:31 good_news_everyon left #mojo
17:56 disputin joined #mojo
18:25 sugar joined #mojo
18:36 rshadow joined #mojo
18:36 asarch joined #mojo
18:43 Grinnz new IO::Socket::SSL release, that was fast
18:54 good_news_everyon joined #mojo
18:54 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vDMRR
18:54 good_news_everyon mojo/master de69598 Sebastian Riedel: we did not mean to test this :)
18:54 good_news_everyon left #mojo
18:55 good_news_everyon joined #mojo
18:55 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vDMRu
18:55 good_news_everyon mojo/master 2d2eb4f Sebastian Riedel: Merge pull request #1055 from kraih/subprocess_fix...
18:55 good_news_everyon left #mojo
19:01 good_news_everyon joined #mojo
19:01 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vDM0S
19:01 good_news_everyon mojo/master 15be7c7 Sebastian Riedel: better subprocess tests
19:01 good_news_everyon left #mojo
19:07 good_news_everyon joined #mojo
19:07 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vDME9
19:07 good_news_everyon mojo/master 97de3e0 Sebastian Riedel: two processes are enough
19:07 good_news_everyon left #mojo
19:07 sri jberger: hope there is no race condition where the TAP gets corrupted
19:07 genio sri: I played with a few MBPs at best buy during lunch today.  I think I agree with you that the newer mac keyboards are infuriating
19:07 genio I didn't know what you were talking about until I'd tried those newer ones
19:08 sri genio: i've only tried the 12" keyboard so far, which was the first generation
19:08 sri the MBP keyboard is the second generation and supposed to be better
19:08 genio The newer keyboards quite a bit different when compaired to the old 2011 MBP that I have
19:09 sri that's for sure
19:09 genio The 2015 MBP keyboard feels better than the ones with the touchbar, though
19:09 genio *are quite a bit
19:09 sri that said, i could get used to the 12" keyboard after a week, my biggest problem was the keys breaking :S
19:10 genio I think after today I've decided to just drop the ~$2500 on the 2015 MBP
19:10 genio it's hard to find anything remotely close to it in the 15" laptop category
19:10 sri yea
19:11 genio the XPS 15 in the store seemed decent as well, but it was almost the same cost and seemed like a flimsier build quality
19:12 sri maybe a little bit, but not much
19:12 genio We have a Lenovo 460 or some such here in the office. I'm going to play with that for a minute or two before purchasing, but so far, MBP
19:13 * sri mostly works on the laptop in clamshell mode these days anyway, so built-in keyboard becomes less important
19:13 genio $2100 before taxes on the XPS and  ~$2500 on the MBP after taxes
19:14 genio I only use the built-in keyboard
19:14 sri XPS would have a kick ass gpu
19:14 genio yea, but it also has the touchscreen
19:14 sri oh, yea, then i guess you have to go with a 2015 MBP
19:14 sri XPS 15" with touchscreen also has no battery life at all
19:15 genio MBP also wastes none of my time with having to wipe the machine and install some linux flavor
19:15 sri was about to ask if you can work on windows :)
19:16 jonasbn joined #mojo
19:16 sri then i would have pointed you at the surface book, which feels pretty good when typing as well
19:16 genio the surface book seems like a really well done machine, but its cost is much more than even the MBP
19:17 genio 16GB ram with 500GB hard drive was pushing closer to $3k
19:18 * sri still wishes he had gone for the 15" MBP... since the 13" feels a little underpowered every now and then
19:31 Pyritic joined #mojo
19:37 blonewolfs joined #mojo
19:52 jberger sri: yeah, my original version of that test just had a 'fail' statement if it got that far
19:54 jberger also, IIUC Test2 has new ways of ensuring test flow between processes
19:54 jberger (when you ask for it)
19:54 jberger so once we get that into core it might be something worth thinking about
19:54 jberger (perl core, I mean)
19:54 castaway joined #mojo
19:56 disputin joined #mojo
19:59 mib_i9q8bm joined #mojo
20:01 mib_i9q8bm where can I post some sample code?
20:01 pink_mist gist.github.com
20:01 purl gist.github.com is nice to inline pastes WHEN GITHUB WORKS
20:02 pink_mist don't mind purl, she gets easily excited
20:05 * jberger bops purl on the nose
20:05 * purl takes out jberger at the kneecaps
20:09 mib_i9q8bm wonder if someone can help with this  code: https://gist.github.com/anonymous/06859b83b01ee3eca78ba0a2c8d0ddec
20:10 mib_i9q8bm trying to tun the /loop one to see if I can get the external template to be read
20:10 mib_i9q8bm ./test_mojo.pl get /loop
20:11 jberger well I know nothing about that renderer, as I said before, but certainly only one of those two paths to the template can be correct (if they are the same template)
20:12 pink_mist none of us (that I know of) have experience with HTML::Template, so I find it unlikely that we will be able to help with a template issue for it
20:12 preaction i also suggest very strongly not to use HTML::Template or any of its derivatives because it has often unexpected behavior and some nasty edge cases
20:13 jberger other than simple things like what I mentioned, I'd probably agree with pink_mist and further suggest you contact the author of the plugin (unless as preaction says, you should actually just avoid the whole thing)
20:14 preaction i think, though, the name of the template will have to be foo/main.txt.tmpl, since your format is 'txt'
20:16 preaction if the path in /test is correct, why not use the same path in /loop?
20:16 mib_i9q8bm even if I remove the format => 'txt' it still doesn't work
20:17 mib_i9q8bm netiher one work
20:17 preaction okay, then paste your log into the gist of the error you get when it doesn't work
20:18 preaction i do find it kind of disconcerting that the synopsis of the plugin only shows inline templates working...
20:22 jberger I thought there was one ...
20:23 jberger nope, I was wrong
20:23 jberger wait yes
20:23 jberger the first example
20:23 purl rumour has it the first example is args and get
20:23 jberger $self->render('bender', handler => 'tmpl', tmpl_opts => {utf8 => 1});
20:24 mib_i9q8bm i pasted the error at gist
20:26 preaction you have to give us the url
20:27 jberger or you can update the original gist
20:28 rshadow joined #mojo
20:28 mib_i9q8bm https://gist.github.com/anonymous/5793f9e577b9a3617b9c3c12215c1cb3
20:29 preaction looks like a bug in the plugin
20:29 jberger mib_i9q8bm: I read that as "please file and issue with the plugin author"
20:29 jberger s/and/an/
20:30 preaction min version of Mojolicious for the plugin is 4.0. perhaps they need to test it on an updated version?
20:34 rshadow joined #mojo
20:38 mib_i9q8bm I am going to try to contact the author of the plugin
20:44 sri 4.0 is a bit old, a few things around the renderer got changed and simplified
20:44 sri usually exception handling will not work correctly without updates
20:47 disputin joined #mojo
21:27 polettix joined #mojo
22:16 batman joined #mojo
22:19 Bean joined #mojo
22:26 * sri is still waiting for suggestions for how to teach delays better btw.
22:32 preaction i'm planning on writing an intro to event loops using Mojo::IOLoop, so i'll probably cover it then. that's going to take me a few weeks, I suspect. i can't think of any way that doesn't involve diagrams and long code examples though
22:49 good_news_everyon joined #mojo
22:49 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vDDOx
22:49 good_news_everyon mojo/master e03bcd9 Sebastian Riedel: explain the original idea behind delays with examples
22:49 good_news_everyon left #mojo
22:49 sri just thought of this
22:49 sri we don't really explain the original idea in the docs
22:49 preaction that's approximately what i was thinking of doing for my talk, yeah
22:50 preaction like, almost exactly that ;)
22:50 sri oops
22:50 preaction show the nested pattern then unroll it. it's good to have it here, though
22:51 kgoess_ nice. but remind us again why the name is "Delay" ?
22:52 sri because nobody could come up with something better
22:52 sri first name was Mojo::IOLoop::Trigger
22:53 sri Mojo::IOLoop::Step was a contender too
22:54 * kgoess_ nods
22:55 jberger I do almost wish we had better names, but honestly we've been trying for years, I don't think its going to happen
22:55 jberger also, a major rename of Delays at this point would probably bring enough breakage as to push my vote to just going to some promises
22:56 jberger (which is NOT my preferred choice, mind)
22:57 sri if someone can make promises rock in mojolicious a patch would get my vote
23:00 disco I've a little question about mojo-pg example. Actually I'm new to Mojolicious and I probably have to get the habit... So, in the Model/Posts.pm there is a render(posts => ...). But I can't get what it does (even after reading doc about Rendering). Any advice ? ;)
23:01 sugar joined #mojo
23:02 disco Does 'posts' refers to templates/posts/ somehow ?
23:02 jberger disco have you read the Mojolicious Tutorial?
23:02 jberger I highly recommend you read the Tutorial and the Guides in the order listed here: http://mojolicious.org/perldoc
23:02 sri http://mojolicious.org/perldoc/Mojolicious/Guides/Tutorial#Stash-and-templates
23:03 disco jberger: yes
23:05 disco I can see that you can pass the template with render(template => 'foo'); But I can't find what means passing render(posts => ...).
23:05 disco I'm probably missing something simple, but can't go over it...
23:06 sri posts is an arbitraty name
23:06 preaction disco: http://mojolicious.org/perldoc/Mojolicious/Controller#render <- last example of this method
23:09 disco preaction: ok, this uses the template in templates/foo/index.html.ep ?
23:09 disco sri: I thought that, but then what does the render() when it gets this argument (posts => ...) ?
23:09 preaction yes. see the second box of examples, too. last one
23:10 preaction the first argument is the name of the template. the rest of the arguments are the stash. just like the docs i linked to explain
23:10 sri http://mojolicious.org/perldoc/Mojolicious/Guides/Rendering#Renderer
23:12 disco [ The controller value gets converted from CamelCase to snake_case ]
23:12 disco this is probably what I missed.
23:13 sri i guess the description of Mojolicious::Controller::render could use some rewording to make it friendlier
23:14 disco I think I will read it again from start.
23:14 disco I read it first before parsing the mojo-pg example
23:14 disco and it was then quite theoretical ;)
23:15 disco now that I'm trying to learn and implement, it seems I didn't understand all details.
23:15 disco Sorry for annoying you with some basic questions ;)
23:15 miller joined #mojo
23:16 jberger indeed I do often recommend a reread, but I wasn't sure you were at that point, good for you, level up
23:17 disco thanks for helping ;)
23:18 sri it's a fair question, i think that topic deserves a little more coverage in the docs
23:18 disco I'0ve also sometimes some difficulties to go from Mojolicious::Lite examples to full app. Things are slightly different and I don't get eerything at first read, indeed.
23:19 sri that's very common too
23:19 disco sri: thanks
23:19 sri been wondering if the docs in Mojolicious::Lite could maybe have a little list of snippets with translations
23:22 disco (i'm a chemistry teacher and i often have to explain things from different point of views. And sometimes we do some ellipsis because we know the process of understanding. So I'm probably in the same situation of my students now, not getting it because I'm getting it the wrong way :-)
23:23 jberger it does also seem that people sometimes have to get accustomed to the style of the mojo docs
23:23 jberger they are very terse but cover everything really quite well
23:23 batman joined #mojo
23:23 disco jberger: exactly.
23:24 jberger people seem to expect that the docs are haphazard and rambly and skim
23:24 jberger once you start to grok that the material is actually covered you just have to really read is when I recommend the reread
23:24 jberger and thus if you are there already, so much the better
23:25 disco and also practise. making mistakes and understanding what's wrong.
23:25 jberger yep
23:25 jberger keep working with it, make little apps (it is really easy to make little apps in mojo :D) and try things out
23:26 disco jberger: yes, it's exactly what I'm doing.
23:26 jberger once you get good at it, you can make demo apps as one-liners :-P, don't probably try that just yet
23:26 disco jberger: I'm doing perl for years, but not with this OO style ;)
23:27 jberger chaining OO doesn't take long to get used to
23:27 disco jberger: :-))
23:27 jberger but it is a little different
23:27 jberger other than the chaining, this is basically a dead simple Moo-like thing that only generates lazy accessors and a constructor
23:28 jberger (and as a result, it is SUPER fast)
23:28 disco jberger: I'm not at the stage of conceptualizing this in my brain, but it will come ;)
23:28 jberger no worries
23:28 jberger keep cracking away at it
23:29 jberger and have fun!
23:29 disco thanks for encouragment ;)
23:29 jberger \o\
23:29 disco will continue tomorrow, time to sleep now ;)
23:29 jberger /o/
23:29 jberger nn
23:30 howitdo joined #mojo
23:30 disco tnx and talk you soon ;)
23:31 jberger disco: btw, fellow scientist here
23:32 jberger we can talk about that some other time
23:32 jberger get some sleep
23:33 disco with pleasure ;)
23:33 disco off
23:54 stryx` joined #mojo

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