Camelia, the Perl 6 bug

IRC log for #mojo, 2013-01-04

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

All times shown according to UTC.

Time Nick Message
00:09 Miked joined #mojo
00:12 Molaf_ joined #mojo
00:23 inokenty sri: http://pastebin.com/Je4Bqma9
00:23 inokenty Is it correct behaviour?
00:37 inokenty My attempt to solve the problem - http://pastebin.com/VgUQT1kZ
00:39 Britzel joined #mojo
00:41 vervain Move your layout into your 'extends'
00:41 vervain Or at least if that's what you want
00:41 vervain ;-)
00:46 vervain My wording wasn't that great so: http://pastebin.com/F8kMZEXD
00:46 egopro joined #mojo
00:48 inokenty vervain: But I don't want to hardcode layout name in a template
00:49 inokenty I set layout name in $app->defaults(layout => 'default');
00:55 mattastrophe joined #mojo
01:06 vervain I see what you mean.  Puzzling.
01:10 hlin joined #mojo
01:17 basic6 joined #mojo
01:20 vervain the tests in layouted_lite_app.t suggest that this behavior is expected.  The 'inheritance' templates don't seem to get the default layout set in app->defaults there either.
01:21 vervain 3252.197
01:22 vervain Sorry, I seem to have dropped a paste.
01:56 mattastrophe joined #mojo
01:58 xaka joined #mojo
02:00 d4rkie joined #mojo
02:01 d4rkie joined #mojo
02:07 zivester joined #mojo
02:21 _xaka_ joined #mojo
02:50 zdk joined #mojo
03:05 ka2u joined #mojo
03:20 yakubori joined #mojo
03:24 noganex_ joined #mojo
03:51 ka2u joined #mojo
04:17 asarch joined #mojo
04:18 keedi joined #mojo
05:17 ka2u joined #mojo
06:30 egopro joined #mojo
06:32 egopro joined #mojo
07:06 Vandal joined #mojo
07:13 basic6 joined #mojo
07:25 ryozi joined #mojo
07:29 sri o/
07:35 wircus frigg
07:35 wircus My web socket is leaking redis subscriptions :-/
07:38 nuba joined #mojo
07:46 PanzerBjorn joined #mojo
07:46 PanzerBjorn Hey guys, anyone got any advice/opinion on web form validators?
07:55 anewkirk try Validation::Class::Simple
07:56 PanzerBjorn From the author's mouth. =)
07:56 PanzerBjorn (Or fingers as the case may be...)
07:56 anewkirk indeed
08:02 sri wircus: i would advice against that
08:04 PanzerBjorn The links in the 'fields' section here are broken - they don't go to documentation:
08:04 PanzerBjorn http://search.cpan.org/~awncorp/Validation-Class-​7.900014/lib/Validation/Class/Prototype.pm#fields
08:05 wircus sri: so would my redis server.
08:06 wircus kinda sucks, cause we wrote the redis driver as well, nobody else to blame :-/
08:06 wircus I know, I'll just blame batman.
08:07 sri da da da da da da da
08:13 dod joined #mojo
08:36 dbr joined #mojo
08:44 anewkirk PanzerBjorn, try metacpan
08:44 tempire Input::Validator is popular
08:45 PanzerBjorn I just decided to write my own validator that is light, efficient and does only what I need. =/ Someday I will stop re-inventing wheels.
08:45 anewkirk famous last words
08:46 connor_goodwolf joined #mojo
08:48 _xaka_ "re-inventing" is a wrong term, people should call it "customizing"
08:48 PanzerBjorn I would think that customizing would start from the base of something else first though...
08:49 anewkirk nothing that exists is completely new
08:49 good_news_everyone joined #mojo
08:49 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/0JSXYA
08:49 good_news_everyone mojo/master b7193ca Sebastian Riedel: link to plugins and commands
08:49 good_news_everyone left #mojo
08:49 anewkirk everything that exists is built on top of implementations that's come before it
08:50 anewkirk (case in point) mojolicious is heavily influenced by rails
08:51 PanzerBjorn It is? o.O
08:51 _xaka_ that's why there are XXXX modules on cpan that do the same but in different ways. wheels for everyone!
08:51 ObseLeTe joined #mojo
08:52 sri TIMTOWTDI
09:00 PanzerBjorn ... //= is the "equals or empty" operator right? Ironically enough, perldoc.org hasn't been updated to include it except in the operator precedence chart.
09:09 rhaen_fork joined #mojo
09:09 rhaen_fork re-moin
09:24 suy joined #mojo
09:32 ObseLeTe joined #mojo
09:37 ObseLeTe joined #mojo
09:40 inokenty sri: Hi. Did you see my issue above?
09:40 basic6 is the following correct: having a route('/login')->to("Main#index") for every http request (get, post) is bad style
09:40 basic6 (the index method would check for parameters (which have been passed via POST) and if there are any, pass those to a login method (in the app class)
09:40 basic6 instead, only get requests to /login should call index and post requests should call a login subroutine in the app class?
09:40 inokenty About 'extends' helper
09:53 ObseLeTe joined #mojo
09:53 sri inokenty: doesn't look like an issue to me
09:54 sri perhaps a feature request
09:55 sri doesn't look particularly interesting to me though
09:56 sri documentation says layout and extends are almost the same, all that would have to be rewritten
10:01 SmokeMachine joined #mojo
10:01 dod joined #mojo
10:01 tempire dernit
10:02 tempire I was going to respond to that namespace ticket, being all responsible.
10:02 tempire \o
10:12 egopro joined #mojo
10:15 sri tempire: i'm sowwy :/
10:31 lukep joined #mojo
10:49 mire_ joined #mojo
10:53 ObseLeTe joined #mojo
10:57 tempire it's ok.
10:57 * tempire takes the credit
11:03 nic basic6: Have you seen the login examples on github?  They're reasonable extensive and include some with authorisation
11:03 basic6 nic: no, i've found some example projects, but i must've missed those. do you have a link?
11:04 nic https://github.com/byterock/Mojo-Au​thentication-Authorization-examples
11:05 basic6 thank you, i'll check it out
11:05 PanzerBjorn Whew, validator rolled. =P Time for bed.
11:06 PanzerBjorn Eccentric rubbish collector indeed.
11:06 PanzerBjorn ... okay, that didn't even make sense. Goodnight! o/
11:08 PanzerBjorn left #mojo
11:16 SmokeMac_ joined #mojo
11:20 Guest-quest joined #mojo
11:21 Guest-quest hello everybody mojoers! ! ! (мажорики по нашему)
11:22 SmokeMachine joined #mojo
11:23 egopro joined #mojo
11:24 SmokeMa__ joined #mojo
11:30 suy joined #mojo
11:30 SmokeMachine joined #mojo
11:34 DaniBunn1 joined #mojo
11:42 inokenty Guest-quest: Здарова =)
11:42 SmokeMac_ joined #mojo
11:47 Guest-quest inokenty: ага, привет
11:48 SmokeMachine joined #mojo
11:49 nic It's a bit strange that HelloWorld is under Mojo rather than Mojolicious
11:49 inokenty Guest-quest: Гуглопереводчик не знает слова "мажорики" ))
11:51 yakubori joined #mojo
11:53 SmokeMachine joined #mojo
11:55 Guest-quest inokenty: забодай комар гугл
11:56 sri nic: it would be just as strange under Mojolicious::
11:57 nic Maybe I'm just thinking about it the wrong way
11:58 nic Turned out I was chasing a wrong thread anyway :/
11:58 nic Was looking for a convenient way to run morbo without creating an app
11:59 sri morbo `which mojo`
11:59 nic ahh
12:00 nic that works v nicely
12:01 nic I'm going to have to write that down somewhere; think it's the second time I've asked
12:02 * nic writes in black marker on wall, "mojo is the smallest app you're looking for"
12:02 kwa joined #mojo
12:07 SmokeMac_ joined #mojo
12:07 mire_ joined #mojo
12:11 nic haha
12:11 nic just seen the Cookbook tells me how to package releases for cpan
12:12 nic so I had abs no excuse for getting that wrong, other than the wicked rumours you can do it directly from github
12:17 nic sri: Could we have a switch for turning on/off the perldoc redirect (to metacpan.org) please
12:17 nic I know why it's needed on mojolicio.us, but locally it's stopping me doing something v useful
12:18 nic I'm writing pod, and it helps to see the current output
12:18 sri -1
12:18 nic mojo generate lite_app; morbo myapp.pl
12:19 nic I think that would do it, with a --watch on the files I'm editing
12:19 sri the pod browser is not meant to be reusable
12:19 SmokeMachine joined #mojo
12:20 sri if you want that use a fork of it
12:20 nic k
12:33 SmokeMachine joined #mojo
12:43 SmokeMac_ joined #mojo
12:48 SmokeMa__ joined #mojo
12:50 good_news_everyone joined #mojo
12:50 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/Vw7tYw
12:50 good_news_everyone mojo/master 6397b63 Sebastian Riedel: documentation tweaks
12:50 good_news_everyone left #mojo
12:55 SmokeMachine joined #mojo
13:03 SmokeMac_ joined #mojo
13:08 SmokeMachine joined #mojo
13:28 ObseLeTe joined #mojo
13:29 SmokeMac_ joined #mojo
13:33 SmokeMachine joined #mojo
13:39 SmokeMac_ joined #mojo
13:43 SmokeMa__ joined #mojo
13:47 SmokeMachine joined #mojo
13:52 SmokeMac_ joined #mojo
14:25 dod joined #mojo
14:26 dod joined #mojo
14:30 dod joined #mojo
14:42 SmokeMachine joined #mojo
14:47 mire_ joined #mojo
14:52 SmokeMac_ joined #mojo
15:06 yakubori joined #mojo
15:16 Britzel_ joined #mojo
15:18 nic I like the idea of making a dedicated plugin for helping development of pod
15:18 nic and the same thing could be used when developing anything rendered
15:19 nic but it's prob not worth doing till I can figure out how to sync the browser
15:19 nic Every time morbo decides to run, at the end it should trigger the browser to refresh
15:20 nic At the moment I've got the browser auto-reloading every 5sec, which is a bit annoying
15:24 rhaen_fork joined #mojo
15:32 SmokeMachine joined #mojo
15:36 SmokeMa__ joined #mojo
15:39 SmokeMac_ joined #mojo
15:50 SmokeMachine joined #mojo
15:54 jberger nic: sounds like a job for websockets
15:55 jberger in which case a CPANable mojo app sounds excellent!
15:55 nic jberger: Does that mean putting it under App:: ?
15:56 nic I like the idea of showing off mojolicious uses under App::, but I was wondering if this would be a simple plugin
15:57 jberger I think if the concept is to be viewing pod documentation live while editing a document, then that sounds like an application
15:57 nic k
15:58 jberger if it was some pluggable part of a website, I would see it as a plugin
15:58 jberger just my opinion
15:58 jberger if you can see it as a part of a larger application, then its probably a plugin
15:58 jberger nic: have you tried farabi?
15:59 nic I just see it as a development tool, so you want it to be easily accessible to devs in a hurry
16:00 nic Assuming I get the hang of websockets quickly enough, I'll ask for opinions before submitting anything
16:00 * nic looks up farabi
16:00 * nic likes the cool headgear
16:01 nic ooh
16:06 d4rkie joined #mojo
16:13 gryphon joined #mojo
16:24 nic farabi is interesting but I don't think it's related to the project I'm thinking about
16:26 nic I'm guessing farabi could include a farabi-specific equivalent
16:27 nic I think a hurdle might be that I can't tell when morbo is finished reloading
16:39 jbnewman joined #mojo
16:39 jberger I think expecting morbo to detect the differences is probably the wrong way to go about it
16:40 jberger but thats a design decision
16:40 jbnewman Would someone please be so kind as to refer this idiot (aka "me") to docs that discuss variable scoping?
16:40 jberger jbnewman, you mean for Perl?
16:41 jberger all mojolicious code is just Perl as far as variable scoping goes
16:41 jbnewman jberger: Nah, within the scope of mojo under its own server. (As in, I'm seeing things happen that are odd, and clearly it's doing something I don't understand).
16:41 jbnewman It may apply perl-wide, in so much as the script continues running and is accessed by multiple users.
16:42 jbnewman (Is a global variable accessible across sessions, for instance?)
16:55 mattastrophe joined #mojo
16:59 jpn joined #mojo
17:06 nic jberger: I suspect we're talking about different things
17:06 nic jbnewman: What do you mean by a global var?
17:06 xaka joined #mojo
17:06 jbnewman So here's specifically what I'm seeing.
17:07 jbnewman I have a module that has a hash in it. At some point, it'll retrieve data from a database, but for the moment, it's just a hard coded hash.
17:07 jbnewman I've build the update routine to change the data.
17:07 jbnewman No big deal. I expected it to display the updated data (because I stick the updated hash into the stash), but that if I reloaded, it to revert back to the original hash.
17:08 jberger jbnewman, you probably want to store the has in an attibute on the app
17:08 jberger *hash
17:08 jbnewman What I'm seeing though is that the update exists, across all users, until the daemon is restarted.
17:08 jbnewman Which suggests that one user has access to that variable, as it has been changed, by another user. Which suggests to me either a caching issue or a scoping issue.
17:09 jberger you want the updated data only to be visible to the user that updated it?
17:10 jbnewman Yeah. Generally, I would expect that all variables would be "local" to a given user, no?
17:10 jberger no
17:10 jbnewman Hence my questions re: variable scoping. :-D
17:10 jberger ok
17:11 jberger any my variable inside the controller function etc will be effectively "request-scoped" because they will be reinitialize at each call
17:11 jberger but any persistent variables are essentially bound to the controller or app, so obviously shared across requests
17:12 SmokeMachine joined #mojo
17:12 jberger I expect this is similar to all other web frameworks
17:12 jberger except pehaps Continuity
17:13 * jbnewman is reasonably new to web frameworks.
17:13 jberger remember, basically what you are defining is the behavior of the application
17:13 * jbnewman tries to figure out where the variable is that's existing outside the controller function.
17:14 jberger not simply the behavior on each request
17:14 * jbnewman figures it's probably because of his love of hash references.
17:14 SmokeMachine joined #mojo
17:14 jberger you can put the hashreference inside the stash
17:15 jberger the stash only exists for the user
17:16 jbnewman Found it.
17:17 jbnewman So I have a module I wrote, for sake of conversation, a utility module, that's where this hash (reference) is that I'm using with dummy data.
17:17 jbnewman It returned, in turn, a hash reference.
17:17 jbnewman So when the other functions altered the hash reference they were working with, this ultimately functioned as a global variable across requests… because they were all changing the destination hash.
17:18 jbnewman (Which actually could be seen as a "feature").
17:18 jberger in general what you would probably do is store a unique identifier in the session
17:18 jberger and keep any active user data in a larger hash where the keys are the unique identifiers
17:18 jbnewman Well, I think when I move to using "real data" (databasee) the problem goes away.
17:18 jberger probably
17:18 jbnewman In the short term, doing a shallow copy of the hash reference before returning it from the utility module worked.
17:19 jberger look into the session storage though, you will probably need that
17:19 jberger cool, if it work
17:19 jberger s
17:19 * jbnewman nods
17:20 jbnewman And, if I comment out my "fix-up" code, I get a server-lifetime-persistent data store, which is actually quite handy for pre-database work! Wadda deal! :-) Many thanks for your help.
17:28 SmokeMac_ joined #mojo
17:38 SmokeMachine joined #mojo
17:40 mire_ joined #mojo
17:43 marcus o/
17:43 marcus Wonder how we can make Mojolcious more appealing to women.
17:44 SmokeMac_ joined #mojo
17:44 marcus I mean, we have a horse on the frontpage and everything....
17:45 marcus unicorn even
17:48 SmokeMa__ joined #mojo
17:56 ObseLeTe joined #mojo
18:01 SmokeMachine joined #mojo
18:02 wircus hmm
18:03 wircus Think I stopped the redis subscription leak \o/
18:03 wircus now to add a effin' spinner
18:08 sri https://github.com/kraih/mojo/pull/437 # needs opinions
18:10 sri if nobody cares i think the base_tag helper is toast
18:17 basic6 is there any reason to add a helper (instead of just a regular subroutine) to the application class if it's not used in any template (which seems to be the reason to use a helper)?
18:26 cstamas is there some examples about using eventemitter available?
18:28 rem_lex| joined #mojo
18:28 SmokeMachine joined #mojo
18:33 jberger basic6, two reasons to add helpers that I can think of, 1 you need the controller instance or 2 you need to use in a template
18:33 jberger otherwise they are just methods
18:34 jberger sri: I see no reason not to merge his patch
18:34 jberger deprecating the base_tag is probably fine too
18:35 jberger but if there is some reason to worry about security, may as well do that now
18:36 jberger then again, I can't quite figure out why he is adding login information to the app's url
18:36 jberger to then need to scrub it?
18:38 ispy_ joined #mojo
18:38 ispy_ hey sri and all...
18:38 ispy_ anyone else having trouble getting mojolicious to properly determine the proper app-mode?
18:39 ispy_ If I launch my application using morbo, I would assume the app->mode to be "development" or even "nothing at all". And when launching under Hypnotoad or Apache, I'd assume "production" .. is my understand incorrect?
18:41 anewkirk ispy_, deployment configuration is never detected
18:41 anewkirk hypnotoad does force production mode
18:41 anewkirk but thats it
18:41 anewkirk development mode is the default
18:41 ispy_ anewkirk, ok, my tests, morbo and daemon mode also force production.
18:41 anewkirk I doubt that, you're overlooking something
18:42 ispy_ hmm...
18:42 anewkirk maybe you set a ENV var and forgot
18:43 ispy_ anewkirk, you would think, but dude, that's not the case? after you just mentioned it I was sure to double check.
18:43 ispy_ Let me check my .bashrc
18:43 ispy_ Maybe I have some old cruft there...
18:44 ispy_ nope all clear. Nothing in my environment forcing MOJO_MODE to anything.
18:44 ispy_ Nothing in my single script "after5" calling $ENV{'MOJO_HOME'} or setting app->mode to anything...
18:44 ispy_ This is been driving me nuts for a few months, I've worked around it.
18:45 ispy_ This is for after5detroit.com, a currently year long in production mojolicious::lite application? been doing really well, too. I'm just trying to figure this thing out ;)
18:45 anewkirk not sure I can help beyond that
18:46 ispy_ Well, thanks for trying. You at least helped me to double check a few points.
18:48 anewkirk thanks
18:56 jberger ispy_, did you try simply running perl -E 'say $ENV{MOJO_MODE}'
18:58 jberger there are any number of places in the chain that the env var could be set
18:58 jberger that at least rules out all the ones before you get to mojo
18:58 jberger then you might try `ack -i mode` on your source tree
19:03 ispy_ jberger, thanks, I'll do this now.
19:04 wircus sri: fwiw, I never used that helper
19:05 sri wircus: it predates all the url generating helpers :)
19:05 sri doubt there is a good use for it anymore
19:06 ispy_ jberger, so when I do the perl -E, an empty value is sent to stdout. So that's good.
19:08 ispy_ jberger, and again I can't find any place within my source where I'm defining it otherwise.
19:09 ispy_ Here's how I came across this issue (yet to be determined I know) ? after5detroit.com uses google apps for user authentication. However when I'm developing it locally, I'd prefer to override this login mechanism. I took advantage of mojo's ability to be some what self-aware of its mode, especially when weighed against using hypnotoad.
19:12 rhaen_fork joined #mojo
19:14 xaka joined #mojo
19:19 good_news_everyone joined #mojo
19:19 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/HFM6KA
19:19 good_news_everyone mojo/master 5e59bd9 Sebastian Riedel: deprecated base_tag helper (closes #437)
19:19 good_news_everyone left #mojo
19:24 good_news_everyone joined #mojo
19:24 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/cP0C7A
19:24 good_news_everyone mojo/master 62e9eda Sebastian Riedel: fixed typo in documentation
19:24 good_news_everyone left #mojo
19:39 cstamas sri: is there some examples about using eventemitter available?
19:42 mire_ joined #mojo
19:43 phips_ joined #mojo
19:48 phips joined #mojo
19:49 Britzel joined #mojo
19:54 ObseLeTe joined #mojo
20:00 bluescreen joined #mojo
20:16 ObseLeTe joined #mojo
20:41 Guest-quest Give me understanding right:
20:41 Guest-quest Mojolicious::Commands->start_app(MyApp => @ARGV);
20:42 Guest-quest i Would like this:
20:42 Guest-quest use MyApp;
20:42 Guest-quest Mojolicious::Commands->star​t_app(MyApp->new(%foo_args) => @ARGV);
20:44 bpmedley_ joined #mojo
20:45 Guest-quest is it right in principle?
20:49 Guest-quest What do you think?
20:57 ispy_ joined #mojo
21:07 sri MyApp->new(%foo_args)->start
21:08 sri or even MyApp->new(%foo_args)->start(@ARGV)
21:10 Guest-quest sri: ok, thanks
21:11 sri app->start in a lite app is nothing else
21:19 xaka joined #mojo
21:20 Guest-quest sri: big thanks
21:39 perlite joined #mojo
21:42 ispy_ joined #mojo
22:10 good_news_everyone joined #mojo
22:10 good_news_everyone [mojo] kraih pushed 2 new commits to master: http://git.io/cSsMWQ
22:10 good_news_everyone mojo/master 46cb2d2 Sebastian Riedel: documentation tweaks
22:10 good_news_everyone mojo/master cca3889 Sebastian Riedel: updated list of highlights
22:10 good_news_everyone left #mojo
22:13 good_news_everyone joined #mojo
22:13 good_news_everyone [mojo] kraih tagged v3.72 at bed093e: http://git.io/nnbQWQ
22:14 good_news_everyone left #mojo
22:48 Annihitek joined #mojo
23:07 rem_lex joined #mojo
23:46 jzawodn joined #mojo

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