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

IRC log for #mojo, 2014-09-03

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

All times shown according to UTC.

Time Nick Message
00:00 meshl joined #mojo
00:18 jberger jzawodn++
00:21 jzawodn next-up: internal "brown bag" talk to show other perl folks at work what Mojo can do
00:26 jberger jzawodn: another nice thing about delays, their "hidden feature". is that they make it very hard to make circular reference leaks in the callbacks
00:27 jberger because of the way the internal storage works, not because of any way that you use it
00:27 jzawodn yeah, I was rather surprised when I tested my code in some large runs and didn't have any leaks
00:27 jzawodn previous, pre-mojo, attempts always had weird leaks or stuff I forgot to weaken
00:28 jberger just part of the friendly service here at Mojo :-D
00:28 jzawodn I have a secret plan to replace Apache on one of our web tiers... I'm starting to think I might just be able to pull it off.
00:29 jberger \o/
00:30 briandfoy Back at 16:31, sri suggested that I use $self->app->config->{command_stuff} = {...}; to pass data if I want to cascade commands.
00:31 briandfoy Isn't that what stash is for? Or is that only for templates?
00:31 jberger I think you need a request for a stash
00:31 briandfoy I don't like the idea of mixing configuration info with temporary internal info
00:31 briandfoy i was thinking about templates for output to the terminal, too...
00:31 sri hahaha
00:32 jberger I wouldn't do that either, maybe a helper that returns a hashref
00:32 sri if it makes you feel better use $self->app->defaults->{my_command_stuff} = {...}
00:32 jberger I guess it is all kinda the same thing
00:32 sri that's almost the stash ;p
00:32 sri but seriously, it shouldn't matter, since that data is only stored there when the command runs
00:33 briandfoy will that stick around for other requests?
00:33 briandfoy Because I don't want that
00:33 sri commands have a very limited lifetime
00:34 briandfoy I want to re-use code for commands and requests...
00:34 sri (at least the oneshot config commands we are talking about here)
00:34 briandfoy I don't know. I'm still trying to map out all the magic
00:34 briandfoy the danger in all frameworks is that you have to tailor your problem to what the framework naturally wants to do :)
00:35 sri you have the app instance, do whatever you like with it
00:35 briandfoy that's the point: I'm still trying to figure out what I can do, what I should do, and what I shouldn't do. :)
00:35 jberger briandfoy: I might keep the state in whatever request object you create
00:36 jberger (for the record, briandfoy's requests might not necessarily be web requests)
00:36 jberger more like jobs
00:37 briandfoy and Mojo has the async and other features that are more attractive than the web stuff
00:39 woz joined #mojo
00:49 d4rkie joined #mojo
00:52 zivester joined #mojo
01:08 good_news_everyon joined #mojo
01:08 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/V7TCkg
01:08 good_news_everyon mojo/master f7b5247 Sebastian Riedel: code blocks are more common
01:08 good_news_everyon left #mojo
01:14 * jberger is watching GoT with the wife
01:15 * jberger is queuing up s03e09 ;-)
01:15 sri everyone dies
01:15 jberger ah, but she doesn't know that yet
01:16 laouji joined #mojo
01:22 sri oh right, you read the books :c
01:23 jberger I've seen the show too
01:23 jberger she finally decided that she was missing too many cultural references
01:23 klapperl joined #mojo
01:26 preaction joined #mojo
01:26 sri there's stuff in the show that's not in the books yet though :D
01:27 jberger a little
01:27 sri pretty big spoiler later on
01:28 sri the big boss of the white walkers is revealed
01:30 sri "jberger quit. I CAN'T HEAR YOU...LALALALALALA..."
01:32 jberger I told you, I've seen the show too :-P
01:32 jberger LALALALALA
01:32 purl don't give up the day job.
01:34 sri -.-
01:34 * jberger pushes purl down the stairs
01:34 purl Hey! *thump* ow! *bang* argh! *bam* son of a *thump* *crunch* whimper...
01:39 woz joined #mojo
01:47 pete sri: I thought he was only allegedly revealed
01:49 jberger even if it is, it wasn't a mystery anyone cared about
01:50 woz_ joined #mojo
01:51 jberger all my favorite mysteries are in Oldtown
02:03 noganex_ joined #mojo
02:03 pete It's been a couple of years since I read it, I'm not sure I can really remember who anyone is
02:03 pete There's a dwarf
02:03 pete I liked the dwarf
02:06 d4rkie_ joined #mojo
02:08 jberger the band is playing
02:11 zivester joined #mojo
02:21 woz joined #mojo
02:48 r0b3rt joined #mojo
03:08 KCL joined #mojo
03:23 woz joined #mojo
03:56 bytewolf joined #mojo
04:08 bytewolf_ joined #mojo
04:14 r0b3rt left #mojo
04:28 woz joined #mojo
05:13 d4rkie joined #mojo
05:27 laouji joined #mojo
05:32 woz joined #mojo
05:48 Eke- joined #mojo
06:04 preaction http://razvancaliman.com/writing/css-shapes-editor-chrome/ <- it is things like this that makes me think i need a browser-based editor for Statocles
06:11 mr-foobar joined #mojo
06:27 dod joined #mojo
06:32 jamesaxl joined #mojo
06:37 woz joined #mojo
06:42 KCL_ joined #mojo
07:03 Vandal joined #mojo
07:09 rawler joined #mojo
07:17 Eke|| joined #mojo
07:19 trone joined #mojo
07:24 basiliscos joined #mojo
07:42 woz joined #mojo
07:55 woz joined #mojo
08:34 rawler joined #mojo
08:38 edestler joined #mojo
08:42 Dandre joined #mojo
08:57 fhelmber_ joined #mojo
08:57 Dandre joined #mojo
09:05 Dandre joined #mojo
09:09 Dandre joined #mojo
09:17 bzero sri: $validation = $validation->token('fa6a08...'); at Mojolicious::Validator::Validation documentation. But only csrf_token method exists. So $validation = $validation->crf_token('fa6a08...') should be used...
09:17 bzero *attribute
09:19 Dandre joined #mojo
09:21 dp_ joined #mojo
09:22 dod joined #mojo
09:29 mr-foobar joined #mojo
09:33 denis_boyun joined #mojo
09:33 Dandre joined #mojo
09:39 Dandre joined #mojo
09:46 Dandre joined #mojo
09:50 Dandre joined #mojo
09:55 Dandre joined #mojo
10:00 Dandre joined #mojo
10:01 ryozi joined #mojo
10:02 Dandre joined #mojo
10:11 Dandre joined #mojo
10:20 Dandre joined #mojo
10:21 laouji joined #mojo
10:28 Dandre joined #mojo
10:35 Dandre joined #mojo
10:47 Dandre joined #mojo
10:51 Dandre joined #mojo
10:51 neilhwatson joined #mojo
10:57 Dandre joined #mojo
11:02 Adura joined #mojo
11:04 Dandre joined #mojo
11:17 meshl joined #mojo
11:31 Dandre joined #mojo
11:32 _corgi_ joined #mojo
11:33 Dandre joined #mojo
11:49 Dandre joined #mojo
11:54 d4rkie joined #mojo
11:57 Dandre joined #mojo
11:58 bobkare joined #mojo
12:03 Dandre joined #mojo
12:08 good_news_everyon joined #mojo
12:08 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/Le-bag
12:08 good_news_everyon mojo/master 4ca8e4a Sebastian Riedel: fixed a few typos in documentation
12:08 good_news_everyon left #mojo
12:14 Akron joined #mojo
12:14 Dandre joined #mojo
12:20 Martin90 joined #mojo
12:21 Martin90 Hello, I wonder if it is possible to uplod file to another server with Mojo::Upload ?
12:22 Martin90 physically different server
12:23 Dandre joined #mojo
12:24 Martin90 and in the same time download from another server, is it possible ?
12:25 pete When you say "upload to another server", what mechanism did you have in mind?
12:25 pete Do you want to proxy the file on by generating another LWP request?
12:25 pete Do you want to SCP it once upload is complete?
12:28 Martin90 I mean automaticly upload to directory in another server
12:30 Martin90 yes I think LWP, does mojo has this feature ? And download from separated server too ?
12:31 punter joined #mojo
12:33 Dandre joined #mojo
12:38 john joined #mojo
12:41 marcus Mojo::UserAgent supports posting files yes, Martin90 - http://mojolicio.us/perldoc/Mojo/UserAgent/Transactor#tx
12:43 Martin90 it is equvalent of LWP ?
12:44 john Given routing of:
12:44 john $logged_in->get('admin/plmapplugin')->to( 'admin#plugin' );$logged_in->get('admin/:action')->to( 'admin#' );
12:45 john $action always returns "plugin", even when the request is for plmapplugin
12:46 john I sthis expected?
12:47 marcus Martin90: yes
12:47 marcus Martin90: Mojo::UserAgent is equivalent to LWP.
12:47 sri hmm, this is problematic https://github.com/kraih/mojo/issues/671
12:49 john Assuming it is expected, how can I get at 'plmapplugin' instead of 'plugin'
12:50 Martin90 thank you marcus ;0
12:51 marcus sri: ouch that's a sticky one.
12:51 john $self->match->endpoint->name returns plmapplugin when requesting admin/plmapplugin
12:51 john but returns 'adminplugin' whe requesting admin/plugin
12:55 sri proposal for the $c problem, add another scope https://gist.github.com/anonymous/a9d3d416c66b86fa7980
12:56 marcus john: I'm not sure what you are expecting.
12:56 sri that actually allows self and c stash values to override $self and $c in the template
13:00 john marcus: in my method 'plugin' in my Admin.pm, I'd like to get either plmapplugin, if the request was admin/plmapplugin
13:00 john or
13:00 john plugin, if the request was admin/plugin
13:03 Akron sri: :)
13:03 Akron I forgot about self.
13:03 marcus john: Action is a reserved stash value, and automatically matches the action you are dispatched to.
13:04 marcus http://mojolicio.us/perldoc/Mojolicious/Controller lists the reserved stash values
13:05 john marcus: in the case of admin/plmapplugin, $action has a value of plugin
13:05 Martin90 The best way to pass data into template is by $self->render(template => 'temp_name', data => $hashdata); ?
13:05 Martin90 data is a helper right ?
13:05 marcus john: because you dispatch to the controller action plugin.
13:06 john marcus: but how might I get plmapplugin if the request is admin/plmapplugin
13:07 Akron Why not disallowing c and self then? It's broken since june, so backcompat may not be the biggest issue.
13:07 marcus john: ->to('admin#plmapplugin')
13:08 john marcus: sorry, what do you mean by that?
13:09 marcus john: I think you're misunderstanding something fundamental about :action - Mojo automatically sets it to the name of the sub in the controller that you're matching.
13:09 john marcus: Yes, it would appear I am. :)
13:10 john marcus: I was hoping there was a single call I could make that would give me the context of what called the sub in my controller
13:10 john marcus: as it is, I have to do a bit of logic
13:11 marcus john: or you could name the placeholder in your second action not :action, as it's reserved, and dispatch it to a single method.
13:11 marcus like - $logged_in->get('admin/:action')->to( 'admin#' ); that doesn't seem very sane to me.
13:12 john oh!
13:13 john It just saves me typing out every route
13:13 john most of my uris are admin/"sub in admin controller"
13:14 lipizzan joined #mojo
13:14 john It seems to work like $logged_in->get('admin/:foo')->to( 'admin#' . $foo)
13:16 john I'll have a look at the routing docs
13:16 john as I am woefully unclued
13:16 john a routard :)
13:17 sri Akron: stash values shouldn't be reserved for no reason
13:17 * nic likes "routard"
13:19 sri Akron: in fact, i'd rather make the list of reserved stash values smaller
13:20 Akron sri: I agree. But the possibility of overriding the controller doesn't sound like such a good idea.
13:21 sri marcus, tempire, crab, jberger, batman: what do you think? reserve self/c stash values or add a new scope (like in my patch above) preserving backwards compatibility?
13:22 marcus sri: I'm in favor of your patch.
13:22 marcus unless there's some horrible downside I don't see
13:26 * batman doesn't understand the gist :(
13:28 * Akron neither ... Does it mean, I can access stash 'c' and the value differs from $c ... ?
13:28 batman sri: i think i might get it now. you define $c outside of the "{$actual_template_code}" ?
13:28 batman so if the template defined $c, then it will override the other variable, but avoid the warning because of the scope?
13:29 batman sri: what about the do{} ? why did you have the do{} before?
13:29 sri completely unrelated
13:29 Akron Ah, okay, I see. Thanks batman.
13:29 batman sri: ok.
13:29 sri do was useless garbage
13:30 batman ;)
13:30 batman then i have no reason to say anything but +1
13:30 batman :)
13:30 Akron but it sounds very motivational!
13:30 Akron Now that I understand the code, I'm all for the patch, too.
13:30 zivester joined #mojo
13:30 Martin90 If I start morbo from command line where I should place new ->watch directories ?
13:31 sri \o/
13:35 good_news_everyon joined #mojo
13:35 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/JfPwoQ
13:35 good_news_everyon mojo/master e9e2052 Sebastian Riedel: fixed .ep template bug where the stash value "c" could no longer be used (closes #671)
13:35 good_news_everyon left #mojo
13:37 Martin90 do { $code\n"; mising } ?
13:39 batman Martin90: $mt->prepend($prepend . $mt->prepend)->append('}' . $mt->append);
13:39 batman if i understand it correctly from the gist ^
13:40 Tiger joined #mojo
13:44 good_news_everyon joined #mojo
13:44 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/RyetpQ
13:44 good_news_everyon mojo/master 895cb87 Sebastian Riedel: put return value into the correct scope
13:44 good_news_everyon left #mojo
13:46 Akron sri++ Thanks! (although I changed my code already to use another character for the stash parameter. ;))
13:46 sri Akron++
13:47 Martin90 none of videos in "Popular Topics" at http://mojocasts.com doesn't work.
13:48 sri that reminds me... i've been wondering if there is money in putting screencasts on youtube
13:49 Dandre joined #mojo
13:49 Martin90 why money ? Youtube is free as far as I know ;)
13:49 sri make money
13:50 Martin90 ahh ;)
13:50 Martin90 what's wrong with these at mojocast ? Why they don't work ?
13:51 Martin90 all from Episodes are ok
13:51 sri they work for me
13:51 Martin90 from "Popular Topics"  tab ?
13:51 sri yes
13:53 Martin90 I use firefox and they don't
13:53 Dandre joined #mojo
13:53 Martin90 now testing on chrome and after very long load started
13:56 Martin90 Sometimes I click on episode and nothing happen, so I wouldn't say it work ok
13:59 Martin90 which feature in mojo is responsible for hash selecting webpage content like #helper ?
14:00 sh4 joined #mojo
14:04 Martin90 like these tags in documentation
14:06 d4rkie joined #mojo
14:07 Dandre joined #mojo
14:10 Dandre joined #mojo
14:21 Dandre joined #mojo
14:29 batman Martin90: what do you mean? like how to build an anchor that points to an element on a webpage?
14:29 batman that's more a pure html thing, not a mojo thing...
14:30 Martin90 yes, like those in mojo doc i.e http://mojolicio.us/perldoc/Mojolicious/Plugin/TagHelpers#HELPERS
14:30 Martin90 #HELPERS
14:30 Martin90 I thought there is mojo feature for that
14:32 Martin90 I have problem with morbo in full app, it doesn't refresh webpage if content change in templates and MyApp package
14:35 batman Martin90: it's <a href="name_of_id">....</a> and <h1 id="name_of_id"></h1>
14:35 batman the id="" can be added to any element.
14:35 batman oops! i meant <a href="#name_of_id">....</a>
14:35 Martin90 pure html then
14:36 Martin90 thank you batman ;)
14:36 Martin90 Can you also help with my morbo issue ;/ It doesn't refresh content and in result I have to stop and run morbo again each time I change somehing...
14:38 batman Martin90: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a # it's the "fragment" of an url
14:38 batman you can also construct the url in mojo: %= my $url url_for("whatever)->fragment("name_of_id");
14:38 batman my $url =
14:38 * batman wonder if there's something stuck in the keyboard.... :)
14:39 Martin90 ;)
14:39 Martin90 I get it thanks.
14:40 batman http://mojolicio.us/perldoc/Mojo/URL#fragment
14:40 * sri wonders if there's a good resource we could point people at for learning more about html
14:40 sri (and the basics of the web)
14:41 sri like the elements of a url
14:41 batman w3schools!
14:41 purl i think w3schools is where I tend to reference CSS attributes.  There's probably more useful stuff there than I've seen.
14:41 batman j/k
14:42 mr-foobar joined #mojo
14:42 Martin90 w3schools, yes amazing resource
14:42 batman i never click on a w3scools link anymore... unless i don't see what the link points to, before clicking :)
14:42 batman sri: https://developer.mozilla.org/en-US/learn/html ?
14:43 batman developer.mozilla.org++ # next after stackoverflow imho
14:43 sri yea, googled that too :) but most of those resources don't actually look very nice
14:43 Martin90 stackoverflow why would you point there to lern HTML ? ;)
14:45 batman Martin90: because i know what to ask for
14:45 batman sri: you don't think developer.mozilla.org look any good...?
14:46 batman i think it's w3.org, done right :)
14:46 sri batman: it's not exactly what i wanted... but i guess it's the best there is ;p
14:47 batman not sure what you wanted :/
14:47 Dandre joined #mojo
14:47 batman what i really like about mozilla is that it even mention caveats about different browsers
14:47 Martin90 does morbo olny refresh under Lite ?
14:47 batman so it's like w3.org + caniuse.com :)
14:47 batman Martin90: no
14:47 batman but it only refresh when a file you have told it to watch changes
14:48 batman s/refresh/reloads/
14:48 Martin90 ok here is the problem
14:48 Martin90 I start morbo from coman line
14:48 Martin90 how can I add watch in my script ?
14:48 Martin90 Mojolicious::Commands->start_app('MyApp');
14:49 Martin90 I bet it should happen somewhere in starting app but how to access object of morbo ?
14:50 sri morbo -h
14:51 Dandre joined #mojo
14:54 good_news_everyon joined #mojo
14:54 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/WPdLxw
14:54 good_news_everyon mojo/master 035cd84 Sebastian Riedel: recommend MDN for learning HTML
14:54 good_news_everyon left #mojo
14:54 sri http://mojolicio.us/perldoc#LEARNING-HTML
14:55 cpan_mojo Mojolicious-Plugin-BootstrapHelpers 0.010 by CSSON - http://metacpan.org/release/CSSON/Mojolicious-Plugin-BootstrapHelpers-0.010
14:56 batman sri: cool :)
14:57 sri batman++
14:58 batman your
14:58 batman oops!
14:58 batman sweet!
14:58 batman eating+typing....
14:59 Martin90 sri, I bet you were asked for this but do you know any big projects running on Mojolious ?
15:01 sri rt.com
15:02 sri https://github.com/kraih/mojo/wiki/Projects-and-Companies-Using-Mojolicious#companies
15:03 Martin90 IBM, using mojolicious ? o.0
15:04 sri it's more surprising if a large diverse it company doesn't use mojolicious for something
15:04 batman Martin90: not sure what big is, but i served 2.3M xml documents yesterday...
15:05 doby i work for a massive company and they run mojolicious
15:05 doby i put it there :)
15:05 doby i would tell you but dont think i can
15:05 Martin90 sri, haha sorry for my surprise ;)
15:07 Martin90 good job mojolicious team, I wonder if mojolicious is competitive for php frameworks though
15:08 Martin90 like node.js
15:08 Mikey Martin90: harder to find perl devs than php devs.  also harder to find food than it is to find dirt.
15:09 batman Martin90: we got some php devs to use mojo
15:10 batman haven't heard of any mojo devs that went to php...at least not for fun :P
15:10 batman ;)
15:11 Martin90 hehe, nice ;)
15:12 Martin90 I must admit when I fiI must admit when I first heard of mojolicious and that its author is catalyst father I asked myself why next framework ? Why not just improve or add features to existing one ?rst heard of mojolious and that its autor is catalyst fateher I asked myself why next framework ? Why not just improve or add fetures to existing one ?
15:13 batman Martin90: did you just bang your head in the keyboard..?
15:13 Martin90 hah xD
15:13 Martin90 sorry cat did it xD
15:13 batman haha
15:14 Dandre joined #mojo
15:14 Martin90 but really that was my first impression
15:16 bobkare joined #mojo
15:18 sri the majority of the catalyst core team didn't agree with me, making something new was a better option than to keep fighting
15:18 sri i regret nothing
15:18 batman i'm really happy. catalyst is very complicated compared to mojolicious.
15:19 batman and mojo is super light. it does the same as catalyst + a lot of plugins in very few lines
15:19 sri (of course i wish i had made better decisions in the first place... but who doesn't in retrospect)
15:20 batman i think if you don't wish that, then you haven't developed ;)
15:22 Martin90 cool
15:23 Martin90 are you interested in translating mojo to another language ?
15:24 sri https://github.com/kraih/mojo/wiki#documentation-translation
15:24 sri ;)
15:25 Martin90 cool
15:28 good_news_everyon joined #mojo
15:28 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/9Uoj5Q
15:28 good_news_everyon mojo/master 9162e45 Sebastian Riedel: documentation updates are rarely mentioned on Twitter
15:28 good_news_everyon left #mojo
15:28 neilhwatson Why would I get the error 'Couldn't find application class' when I try to start the app?
15:31 Martin90 (Missing operator before  'default'?) near "% layout 'default'" what is it ?
15:36 Martin90 strange,..
15:36 purl i guess strange, is a continue considered the same lexical scope as the for's?
15:40 cpan_mojo Mojolicious-Plugin-AttributeMaker 0.04004 by HAMMER - http://metacpan.org/release/HAMMER/Mojolicious-Plugin-AttributeMaker-0.04004
15:41 Martin90 morbo -w --watch lib/MyApp/Session.pm templates\webpages\index.html.ep myapp PROBLEM: File "lib/MyApp/Session.pm" did not return an application object.
15:41 Martin90 complain even for templates
15:43 good_news_everyon joined #mojo
15:43 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/_jGopg
15:43 good_news_everyon mojo/master 2290dd0 Sebastian Riedel: mention @INC in missing application class error
15:43 good_news_everyon left #mojo
15:51 batman Martin90: you need specify -w multiple times
15:52 Martin90 I decided to swicth to Lite for prototyping
15:52 Martin90 the dir organization is the same as it is in full app right ?
15:54 batman yes
15:55 batman if you mean ./public and ./templates
15:55 batman have you read the Mojolicious::Lite tutorial?
15:55 Martin90 I am doing it now ;)
15:56 Martin90 yes I meant public and templates
15:56 Martin90 lite doesn't have startup function roght ?
15:57 Martin90 right*
15:57 disputin joined #mojo
15:58 Martin90 thre is no MyApp and controler classes right ?
15:58 Martin90 everything is in one file
16:04 Martin90 ok I have to go, see you ;)
16:37 dj_goku joined #mojo
16:44 disputin joined #mojo
16:47 good_news_everyon joined #mojo
16:47 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/zAtj2g
16:47 good_news_everyon mojo/master b8e10a0 Sebastian Riedel: explain handshake failure
16:47 good_news_everyon left #mojo
17:18 marty joined #mojo
17:20 berov joined #mojo
17:20 meshl joined #mojo
17:25 good_news_everyon joined #mojo
17:25 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/qUHvsw
17:25 good_news_everyon mojo/master 2b85923 Sebastian Riedel: more consistent error messages
17:25 good_news_everyon left #mojo
17:30 Eke- joined #mojo
17:34 preaction joined #mojo
17:34 briandfoy Is there any specific advice about what should go in a Controller and what goes in a Plugin?
17:35 briandfoy And how to handle conflicts if multiple plugins want to define the same names in helper()?
17:35 briandfoy Or is that all just ocular inspection?
17:36 preaction i think nested helpers is a new thing now, or maybe that's just an idea being discussed, which might help that second problem
17:36 preaction my feeling would be if it has a route, it's a controller
17:38 preaction i believe also that controllers are the things you pass to Mojo::Server, so if it can stand alone, it's a controller
17:38 preaction might be wrong on that. most of my stuff has been Lite apps
17:39 briandfoy but the code in the Controller might need other subroutines that specifically don't use the route. Think about refactoring distraction bits into methods. The Controller still needs that code, but is it a method in the Controller or does it move to a Plugin?
17:39 briandfoy I'm just curious, since the Mojo docs are really good on reference but light on this sort of wisdom.
17:41 preaction i've never had to do, so take this with a grain of salt, but i'd say a plugin is for something that can stand alone and be used through multiple controllers. a plugin can be distributed separately. so, i'd probably start it out as a method in a controller until it became useful to split into a plugin
17:42 sri preaction: nested helpers are a thing and released :)
17:42 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Adding-helpers
17:44 preaction so i'm thinking controller and plugin both are discrete units of distributable parts. controller can stand alone. plugin can't
17:44 preaction the assetpack plugin has routes, so i was wrong up there
17:45 sri preaction: afraid your definition of controller is incorrect
17:45 sri they are never passed to Mojo::Server
17:45 preaction right. they need to be routed to...
17:46 preaction okay, now i'm also confused about the differences ;)
17:46 sri briandfoy makes a good point, i should mention that keeping actions small is desirable
17:52 batman briandfoy: i try to put as much code as possible into the controller, and then i move code into other classes or plugins when i need to reuse the code
17:52 briandfoy I read Rendering a while ago, but it's not where I'd look for advice on Plugins. Sorta like having to look for docs on Perl variables in perldata instead of perlvar :)
17:53 batman briandfoy: the reason i move code into a plugin could be to call a helper from templates, controller or even from the app.
17:54 batman but i also try to make new classes or packages that i can import functions from. sometimes when i need to move code out of the controller, the code makes up it's own little system which is handy to isolate into a class
17:55 batman sorry, for not giving any "best practices" :/
17:56 sri fun fact, there's a plugin example in almost every guide because they are so versatile
17:57 sri it's true, the docs are low on organizational best practices
17:58 sri regarding plugins... we are simply not sure yet what the best practice is ;p
17:58 briandfoy I'm mostly worried about Plugin collisions and helping people know where a method comes from.
17:58 briandfoy I haven't looked for any introspection stuff in Mojo yet :)
17:58 batman "helping people know where a method comes from." <-- tricky part i guess.
18:00 sri yes, tricky
18:00 sri collisions show up in the log though
18:02 briandfoy well, logging is another area I'm working on since I need more powerful logging than STDERR or a file
18:05 good_news_everyon joined #mojo
18:05 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/WQiRew
18:05 good_news_everyon mojo/master bbd74e8 Sebastian Riedel: mention that actions should be kept small
18:05 good_news_everyon left #mojo
18:07 sri i think we are in a bit of a pre best practices phase
18:07 briandfoy One of the reasons I never quite liked Python was that in my first day learning it, I tried creating variable names that happened to be method names in some simple class I was using for the example. The messages were of no help to track down the error and I solved it by changing the name of the variable.
18:08 briandfoy I love sigils for that reason.
18:08 sri i hope nested helpers will make that a non-issue
18:09 sri i've optimized them very aggressively, to make choosing a prefix a no-brainer
18:09 briandfoy I don't have an actual problem right now. It's just the funny feeling I get when everyone is adding random mixins at the same time.
18:09 briandfoy It's supposed to be a salve for multiple inheritance, but I think it often has the same issues through other means
18:09 * sri nods
18:10 briandfoy I still wish Perl had Interfaces
18:11 preaction maybe sub signatures is a step towards that
18:11 batman i wonder how many helpers people have...
18:12 sri this is why i was pushing so hard for nested helpers ;)
18:12 batman i mean, i've never even thought that helper collision could be an issue.
18:12 batman how many mail() helpers do i need...?
18:12 batman but... i think maybe plugin creators should be better at being able to accepting "helper_name", "helper_namespace" or something like that
18:13 briandfoy When Moose came out, one of the developers promised me that it would only ever be five files. Now it's not so much Moose that I don't like but that any serious application has a long list of plugins and syntax benders.
18:13 briandfoy Dist::Zilla has the same problem
18:13 briandfoy as does the American highway system
18:13 briandfoy that's why I like Mojo.
18:13 sri batman: that's because you're using fat controllers
18:13 briandfoy It has everything in one distro (mostly).
18:13 batman i really don't like Dist::Zilla. it's true to it's name: a giant monster :/
18:14 sri which gets you yelled at in a lot of places ;)
18:14 batman sri: i wouldn't call them "fat". it's not like 1000 lines of code...
18:22 good_news_everyon joined #mojo
18:22 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/n8Pg6w
18:22 good_news_everyon mojo/master 8747ad9 Sebastian Riedel: more reliable log messages for helper collisions
18:22 good_news_everyon left #mojo
18:34 disputin joined #mojo
18:42 KCL joined #mojo
18:48 good_news_everyon joined #mojo
18:48 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/i0c7fQ
18:48 good_news_everyon mojo/master 9faf4ff Sebastian Riedel: use more nested helpers in recipes
18:48 good_news_everyon left #mojo
18:55 berov briandfoy:  if you need some methods not exposed as actions you can simply "hide" them - this is what I do
18:56 berov example: https://metacpan.org/source/BEROV/Ado-0.61/lib/Ado.pm#L63
18:57 Kripton joined #mojo
18:58 berov I have a base Controller class in which I put some methods which I want to share among all controllers
18:58 berov then hide the methods in the application class  upon startup of the app
18:58 berov I discovered this by looking at Mojo source
18:59 berov the controllers of course inherit from this base class
19:00 jamesaxl joined #mojo
19:00 sri if you have to hide methods, odds are you're doing something wrong
19:01 sri a) they should be helpers, or b) they should be private methods with an _ prefix
19:02 berov I do not want to use them as helpers
19:02 sri what is "as helpers"?
19:02 berov well in templates helpers are also available
19:03 sri not necessarily
19:03 berov and I do not whant them there
19:03 sri see nested helpers http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Adding-helpers
19:04 berov ah thanks :) I was about to look for this :)
19:04 sri $c->ado->config
19:06 berov good idea, thankgs
19:07 berov so I can organise some specific helpers in one place
19:07 sri that's the idea
19:09 berov yep will look into this
19:11 sri is it just me or are the links not working in chrome? https://developer.mozilla.org/en-US/learn/html
19:11 berov not ot oppose but to understand .. why do you hide some methids
19:11 berov lib/Mojolicious.pm:162:  $r->hide(qw(param redirect_to render render_exception render_later));
19:12 berov like these
19:12 sri because they are built-in public methods
19:12 berov sri: ?
19:12 berov aha
19:12 berov ok
19:13 sri those methods are essentials everything else is built on top of, so they need to be a little faster than helpers
19:13 berov then I will have to think what are those I hide in my code :)
19:13 berov ah that is good explanation
19:13 preaction sri: on that page, the links to MDN are working for me in Safari, but none of the others. an external-link interstitial problem maybe?
19:14 genio sri: seem to be working for me in Chrome
19:14 sri right, internal links work for me too
19:14 berov some of those which I hide , I use them the same way - almost everywhere
19:14 sri just the external ones to the tutorials not
19:14 sri open in new tab works though
19:15 preaction http://standardmarkdown.com <- i was just using Confluence and decrying the state of markdown, and today they announce this
19:16 genio How can it possibly take this long to install a compiler and IDE?  MS Visual Studio 2013 has been installing for 2+ hours
19:17 moritz it's enterprise!
19:18 batman genio: haha :)
19:19 batman i wonder how long it takes to start visual studio...
19:19 genio The sad thing is that the project I need it for shouldn't take me more than 20-30 minutes.
19:22 mishantil genio: Isn't it popular to outsource booting Visual Studio to India these days?
19:22 * sri wonders if this is a better link https://developer.mozilla.org/en-US/learn
19:23 berov sri: I like the previous more
19:24 berov https://developer.mozilla.org/en-US/learn/html
19:25 berov but may be the second is better
19:25 berov if you wan to point a newby to everything
19:27 sri this one is a bit slow but also not bad http://www.codecademy.com/en/tracks/web
19:27 berov If It was me I would be quite intimidated seeing how much I have to learn :)
19:29 preaction that has been a constant source of annoyance for me in #css on freenode: web dev is just as deep and broad as any other dev. CSS is just as complex as any other computer language :p
19:29 mishantil and getting worse all the time.
19:29 berov agree :)
19:32 sri hmm, one of the links on the mozilla site is even dead :S
19:32 sri the google one
19:32 purl the google one is like, "Look, you can go to froogle.google.com!
19:35 sri it's funny, we complain all the time about the state of perl tutorials... but linking to a few good ones is no big problem... now html and web basics... OMG
19:43 Eke- joined #mojo
19:47 Martin90 joined #mojo
19:48 berov BTW I see jberger started writing a book about Mojolicious. What are the plans?
19:48 Martin90 book about Mojolicious ? Which one ?
19:48 berov may be this will be the kind of wisdom briandfoy is looking for
19:48 Martin90 ahh writing ;)
19:49 berov https://github.com/jberger/MojoBook
19:49 berov seems stalled
19:53 berov I really missed insights on how to organise my app "the right way" so I found my self looking in the Mojo source and other apps mostly PHP and combined
19:54 axlrose joined #mojo
19:54 woz joined #mojo
19:55 berov mostly missed wisdom on how to make it so when it grows I do not have to start thinking of rewiting it
19:56 berov you know those simple solutions you have to make in the beginning so your code-base can grow without at some point starting hindering maintenance
19:59 sri i think tempire might also be secretly writing
19:59 Martin90 Can I use startup in Lite and in general is there Controller class ?
20:01 jnbek I wouldn't say 'stalled'
20:01 jnbek the mojo devs have just been on a hell of a sprint, for lack of a better term; getting cool stuff into Mojolicious itself :D
20:01 berov it's my English, sorry
20:02 jnbek s'ok
20:02 jamesaxl joined #mojo
20:04 berov Martin90: if you want "startup" you do not want a lite app
20:04 berov just MHO
20:06 Martin90 what about controller class in lite version ?
20:06 berov same
20:06 Martin90 does lite provide this ?
20:07 berov lite is for one-file apps
20:07 Martin90 so, in lite version all staff is in myapp.pl whic hends with app->start right ?
20:07 Martin90 berov, no excatly it provide templates which may be outside ;)
20:07 berov but of courese you should be able to implement startup, if you want
20:08 berov *of course
20:09 Martin90 yes the doc says that
20:09 berov then you will find your self needein something more and   you should go for a full - well structured application
20:11 berov here are good amounts of examples which I used https://github.com/kraih/mojo/tree/master/t
20:12 berov and see this also https://github.com/kraih/mojo/wiki/Example-applications
20:16 Martin90 good source, thanks ;)
20:17 berov welcome
20:19 Akron joined #mojo
20:22 denis_boyun joined #mojo
20:22 Martin90 I looks like startup doesn't work under lite
20:25 woz joined #mojo
20:31 berov you need an application class
20:31 berov package*
20:32 berov which must inherit from Mojolcious
20:33 berov http://mojolicio.us/perldoc/Mojolicious/Guides/Growing
20:34 berov just read this from the beginning to the end
20:38 batman Martin90: whatever code you put directly in the file will be run, like the code in startup()
20:39 batman The scoping is different though. Unless you put code inside { a scope }
20:44 Kripton_ joined #mojo
20:45 Martin90 so normal controler class won't work right ?
20:46 Martin90 I want to prototype in lite and then copy paste code into full app
20:47 Martin90 that's sensible way of doing things, if I would have to rewrite code from lite to full app then it doesn't have sense
20:48 mishantil Martin90: Going from lite to full is trivial.
20:48 mishantil Martin90: Just make sure you follow some sensible patterns then you're good.
20:49 Martin90 "sensible patters" in routes right ?
20:51 mishantil Martin90: routes, naming, dealing with externals (like db) etc.
20:54 good_news_everyon joined #mojo
20:54 good_news_everyon [mojo] kraih tagged v5.37 at aab6ce2: http://git.io/V_3w-Q
20:54 good_news_everyon left #mojo
20:56 good_news_everyon joined #mojo
20:56 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/8bpuHQ
20:56 good_news_everyon mojo/master badd15d Sebastian Riedel: bump version
20:56 good_news_everyon left #mojo
20:56 woz joined #mojo
20:56 cpan_mojo Mojolicious 5.37 by Sebastian Riedel - http://metacpan.org/release/SRI/Mojolicious-5.37
21:06 woz_ joined #mojo
21:09 jnbek muhuhahahaha
21:15 jberger_ MojoBook's not dead, it's just resting. Beautiful plumage!
21:18 jberger_ Martin90: agreed, please read Growing again carefully
21:19 jberger_ And be sure you have read Mojolicious::Lite recently too
21:35 Martin90 alright, thanks ;)
21:37 woz joined #mojo
21:45 bodgix joined #mojo
22:01 kablamo joined #mojo
22:02 disputin joined #mojo
22:11 woz joined #mojo
22:18 trone joined #mojo
22:18 cpan_mojo Mojolicious-Plugin-AttributeMaker 0.04005 by HAMMER - http://metacpan.org/release/HAMMER/Mojolicious-Plugin-AttributeMaker-0.04005
22:29 woz joined #mojo
22:34 cpan_mojo Mojolicious-Plugin-AttributeMaker 0.04 by HAMMER - http://metacpan.org/release/HAMMER/Mojolicious-Plugin-AttributeMaker-0.04
22:42 cpan_mojo Mojolicious-Plugin-AttributeMaker 0.05 by HAMMER - http://metacpan.org/release/HAMMER/Mojolicious-Plugin-AttributeMaker-0.05
22:42 jnbek stop
22:42 jnbek HAMMER time!!
22:42 jnbek sorry
22:43 * jnbek escorts himself out
23:00 sri :D
23:00 sri \o\
23:00 sri /o/
23:01 meshl joined #mojo
23:03 GabrielVieira joined #mojo
23:33 jberger ¯\_(ツ)_/¯
23:37 firnsy lol
23:50 d4rkie joined #mojo
23:55 ElShaun joined #mojo

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