Camelia, the Perl 6 bug

IRC log for #mojo, 2012-12-21

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

All times shown according to UTC.

Time Nick Message
00:14 Molaf_ joined #mojo
00:22 LordVorp joined #mojo
00:26 bpmedley_ joined #mojo
00:33 egopro joined #mojo
01:01 laouji joined #mojo
01:12 Mike-PerlRecruiter_ joined #mojo
01:26 xaka joined #mojo
01:34 cooper joined #mojo
01:51 d4rkie joined #mojo
01:53 d4rkie joined #mojo
02:16 marty The Mayans were on PST, in 5 hours it's kaputt for us all.
03:29 xaka joined #mojo
03:41 noganex_ joined #mojo
03:59 Foxcool_ joined #mojo
04:23 mfontani joined #mojo
04:25 ZadYree joined #mojo
04:26 graf joined #mojo
04:27 plu joined #mojo
04:27 crab joined #mojo
04:27 sri joined #mojo
04:29 chansen joined #mojo
04:31 stephan48 joined #mojo
04:31 rhaen joined #mojo
04:33 Miked joined #mojo
04:36 phillipadsmith joined #mojo
05:45 al joined #mojo
05:55 xaka joined #mojo
06:03 _xaka_ joined #mojo
06:30 egopro joined #mojo
06:40 ver joined #mojo
06:46 Miked joined #mojo
06:48 Vandal joined #mojo
07:08 dod joined #mojo
07:11 asarch joined #mojo
07:24 xaka joined #mojo
07:26 spleenjack joined #mojo
07:27 tempire left #mojo
07:27 tempire joined #mojo
07:32 yakudza joined #mojo
07:35 mattastrophe joined #mojo
07:44 dod joined #mojo
07:57 Foxcool joined #mojo
08:13 sinkovsky joined #mojo
08:15 dod joined #mojo
08:20 egopro joined #mojo
08:39 janus crap, missed EOW - anyone left? :)
08:39 wircus nooo
08:42 xaka joined #mojo
08:46 mire_ joined #mojo
08:48 xaka joined #mojo
08:48 suy joined #mojo
08:59 alnewkirk joined #mojo
09:10 Miked joined #mojo
09:10 navi joined #mojo
09:15 alexeiras joined #mojo
09:16 sri https://gist.github.com/4351674 # more fun with keywords :)
09:19 * tempire was raptured
09:26 * sri is still waiting for his rapture :/
09:42 egopro joined #mojo
09:44 wircus__ joined #mojo
09:44 batman____ joined #mojo
09:50 nic https://github.com/byterock/mo​jolicious-plugin-authorization has merged the fix so it works with current Mojolicious
09:50 nic (not yet on cpan)
09:51 sri nic++
09:55 HtbaaPi_ joined #mojo
09:57 SmokeMachine joined #mojo
10:05 rem_lex| joined #mojo
10:12 memowe http://tinyurl.com/hastheworldendedyet
10:12 memowe (Mojolicious app)
10:13 sri oh
10:15 phillipadsmith joined #mojo
10:19 fhelmber_ joined #mojo
10:44 yakudza joined #mojo
10:49 Averna joined #mojo
10:53 cosmincx joined #mojo
11:01 mib_2lc4vf joined #mojo
11:02 ObseLeTe joined #mojo
11:03 ObseLeTe joined #mojo
11:10 judofyr joined #mojo
11:18 mire_ joined #mojo
11:30 eugen joined #mojo
11:34 b2b joined #mojo
11:37 nic sri: I guess it's too late to change the arg order for spurt?
11:38 nic spurt($path, $content) would be closer to perl6
11:39 nic and spurt($path, @content) would be a nice convenience (joined with line terminator)
11:41 nic (or not joined at all might be preferable)
11:43 sri nic: that wouldn't work with Mojo::ByteStream
11:43 nic oh ok
11:44 sri well... it could be a custom method... but that wouldn't be as neat
11:44 sri but yea, it's too late now
11:44 nic I'm guessing people are already using the current one anyway
11:50 navi joined #mojo
12:24 Vandal why can I get this error? t\basic.t .. Can't locate object method "new" via package "Aggregator" at D:/Web/Perl/site/lib/Mojo/Server.pm line 23
12:41 Miked joined #mojo
12:42 cosmincx joined #mojo
12:48 nic sri: A minor tweak to slurp would make it non-greedy and so we could use it without parentheses
12:48 nic $a = join q{}, slurp q{/tmp/test.txt}, q{some text};
12:49 nic at the moment slurp uselessly gobbles anything after its argument
12:49 nic if the def was declared "sub slurp ($) {" then it wouldn't be greedy
12:52 good_news_everyone joined #mojo
12:52 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/hkpSHA
12:52 good_news_everyone mojo/master bb88978 Sebastian Riedel: improved Mojo::Server to die more gracefully if an application class could not be found
12:52 good_news_everyone left #mojo
12:55 sri nic: you should also mention the disadvantages when you're proposing a change
12:55 ki0 joined #mojo
12:56 nic :)
12:56 nic I could only think of "prevents adding future arguments"
12:56 sri yea
12:58 Vandal how to run tests?
12:59 nic Vandal: watchamean?
12:59 Vandal what?
12:59 nic which tests?  Mojolicious or your own?
12:59 Vandal Mojolicious
13:00 nic Do you have cpanm?
13:00 Vandal no
13:00 Vandal I have Mojolicious and test
13:00 Vandal isnt it enough?
13:01 nic You can download the .tar.gz, either from cpan or github, expand it and "prove t"
13:01 Vandal no
13:01 nic ?
13:01 Vandal I mean I have my Mojolicious app
13:01 Vandal it have directory 't'
13:01 memowe Do you want to test your app or Mojolicious?
13:01 Vandal with test
13:01 Vandal yes
13:01 Vandal app
13:01 memowe "yes"?
13:01 memowe ;)
13:02 memowe prove t
13:02 Vandal damn
13:02 nic Vandal: Have you read the tutorial Mojolicious::LIte?
13:02 nic it shows how to start testing
13:02 Vandal it buggy
13:02 good_news_everyone joined #mojo
13:02 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/T8OyEw
13:02 good_news_everyone mojo/master a6cac04 Sebastian Riedel: more consistent error message
13:02 good_news_everyone left #mojo
13:03 Vandal ok
13:03 Vandal I did this: mojo generate app Foo
13:03 Vandal than: cd foo
13:03 Vandal than: prove t
13:03 Vandal and got: t\basic.t .. Can't locate object method "new" via package "Foo" at D:/Web/Perl/site/lib/Mojo/Server.pm line 23
13:04 Vandal where is my mistake?
13:04 nic You're not picking up Foo.pm
13:04 nic You need to be in the dir that contains public, templates,e tc
13:04 sri i just committed a better error message for that
13:05 memowe sri++
13:05 Vandal nic, I am
13:05 sri it will now say "Couldn't find application class "Foo"."
13:05 nic aha
13:07 nic Vandal: If you do "perl -V" it will show which paths you're set up for already
13:08 nic you might need to add 'lib' to your PERL5LIB
13:08 judofyr or run `prove -l t`
13:08 Vandal judofyr, thank you!
13:09 batman or just prove -l (should find tests in standard locations automatically)
13:11 sri or just "./script/foo test" like the documentation says
13:12 judofyr TIL
13:12 nic I suspect the real problem is Vandal doesn't pick up Mojolicious::Controller when he switches to 'foo'
13:12 Vandal I tried "mojo test" like the documentation says
13:12 Vandal it wont help
13:12 sri i'm certain that's not what the documentation says
13:13 Vandal http://mojolicio.us/perldoc​/Mojolicious/Commands#test
13:13 sri so you only tried the first form and then gave up?
13:13 Vandal yep
13:13 Vandal I thought its all the same
13:14 nic http://mojolicio.us/perldo​c/Mojolicious/Lite#Testing
13:14 Mike-PerlRecruiter_ joined #mojo
13:14 nic Vandal: I strongly suspect you'll get on better with Lite app to start with, and reading all of that doc (and the other docs) is a great start
13:14 sri there's like 20+ test examples... and that's the only non-fool-proof one -.-
13:15 Vandal nic, I don't want Lite, I don't like it
13:15 nic You don't need to like it, but understanding it helps a lot
13:15 good_news_everyone joined #mojo
13:15 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/Ywj_8A
13:15 good_news_everyone mojo/master 6a7951c Sebastian Riedel: better test example
13:15 good_news_everyone left #mojo
13:16 nic A fair few people are thinking they'll avoid Lite and so not need to read that doc
13:16 nic and then get stuck cos they don't realise the doc is essential reading for everybody
13:17 sri yea, whenever someone has problems that's pretty much always the reason
13:17 sri dunno how this could be any more clear http://mojolicio.us/perldoc#TUTORIAL
13:18 Vandal I've read docs on Test::Mojo and Mojolicious::Commands
13:18 Vandal it wont help :)
13:19 sri ok, then it's expected that you would fail
13:19 nic Those two docs wouldn't even be in my top 10 docs to read early on
13:20 nic Reading everything under ::Guides (after Mojolicious::Lite) helps greatly
13:20 Vandal I've read under ::Guides
13:20 Vandal but not Lite
13:25 Vandal nic, is there are any examples on how to mock database or use test one?
13:25 iskyee joined #mojo
13:26 nic there's lots of info on mocking around the web
13:26 nic most of the time it's easiest to have a real db
13:27 iskyee Hi, Is there any way to call a  controller action in another controller?
13:27 nic if sqlite is an option, it's great for testing
13:28 iskyee like I m calling Labels#show in  Posts#index
13:32 jberger joined #mojo
13:36 judofyr iskyee: nope
13:36 judofyr iskyee: refactor the code into a helper
13:38 iskyee I know I can make it as a helper, but I want to reuse the Labels controller in any other ones, even we can directly route to it  via ajax ,
13:39 iskyee recently I put Labels query in  under statement, like  under  sub {    $self->stash(labels => $db->get_labels)
13:40 iskyee and %= include 'labels_show' in other one's template
13:41 iskyee but you will repeat that in every controller which need labels.
13:42 iskyee so is there any implementation like Ruby/Cells(https://github.com/apotonick/cells)   in Mojolicious?
14:08 ryozi joined #mojo
14:08 iskyee something like this will work?  https://gist.github.com/4353048
14:16 jberger joined #mojo
14:18 anaio joined #mojo
14:49 wircus__ joined #mojo
14:49 batman____ joined #mojo
15:13 gryphon joined #mojo
15:15 Britzel joined #mojo
15:19 ObseLeTe joined #mojo
15:20 baton8 joined #mojo
15:20 judofyr joined #mojo
15:21 ObseLeTe joined #mojo
15:32 GabrielVieira2 joined #mojo
15:53 d4rkie joined #mojo
16:20 Adura joined #mojo
16:30 zivester joined #mojo
16:38 wircus__ joined #mojo
16:38 batman____ joined #mojo
16:46 ryozi joined #mojo
16:48 ObseLeTe joined #mojo
17:01 Vandal how can I check if there was any errors in ->ua request?
17:01 Vandal is it $tx->res->error ?
17:08 xaka joined #mojo
17:12 ObseLeTe joined #mojo
17:22 spleenjack joined #mojo
17:29 dwierenga joined #mojo
17:39 dod joined #mojo
17:42 cfedde joined #mojo
17:45 cfedde I have $mt->render($template, %arg);  Can I get the key => values of %arg as lexicals in the template?
17:45 inokenty joined #mojo
18:04 nic Vandal: $tx->success can be useful depending on your calling pattern
18:06 nic (I quite like "if (my $response = $tx->success) {...")
18:07 nic cfedde: They're in the stash
18:08 nic (I've hit problems of undefined/missing values, so it can be safer to put them in lexicals yourself rather than use the auto-provided ones)
18:08 zaltekk joined #mojo
18:08 cfedde nic: even when using Mojo::Template as a plain old templater outside Mojolicious?  Cool!
18:09 nic oh, if you're outside Mojolicious then maybe you don't have a stash
18:10 cfedde in this case.  I'll just get them out of $@_;
18:10 cfedde er... @_ even
18:40 GabrielVieira joined #mojo
18:42 asarch joined #mojo
18:57 spleenjack joined #mojo
19:01 xaka joined #mojo
19:07 rem_lex|pivo joined #mojo
19:17 gryphon_ joined #mojo
19:19 gryphon__ joined #mojo
19:23 gryphon joined #mojo
19:41 spleenjack joined #mojo
19:50 _xaka_ joined #mojo
19:52 yakudza joined #mojo
20:44 bpmedley_ joined #mojo
21:14 xaka joined #mojo
21:29 ifim joined #mojo
22:21 eugen joined #mojo
22:37 cfedde images that serve under morbo do not serve when I run the Mojolicious::Lite script as a cgi.  is there something I can do about that?
22:39 bpmedley cfedde: What server?
22:39 cfedde bpmedley: apache.
22:40 cfedde images are in public below the cgi script and simply src="image.jpg" in the index.html.ep
22:41 bpmedley cfedde: I worked on something similar for a while.. the best I could do is run morbo or hypnotoad behind an apache proxy.
22:41 bpmedley cfedde: Not sure if it will work with your setup or not.
22:41 cfedde bpmedley: I'm thinking that's the better approach than to run this as a cgi.
22:42 cfedde that or do the right apache config to make it 'just work'
22:42 bpmedley cfedde: Do you have an e.g. for that?
22:42 cfedde redirect or rewrite or somesuch.
22:44 bpmedley cfedde: http://scsys.co.uk:8002/219940
22:46 cfedde bah.. $job's firewall blocks high order prots.
22:46 cfedde ports too.
22:46 bpmedley http://pastie.org/5563320
22:47 cfedde bpmedley: thanks
22:47 cfedde I had just worked around it.
22:47 bpmedley cfedde: What did you do?
22:47 cfedde ssh to home and use w3m
22:48 bpmedley cfedde: Oh; I thought you were referring to the apache setup.. :)
22:48 cfedde ah.  no.
22:48 cfedde getting to your paste.
22:48 cfedde using the proxy seems like the best choice.
22:50 cfedde also thanks for the paste.
22:50 cfedde and the extra to repaste.
22:51 bpmedley cfedde: np
22:51 cfedde also http://mojolicio.us/perldoc/Mojol​icious/Guides/Cookbook#Hypnotoad
22:53 bpmedley cfedde: Right; depending on your setup you can run hypnotoad stand-alone or behind the proxy.
22:55 jberger joined #mojo
23:42 cfedde If I use the proxy model then I need an apache config and a hypnotoad daemon set per app.
23:43 cfedde Is that right?
23:51 asarch joined #mojo

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