Camelia, the Perl 6 bug

IRC log for #mojo, 2012-06-25

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

All times shown according to UTC.

Time Nick Message
00:06 CromeDome joined #mojo
00:20 crab why?
00:26 tempire tm: you don't want to call other controllers
00:26 tempire that will get you into worse trouble than you're already in
00:35 GitHub37 joined #mojo
00:35 GitHub37 [mojo] kraih pushed 1 new commit to master: http://git.io/EQPc-w
00:35 GitHub37 [mojo/master] added slurp_file method to Mojo::ByteStream - Sebastian Riedel
00:35 GitHub37 left #mojo
00:36 sri that should be fun for oneliners :)
00:38 tempire I propose just slurp
00:39 tempire since perl convention always implies the file context
00:39 * tempire slurps
00:40 * sri scratches head
00:45 GitHub137 joined #mojo
00:45 GitHub137 [mojo] kraih pushed 1 new commit to master: http://git.io/DhNhhw
00:45 GitHub137 [mojo/master] renamed slurp_file to slurp - Sebastian Riedel
00:45 GitHub137 left #mojo
00:46 sri \o/
00:50 sri oh, looks like brave is pretty good... judging by the rating
00:50 laouji joined #mojo
00:56 sri tempire: what's the opposite of slurp?
00:57 sri hmm, google says expel or spit
01:06 sri perl -Mojo -E 'b->slurp("Makefile.PL")->split(​"\n")->shuffle->join("\n")->say'
01:06 sri :)
01:24 scott_ joined #mojo
01:28 crab sri: why remove render_to_file and render_file_to_file?
01:29 GitHub52 joined #mojo
01:29 GitHub52 [mojo] kraih pushed 1 new commit to master: http://git.io/2DU1wg
01:29 GitHub52 [mojo/master] made slurp a little smarter - Sebastian Riedel
01:29 GitHub52 left #mojo
01:30 sri perl -Mojo -E 'b("Makefile.PL")->slurp->split(​"\n")->shuffle->join("\n")->say'
01:30 sri ok, that looks better :)
01:30 sri crab: because we never used them
01:31 sri i thought they would be useful for config file preprocessing or something like that, but never happened
01:31 scott__ joined #mojo
01:34 BaggioKwok joined #mojo
01:46 GitHub127 joined #mojo
01:46 GitHub127 [mojo] kraih pushed 1 new commit to master: http://git.io/YCzbSA
01:46 GitHub127 [mojo/master] simplify slurp - Sebastian Riedel
01:46 GitHub127 left #mojo
01:53 d4rkie joined #mojo
02:10 tempire sri: write
02:11 sri tempire: that's boring
02:11 tempire truth
02:11 tempire but I'm going off of accepted convention in File::Slurp
02:12 sri doesn't that use read_file and write_file?
02:12 tempire yes, but the original intent was slurp
02:12 tempire to match perl6
02:12 tempire inscribe
02:12 sri well, we have slurp and say
02:13 tempire I like say
02:13 tempire unless it's your intent to have it write the file
02:13 tempire then I guess we have to find something that starts with s
02:13 sri don't think that's necessary
02:14 sri slurp is just there because we use the code internally anyway and doesn't cost extra
02:14 tempire myapp deploy uberspace
02:18 tempire slurp slurp slurp
02:22 sri say say say
02:23 tempire anyone know how the redhat openshift tools work?
02:26 sri is Mojo::Home->slurp_rel_file and ok name?
02:26 sri s/and/an/
02:26 tempire works for me
02:27 sri good, then i just ran out of stuff i wanted to clean up :)
02:27 tempire I would really love a cpan site that looks like rubygems.org
02:27 sri rubygems.org is pretty awful actually
02:28 tempire but it's so pretty
02:28 sri the search engine design of metacpan is far superior imo
02:28 sri true, a nicer design would be cool
02:29 tempire metacpan seems like a google-esque after-thought on the underlying engine
02:29 tempire at least, that's what I gather from its beginnings
02:29 tempire cargo cult design
02:29 sri prolly just stolen from search.cpan.org
02:33 tempire hmm
02:33 tempire thought about making a deploy openshift command
02:34 sri shouldn't dotcloud come first?
02:35 tempire I prefer reading through ruby over python
02:35 tempire unless there's an api
02:35 tempire api docs, I mean
02:36 sri ruby is *a lot* closer to perl
02:36 tempire I have a negative visceral reaction to __init__
02:36 * sri too :)
02:36 tempire __arbitrary__hidden_________routines________this__​__is_______so____easy___to___________________read
02:54 crab sri: good reason, but please, you should put that into the commit message
02:59 noganex_ joined #mojo
03:03 bird joined #mojo
03:33 crab look, a bird.
03:42 arpadszasz joined #mojo
04:10 asarch joined #mojo
04:39 GitHub191 joined #mojo
04:39 GitHub191 [mojo] kraih pushed 1 new commit to master: http://git.io/_aBLqQ
04:39 GitHub191 [mojo/master] better slurp example - Sebastian Riedel
04:39 GitHub191 left #mojo
05:00 * sri didn't know placeholders are still called symbols internally http://mojolicio.us/perldoc/Moj​olicious/Routes/Pattern#symbols
05:01 sri would renaming make patterns easier to grok?
05:12 crab i think no, because that method name is the only place where the term "symbols" is used
05:13 sri wat?
05:13 sri that sounded like you were contradicting yourself
05:14 crab renaming that method to placeholders wouldn't hurt
05:14 sri oh
05:14 crab but i also don't think it's an actual sticking point in understanding routes and patterns
05:15 sri it's also used in the code
05:15 sri and some test comments
05:15 sri it's not enduser api, so i'm worried more about people that want to hack on it
05:16 xaka joined #mojo
05:19 laouji joined #mojo
05:24 GitHub137 joined #mojo
05:24 GitHub137 [mojo] kraih pushed 1 new commit to master: http://git.io/DGGYVQ
05:24 GitHub137 [mojo/master] updated Mojolicious::Routes::Pattern with new terms - Sebastian Riedel
05:24 GitHub137 left #mojo
05:32 arpadszasz joined #mojo
05:34 vishwanathms_ joined #mojo
05:45 fhelmber_ joined #mojo
05:56 xaka joined #mojo
05:59 Foxcool joined #mojo
05:59 ovnimancer joined #mojo
06:11 arpadszasz joined #mojo
06:39 Vandal joined #mojo
06:40 Leandr joined #mojo
06:44 taryk joined #mojo
06:45 arpadszasz joined #mojo
06:55 davido joined #mojo
07:00 nicolasbd joined #mojo
07:16 Leandr joined #mojo
07:33 arpadszasz joined #mojo
07:36 Akron joined #mojo
07:37 Foxcool joined #mojo
07:40 Akron There was a "render_file_to_file" method? Wow ... that sounds less great.
07:42 Akron tempire: "myapp deploy uberspace" yes - would be nice, however, a more general sftp deploy thing, maybe with syncing would be a lot more useful.
07:51 spleenjack joined #mojo
07:57 batman joined #mojo
08:21 crab what's uberspace?
08:26 pau4o joined #mojo
08:49 Akron crab: A new german shared webhoster, that gives its users a lot of freedom.
08:50 Akron crab: http://uberspace.de/
08:58 Patterner german would be "ueberspace" :)
08:58 human39 joined #mojo
09:04 Akron Patterner: That would be politically totally incorrect!
09:09 SpiceMan joined #mojo
09:09 SpiceMan left #mojo
09:24 vishwanathms_ joined #mojo
09:31 arpadszasz joined #mojo
09:45 daxim joined #mojo
09:51 Foxcool joined #mojo
10:04 Akron joined #mojo
10:07 mire joined #mojo
10:26 Patterner too close to "nazispace"?
10:39 memowe WTF?
10:40 memowe How is ue?berspace not pc?
11:09 ryozi joined #mojo
11:33 jamadam joined #mojo
11:55 jamadam sri:https://gist.github.com/2988167
11:56 jamadam made some test cases for Mojo::DOM, not sure this helps you though.
12:07 Akron joined #mojo
12:09 Akron memowe: Too much Nietzsche to be pc. ;)
12:37 bkmrx joined #mojo
13:10 Psyche^ joined #mojo
13:10 gryphon joined #mojo
13:20 CromeDome joined #mojo
13:43 sri jamadam: only if we decide to add Mojo::DOM::Collection, but so far we don't have good enough reasons to add it
13:49 inokenty joined #mojo
13:49 Akron The question is, will we have ->dom and ->json methods in Mojo::ByteStream, now we have "->slurp". ->eval even!
13:50 sri Akron: don't think so, lets see how slurp works out first
13:55 Akron Akron ->json may be stupid, but I could see ->dom be useful or Mojo::Dom exporting a 'd', so I could do something like d(b('myfile.xml')->slurp)->find('div') ... However, a dom-method would be a lot more elegant.
13:55 Akron Why did I prepend Akron? I meant sri. ;)
13:55 sri obvously you're not convinced of it yourself
13:56 Akron Of course not. This is discussion, not debate.
14:02 jamadam sri: Your example oneliner yesterday looks useful to me.
14:04 sri jamadam: well, that's just one small use case
14:05 asarch joined #mojo
14:11 jamadam My test cases are to artifical?
14:16 sri jamadam: most of them are about modifying the DOM, which is not a very common use case
14:18 jamadam i see
14:19 sri jamadam: maybe try convincing tempire, marcus and crab to vote yay on the addition
14:20 sri to convince me it would have to make a few very common use cases better
14:20 jamadam yes
14:23 jamadam however, through making test cases, I realized current version is more useful than I thought
14:25 jamadam I'll think about traversing use cases
14:35 Foxcool joined #mojo
14:54 sri if anyone else is in favor of adding Mojo::DOM::Collection, please speak up
14:58 jiyuperl joined #mojo
15:22 vishwanathms joined #mojo
15:22 vishwanathms_ joined #mojo
15:31 d4rkie joined #mojo
15:38 vishwanathms joined #mojo
15:38 vishwanathms_ joined #mojo
15:40 knshaum joined #mojo
15:42 Leandr joined #mojo
15:43 diegok Hi! o/
15:44 diegok how do I force a response to render the default not_found page?
15:48 inokenty diegok: return $self->render_not_found; ?
15:48 diegok inokenty: thanks! :)
15:48 inokenty =)
15:49 diegok sri: shouldn't we add the render_not_found method to the rendering guide?
15:50 sri diegok: i think it's too uncommon
15:51 sri at least i wouldn't know how to properly explain it with examples
15:52 diegok well, my use case is I have categories by slug, if I capture a slug that doesn't exists on my DB, I send a not_found.
16:00 diegok sri: this example makes sense https://gist.github.com/2989425 ?
16:02 batman joined #mojo
16:03 sri diegok: makes sense for what?
16:04 diegok as an example for the guide :)
16:04 sri no
16:04 daniel_ joined #mojo
16:04 diegok ouch!
16:05 sri that kind of example has no pseudo code
16:05 sri you would also have to explain render_exception
16:05 diegok you mean my db thingy?
16:05 sri with a common example that users can actually cut and paste
16:06 diegok ok, that makes sense :)
16:07 diegok So, I should think of a full example that uses render_exeption and render_not_found if I want to insists on this?
16:07 sri and ideally merge it with the custom exception/not_found template recipe
16:08 diegok ok
16:12 sri and don't make it too big ;)
16:14 crab sri: re: Mojo::DOM::collection, i think the idea has some potential, but i don't mind waiting a while to see more compelling rationale to do it
16:15 CromeDome joined #mojo
16:16 sri crab: there are also problems that need to be addressed, like ->find('div')->map(sub { $_->type }) resulting in a Mojo::DOM::Collection object again
16:18 sri all the magical ->text and ->attrs methods would depend on the collection actually containing Mojo::DOM objects
16:18 crab yeah.
16:19 sri and of course there are more generic alternatives
16:20 sri ->find('div')->call('attrs', class => 'whatever');
16:20 sri (inspired by underscore.js)
16:21 sri or even ->find('div')->filter('attrs', 'class') to crate a new collection with the results
16:22 sri a lot to think about :)
16:28 jzawodn joined #mojo
16:33 sri marcus, tempire: what is your opinion on Mojo::DOM::Collection?
16:45 sri the best argument for a new collection class might be an entirely new method that just doesn't fit into either... Mojo::DOM nor Mojo::Collection
16:47 rem_lex|pivo joined #mojo
16:54 Foxcool joined #mojo
16:59 rem_lex| joined #mojo
17:54 sri 666 watchers on github :o
17:55 sri bad omen for 3.0?
17:58 * whee fixes
18:05 sri phew
18:05 sri \o/
18:05 sri whee++
18:16 memowe \oF
19:10 hippo joined #mojo
19:11 hippo Anyone know if hypnotoad loads a configuration file by default? it seems like it used to work but now it doesn't
19:27 hippo I guess I had to enable the config plugin inside of my perl module   $self->plugin('Config', default => {});
19:27 hippo left #mojo
19:45 sri diegok: got a better example now?
20:00 sri diegok: i just had an idea for a recipe if you're stuck
20:09 GitHub134 joined #mojo
20:09 GitHub134 [mojo] kraih pushed 1 new commit to master: http://git.io/AZ7_Cw
20:09 GitHub134 [mojo/master] better recipe for rendering exception and not found pages - Sebastian Riedel
20:09 GitHub134 left #mojo
20:11 sri time to wrap up 3.0, i'm gonna tag the release soon, so better yell now if something is still missing!
20:23 rnp sri: will be able to cache session based objects in this release?
20:58 rnp left #mojo
21:06 tempire 3.0! 3.0!
21:10 * sri is writing the announcement
21:10 diegok sri: \o/ looks fine. Still want an example?
21:10 sri diegok: if you've got a really good one
21:12 diegok hm... not really good. Something around /divide/:first/by/:second' and render_exeption for 0 and not found when no numbers.
21:13 rem_lex|pivo joined #mojo
21:14 brambles joined #mojo
21:14 sri diegok: that sounds interesting
21:14 perlite joined #mojo
21:16 diegok sri: ok, I'll write a gist then you can decide. I like what you have: just a short text telling this is possible and a pointer for more.
21:28 diegok https://gist.github.com/2991364
21:43 lukep joined #mojo
21:50 davido joined #mojo
21:53 davido I'm working with a full app.  I am using DBIx::Connector to manage my connection (using 'has' to make my connector object available as app->db_conn).  Where should I be instantiating M::P::Config so that the database login information is available to my 'has db_conn => sub{...}'?
21:55 davido By the time startup() is invoked, it's too late, I believe.
21:55 brambles joined #mojo
22:11 marcus why?
22:21 davido "has db_conn => sub => { .... }" instantiates my connector object ahead of startup().
22:49 brambles joined #mojo
22:54 davido A snippet's worth a thousand words: https://gist.github.com/2991974
22:54 davido The question is how should I be making the config available to db_conn?
22:59 Akron joined #mojo
22:59 Akron davido: That's the way I do it: https://github.com/Akron/Sojolicious/bl​ob/master/lib/Mojolicious/Plugin/Oro.pm Don't know if that's the best way.
23:00 Akron Is 3.0 there yet? (I'
23:00 Akron Is 3.0 there yet? (I'm wearing my funny hat in preparation!)
23:01 marcus joined #mojo
23:02 marcus the sub is run the first time it's used
23:04 davido You mean the db_conn sub?  So in that case the first time it is used would be within startup() where I have a $r->bridge( cb=>sub{authentication stuff } )->to(...);
23:12 davido I got it.  Thanks marcus & Akron.  "the sub is run the first time it's used" woke me up. :)
23:13 Akron marcus++
23:34 marcus joined #mojo
23:37 sri Akron: just a few more hours
23:46 gabrielvml joined #mojo
23:46 gabrielvml test

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