Camelia, the Perl 6 bug

IRC log for #mojo, 2012-02-06

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

All times shown according to UTC.

Time Nick Message
00:11 federated_life is there a quick answer to sending a scalar to the controller ?
00:29 grim_fandango joined #mojo
00:39 marty Use the stash.   http://mojolicio.us/perldoc/Mojoli​cious/Guides/Rendering#Stash_data
00:39 marty https://github.com/kraih/moj​o/wiki/Recipes-for-templates
00:43 federated_life should stash be in controller or the model ?
00:53 marty Either.  stash values are available in templates like so... %= $myvar   or in your controller like so...  $self->stash->{myvar}
00:57 federated_life so in the controller, theres functions like index / protected / logout...should I put the stash in there?
01:01 d4rkie joined #mojo
01:03 marty Whatever works best for your situation.  :)
01:04 federated_life what stuff goes in the package with the startup function ?
01:06 marty "stuff" is somewhat ambiguous.  :)
01:07 federated_life sorry...so it looks like routes go in there, but what other functions would be there aside from startup (startup appears to be a required standard)
01:11 marty There is no "best practices" that have bubbled to the surface yet.  So you can put anything in there.  My preference is to put as little as possible  and subclass whenever reasonable.
01:12 federated_life so then new packages should be made, and called in startup as new?
01:14 federated_life Im trying to pass a second package, but it looks like Im doing it wrong...$self->helper(users => sub { return $users }, datafeed => sub { return $datafeed } );
01:16 marty Here are some example applications.  (beware, some of these may be out dated, ymmv)  https://github.com/kraih/moj​o/wiki/Example-applications
01:17 marty http://mojocasts.com/e3#Helpers
01:17 preflex_ joined #mojo
01:18 federated_life it looks like the helper returns to the controller...but can it return more than one package reference that is accessible in the controller similar to an arrayref list ?
01:24 mire joined #mojo
02:03 hshong joined #mojo
02:09 hshong joined #mojo
02:30 federated_life how to put a loop in the template?
02:30 federated_life to loop through an array with a foreach
02:33 keedi joined #mojo
02:46 marty The template recipes link I sent you has examples of how to loop through an array[ref] passed in the stash
03:23 GitHub100 joined #mojo
03:23 GitHub100 [mojo] kraih created hypnoconf (+1 new commit): http://git.io/szqplw
03:23 GitHub100 [mojo/hypnoconf] deprecated Hypnotoad configuration files in favor of more powerful application configuration files - Sebastian Riedel
03:23 GitHub100 left #mojo
03:27 sri that branch is for https://github.com/kraih/mojo/issues/280
03:27 marty sri++  That's a big change.
03:28 sri the choice was breaking stuff or making it a little messy… that's the little messy solution
03:29 sri not sure if i should write here or in the ticket
03:29 * sri pokes marcus, tempire and crab
03:29 sri it's messy becayse hypnotoad (which is obviously on the Mojo layer) needs to know a little bit about the config plugins
03:30 sri https://github.com/kraih/mojo/blob/hypn​oconf/lib/Mojo/Server/Hypnotoad.pm#L130
03:30 sri specifically that part
03:32 marty Interesting.  None of it will affect me atm, but I imagine it can make deploying mojolicous apps easier in some situations.
03:32 sri little amusing that the change actually ends up removing 20 lines of code
03:32 marty \o/
03:32 marty whoda thunk
03:32 sri not to mention the 20 or so lines that are deprecated now
03:33 sri so -40 in the end
03:34 marty That has been your trend for the last few weeks or so at least.
03:34 sri indeed, removed about 1200 lines :)
03:34 marty wow, more than I thought.
03:35 * marty hopes Prometheus is as awesome as the trailer.
03:35 * sri too
03:35 marty I want to watch it NOW!
03:36 sri !
03:36 marty I just watched "The Thing" last night. It was sorta ok but kinda sorta not. I was looking for marcus amongst all the Norwegian guys.  :)
03:53 hshong joined #mojo
04:07 xaka joined #mojo
04:38 tempire where does hypnotoad read from the mojolicious layer?
04:45 sri tempire: i linked to it
04:46 tempire doh
04:47 sri it's a branch, feel free to hack on it if you've got any idea
04:47 sri we've got an unrelated testing problem though
04:48 sri hypnotoad tests will use the installed mojolicious and not the repo one if one is already installed
04:49 sri side effect of the recent dual-life module fix :S
04:49 sri and i have no clue how to fix it
05:02 GitHub10 joined #mojo
05:02 GitHub10 [mojo] kraih pushed 1 new commit to master: http://git.io/NBs7GQ
05:02 GitHub10 [mojo/master] fixed Hypnotoad and Morbo test bug - Sebastian Riedel
05:02 GitHub10 left #mojo
05:03 sri not pretty, but works
05:06 sri tempire: i expect an opinion from you about the hypnotoad change :)
05:07 * tempire revisits
05:09 tempire what's in HYPNOTOAD_APP ?
05:09 tempire just the filename of the  app script?
05:09 tempire or I guess the app name
05:10 tempire yeah, the script.  ok
05:12 sri internal env vars
05:12 sri it execs, so env vars are used to store information
05:15 tempire I'm a little confused as to where the $app->config is
05:16 sri now that is a good question!
05:17 sri tempire: https://github.com/kraih/mojo/blob/hypnoc​onf/lib/Mojolicious/Plugin/Config.pm#L88
05:17 sri the root of all evil
05:17 tempire oh
05:17 sri right
05:17 tempire hmm
05:17 sri that's what i meant
05:18 tempire that's tough.  it makes perfect sense considering the context.
05:18 sri the big problem is actually https://github.com/kraih/mojo/blob/hypnoc​onf/lib/Mojolicious/Plugin/Config.pm#L161
05:18 tempire but….
05:18 sri we could just use app->defaults->{config} if that little option wasn;t there
05:20 sri i've also considered adding app->config as a real method… but then config plugins would break a little too
05:20 sri i don't see a way out, it's either a little messy or breaks backcompat
05:20 tempire so rears the ugly problem of using general terms for important things.
05:21 tempire among other things
05:21 tempire so, if I understand, the problem with using defaults->{config} is that someone might set stash_key with the value 'config'
05:21 tempire right?
05:22 sri no
05:22 sri they might set it to a value other than config
05:22 tempire yeah
05:24 tempire what was the purpose for stash_key in the first place?
05:24 sri i don't remember
05:25 sri (which usually means someone else asked for)
05:26 sri it's documented in 3rd party modules already though (YAMLConfig)
05:27 sri prolly doc cargo culted… but still
05:29 sri hmmmm
05:29 sri turns out it's untested
05:29 sri so not officially a feature ;p
05:29 sri how weird
05:29 sri and fortunate
06:10 tempire the new page not found page is super great
06:11 GitHub57 joined #mojo
06:11 GitHub57 [mojo] kraih pushed 1 new commit to hypnoconf: http://git.io/HU05eg
06:11 GitHub57 [mojo/hypnoconf] added experimental config method to Mojo - Sebastian Riedel
06:11 GitHub57 left #mojo
06:11 sri ok, please review
06:11 sri i think that's rather clean
06:11 sri no tests broken and config has become more of a core concept
06:13 GitHub84 joined #mojo
06:13 GitHub84 [mojo] kraih pushed 1 new commit to hypnoconf: http://git.io/4j5uCA
06:13 GitHub84 [mojo/hypnoconf] fixed typo - Sebastian Riedel
06:13 GitHub84 left #mojo
06:14 tempire looks fine to me
06:14 tempire %= config 'something' seems like a bad idea
06:15 sri not really
06:16 sri you migth configure stuff like the application name
06:16 tempire in a template?
06:16 sri it's a get
06:16 sri not a set
06:16 tempire oh
06:16 tempire nevermind :s
06:17 sri my only concern now is that config and defaults overlap a bit
06:17 sri their purposes in general are very different though
06:18 tempire config for daemon configuration, defaults for application configuration
06:18 sri nope
06:19 sri config is for everything that comes from config files
06:19 sri defaults is for everything that goes into the stash
06:20 sri config can be changed by admins, defaults is internal
06:23 * sri wonders if marcus has been eaten by a moose
06:23 sri he started the whole discussion but hides now!
06:23 tempire bad cheese
06:41 mattastrophe joined #mojo
06:46 GitHub122 joined #mojo
06:46 GitHub122 [mojo] kraih pushed 1 new commit to hypnoconf: http://git.io/mmKuKw
06:46 GitHub122 [mojo/hypnoconf] added basic config tests - Sebastian Riedel
06:46 GitHub122 left #mojo
06:52 mattastrophe joined #mojo
06:55 GitHub189 joined #mojo
06:55 GitHub189 [mojo] kraih pushed 1 new commit to hypnoconf: http://git.io/bpnT5g
06:55 GitHub189 [mojo/hypnoconf] fixed typos - Sebastian Riedel
06:55 GitHub189 left #mojo
06:55 sri think we are getting close
07:03 Vandal joined #mojo
07:05 cosmincx joined #mojo
07:10 dpetrov_ joined #mojo
07:24 * crab looks at hypnoconf
07:27 mattastrophe joined #mojo
07:30 GitHub174 joined #mojo
07:30 GitHub174 [mojo] kraih pushed 1 new commit to master: http://git.io/Y2kiQQ
07:30 GitHub174 [mojo/master] better Hypnotoad and Morbo test fix - Sebastian Riedel
07:30 GitHub174 left #mojo
07:42 daigangbo joined #mojo
07:44 daigangbo hello,why restart the server when I change the template
07:46 espent joined #mojo
07:47 daigangbo thank you
07:48 tempire daigangbo: for production or development?
07:49 daigangbo dev
07:49 tempire how are you starting the app?
07:50 daigangbo morbo ..
07:51 tempire templates reload automatically with morbo.  you don't have to restart morbo
07:54 daigangbo oh,but when I modify the templates ,the page is not change unless I restart morbo
07:54 tempire what version of mojolicious?
07:54 tempire "mojo version"
07:55 daigangbo perl5/perlbrew/perls/perl-5.14.2/bin/morbo
07:56 tempire that's perl
07:56 tempire execute "mojo version" on the command line
07:56 daigangbo Mojolicious (2.46, Leaf Fluttering In Wind)
07:57 tempire that's the latest, templates should reload fine.
07:59 daigangbo oh,thanks ,I check it again
07:59 GitHub76 joined #mojo
07:59 GitHub76 [mojo] kraih pushed 1 new commit to hypnoconf: http://git.io/PkZmGw
07:59 GitHub76 [mojo/hypnoconf] better Hypnotoad description - Sebastian Riedel
07:59 GitHub76 left #mojo
07:59 sri crab: and what do you think?
07:59 purl I think sri should try flossing more often!
07:59 sri purl: :(
07:59 purl there there
08:04 GitHub16 joined #mojo
08:04 GitHub16 [mojo] kraih pushed 1 new commit to master: http://git.io/uRSlxQ
08:04 GitHub16 [mojo/master] fixed typos - Sebastian Riedel
08:04 GitHub16 left #mojo
08:05 sri oh damn
08:05 sri i broke master :S
08:08 GitHub103 joined #mojo
08:08 GitHub103 [mojo] kraih pushed 1 new commit to master: http://git.io/o1pF1Q
08:08 GitHub103 [mojo/master] Merge branch 'hypnoconf' - Sebastian Riedel
08:08 GitHub103 left #mojo
08:08 sri oh well
08:09 espent /join #perlbrew
08:11 sri update seems quite painless, just tried it for http://mojolicio.us
08:11 sri deprcation warning is there, and zero downtime change from hypnotoad.conf to app config works too
08:14 sri merging hypnoconf was kinda accidental though… hope nobody finds a dealbraker now :o
08:16 bird joined #mojo
08:17 scott joined #mojo
08:20 bird scott
08:24 memowe o/
08:27 keedi joined #mojo
08:28 melmothX joined #mojo
08:57 berov joined #mojo
09:12 cosmincx joined #mojo
09:19 ver joined #mojo
09:20 daxim joined #mojo
09:50 ver joined #mojo
10:00 marcus sri: Read through the diff of your branch, looks very nice to me.
10:04 memowe hypnoconf?
10:27 cosmincx joined #mojo
10:53 ki0_ joined #mojo
11:12 Foxcool joined #mojo
11:27 briang joined #mojo
11:27 marcus memowe: yes
11:30 marcus sri: not hiding, sleeping. You know us boring family men, who sleeps during the night..
13:14 mikegrb_ sta
13:14 mikegrb_ er, ww
13:42 jnap joined #mojo
13:46 inokenty joined #mojo
14:02 judofyr joined #mojo
14:02 judofyr is there a way to get Mojo::JSON to convert an object to proper JSON?
14:02 judofyr e.g. "sub to_json"
14:24 d4rkie joined #mojo
14:31 ki0 joined #mojo
14:41 amoore joined #mojo
14:45 cosmincx joined #mojo
14:57 sri marcus: didn't you want to write something like this? http://mitmproxy.org/
14:58 marcus yes. and now I don't have to \o/
14:58 sri \o/
14:58 marcus being lazy works \o/
15:07 cosmincx joined #mojo
15:14 GitHub147 joined #mojo
15:14 GitHub147 [mojo] kraih pushed 1 new commit to master: http://git.io/Oh-tjg
15:14 GitHub147 [mojo/master] improved session performance slightly - Sebastian Riedel
15:14 GitHub147 left #mojo
15:17 sri we better release soonish, changes list is getting kinda huge
15:31 Netfeed sri: cool tool
15:33 herrclark joined #mojo
15:51 cosmincx joined #mojo
16:09 mercutioviz joined #mojo
16:16 crab shall i?
16:17 cosmincx joined #mojo
16:20 paul oh sri that reminds me
16:20 paul i was going to look through websockets for you
16:20 paul and see if i could see whether there was anything i was doing dumb
16:20 paul have barely touched it in a week now, i'll try and get on it tonight
16:21 baton8 joined #mojo
16:23 sri crab: guess you win again :)
16:24 sri crab: you didn't comment on the hypnoconf branch btw
16:25 crab sri: i haven't tried it yet in production, but looks good.
16:27 GitHub144 joined #mojo
16:27 GitHub144 [mojo] amenonsen pushed 1 new commit to master: http://git.io/8Hb7qw
16:27 GitHub144 [mojo/master] Bump VERSION after release - Abhijit Menon-Sen
16:27 GitHub144 left #mojo
16:28 sri \o/
16:35 GitHub93 joined #mojo
16:35 GitHub93 [mojo] kraih pushed 1 new commit to master: http://git.io/7Y8bpA
16:35 GitHub93 [mojo/master] more config tests - Sebastian Riedel
16:35 GitHub93 left #mojo
16:36 sri crab++
16:44 ki0 joined #mojo
16:45 sri i've sent a little warning to the list, since the deprecation warning is easy to overlook if you've automated your deployment process
16:51 GitHub96 joined #mojo
16:51 GitHub96 [mojo] kraih pushed 1 new commit to master: http://git.io/_loQMQ
16:51 GitHub96 [mojo/master] link to settings from deployment recipe - Sebastian Riedel
16:51 GitHub96 left #mojo
16:56 GitHub175 joined #mojo
16:56 GitHub175 [mojo] kraih pushed 1 new commit to master: http://git.io/G88KZg
16:56 GitHub175 [mojo/master] link to cookbook from settings section in Hypnotoad documentation - Sebastian Riedel
16:56 GitHub175 left #mojo
16:58 marcus crab++ sri++
16:59 GitHub180 joined #mojo
16:59 GitHub180 [mojo] kraih pushed 1 new commit to master: http://git.io/kXRdKw
16:59 GitHub180 [mojo/master] fixed typo in link - Sebastian Riedel
16:59 GitHub180 left #mojo
17:03 memowe \o/
17:19 federated_life joined #mojo
17:32 xaka joined #mojo
17:41 kaare joined #mojo
17:53 ki0 joined #mojo
18:04 noganex joined #mojo
18:07 mattastrophe joined #mojo
18:28 ki0 joined #mojo
18:31 dlyke joined #mojo
18:32 kmx joined #mojo
18:36 ki0_ joined #mojo
18:47 mire joined #mojo
19:37 xaka i'm using Mojo::JSON and found that it decodes '{"key":1}' different from JSON module. The "key" value is a string ('1'), not an integer (1). Any ideas how to fix it?
19:37 paul with all due respect xaka, why would you care? the type is only inferred?
19:37 paul is it actually presenting a problem?
19:38 xaka sure it is. when i encode it again and send to javascript which is expecting the number - it dies with exception
19:38 paul is it quoted in the resultant json?
19:38 paul ie '{"key":"1"}'?
19:39 xaka no, there is no quotes
19:39 paul so it encodes it as '{"key":1}' ?
19:58 paul guessing that problem resolved itself!
20:07 xaka actuall no, i'm just doing my investigation. Looks like it's because in perl there is no way explicitly set value type to IV. In case of Mojo::JSON it's NV, in case of JSON (XS implementation) it's IV.
20:08 xaka Mojo::JSON does "int(...)" if it sees the number that is correct, but probably it's not enough
20:08 paul xaka: but from what you were saying it was reserialized exactly as the input?
20:09 paul at least, that's what i understood
20:47 lukep joined #mojo
20:50 tempire http://empireenterprises.com/skitch//​Cute_Overload__D-20120206-124930.png
20:58 ccushing Use of uninitrl/5.14.2/Moj
21:00 ccushing Use of uninitialized value $msgs[0] in join or string at ... Mojo/Log.pm line 53.
21:00 ccushing why Mojo no use Carp; ?
21:01 paul no external deps?
21:01 ccushing paul Carp is distributed with Perl
21:01 paul i lose track of what's in core :(
21:02 ccushing it's been in core since like pre 5.8
21:02 ccushing or at least 5.8
21:02 paul oh i'm sure, but i've got so many boxes with so many different modules on i rely on perl -M to check :)
21:20 Foxcool joined #mojo
21:28 sri corelist Carp
21:29 sri "Carp was first released with perl 5"
21:29 paul i think i was probably thinking of CGI::Carp, but honestly i do find it hard to keep track of what's core
21:29 ccushing joined #mojo
21:29 paul like i only discovered Time::Piece a year ago or so
21:30 paul blew my mind
21:32 sri corelist -v 5.14.2
21:38 ccushing yeah Carp was in 5.6
21:38 ccushing sri so why no carp love?
21:46 GitHub17 joined #mojo
21:46 GitHub17 [mojo] kraih pushed 1 new commit to master: http://git.io/scoWrw
21:46 GitHub17 [mojo/master] removed useless use of carp - Sebastian Riedel
21:46 GitHub17 left #mojo
21:57 tempire lulz
21:59 sri :)
22:01 ccushing I <3 this die because it's undefined and thus I have no idea which ->log is is trying to record an undefined variable
22:59 andrefs joined #mojo
23:11 sri hmm
23:11 sri wonder if Mojo::CookieJar should be renamed to Mojo::UserAgent::CookieJar

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