Camelia, the Perl 6 bug

IRC log for #mojo, 2011-08-13

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

All times shown according to UTC.

Time Nick Message
00:59 xaka joined #mojo
01:04 MisterHatt url_escape is to url encode strings?
01:13 j3nnn1 joined #mojo
01:25 tempire http://upload.wikimedia.org/wikipe​dia/en/0/05/Uncanny_X-Men_461.jpg
01:25 tempire mojo from marvel comics
01:25 tempire looks like a super villain to me
01:27 jwang eh, could there be one for Mojolicious?
01:27 jwang I used this in a blog article: http://grokify.com/images/IronMan_​IT-Hero-to-Super-Hero_500x149.png
02:03 perlrocks Twitter: "Giggling to myself as I work on a little side project.  Mojolicious makes building web apps fun again. #perl" --jasoncrowther http://twitter.com/jasoncrowt​her/status/102198499902365697
02:08 jwang mm, wonder if the IronMan graphic can be used for Mojo, I don't see why not
02:52 Alias joined #mojo
02:53 will joined #mojo
03:15 plu Mojolicious++ # abusing it for a textmate bundle :)
03:59 kaare joined #mojo
04:21 gabo2 joined #mojo
05:01 d4rkie joined #mojo
05:12 D4RK-PH0ENiX joined #mojo
06:55 trone_ joined #mojo
07:00 marcus yo
07:04 Foxcool joined #mojo
07:24 plu marcus: hey ho!
07:24 plu marcus: are you at the YAPC? :)
07:24 marcus plu: not yet. Arriving late sunday
07:24 plu marcus: ah cool! I couldnt make it this year
07:26 jwang Riga is a great city. would love to visit it again
07:26 jwang once the largest city in Sweden if I recall correctly
07:26 omega joined #mojo
07:31 preflex joined #mojo
07:32 marcus jwang: sounds strange, latvia is a lot smaller than sweden.
07:33 marcus but it's a nice city. Been there a couple of times
07:34 marcus jwang: wikipedia says you are right tho :)
07:35 marcus Riga is like ⅓ of the latvian population.
07:35 marcus it's smaller than stockholm today tho
07:37 perlrocks Twitter: "@ It is hard to use Web applications in Perl plain kazumi_sio. Is very easy to use framework for something Mojolicious." (ja) --perlcodesample http://twitter.com/perlcodesam​ple/status/102282542085976064
07:37 batman sooo much easier to program when you have gotten some sleep :)
07:37 marcus batman: true that!
07:38 batman i figured out the stash issue complained about yesterday. the issue wasn't include() it was content_for() and MY problem was that i did content_for(...) before stash(...) :/
07:38 batman but i got another question today, which i hope isn't that obvious
07:39 batman $dom->find('pre')->each(sub { warn shift->text }); #  looks like newlines are stripped away from the pre tag... am i doing something wrong?
07:40 marcus batman: we prefer questions in the form of an answer. ;)
07:40 marcus aka unit test!
07:41 marcus (it looks like you are doing it right tho)
07:41 batman perl -MMojo::DOM -e'Mojo::DOM->new->parse("<pre>hello\​nworld</pre>")->find("pre")->each(sub { warn shift->text })'
07:42 batman not really a unittest though :/
07:43 marcus nope. but it looks like you are right.
07:43 batman sub _text {} in Mojo::DOM does Trim whitespace
07:43 batman maybe it shouldn't if it's a <pre> tag?
07:44 marcus batman: that sounds useful to me, but we have to wait for sri to leave sleep mode to know for sure.
07:44 batman sounds sane
07:45 marcus batman: you could just do a github pull request with tests.
07:45 batman i'll have a look at it
07:46 batman but i would image this would be rather easy to fix for someone who's used to looking at the mojo code
07:46 batman *imagine
07:46 batman instead of me poking around :P
07:47 marcus batman: poking around is the best way to learn stuff tho :)
07:47 marcus batman: going to riga?
07:47 batman i got sooo much stuff i need to do, so whenever i can avoid learning stuff and just using it, i will
07:49 batman yeah i am. you haven't written anything on http://yapceurope.lv/ye2011/w​iki?node=Who%20Stays%20Where
07:49 batman i just got "ok" yesterday from work :)
07:49 batman was in a bit of a hurry, but it all worked out
07:50 marcus seems I am the only one staying at my hotel :)
07:50 marcus Old Riga Palace
07:50 jwang marcus: wikipedia  is great. like instant info
07:50 batman ok.
07:50 batman i hope i got wireless :P
07:51 marcus Internett
07:51 marcus •Trådløst Internett er tilgjengelig kun på de offentlige områdene og koster ingenting.
07:51 marcus •Internett via kabel er tilgjengelig kun på hotellrommene og koster ingenting.
07:51 marcus >(
07:51 marcus :)(
07:52 batman sweet
07:52 batman when are you going?
07:53 marcus 19 on sunday from Rygge
07:53 marcus with Ryan air
07:53 marcus and going home with norwegian on wednesday
07:54 batman ok. i'm leaving around noon from osl, and back on wednesday, aronud 7pm i think...
07:54 marcus my flight back is in the day, 13:50
07:55 batman so today i need to make the place look ok before my gf comes back on monday :)
07:55 batman oh. so you getting to days of talks, and one day with hangover?
07:55 batman oh. so you're getting two days of talks, and one day with hangover?
07:55 batman of? with?
07:56 batman <--- brain is slowly melting down...
07:56 marcus batman: yeah. I'm scheduled to hold a Mojolicious talk as well.
07:56 batman i think in a couple of years, the only thing i'll know is Perl, unless i do something drastic :/
07:56 batman i saw that. i don't think i'm going to participate.
07:57 batman i saw the slides (i think) and i do believe i got it covered
07:58 marcus batman: I think the slides you saw were from the london.pm presentation, it's been updated since. But I'm not really trying to convince people who are already in #mojo, so I don't really care if you attend :)
07:58 marcus hmm, need to update the CSS selector slide to include $subject
07:59 marcus batman: you missed an awesome oslo.pm talk on thursday.
08:00 marcus damian ftw.
08:00 marcus at least 50-60 attended
08:02 batman yeah, i was running late because of dinner :(
08:03 batman i was done eating 6:10, and i didn't want to come in late
08:03 batman please don't tell me it wouldn't be an issue :/
08:04 marcus you'd probably suffered some light heckling, but it would have been fine.
08:04 batman arg.
08:04 marcus the talk was done at 8:45
08:05 batman oh.
08:05 batman can't do much about it now :(
08:06 batman another question: how is the syntax highlightning done on http://mojolicio.us/perldoc/Mojolicious/Lite ?
08:06 marcus see for yourself, the source is on github ;)
08:06 batman where?
08:06 marcus https://github.com/kraih/mojolicio.us
08:08 marcus actually, the pod renderer is shipped with mojo
08:08 marcus http://cpansearch.perl.org/src/SRI/Mojoliciou​s-1.76/lib/Mojolicious/Plugin/PodRenderer.pm
08:09 marcus seems it's done clientside with javascript
08:09 marcus <pre class="prettyprint">
08:09 sugar joined #mojo
08:10 marcus http://mojolicio.us/css/prettify-mojo.css
08:11 batman http://code.google.com/p/google-code-prettify/ ?
08:38 tempire I'm not going to be at yapc
08:38 tempire but I'm excited about marcus' mojo talk
08:40 marcus ah, reminds me I need to show off mojocasts as well
08:40 tempire hooray!
08:42 tempire huh
08:42 tempire google is a yapc::eu sponsor
08:43 jamesw my brain is broke
08:44 marcus tempire: for recruiting, prolly
08:44 tempire I'd work for google
08:44 tempire if only to understand their organizational and management structure
08:47 batman code-prettify works like a charm (almost) :)
08:52 sromanov joined #mojo
08:55 varta joined #mojo
09:41 rhaen hm.
09:42 rhaen btw, I am not sure if I would work for them.
09:43 tempire I want to work for apple when they open their spaceship
09:44 rhaen k, see you there!
09:44 rhaen I had the google interviews, but I cancelled them.
09:44 rhaen well, the 4th.
09:44 purl hmmm... the 4th is outstanding
09:45 rhaen as my current work-life balance is close to optimal. So why should I change?
09:45 rhaen even working for google might be something like the best thing for technicans.
09:45 rhaen However, I am a father, too.
09:46 rhaen and a husband
09:46 purl a husband is at http://www.10k4awife.com/
09:46 rhaen but working for Apple, hm..... that would be just awesome :)
09:47 rhaen interesting, my shell has dns - firefox and safari don't. Is there a way flush caches?
09:48 rhaen hm. rebooting due to a broken dns resolution? How ugly!
09:52 rhaen ah. dscacheutil -flushdns hm.
09:54 perlrocks Twitter: "Just a little, Mojolicious:: Lite - I touch. Installation $ cpanm Mojolicious ... http://t.co/F87wmNo" (ja) --sakusaku http://twitter.com/sakusaku​/status/102316978420715521
09:59 Foxcool joined #mojo
10:05 * sri yawns
10:07 sri marcus/batman: i would add text/all_text without trimming, but nobody has come up with good method names yet
10:10 preflex_ joined #mojo
10:11 sri marcus/batman: and no, i won't implement pre magic based on unit tests, but i'm open for full patches
10:19 perlrocks Twitter: "Mojolicious Google Group – Starting with Plugins http://t.co/VdgkPC1" --geekspot_ru http://twitter.com/geekspot_​ru/status/102323483983364096
10:34 sri it's kinda weird, people keep asking about text/all_text without trim but never come up with a good method name… that's the only thing missing, the whole code is already prepared
10:40 perlrocks Twitter: "Mojocast #2: Placeholders, methods, and formats http://t.co/MFWGdBv #mojolicious #perl #видео #video" --allframeworks http://twitter.com/allframewo​rks/status/102328698568589312
11:14 batman raw_text() ?
11:15 batman sri: are you open for pre magic by default, or do you -always- want to go via other_get_text_without_trimming() method?
11:15 sri pre magic would make sense i guess
11:16 sri raw_text and all_raw_text is kinda ugly
11:16 batman ok. guess i will need to start on the patch -some-other-day- then
11:17 batman another thing i think i've been missing out on is how to construct urls/links with query_string... i've been trying all kinds of weird stuff like url_for($name, { query => 42 }); <--- that's for named captures and not QS right?
11:17 batman oh crap! i'm late :(
11:17 batman got to run - will ask about the url_for (and friends) later
11:17 batman take care.
11:18 sri for the future
11:18 sri never ask shit and vanish 5 mins after
11:19 * sri should just stay away from end user support
11:21 abra joined #mojo
13:07 perlrocks Twitter: "Mojo::Template - search.cpan.org: Mojo::Template is a minimalistic and very Perl-ish template engine, designed s... http://t.co/ZZAntU0" --internetspecial http://twitter.com/internetspe​cial/status/102365553003474945
13:15 GitHub118 joined #mojo
13:15 GitHub118 [mojo] kraih pushed 1 new commit to master: http://bit.ly/osFGcK
13:15 GitHub118 [mojo/master] added experimental raw_text and all_raw_text methods to Mojo::DOM - Sebastian Riedel
13:15 GitHub118 left #mojo
13:17 sri i still don't like the raw_text, all_raw_text and all_raw names
13:22 sri in fact, i dislike them so much i might just remove them again
13:35 GitHub35 joined #mojo
13:35 GitHub35 [mojo] kraih pushed 1 new commit to master: http://bit.ly/ng7O1I
13:35 GitHub35 [mojo/master] removed raw_text and all_raw_text methods from Mojo::DOM again until we have better names - Sebastian Riedel
13:35 GitHub35 left #mojo
14:01 GitHub105 joined #mojo
14:01 GitHub105 [mojo] kraih pushed 1 new commit to master: http://bit.ly/n1KOJB
14:01 GitHub105 [mojo/master] cleanup - Sebastian Riedel
14:01 GitHub105 left #mojo
14:24 ghandi joined #mojo
14:25 ghandi Hi There! I'm one of many switchers from catalyst. I really like mojolicious. But currently i can't realy find a way how to get the real paths to files in my App? I've seen there is Mojo::Home. But do i really have to instantiate it myself all the time over and over again?
14:26 ghandi In general im searching something like path_to("/some/file.png"); in catalyst
14:26 * sri waves
14:27 sri app->home
14:27 sri http://mojolicio.us/perldoc/Mojo#home
14:28 sri defined in the base class of Mojolicious
14:29 ghandi Ahhh. Ok, thanks. I was trying $self->home in my controllers which wasn't working. But this solves my problem. Thanks :)
14:44 ghandi why do log messages i send via app->log->debug("foo"); end up in stdout of morbo instead (like all other log messages) in log/development.log?
14:56 ghandi left #mojo
15:38 GitHub9 joined #mojo
15:38 GitHub9 [mojo] kraih pushed 1 new commit to master: http://bit.ly/nFUgd6
15:38 GitHub9 [mojo/master] fixed small text formatting bug - Sebastian Riedel
15:38 GitHub9 left #mojo
15:39 will joined #mojo
16:02 preflex joined #mojo
16:29 ilbot2 joined #mojo
16:29 Topic for #mojo is now join the revolution ♥ http://mojolicio.ushttp://irclog.perlgeek.de/mojo/today
16:48 sri interesting, firefox and webkit already support some css4 selectors
16:58 marcus sri: cool.
16:59 ispy_ joined #mojo
17:11 * marcus tests siege as an 'ab' replacement
17:13 * mhi guesses that someone was reading HN ;)
17:14 marcus mhi would be right
17:15 mhi :)
17:15 marcus brew ftw
17:16 ghandi joined #mojo
17:17 marcus pretty colors :)
17:17 marcus seems it is not broken like ab is on lion \o/
17:20 john joined #mojo
17:21 sri i've been using siege since installing lion, not too impressed though
17:21 sri keep alive seems rather fragile
17:22 sri ab is broken because of kqueue btw. i've heard it can be repaired by enforcing poll
17:23 sri siege also seems slower
17:23 sri for whatever reason
17:23 Foxcool joined #mojo
17:25 j-v-e joined #mojo
17:28 j-v-e joined #mojo
17:33 ghandi Anybody got an idea, why M::Lite Apps recognize the home-dir automatically and correct, while the full featured app doesn't find anything by itsef (app->home is empty) and when calling detect() it returns the perl module path (/usr/local/share/perl/5.10.0)?
17:36 j-v-e joined #mojo
17:38 stephan48 ghandi: in a Mojo app you need $self->app->home or $self->home
17:38 stephan48 cause app is the app instance only in Lite Apps as far as i know
17:43 ghandi ahhhh...sri already pointed out, that i should use app->home but i interpreted that app just be the name of my app so i was trying MyFullAppName->home...because $self->home failed in the controller...but $self->app->home works like a charme...little confusing....
17:44 sri we would never use a singleton for something like that
17:47 marcus sri: did you do the sysctl as brew install suggested.
17:47 marcus sudo sysctl -w net.inet.tcp.msl=1000
17:48 sri interesting
17:51 sri doesn't make much of a difference though
17:51 sri it appears to not recognize connection: close
17:54 sri so it fails a transaction every 25 requests
17:58 exc joined #mojo
18:00 exc is there an easier way of setting default displayed module when using pod_renderer plugin?
18:00 exc currently it is Mojolicious/Guides
18:00 exc so far i came up with
18:01 exc $self->routes->name('perldocmodule')->chi​ldren->[0]->pattern->defaults->{'module'} = 'README'
18:01 sri the pod renderer plugin is not meant as a general purpose perldoc browser
18:02 exc all right, but it would be a nice feature to use it as a default browser for the application itselft,just thinking
18:03 sri it's a huge hack
18:03 sri i wouldn't feel comfortable having people rely on it
18:03 exc my idea was to allow me as a developer to use "/perldoc" route to browse the pods of my project
18:04 sri feel free to fork it and turn it into a much more powerful plugin though
18:05 exc huh, but a good idea
18:05 exc but maybe all it takes is just to add one line and modify another one:
18:05 sri Mojolicious::Plugin::PodRenderButPowerful or so :)
18:05 exc my $module = $conf->{module} || 'Mojolicious/Guides';
18:06 exc '/perldoc/(*module)' => {module => $module} => sub {
18:06 exc well ... and maybe @PATHS, that would be all :)
18:06 sri that's always how it starts ;p
18:07 exc i see ;)
18:10 exc hm, i should probably go with Mojolicious::Plugin::PodRenderButPowerful
18:10 exc and it all started as an idea like
18:11 exc "hey, can i use my mojo app to browse its docs? hm, ... pod_renderer"
18:11 exc :)
18:12 sri your hack above to set the default module is scary
18:12 sri name is useless though
18:13 exc yes, i know, my hands very shaking when i first write that one ;)
18:13 sri $self->routes->children->[0]->​pattern->defaults->{'module'} = 'README';
18:13 exc aha, thank you
18:14 exc my wrong assumption was that by using name() i can refer to the specific perdoc route
18:20 j-v-e joined #mojo
18:23 tempire https://github.com/plu/github-tmbundle
18:24 tempire hmm
18:24 xaka joined #mojo
18:25 d4rkie joined #mojo
18:27 tempire got some mojocast traffic from linkedin
18:28 tempire wonder where that was posted
18:31 j-v-e joined #mojo
18:40 exc joined #mojo
18:47 GitHub5 joined #mojo
18:47 GitHub5 [mojo] kraih pushed 1 new commit to master: http://bit.ly/r17toX
18:47 GitHub5 [mojo/master] fixed typo - Sebastian Riedel
18:47 GitHub5 left #mojo
18:52 sri http://www.css3shapes.com/ # neat
18:56 sri and it looks like firefox 6 got released early :)
18:56 sri ftp://ftp.mozilla.org/pub/mozilla.o​rg/firefox/releases/6.0/mac/en-US/ # with proper websocket support!
18:57 sromanov joined #mojo
19:09 perlrocks Twitter: "The #websocket api in #firefox 6 is prefixed though, but there's already a usage example in #mojolicious. http://t.co/oleExKB #perl" --kraih http://twitter.com/kraih/status/102456855850270720
19:23 perlrocks Twitter: "♺ @kraih The #websocket api in #firefox 6 is prefixed though, but there's already a usage example in #mojolicious. http://t.co/aQXatbt #perl" --Metztli_IT http://twitter.com/Metztli_I​T/status/102460348904378369
19:30 JonChisciotte joined #mojo
19:32 john the css3 shapres are cool
19:39 marcus agree
19:41 marcus sri: so it's now supported in chrome and firefox?
19:42 sri chrome canary
19:42 sri but should be in the next stable release
19:47 marcus swell
19:47 marcus homefully apple will stuff it into safari 5.2
19:47 marcus hope
19:47 marcus any chance of it getting into ie10 as well?
19:48 batman sri: sorry for leaving... it's just too much fun learning new stuff, so time ran away
19:55 JonChisciotte Hi, I need to call a route that launches a job that can take lots of time and show its status in the browser. I need to fork the process and start polling another route that makes the check or Mojo can help me in other ways?
20:09 baton8 joined #mojo
20:25 perlite joined #mojo
20:25 mspo joined #mojo
20:25 Skylos joined #mojo
20:37 vel joined #mojo
20:47 mspo how do I open/read a file relative to my app's path?
20:52 mspo Mojo::Home?
20:55 marcus ->app->home->rel_file ?
21:00 marcus grr, fucking google is giving me hits for 'CS4' when searching for CSS4 subject :-/
21:02 Skylos goggle nows yew dunno hao ta spall.
21:05 batman joined #mojo
21:06 batman mspo: have you gotten an answer?
21:06 exc http://localhost:3000/doc - on-the-fly documentation of your Mojolicious application
21:06 exc using https://github.com/viliampucik/​Mojolicious-Plugin-DocRenderer
21:07 exc [based on nice Mojolicious::Plugin::PodRenderer]
21:08 mspo batman: I got app->home->rel_file, but I haven't tried it yet
21:09 batman excellent.
21:09 mspo somehow I never did my $app = Mojolicious->new;
21:10 batman and then you can use Mojo::Asset::File to slurp the content in... but a normal open() will also work :)
21:12 mspo yeah I just found that slurp
21:16 sromanov joined #mojo
21:17 marcus working on slides - http://nordaaker.com/docs/skit​ch/Keynote-20110813-231718.jpg
21:19 mhi :)
21:19 mhi Big in Russia?
21:20 marcus mhi: some of the very first mojolicious presentations were held there.
21:20 marcus mhi: at some point, this channel was like 50% cyrillic ppl :)
21:21 batman joined #mojo
21:21 marcus hmm, metacpan source code actually looks pretty sane. how cool.
21:21 batman i tend to do $data = do { local $/; open my $FH, '<', $file; <$FH> }; to slurp... not sure if there's any difference
21:22 mhi marcus: Wow, nice to know.
21:23 marcus mspo: very neat!
21:23 marcus mhi: we still have yko at least ;)
21:26 sromanov marcus: Foxcool and myself are from St. Pete's =)
21:26 marcus sromanov: I have a guest from st. petersburg atm :)
21:26 sromanov nice)
21:27 marcus she brought me unfiltered fresh beer :)
21:27 sri exc: great, now i have something to refer people to when they ask for more perldoc features :)
21:30 batman now i can ask again: how can i use link_to() or url_for() to generate query strings?
21:31 sri you don't, they return Mojo::URL objects
21:32 sri not link_to… but i think you can pass Mojo::URL objects to it
21:32 batman let's say i'm currently on http://foo.com/resource/named_capture?a=42 and i want to make a new link/url in the current template to look like  http://foo.com/resource/na​med_capture?a=42&amp;b=24
21:33 marcus batman: I've been using c.req.url.clone or so
21:33 batman in your controller before sending it to the template?
21:34 marcus batman: no, I've been doing that in TT.
21:35 batman where does c come from?
21:36 marcus batman: self
21:36 sri <%= url_for->query(foo => 'bar') %>
21:36 sri http://mojolicio.us/perldoc/Mojo/URL
21:37 marcus sri: will url_for preserve query parameters?
21:37 sri no
21:37 marcus right
21:37 marcus I typically do this for a pager for instance, to set a new page.
21:38 alnewkirk store param() state in  stash or session
21:38 marcus alnewkirk: the request object has the full url
21:38 sri using c.req…. all the time seems tedious
21:38 sri you should have a helper
21:38 batman maybe i should create a plugin which provide url_with() and link_with() or something...
21:39 marcus sri: yeah, but maybe this should be in the standard package?
21:39 alnewkirk store params in session
21:39 marcus sri: catalyst has uri_with
21:39 alnewkirk write your pager to look at session instead of param
21:39 marcus or so
21:39 alnewkirk that way you dont have to pass long query string all over the place
21:39 marcus alnewkirk: wtf
21:40 marcus alnewkirk: then you can't link to a page.
21:40 alnewkirk marcus, wtf wtf
21:40 alnewkirk marcus, why not?
21:40 marcus alnewkirk: because the page is stored in the session?
21:40 alnewkirk .... and
21:40 batman i was thinking about url_with(@args, \%captures, \%query); where @args are what you normally give url_for()
21:41 sri marcus: make a proposal, i've not seen a sleek solution yet though
21:41 tempire marcus: you should mention that mojocasts was #1 on hacker news for a couple of hours.  one more thing to highlight mojolicious' hipness
21:42 sri batman: what would be the point of that?
21:42 marcus sri: url_with(foo =>bar)
21:42 alnewkirk $self->session->{page}++; ... url_for 'listpage'; ... listpage action looks at session->{page} for param
21:42 alnewkirk no ugly url string
21:42 sri marcus: dunno
21:43 alnewkirk same sata
21:43 alnewkirk data*
21:43 marcus alnewkirk: session is stored in your browser cookie.
21:43 sri alnewkirk: marcus is right, you can't link to it *from the putside*
21:43 batman alnewkirk: YOU can't see MY session data. so if I give YOU a link without params, then YOU can't access the same page as me
21:43 sri *outside
21:44 batman sri: what would be the point of what?
21:44 alnewkirk that is true, ... i didnt know that was a prerequisite
21:44 batman url_with() ?
21:44 sri batman: your url_with makes no sense
21:44 sri it's like url_for in green
21:44 alnewkirk i know when building query strings that using paging and sorting, etc, ... it can be cumbersome and most apps i've seen use sessions
21:45 batman what does "in green" mean?
21:45 sri it's the same damn thing in a different color
21:46 sri marcus proposal makes sense, but i'm not convinced yet
21:46 DaTa anohter alnewkirk
21:46 batman i need to write some code and some tests to show it i think... but the idea is that sometimes you want to keep everything, but add/remove a query param. other times you might want to keep alt the query params, but change the path-part
21:46 alnewkirk say wah
21:47 batman alnewkirk: ever copy/pasted a google search result url to someone?
21:47 marcus batman: I can't remember needing the second use case.
21:47 alnewkirk batman, Mojo::URL is great at that
21:47 alnewkirk cramming all that functionality into a helper is gonna be tricky
21:47 marcus alnewkirk: please don't use the session for that, it kills kittens.
21:48 batman alnewkirk: imagine how the receiver of that url would look like if all it said was google.com, without a query string :S
21:48 sri marcus point is that url_for doesn't preserve the query, that's really the only valid point here
21:48 sri everything else is already covered in some way or another
21:48 marcus sri: It's useful, I promise :)
21:50 sri i think my main problem is the name
21:50 sri url_with doesn't tell me anything
21:52 alnewkirk consider the following /listpage?page_number=2&first_name_so​rt=true&first_name_order=ASC&last_log​in_sort=true&last_login_order=DESC& ..... very cumbersome
21:52 alnewkirk theres gotta be a better way
21:52 sri alnewkirk: session abuse is rarely the answer
21:52 alnewkirk sri, i agree,
21:52 sri gotta stay RESTful
21:52 alnewkirk i was merely stating what i've seen other app do
21:52 marcus alnewkirk: the solution is to only include the ones the user has changed.
21:53 marcus not all the possible options.
21:53 batman i'll put something together maybe tomorrow... but i'm off to yapc so i'm not sure what will happen the next days when it comes to programming :)
21:53 exc well, some REST apps use headers for paging 'Range: items:0-25',
21:53 sri everything can happen at yapc?
21:53 marcus exc: browsers can't handle that tho?
21:53 exc sorting can express in shorter form: (+name)(-age)
21:53 marcus sri: It's too bad you're not coming :/
21:53 sri exc: that's for apis
21:53 sri marcus: ye :/
21:54 exc actually, I use Dojo toolkit, which uses headers when it communicates with REST
21:54 marcus chansen: are you coming?
21:54 sri well, ajax uses rest apis
21:54 marcus exc: ajax requests are api calls :)
21:55 sri we're mostly talking about user visible endpoints
21:56 sri helper url_with => sub { shift->req->url->clone->query([@_]) };
21:56 sri that is marcus proposal
21:56 marcus yupp
21:57 exc marcus: i see, btw: http://dojotoolkit.org/documentatio​n/tutorials/1.6/store_driven_grid/
21:58 marcus sri: alternative url_with_query() is a bit longer
21:58 sri i'd like a hint at it being the full current url
21:59 marcus sri: current_url_with sounds a bit corny
21:59 sri what does the url_with in catalyst do?
21:59 sri (or uri_with)
21:59 marcus sri: Returns a rewritten URI object for the current request.
21:59 sri i see
21:59 marcus takes a hashref
22:00 sri are you proposing this as a helper of regular controller method?
22:00 sri or both?
22:00 marcus helper
22:01 * sri nods
22:01 batman helper url_with => sub { shift->req->url->clone->query([@_]) }; # this will not replace the existing query params?
22:01 sri it merges
22:01 alnewkirk both would be good, that way you cover the second use case
22:01 sri ->query(@_) would be replace
22:01 batman cool
22:02 sri there are even more things query can do
22:03 marcus batman: mbook:metacpan-web marcus$ perl -MMojo::URL -le'$u=Mojo::URL->new("?foo=bar&bar=foo");print $u->query([foo=>"baz"]);'
22:05 alnewkirk my $url = $self->url_with({'add', 'stuff'}, 'delete'); # i suppose
22:05 batman does it make sense if [foo=>undef] would remove a parameter?
22:06 batman ...like catalyst's uri_with()
22:06 marcus batman: I would like that, but atm it's the same as foo=>""
22:06 batman yeah. i noticed :)
22:06 marcus batman: that would be an incompatible change in the Mojo::URL object tho
22:06 batman i see
22:06 mspo how do I properly use Mojo::JSON error?
22:06 mspo it's otherwise just silent if I have a json syntax problem
22:07 marcus mspo: you just need to inspect the error method after parsing
22:09 sri i would be fine with undef removing the value, but we would have to see if people rely on current behavior
22:09 batman tweet it :)
22:10 sri doesn't work for this kinda stuff :/
22:11 mspo marcus: so $json->decode($foo) or $json->error isn't going to work?
22:12 marcus sri: seems unlikely that it would cause trouble.
22:12 sri marcus: think i'm ok with a url_with helper
22:12 sri yea, it's one of those cases where you have to break the api to be sure
22:13 sri people prolly won't even know if you asked them
22:13 sri i don't see it causing harm though
22:14 sri not present or empty should mostly be the same
22:14 sri marcus: just don't forget the tests ;)
22:14 mspo I'll just use $json->error ? return $json->error : return $decoded;
22:16 sri die $json->error unless my $result = $json->decode(…);
22:20 mspo I just switched my first return to die and I like it :)
22:20 Skylos I love exception pattern
22:23 exc joined #mojo
22:30 batman https://github.com/jhthorsen​/mojolicious-plugin-urlwith # this is what i have so far...
22:30 mspo can I use Mojolicious::Static inside of a template to wrap files in layouts?
22:30 perlrocks Twitter: "Mojolicious-Plugin-DocRenderer 1.0 by EXC - http://t.co/wv510nd" --cpan_new http://twitter.com/cpan_new​/status/102507440041492480
22:31 mspo or should I just slurp it?
22:32 sri batman: i still don't get it, what's the point of named url_with?
22:32 sri $controller->url_with('named', { age => 42 });
22:32 sri this seems pointless
22:34 batman let's say you're browsing page A for a given resource, but then page A does not have the resource, so it wants to redirect you to page B, but with the same query params.
22:35 alnewkirk that seems very plausible
22:35 batman that's not really "named" example, but it's an example on why i want ... @_ ? $c->url_for(@_) ...
22:35 alnewkirk page_a takes the exact same parameters as page_b
22:36 batman $c->redirect_to($c->url_with('http://other.domain.com'));
22:36 mhi Just out of interest: Is there a Mojomolicious book on its way?
22:36 sri hmm, now i'm once again not convinced of url_with
22:36 mhi (-mo :)
22:37 sri maybe it needs to grow up in a plugin first
22:37 batman that's why i did mojolicious-plugin-urlwith :)
22:37 exc left #mojo
22:37 sri batman++
22:37 alnewkirk DocRenderer seems like a great edition to the M::Plugin namespace
22:38 sri yes, it's a fork that needed to happen
22:38 batman thanks. but i will not release it if marcus thinks it's a stupid implementation
22:39 batman anyway... if i may be excused, i would like to go to bed now. need to start packing, and tiding up the apartment before my flight tomorrow
22:40 sri you're excused :)
22:40 batman sweet like sugar
22:40 batman g'nite
22:41 sri nn
22:45 sri batman: btw. Mojo::DOM->text has <pre> support now
22:45 sri i've also thought about <br> and <p> support… but that's really outside the scope of ->text
22:46 sri after all we have a rather good DOM tree layout that other modules could use
22:57 tempire ok
22:57 tempire so
22:57 tempire mojocast #3
22:57 tempire show usage of a simple plugin, probably something builtin
22:58 tempire then some actions that do auth
22:58 tempire consolidate auth to a helper
22:58 tempire then switch the auth helper to under
22:58 tempire and show tag helpers
22:59 tempire and then make the connection between helpers and plugins
22:59 tempire so by the end, people making and submitting plugins will seem like no big deal
22:59 tempire if there's enough time, I suppose I could include a blurb about submitting to cpan
22:59 tempire that parts iffy
23:00 tempire but I like the part about people understanding that plugins are not a big deal
23:00 tempire 'cause there's no reason that every mojo user, even the complete n00b, can't be making and submitting simple mojolicious plugins
23:00 tempire the barrier of entry is so low, it's just the perception that prevents it
23:01 tempire Mojocasts: From 0 to web app in minutes!
23:01 sri sounds great
23:02 sri lots of frequently asked questions covered
23:04 tempire how's the mongodb thing coming?
23:04 sri slowly, but making progress again
23:05 sri mojolicious is in a very good spot now, so i should have more time for mongodb again
23:08 alnewkirk joined #mojo
23:09 tempire woah
23:09 tempire nyan.cat is fully html5
23:09 tempire no images
23:09 purl no images are used for the quotes
23:14 Skylos_ joined #mojo
23:34 sri wo
23:34 sri w
23:54 metaperl joined #mojo
23:56 tempire oh boo
23:56 tempire the cat itself is a gif
23:57 Skylos_ what a shortcut.
23:57 purl i guess a shortcut is ace
23:57 tempire but the rainbow and background is js+html

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