Camelia, the Perl 6 bug

IRC log for #mojo, 2011-02-21

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

All times shown according to UTC.

Time Nick Message
00:23 perlrocks Twitter: "Mojolicious comes to OGara"s * Vicious Buddha * style baby Fri Feb 25th 9pm" --troiatkinson http://twitter.com/troiatkin​son/status/39480259728523264
00:42 Kulag left #mojo
00:43 Kulag joined #mojo
01:11 metaperl1 left #mojo
01:12 metaperl joined #mojo
01:25 perlrocks Twitter: "Well, I guess I use Mojolicious in a before_dispatch" (ja) --shiba_yu36 http://twitter.com/shiba_yu​36/status/39495884228149248
01:36 * tempire just discovered pmtools
01:57 ispy_ joined #mojo
02:17 tempire left #mojo
02:21 tempire joined #mojo
02:28 Alias_ left #mojo
02:39 daviddelikat1 joined #mojo
02:42 daviddelikat left #mojo
02:57 Kulag left #mojo
02:57 Kulag joined #mojo
03:33 yakudzo joined #mojo
03:37 tempire left #mojo
03:41 tempire joined #mojo
03:53 tempire left #mojo
03:59 tempire joined #mojo
04:03 tl joined #mojo
04:05 tholen42 left #mojo
04:15 tempire left #mojo
04:20 tempire joined #mojo
04:51 Alias_ joined #mojo
04:52 GabrielVieira joined #mojo
05:55 kaare joined #mojo
06:01 yakudzo left #mojo
06:11 perlrocks Twitter: "#perl Really simple MVC web framework Mojolicious::Lite http://mojolicio.us/" --heikkil http://twitter.com/heikkil​/status/39567933759819776
06:29 giwi joined #mojo
06:45 tardisx_ left #mojo
06:59 esskar joined #mojo
07:01 yakudzo joined #mojo
07:04 esskar left #mojo
07:12 tholen joined #mojo
07:24 tholen left #mojo
07:28 koban joined #mojo
07:34 Christian joined #mojo
07:35 Christian morning
08:08 breaker313 joined #mojo
08:10 perlrocks Twitter: "#perl And jury is still out (http://bit.ly/9BETPD  http://bit.ly/gPMkSJ ) if Mojolicious any better than Dancer:  http://perldancer.org/" --heikkil http://twitter.com/heikkil​/status/39597757832507392
08:14 crab hi christian.
08:45 sri good morning fellow crazy people
08:48 * crab ponders
09:16 AmeliePoulain joined #mojo
09:23 breaker313_ joined #mojo
09:24 breaker313__ joined #mojo
09:28 breaker313 left #mojo
09:29 breaker313_ left #mojo
09:41 fhelmberger_ left #mojo
09:41 fhelmberger_ joined #mojo
09:54 s0va left #mojo
09:55 Kulag left #mojo
09:56 Kulag joined #mojo
09:56 s0va joined #mojo
10:04 spleenjack joined #mojo
10:24 espent hi..
10:25 espent i need to run some common code in all my mojolicious actions, like a check for if a user is signed in, if certain properties are set and so on.
10:25 espent is chained routes the way to go?
10:28 sri http://mojolicio.us/perldoc?Moj​olicious/Guides/Routing#Bridges
10:31 crab espent: https://github.com/amenonsen/Gadwall​/blob/master/lib/Gadwall/Auth.pm#L41 <- worked example ;-)
10:42 s0va left #mojo
10:52 bc5042 left #mojo
10:52 s0va joined #mojo
11:02 breaker313__ left #mojo
11:02 breaker313 joined #mojo
11:04 s0va left #mojo
11:05 espent cool, thanks @sri and crab
11:08 bc5042 joined #mojo
11:10 s0va joined #mojo
11:13 ysyrota joined #mojo
11:15 fmerges joined #mojo
11:16 s0va left #mojo
11:23 GitHub58 joined #mojo
11:23 GitHub58 mojo: master Sebastian Riedel * e951b87 (1 files in 1 dirs): added render_later example - http://bit.ly/ef1QME
11:23 GitHub58 left #mojo
11:28 yko most interesting to use stuff isa laways experimental and makes you suffer :)
11:28 * yko waves
11:30 * sri pushes yko back into the alligator pit
11:30 yko weekend ended, ye?
11:30 * sri nods
11:41 s0va joined #mojo
11:43 tardisx_ joined #mojo
11:44 * sri still wonders what would be the right way to sandbox perl
11:45 omega chroot or vm? :)
11:45 sri vm is cheating ;p
11:46 sri chroot and ptrace with syscall whitelist seem like the most paranoid
11:46 sri a simple apparmor profile might work too
11:47 sri Safe.pm does not look very trustworthy
11:50 s0va left #mojo
11:53 sri right, dynaloader hacks seem to break Safe.pm...
11:53 crab ask tim bunce what he did for pl/perl and Safe. i don't remember the details, but he found some solution that worked around the traditional flakiness of Safe.pm.
11:56 sri i don't think he solved the problem
12:25 MisterHatt jeez sri, so demanding (re twitter)
12:25 MisterHatt we're working as fast as we can :V
12:25 * sri cracks the whip
12:26 * MisterHatt relays beatings onto certain canadians
12:26 Kulag MisterHatt: Should take note of the sanboxing, we'll need that.
12:26 MisterHatt indeed
12:26 sri what are you building?
12:26 MisterHatt it'd probably help if I knew what you were talking about though
12:27 MisterHatt sri: something similar to what you asked for
12:27 sri oh, interesting
12:27 * sri cracks the whip again
12:28 sri http://code.google.com/p/p​ts-mini-gpl/wiki/uevalrun # this has just been suggested to me, looks interesting
12:28 Kulag sri: I was thinking to create a user for the perl app and set permissions on files such that the app would only be able to load the perl binary and perl libs.
12:29 sri the first thing people do is fork bomb
12:29 MisterHatt pinky murakami live stream makes me want to get coding instead of sleeping :S
12:30 sri you really need a restrictive sandbox if you're going to host multiple apps on the same box/vm
12:30 Kulag MisterHatt: And here I thought you were bandwidth impaired.
12:30 MisterHatt tethering right now so I could dump a gig of the server
12:31 MisterHatt my phone billing cycle resets tomorrow too so fairly unrestricted for the next 28 minutes
12:33 MisterHatt gotta start coding for work, our first 'live' mojo site is going up in a week
12:34 MisterHatt setting up one of the webhosts in perth to offer shared hosting via plack+mod_perl alongside their existing passenger rack/wsgi stuff
12:48 s0va joined #mojo
13:08 mobyu joined #mojo
13:18 daviddelikat joined #mojo
13:24 daviddelikat1 left #mojo
13:30 perlrocks Twitter: "Here's the deal, you build a heroku for #perl and we'll add a first class deployment tool for it to the #mojolicious distribution. ;)" --kraih http://twitter.com/kraih/status/39678404970287105
13:31 yko hmm. it would be nice to have option to pass params to option tag into select_field
13:32 sri stop mumbling start proposing :)
13:32 yko just like select_field foo => [['Please select...' => '', disabled => 'disabled', selected => 'selected'], ...]
13:32 sri i'm interested in solutions, not problems ;p
13:33 * yko mostly proposes problems
13:33 sri do you mean attributes?
13:34 yko yes
13:34 yko or it's possible somehow atm? i see that 'selected' is taken from ->param so it's possible to set it
13:34 yko but other attributes are unreachible.
13:34 sri don't think it is
13:36 yko me to
13:36 yko those example above shows that it would be very nice to have such option. First shown option often is 'Please select...' and needs to be disabled or so
13:37 yko also styling certain options, etc... i think there whould be many use cases
13:42 sri patches welcome
13:42 purl patches welcome is, like, always true or unless for search.cpan.org or swahili for "Put up or shut up."
13:42 * sri pats purl
13:42 purl how condescending
13:49 kaare left #mojo
14:07 tardisx_ left #mojo
14:18 kaare joined #mojo
14:19 GabrielVieira left #mojo
14:34 y0j_ joined #mojo
14:38 y0j left #mojo
14:44 sri yko: are you sure there are no side effects?
14:44 sri and it works for all possible cases?
14:45 sri some tests cases also look bigger than 78 chars
14:45 sri *-s
14:46 fhelmberger_ left #mojo
14:48 yko I checked stuff i could imagine and din't saw any side-stuff
14:49 yko damn, your 'code reuse' is contagious :)
14:49 sri Oo
14:50 sri i guess tag helpers should really be moved to their own test file
14:50 yko btw, i found that it's very easy to test helpers: perl -Mojo -e "print a->select_field(country => [qw/en de/])"
14:50 yko not 'real test', just see how they works
14:50 sri :)
14:51 bellaire joined #mojo
14:51 sri right, that's actually a neat way to test all kinds of helpers quickly
14:51 yko aspecially before writing pod for tag heleprs :p
14:52 MojoGuest638 joined #mojo
14:52 MojoGuest638 From: http://www.google.com.au/url?sa=t&amp;source=web&a​mp;cd=3&amp;ved=0CC0QFjAC&amp;url=http%3A%2F%2Fdev​.xantus.org%2F&amp;rct=j&amp;q=websocket%20demo&am​p;ei=LnxiTZnqNpOfcaaklcMJ&amp;usg=AFQjCNGw6nZv0wO4​2uzUnHhWcD0vcKNULg&amp;sig2=wu8SPbfcLprDlrwkl8gA9g (1 hits)
14:53 MojoGuest638 left #mojo
14:53 yko gonne eat something. this aligator pit makes me hungry
14:54 sri yko: you really shouldn't ignore the 78 char rule though :(
14:55 yko that's all your fault!
14:55 sri :O
14:55 yko you changed indent to 2 chars and while i edited my .perltidyrc to match your requirements and than back i missed that 78 chars
14:56 yko wait i'll fix it
14:56 sri already on it
14:56 sri there is a good perltidyrc included btw
14:56 yko ah, ok. than i can haz my brjakfast
14:57 sri sure, just eat marcus
14:57 yko i'm using perltidy from mojo dist last year maybe, but i'm not gona change intdents of all my source
14:57 sri 2 whitespace indetation rocks though!
14:58 yko too late :)
14:58 sri *+n
14:58 yko also i like 4 spaces because they makes me break stuff to subroutines.
14:58 yko but i don't think it's a good reason to start war
14:59 yko which side are you smash an egg btw? :)
14:59 sri wars have been started for worse reasons though :)
14:59 * yko starts eating marcus
15:00 sri purl: yko is also a friendly alligator
15:00 purl okay, sri.
15:01 sri purl: yko is also living under the #mojo channel trap door
15:01 purl okay, sri.
15:01 marcus purl: yko is also a grue
15:01 purl okay, marcus.
15:01 * marcus turns off the lamp
15:02 * sri makes scary noises
15:02 marcus sri: you were eaten by the grue.
15:02 sri :(
15:02 marcus it tracks you by sound
15:04 yko ponie yum yum...
15:09 y0j_ left #mojo
15:11 y0j_ joined #mojo
15:15 y0j_ left #mojo
15:15 y0j_ joined #mojo
15:16 gizzlon joined #mojo
15:25 perlrocks Twitter: "Mojolicious comes to OGara"s * Vicious Buddha * style baby Fri Feb 25th 9pm" --troiatkinson http://twitter.com/troiatkin​son/status/39707228919308288
15:25 toebu joined #mojo
15:25 giwi left #mojo
15:26 dekimsey left #mojo
15:26 GitHub2 joined #mojo
15:26 GitHub2 mojo: master Yaroslav Korshak * 704ca70 (2 files in 2 dirs): improved select_field helper
15:26 GitHub2 mojo: master Sebastian Riedel * de48856 (3 files in 3 dirs): made tag helpers easier to test and added more tests
15:26 GitHub2 mojo: master commits e951b87...de48856 - http://bit.ly/hLpa6W
15:26 GitHub2 left #mojo
15:26 sri ok, now send me many more tag helper tests!
15:32 mobyu left #mojo
15:32 sri yko++ # btw
15:33 yko weeee
15:33 sri purl: karma yko?
15:33 purl bugger all, i dunno, sri
15:33 sri purl: karma yko
15:33 purl yko has karma of 45
15:33 sri purl: karma marcus
15:33 purl marcus has karma of 384
15:34 sri purl: karma sri
15:34 purl sri has karma of 278
15:34 sri :S
15:34 crab heh
15:34 dekimsey joined #mojo
15:34 sri purl: karma crab
15:34 purl bah.
15:34 yko sri: what did you tell about micro-benchmarks? :)
15:34 sri :o
15:35 sri yko: they are the root of all evil?
15:35 yko hehe, i just comparing karma with that :D
15:35 sri heh
15:35 crab purl, forget karma crab
15:35 purl crab: I forgot karma crab
15:36 crab purl: karma crab?
15:36 purl bugger all, i dunno, crab
15:36 crab purl: karma crab
15:36 purl crab has karma of 1120
15:36 sri Oo
15:36 crab no, purl, karma crab is <reply> bah.
15:36 purl crab is <reply> bah. has neutral karma
15:36 crab oh well.
15:37 sri purl: karma sri is over 9000!
15:37 purl sri is over 9000! has neutral karma
15:37 sri ohoh
15:37 Kulag Any thoughts on using cpanm and local::lib to build self contained app distributions vs, say, a debian package?
15:37 sri purl: karma sri?
15:37 purl wish i knew, sri
15:37 sri Kulag: i'd go with somethig non distribution specific
15:38 sri but it's really a matter of taste i guess
15:38 Kulag sri: I'm not looking for something for distribution, just for automated deployment.
15:38 sri git then :)
15:39 sri in case you're pure perl and submodules work for all dependencies
15:39 Kulag That works fine for the app, but wouldn't updating dependencies out from under an app be a bad idea?
15:39 sri yea
15:39 Kulag It'd be nice for security updates
15:40 Kulag But it'd be safer to take a git snapshot, install all non-core deps to inc/, and then toss that up onto a bunch of servers.
15:41 Akron joined #mojo
15:41 sri you could also treat the actual app differently, since it will likely change more often than your dependencies
15:41 sri app via git, dependencies via distribution packages
15:42 Kulag The main issue I have with distribution packages is that they always lag behind cpan by a few months in my experience.
15:43 crab you can't have everything
15:43 dekimsey left #mojo
15:43 Kulag Nope, just trying to find a good balance.
15:43 crab it's much more important that whatever strategy you choose be properly documented than the exact details of what the strategy is
15:44 sri in the end distribution specific packages will be less pleasant unless you have a sysadmin to do it for you
15:44 crab after much bitter experience, these days i write detailed notes like "we need x, y, and z to be downloaded from ... and installed using the following commands: ..." for everything.
15:45 sri go with perlbrew, locallib and friends
15:45 crab (but i don't use distribution packages for perl modules, in general)
15:45 crab yes, agreed
15:45 fhelmbe__ left #mojo
15:45 fhelmber_ joined #mojo
15:47 giwi joined #mojo
15:47 dekimsey joined #mojo
15:52 giwi left #mojo
15:54 marty joined #mojo
15:54 AmeliePoulain left #mojo
15:56 Christian nice evening to you all
15:59 Christian left #mojo
16:04 koban left #mojo
16:11 hoelzro joined #mojo
16:14 giwi joined #mojo
16:27 qualiabyte joined #mojo
16:34 qualiabyte is now known as help
16:34 help is now known as qualiabyte
16:43 lonerr joined #mojo
16:51 MojoGuest244 joined #mojo
16:51 MojoGuest244 From: http://www.google.pl/search?hl=pl&amp;safe=o​ff&amp;biw=1366&amp;bih=653&amp;q=websockets​+demo&amp;aq=f&amp;aqi=g1&amp;aql=&amp;oq= (1 hits)
16:51 MojoGuest244 left #mojo
16:54 qualiabyte hello,  i have a question about about running one of the example mojo apps - bootylicious
16:56 qualiabyte it comes bundled with an old version of mojo (0.999932), but i have mojo 1.1 installed as well
16:56 sri they will clash
16:56 mateu left #mojo
16:56 sri you should contact the author of bootylicious
16:57 sri or make sure the newer mojolicious is not in @INC
16:58 qualiabyte i run with this command: 'perl ./bootylicious daemon'
16:58 qualiabyte it gives this error: 'syntax error at /usr/local/share/perl/5.10.0/​Mojolicious/Command/Daemon.pm line 8, near "has description"
16:58 qualiabyte Compilation failed in require at (eval 358) line 3.'
16:58 sri yes, it does not work
17:00 mateu joined #mojo
17:00 qualiabyte when I run the debugger, it seems to have the bundled mojo loaded at first:
17:01 sri ok listen, you can't have two conflicting versions of mojolicious in @INC
17:01 sri one has to go
17:01 sri you really should contact the bootylicious author about it
17:02 qualiabyte ah, ok thank you
17:02 sri sure
17:03 qualiabyte just wasn't sure if i was overlooking another way
17:05 qualiabyte and thanks for your work on Mojo - i think it is pretty cool!
17:05 sri the problem is command auto detection, the older mojolicious is detecting and trying to load new commands using new features
17:05 sri glad you like it :)
17:06 sri it is basically mixing new and old code when you have multiple versions in @INC
17:07 MojoGuest153 joined #mojo
17:07 MojoGuest153 From: http://news.ycombinator.com/item?id=1277067 (251 hits)
17:08 MojoGuest153 left #mojo
17:08 Akron left #mojo
17:10 qualiabyte i'll try to contact the app's author (vti) as well; he seems to still be developing it
17:17 qualiabyte yeah, i noticed it tried to load Mojo::Command::Daemon which seems to have moved to Mojolicious::Command::Daemon
17:21 qualiabyte or, that may have been vice-versa.  either way, yes - mixed versions were running at once.
17:22 fmerges left #mojo
17:23 breaker313 left #mojo
17:36 tholen joined #mojo
17:36 * crab idly wonders what it is in bootylicious that depends on an old mojo
17:37 crab can't be that hard to fix.
17:39 sri it surely isn't
17:40 sri it might not even be incompatible
17:41 qualiabyte I got it running with mojo-1.1, but the next problem I had was the botprotection plugin when trying to view articles
17:42 qualiabyte although, maybe I can just download updated versions of those modules, remove the relevant 'contrib/' dirs and it would work...
17:45 sri the botprotection plugin seems to depend on $c->helper, a method we've deprecated a long long time ago and removed somewhen last year
17:46 sri and it actually uses the method to access experimental features :S
17:46 sri that plugin is not good
17:47 sri surely nothing for normal users
17:49 crab i looked at that plugin in some detail a while ago, and did not like it.
17:50 crab it stores an enormous amount of state in the cookie, does a lot of questionable work per request, and iirc did not protect effectively against all forms of CSRF (which it was kinda sorta supposed to do).
17:54 ysyrota left #mojo
17:54 crab i think the reddit-expression would be "i was disappoint"
17:57 sri heh
18:01 qualiabyte Mmm... I was just looking at the same thing
18:03 crab well, what happens if you just disable the plugin?
18:08 qualiabyte I'll try taking it out - it looks like it's mostly in the test files
18:09 tempire for a console logging plugin...
18:09 tempire plugin 'consolelog' ?
18:09 tempire plugin 'console_log'
18:09 tempire plugin 'logg0rz'
18:09 sri plugin 'loggin_mah_keyz';
18:19 perlrocks Twitter: "My interview with @kraih about #mojolicious has been translated into Russian! http://bit.ly/hrjtge (original here: http://bit.ly/gsjBVP)" --burntflowers http://twitter.com/burntflow​ers/status/39751023824351232
18:24 perlrocks Twitter: "svetlana says: read this ActiveState blogpost interview with Sebastian Riedel (@ kraih): http://bit.ly/gTfPrw # perl # mojolicious ;-)" (ru) --pythondj http://twitter.com/pythond​j/status/39752318077517825
18:26 spleenjack left #mojo
18:27 stephan48 left #mojo
18:33 stephan48 joined #mojo
18:37 tempire sri: For Mojolicious::Plugin::ConsoleLogger, I'm currently overriding Mojo::Log->log for the console logger, and then passing it along to the original ->log sub.
18:37 tempire comments?
18:37 purl comments are lying. next_for_GC *is* the GC marking mechanism right now
18:37 tempire I figure it's good to have the same logging in both browser & server logs
18:38 tempire purl: karma tempire
18:38 purl tempire has karma of 6
18:38 tempire :(
18:38 * tempire hugs purl
18:38 * purl smiles
18:38 giwi left #mojo
18:39 tempire purl: karma tempire
18:39 purl tempire has karma of 6
18:39 * tempire cooks purl dinner
18:39 marty hehe
18:39 giwi joined #mojo
18:47 sri haha
18:47 sri tempire: sounds good
18:47 sri tempire++ # here, have a cookie
18:47 tempire sri: karma tempire
18:47 purl tempire has karma of 7
18:48 tempire \o/
18:59 zipkid left #mojo
19:11 tempire where is the exception template stored?
19:12 crab Mojolicious::Controller
19:13 crab likewise not_found
19:38 auggy hiya, i'm installing Mojolicious and I need it to live in a nonstandard directory
19:38 auggy so basically the default mojo installation isn't going to work for me
19:38 auggy I'm not sure how to customize that
19:39 auggy so basically all my cpan packages go into /site/foo/perl
19:39 auggy i need mojolicious stuff to run out of /site/foo/perl ideally
19:39 auggy or /site/foo/mojo, whatever makes more sense
19:40 sri mojolicious does not require an installation
19:40 sri you can just put everything into a directory
19:40 auggy ok, i guess i'm confused then :)
19:40 auggy i installed it via cpan
19:41 yko unzip, unshift @INC, '/local/dir'; enjoy
19:41 auggy and when i try to run "mojo generate lite_app" i get the following message
19:41 auggy It looks like you don't have the Mojolicious Framework installed.
19:41 auggy ok so just download the tarball and pop it into whatever dir
19:41 sri what yko said
19:41 yko hmm. something wrong on your system
19:42 auggy just wanted to make sure there weren't any sh scripts putting things in weird places
19:42 sri it doesn't get any easier than mojolicious for that kinda stuff
19:42 auggy yeah hence why we are using it over catalyst
19:42 auggy i knew there would be an easy/obvious solution ;)
19:42 auggy so i will just try that and let you know if i run into problems
19:42 yko auggy: you can do perl -e 'print join "\n", @INC' and check if any Mojolicious there
19:42 auggy i'm installing on an amazon ami instance
19:43 yko (please sdon't paste output in channel)
19:43 auggy sure
19:43 auggy what would i be looking for in @INC?
19:44 auggy the mojo stuff installed where my cpan Config is set to install packages
19:44 yko than you should make sure if that path is in @INC
19:44 auggy yeah it is
19:44 s0va hello
19:44 purl hello, s0va.
19:44 * yko waves
19:44 s0va does anyone have freebsd?
19:45 auggy just the libs right? do i need the executables in bin in @INC?
19:45 auggy i've added /site/foo/perl/bin to $PATH already
19:45 auggy which is why i'm able to execute mojo
19:46 auggy i'll try tweaking PERL5LIB and see what happens
19:47 yko i removed freebsd image about month ago
19:48 auggy yeah looks like it may not have installed correctly via cpan, yargh
19:49 auggy i'll try the tarball method, thanks folks
19:57 fhelmber_ left #mojo
20:01 tempire omg!  a new plugin!
20:01 tempire https://github.com/tempire/moj​olicious-plugin-consolelogger
20:02 tempire console logs work on mojo exceptions as well
20:03 sri neat
20:08 crab ah, i was thinking of the wrong console.
20:19 sri wow, mason2 filters are ugly
20:20 sri <% $.Repeat(3) { %>lalala</%>
20:21 tempire this is kind of neat:  <% sub { reverse($_[0]) } %>Hello</%>
20:22 crab seems a bit pointless.
20:22 sri actually makes me wonder which other block helpers would be neat to have
20:22 tempire do we have a bytestream block helper?
20:23 sri <%= repeat 23 => begin %>lalala<% end %>
20:23 sri i like the look of it
20:23 sri nope we don't
20:24 sri just the b() function
20:24 tempire I see it now
20:24 tempire close enough
20:25 tempire oooh
20:25 tempire I haven't read through the rendering guide in a long time
20:26 tempire might be useful to have the dumper helper show in the console logger
20:26 sri i'm more the terminal logging type
20:27 tempire me too.  I'm thinking it's a piece of eye candy for newcomers, though.
20:27 tempire one less barrier
20:27 sri it surely doesn't hurt :)
20:27 crab personally, i can't see that repeat 23 => begin is a big improvement over % for (1..23) { ... % }
20:27 sri i'm more than happy about every single new plugin :)
20:28 sri crab: less brackets
20:28 crab more language
20:28 sri sure, but looks better
20:29 tempire epl is already right on the edge of templating language and 'just perl'.  The more template-y stuff it has, the less likely people are to just use tt.
20:30 tempire that's my convoluted vote for 'repeat'
20:30 sri i prefer the indented perl line syntax anyway
20:30 sri damn, that really needs a better name :/
20:31 tempire ipls
20:31 tempire iplease
20:31 purl you are trying to include urls in a template without writing out the path in $c->uri_for.  For example, rather than $c->uri_for( "/blog/id/$id/view" ), I want to have something like $c->uri_for( $c->action_for( "view" ), $id ).
20:31 crab tempire: is repeating a section of the template a constant number of times is a common enough operation to deserve its own syntax sugar?
20:32 tempire crab: no idea
20:32 tempire it's pretty though :)
20:32 sri <%= repeat $i => begin %>
20:33 sri <%= for_these \@records => begin %><%= $_->name %>: <%= $_->something %><% end %>
20:34 * crab runs away screaming
20:34 * sri giggles
20:34 tempire is it necessary to have an arrayref?
20:35 sri nope
20:35 tempire I'd prefer something like <%= for @records => begin %>
20:35 sri https://github.com/kraih/mojolicio​.us/blob/master/mojolicious.pl#L64 # this is the style i'm refering to btw
20:36 ispy_ left #mojo
20:36 tempire yeah, iplease.
20:37 sri %= looks a bit like wall-e
20:38 tempire is there a futurama robot that compacts garbage?
20:38 sri the robot devil?
20:39 * tempire loves cpanm bash completion
20:40 sri lets just call it the wall-e syntax
20:41 tempire does that mean everyone who uses it is destined to be tubby?
20:42 sri it does
20:42 s0va omfg, heroku looks fucking insane
20:43 tempire it does
20:45 sri it also has weaknesses though
20:46 sri your apps run in a very restrictive sandbox
20:47 qualiabyte left #mojo
20:48 sri there is a hard 30 second limit on processes
20:50 sri not unlike google app engine
20:51 tempire the 30 second rule doesn't sound too bad
20:51 sri no event loops, no long polling, no websockets
20:52 sri but yea, it's enough for most users
20:52 tempire it seems to me long polling could still work, you just have to reconnect every 30 seconds
20:52 sri too expensive
20:52 crab hmm, what i really _would_ like to do in a template is: <% ready %> ... <% end %> instead of <% ready begin %> ... <% end %>
20:52 sri one dyno as they call it can only serve one request at a time
20:53 sri and you pay a lot per dyno
20:53 sri crab: how do you know a block started?
20:54 sri block detection is compile time
20:54 crab sri: i imagine $app->block_helper(ready => ...) or so, but i suspect that might be too lat... yeah.
20:55 sri feel free to play with Mojo::Template
20:55 sri but we have to do it differently than ruby
20:55 sri they can do it at runtime
20:55 crab how is it done in mojo?
20:56 crab i haven't looked into the templating code in any detail yet, other than looking at the generated subs a little.
20:56 giwi left #mojo
20:56 sri compile time, begin and end blocks pairs get compiled to a sub {}
20:56 sri *-s
20:56 julien hi there
20:56 purl que tal, julien.
20:57 julien anybody has a sample of code that uses the json config plugin ?
20:57 julien I'm kind of confused on how to call it from the sub startup app function
20:58 sri i would actually build a little heroku proof of concept if i had a way to easily sandbox perl
20:58 crab oh wait.
20:59 crab when you say "compile time", you're not talking about perl compile time. you mean when M::Template->compile is called, right?
20:59 sri but it really would require a portable ptrace binding
20:59 crab julien: https://github.com/amenonsen/Gad​wall/blob/master/lib/Gadwall.pm
20:59 sri which is a bit much for a weekend project
20:59 sri crab: yes
21:00 crab julien: (look for json_config and pretend that the gadwall_setup function is your startup function)
21:02 julien crab: thank, that's helpful
21:03 perlrocks Twitter: "It seems the only missing piece to building a heroku for #perl would be a portable ptrace binding. #mojolicious" --kraih http://twitter.com/kraih/status/39792451342307328
21:04 crab after a very quick look at the code: (a) a hypothetical $app->block_helper(x => ...) could be called from startup, (b) in T::parse we add more "capture_start"-style patterns to the various regexes based on whatever i've declared in [a]. (c) that would solve the block detection problem, but leave us with a block without a sub name. not sure how to deal with that yet.
21:05 crab i'm sure there are some details i'm missing, but it doesn't look impossible.
21:06 crab oh, and the Mojo::Template->new() call from the renderer plugin would have to grow some options to pass in the new block-ish tags.
21:06 sri it is not impossible, but yes, there are many factors that make it hard
21:07 crab anything you can think of off the top of your head? i don't have the time to work on it right away, but i'm pretty motivated to use the syntax, so i'll try to do it sooner or later.
21:07 crab s/anything/any other problems/
21:08 sri mostly perl syntax
21:08 sri everything between <% and %> is raw perl
21:08 sri anything can happen
21:09 sri begin and end are actually anchored to the tags
21:09 sri begin %>
21:09 sri and <% end
21:09 sri your block tags are most likely not
21:10 sri i guess if you anchor them to the start it is not that bad
21:11 crab yeah, i think anchoring them to the start would be ok. in effect make it a shortcut for, literally, "name => begin"
21:11 crab and if you want anything more complicated, then suck it up and write it out in full: whatever expr => begin, as usual
21:12 tempire sri: when you say portable, you mean no xs?
21:12 sri i guess a good preparation would be adding normal helpers as a Mojo::Template feature
21:12 sri tempire: has to be xs
21:12 crab tempire: you can't do ptrace without xs
21:12 sri i mean something else than freebsd
21:12 sri currently there is no working ptrace binding
21:13 crab sri: explain? (normal helpers)
21:13 sri just for freebsd
21:13 sri crab: url_for and friends
21:13 sri crab: they are currently hacked together on the mojolicious layer
21:14 sri a problem is that they need the controller instance as first argument
21:14 sri same goes for block helpers
21:15 sri you should take a look at a raw compiled template
21:15 sri the debug screen allows you to look inside
21:16 crab hmm.
21:16 sri tempire: basically a ptrace that works on linux and ideally os x
21:16 crab ok, will do.
21:17 sri the controller instance is what makes helpers actually hard
21:24 sri http://search.cpan.org/~dankogai/FreeBSD-i​386-Ptrace-0.03/lib/FreeBSD/i386/Ptrace.pm # this needs to be ported to linux and os x
21:25 sri http://cpansearch.perl.org/src/DANKOG​AI/FreeBSD-i386-Ptrace-0.03/Ptrace.xs # not even that much xs
21:35 tempire And Sys::Ptrace doesn't do it?
21:39 sri tempire: it's from 2001 and never passed any tests
21:44 perlite_ joined #mojo
21:45 sri python of course does have a first class ptrace binding :S
21:46 bellaire left #mojo
21:48 julien hummm... not sure I got this right: when I do app->start in my controller, mojolicious looks for myapp.pm (defined by MOJO_APP) and runs the startup function before accepting requests
21:48 perlite left #mojo
21:48 perlite_ is now known as perlite
21:48 sri don't ever call app->start in a controller
21:49 crab julien: what you're calling your controller probably isn't one.
21:50 sri that does seem likely
21:50 julien no probably not, it's just the main script that contains the routes and is launched by hypnotoad
21:50 crab julien: i guess you have a startup script which calls Mojolicious::Commands->start, a lib/MyApp.pm (which is an app), and lib/MyApp/Otherthings.pm (which would be Controllers if they inherit from M::Controller)
21:51 kaare left #mojo
21:51 sri julien: lite or normal app?
21:51 crab julien: when the script calls ->start, yes, it looks for MOJO_APP and loads $that.pm
21:51 sri he said the script contains the routes, that's confusing
21:51 crab oh, must be a lite app. sorry.
21:52 julien sri: lite, but growing...
21:52 crab julien: sorry, with a lite app you just have the one script. when you said "app->start" i should have realised.
21:52 sri ah, startup depends on the application class
21:52 sri (startup method)
21:54 sri and as long as your script has routes it will not look for one
21:54 julien I have 1nw.pl that contains my base code (get /toto, post /submit, ...) and app->start, then I have lib/OneNW.pm that contain the sub startup, and then lib/OneNW/URL.pm that contain my app sub functions
21:54 sri you might want to follow the growing guide
21:54 tholen left #mojo
21:54 sri you can't have "app" and an app class
21:55 julien sri: the guides and documentation in general are great, if you know what you are doing. But if you are learning MVC and Mojo at the same time, that's close to undoable :(
21:55 julien sri: ok
21:55 sri maybe you're growing too early
21:56 sri have you finished everything lite already?
21:57 sri i would also suggest following the guide strictly once before experimenting much
21:58 julien I did a bunch, but not everything no.
21:58 crab otherwise you will be punished.
21:58 crab (oops, did i say that out loud?)
21:58 sri if you're starting fresh it is *A LOT* of information
21:59 julien I learn by example, so I took that little project of url shortener and I'm playing around it.
21:59 sri the problem you just stumbled upon should normally not appear
21:59 sri you took the wrong turn
21:59 julien my main comment is that the documentation list all of the functions, but doesn't guide you in the written of a basic application, like a tutorial would. Or so I feel :)
22:00 julien maybe it's just me...
22:00 sri are you sure you're reading the growing guide?
22:00 julien come on...
22:00 sri it is a step by step guide
22:00 sri http://mojolicio.us/perldoc​?Mojolicious/Guides/Growing
22:11 tardisx_ joined #mojo
22:20 tardisx left #mojo
22:20 tardisx_ is now known as tardisx
22:41 tardisx` joined #mojo
22:50 marcus Yo
22:50 auggy what's the recommended way to talk to a database when using mojolicious?
22:54 sri yo yo yo
22:54 * purl walks the dog
22:55 sri auggy: whatever you like most
22:55 auggy lol
22:57 auggy are there any examples around of different ways of handling db connections?
22:58 auggy i found this discussion about dbix::connector http://groups.google.com/group/mojolicio​us/browse_thread/thread/6cd4ef35d84a24ef
22:58 sri the wiki is usually a good place for that kind of information
22:58 sri lots of links to examples
22:59 auggy ah here we go
22:59 auggy I missed the "Wiki" link
23:00 auggy i am not finding examples of folks using persistent db handles with mojo though :/
23:01 auggy i found the example applications and i'm looking through them now. if anyone knows off the top of their head if any of those have db examples?
23:02 auggy looks like FastNotes might
23:02 hoelzro left #mojo
23:03 xris joined #mojo
23:08 ispy_ joined #mojo
23:18 auggy ok found a plain ol' dbi example, this will work: https://github.com/shoorick/​mojowka/blob/master/mojowka
23:19 auggy thanks for the wiki tip
23:20 xantus joined #mojo
23:20 xantus hey hey
23:22 xantus I removed the spam from mr Rainer on the list, and moved him to moderation
23:22 xantus Since he was posted before, I instructed him to scan his pc, blah blah
23:38 tardisx_ joined #mojo
23:41 tempire how do I determine whether a response was static or not, from within the after_dispatch hook?
23:47 xantus if code is defined
23:47 xantus res->code
23:52 xantus is that what you were looking for?

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