Camelia, the Perl 6 bug

IRC log for #mojo, 2010-12-10

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

All times shown according to UTC.

Time Nick Message
00:10 GitHub70 joined #mojo
00:10 GitHub70 mojo: master Sebastian Riedel * dd1886a (2 files in 1 dirs): improved tests - http://bit.ly/gF531W
00:10 GitHub70 left #mojo
01:14 Akron left #mojo
01:23 stephen left #mojo
01:28 stephen joined #mojo
03:03 MojoGuest406 joined #mojo
03:03 MojoGuest406 left #mojo
03:03 perlrocks Twitter: "Mojolicious - Web framework for Perl http://www.findbestopensour​ce.com/product/mojolicious  #web-framework" --bestopensource http://twitter.com/bestopenso​urce/status/13066348280160256
03:41 su-bzero joined #mojo
03:45 su-bzero_ left #mojo
04:03 tholen42 joined #mojo
04:05 tl left #mojo
04:08 arpadszasz left #mojo
04:36 arpadszasz joined #mojo
04:54 yakudzo http://hacks.mozilla.org/2010/12/​websockets-disabled-in-firefox-4/
04:55 yakudzo opera too...
05:11 yakudzo http://www.xtranormal.com/watch/7991991/
06:08 ltriant left #mojo
06:13 fhelmber_ joined #mojo
06:17 kaare joined #mojo
06:17 josh left #mojo
06:32 josh joined #mojo
06:36 sri lol
06:49 Kulag left #mojo
06:50 Kulag joined #mojo
06:51 kaare left #mojo
07:14 und3f[A] is now known as und3f
07:22 und3f is now known as und3f[A]
07:23 Christian joined #mojo
07:23 Christian morning
07:24 sri moin
07:25 Kulag left #mojo
07:29 Kulag joined #mojo
07:47 crab good afternoon.
08:02 marcus moin
08:09 otaviof left #mojo
08:09 Christian left #mojo
08:10 breaker313 joined #mojo
08:12 Christian joined #mojo
08:19 koban joined #mojo
08:19 yakudzo I have $route->('/somename/(:name)/(:somethingelse)') if I use dot in :name param route will not path
08:19 yakudzo why ?
08:20 ysyrota joined #mojo
08:22 koban yakudzo: https://github.com/kraih/mojo/blob/mas​ter/lib/Mojolicious/Guides/Routing.pod - relaxed placeholders
08:23 yakudzo thanks
08:25 koban :)
08:30 marcus left #mojo
08:49 perlrocks Twitter: "RT: @kraih: Almost ready for #mojolicious 1.0, just some design work left. :) #perl" --sharifulin http://twitter.com/shariful​in/status/13153353030701056
08:54 perlrocks Twitter: "#mojoliicious 1.0! #mojolicious 1.0!!! Guides, Manuals, Wiki, STABLE RELEASE!!! Dear God, let it be #mojolicious 1.0!" --ykorshak http://twitter.com/ykorsha​k/status/13154533769220096
08:54 sri :o
08:56 yko snowrning
08:56 yko :p
09:10 sri hmm, gonna have a built in favicon
09:11 sri i'll hardcode a few files in Mojolicious::Static
09:11 sri (overloadable of course)
09:13 sri eyecandy alone really doesn't cut it for the exception template
09:13 sri it needs to be extremely lightweight too
09:14 sri heavier design would get unpleasant over time
09:21 szasenko joined #mojo
09:37 dpetrov joined #mojo
09:38 dpetrov left #mojo
09:39 ajgb joined #mojo
09:50 al left #mojo
09:53 al joined #mojo
09:59 al left #mojo
09:59 otaviof joined #mojo
10:00 al joined #mojo
10:11 al left #mojo
10:13 al joined #mojo
10:55 Christian left #mojo
11:11 koban left #mojo
11:11 koban joined #mojo
11:30 ajgb it looks like the renderer expects the handler to return true, otherwise it seems to be stuck
11:32 spleenjack joined #mojo
11:43 sri that statement makes no sense to me without context
11:45 ajgb sri: https://github.com/ajgb/mojox-renderer-alloy​/blob/master/lib/MojoX/Renderer/Alloy/HTE.pm
11:46 Christian joined #mojo
11:46 sri wall of code
11:46 ajgb I needed to add return 1
11:46 ajgb at the end
11:46 sri ah, that could be
12:23 sri new exception template is going to be amazing
12:24 viking-3 joined #mojo
12:25 viking-3 hi! another question for you, $self->hook(...) in startup accidentally the whole thing. what am i missing here?
12:27 sri lol
12:27 viking-3 $self->helper works, and from the doc i don't see any difference between helper and hook, but somewhere i found that the hook is added through plugins->add_hook
12:28 sri there are recipes in the documentation
12:28 sri just search for hook
12:28 viking-3 which POD?
12:28 sri dunno
12:29 sri just ack, it's not much
12:31 viking-3 Cookbook has an example, but is also using $self->hook(...)
12:31 viking-3 in the startup
12:33 sri then thats the right way to do it
12:33 viking-3 that's what she said! but it breaks
12:33 sri update your mojo then
12:35 viking-3 uhm... actually the example on CPAN is different, the one i have installed uses plugins->add_hook
12:35 viking-3 meh
12:35 * viking-3 pulls
12:41 viking-3 it helped
13:00 sri preview for the exception template anyone?
13:00 ajgb shoot
13:05 perlrocks Twitter: "Here's a preview for the new #mojolicious exception template i'm working on. :) http://bit.ly/e3OGg0 #perl" --kraih http://twitter.com/kraih/status/13217808921919488
13:06 sri still quite rough
13:06 sri but you get the idea
13:07 perlrocks Twitter: "Cool view! RT: @kraih: Here's a preview for the new #mojolicious exception template i'm working on. :) http://bit.ly/e3OGg0 #perl" --sharifulin http://twitter.com/shariful​in/status/13218259641831425
13:08 ajgb sri: pretty :)
13:13 alnewkirk left #mojo
13:14 yko yay! really nice!
13:17 yko btw, something like @Mojo::Base::CARP_NOT = qw/Mojolicious::Controller Mojolicious Mojo/;
13:17 yko in app.pm makes debugging much easier
13:18 yko main idea is to show lines in user (your) code, that caused errors, instead of showing Mojo code
13:19 perlrocks Twitter: "RT @kraih: Almost ready for #mojolicious 1.0, just some design work left. :) #perl" --tempiretech http://twitter.com/tempirete​ch/status/13221303540523008
13:19 perlrocks Twitter: "RT @kraih: Here's a preview for the new #mojolicious exception template i'm working on. :) http://bit.ly/e3OGg0 #perl" --tempiretech http://twitter.com/tempirete​ch/status/13221363099639808
13:22 szasenko left #mojo
13:33 breaker313 left #mojo
13:35 nuclon joined #mojo
13:35 nuclon good day
13:36 nuclon I have weird Mojo behaviour when I set a cookie
13:36 * sri waves
13:36 nuclon Mojo sends two cookies together: one is session id, another one is mine. so header looks like:
13:36 nuclon Set-Cookie: sid=69a4cda113111737664a22c4a53c1e7a6130194a; Version=1; Path=/; expires=Fri, 10 Dec 2010 14:16:59 GMT, ref=0cea003d5a; Version=1; Domain=.domain.com; Path=/; expires=Sun, 09 Jan 2011 13:16:59 GMT, ref=0cea003d5a; Version=1; Domain=domain.com; Path=/; expires=Sun, 09 Jan 2011 13:16:59 GMT
13:47 nuclon any ideas? mojo v 0.999950
13:48 nuclon even three cookies together!
13:48 sri it might help if you describe the problem
13:54 nuclon onesec
14:00 nuclon sri: okay. here is the link: https://ivipage.com/set.gif?ref=1115555 - and it tries to set two cookies - sid and ref. could you check it please?
14:00 nuclon sri: take a look at http headers and cookies it set
14:01 sri i don't test live apps
14:01 nuclon there are "ref" and "sid" in header, but browser says - there is the only cookie sid
14:01 sri i'm still waiting for a description of the actual problem
14:03 nuclon okay, let me make a one-liner-app..
14:03 sri i mean a sentence summing up whats wrong
14:05 sri you can throw code at me all day, but it won't help if you can't tell me whats wrong
14:09 nuclon okay, let me rephrase :)
14:10 nuclon is it possible to ask Mojo to create separate "Set-Cookie" header for every cookie and to do not join them with comma?
14:10 crab sri: that exception screenshot is ridiculously nice. what are you trying to do, encourage people to break their code just to see it? ;-)
14:11 sri crab: thats exactly what i'm aiming for :)
14:11 MojoGuest825 joined #mojo
14:11 MojoGuest825 From: http://www.google.com/search?sourceid=ch​rome&ie=UTF-8&q=html5+irc+client (1 hits)
14:12 sri nuclon: why?
14:12 MojoGuest825 left #mojo
14:13 sri nuclon: actually thats the default
14:14 nuclon btw - perl -Mojo -e 'a("/" => sub {$a=shift; $a->res->cookies({name =>"k1", value =>"s1", path=>"/", domain=>".localhost"}); $a->res->cookies({name=>"k2", value=>"s2", path=>"/", domain=>"localhost"});$a->r​ender(text=>"!")})->start' daemon - makes separated headers.
14:14 nuclon sri: okay, that's default. and how could i switch that? :)
14:14 sri no
14:14 sri i mean separate headers is default
14:15 sri i have no idea how they could ever get joined unintentionally
14:15 nuclon interesting...
14:15 sri perl -Mojo -e 'a("/" => sub {$a=shift; $a->res->cookies({name =>k1", value =>"s1", path=>"/", domain=>".localhost"}); $a->res->cookies({name=>"k2", value=>"s2", path=>"/", domain=>"localhost"});$a->r​ender(text=>"!")})->start' get / -v
14:15 sri that oneliner is better
14:15 sri it shows two headers for me
14:16 nuclon same for me
14:16 sri you can also set MOJO_CLIENT_DEBUG=1 to see what actually goes over the wire
14:16 nuclon I have no reason why I get joined headers at live app
14:16 nuclon :-\
14:16 sri old mojo?
14:16 sri could be an ancient bug
14:17 sri or a reverse proxy
14:18 nuclon $ perl -MMojolicious -e 'print $Mojolicious::VERSION' 0.999950
14:19 otaviof left #mojo
14:19 sri reverse proxy?
14:20 crab sri: ok, i'm sold, whenever i can have some template text i'm going to drop it in and see if i can make my code break :-)
14:24 nuclon damned Starman!
14:25 nuclon I have no idea why but it does this
14:25 perlrocks Twitter: "RT @ykorshak: #mojoliicious 1.0! #mojolicious 1.0!!! Guides, Manuals, Wiki, STABLE RELEASE!!! Dear God, let it be #mojolicious 1.0!" --Foxcool_ru http://twitter.com/Foxcool_​ru/status/13237962808496128
14:27 Akron joined #mojo
14:27 sri fiddling with set-cookie headers is a very bad idea, since they mostly have to be non spec compliant
14:27 sri this is one of those real world vs spec cases
14:29 y0j left #mojo
14:36 nuclon sri: I found the problem. it is in Mojo::Server::PSGI
14:37 Akron Nice exception template! sri++
14:37 nuclon sri: it takes headers with my $value = $headers->header($name); - but Mojo::Headers joins values with comma if there are few headers with the same name and wantarray() is false
14:38 sri nuclon: ah, if you make a test case i can fix it
14:38 nuclon sri: sweet
14:39 nuclon sri: if I simply will do pull request, will you accept it?
14:40 sri nuclon: sure
14:42 y0j joined #mojo
14:48 nuclon sri: done
14:48 Akron sri: Are there already any design studies regarding the favicon?
14:49 sri Akron: you can actually see it in the screenshot xD
14:49 sri nuclon: on it
14:49 sri Akron: it also spoils the next variation of the mojolicious logo a bit
14:50 Akron sri: Ah - okay. Nice and discreet!
14:50 sri yea, i'm aiming for minimalistic and elegant this time
14:51 Akron Very good!
14:52 sri nuclon: actually i was hoping for a test case :S
14:52 sri had almost the same fix already
14:53 sri nuclon: your fix actually breaks tests
14:54 nuclon sweet
14:54 dhg joined #mojo
14:54 sri we use double arrayrefs
14:54 sri multi line headers and multiple headers with same name
14:55 dhg left #mojo
14:58 sri and that folks is why i never accept a patch without a test ;)
14:58 nuclon okay, working on test case
14:59 sri ok, i have the fix
14:59 sri just nopaste the test when it's ready
14:59 nuclon sri: hm, should I update t/mojo/psgi.t or create new .t file in mojolicious somewhere?
14:59 sri update
15:02 nuclon just wondering what was wrong in my patch? what's your solution?
15:03 GitHub194 joined #mojo
15:03 GitHub194 mojo: master Sebastian Riedel * 61392ad (1 files in 1 dirs): fixed a small Mojo::Server::PSGI header bug - http://bit.ly/h2aEDG
15:03 GitHub194 left #mojo
15:03 sri thats the fix
15:03 nuclon oh, double arrays, right
15:08 und3f[A] is now known as und3f
15:11 und3f is now known as und3f[A]
15:14 GitHub88 joined #mojo
15:14 GitHub88 mojo: master Sebastian Riedel * 85ca9f5 (3 files in 3 dirs): Fixed small Mojo::DOM selector bug - http://bit.ly/foPUIF
15:14 GitHub88 left #mojo
15:17 und3f[A] is now known as und3f
15:19 nuclon hmm, can't find good example how to send a Mojo::Message::Response to server and get output.
15:20 viking-3 left #mojo
15:22 und3f is now known as und3f[A]
15:24 und3f[A] is now known as und3f
15:27 nuclon left #mojo
15:28 und3f is now known as und3f[A]
15:29 und3f[A] is now known as und3f
15:46 koban left #mojo
15:49 und3f is now known as und3f[A]
15:50 und3f[A] is now known as und3f
15:52 Christian have a nice weekend
15:55 Christian left #mojo
16:17 nuclon joined #mojo
16:28 nuclon I'm back :)
16:30 und3f is now known as und3f[A]
16:33 und3f[A] is now known as und3f
16:38 nuclon sri: could you point me to a file with something alike?
16:38 nuclon I mean - test
16:48 nuclon ?
16:52 nuclon left #mojo
16:52 nuclon joined #mojo
16:54 nuclon left #mojo
16:54 nuclon joined #mojo
17:02 ysyrota left #mojo
17:02 vel joined #mojo
17:03 nuclon left #mojo
17:31 Akron I think it's rather unintuitive that $element->attrs->{'id'} is needed instead of $element->attr('id') with the possibility of $element->attr('id' => 'hui') in Mojo::DOM.
17:32 ajgb left #mojo
17:34 MojoGuest761 joined #mojo
17:34 MojoGuest761 left #mojo
17:45 nuclon joined #mojo
17:46 marty joined #mojo
17:58 perlrocks Twitter: "Happy Coder to Great Tutorials... mmmm. Mojolicious! https://github.com/kraih/mojo/​wiki/Routes-for-non-lite-apps" --fleveillee http://twitter.com/fleveill​ee/status/13291588033708032
18:21 sri hmm, wonder if i should bring back stack traces for exceptions
18:23 jfuller joined #mojo
18:23 nuclon sri: btw, is there a way to override function for showing exceptions? as example - I'd really like to get email notificatons with stack traces, query parameters and, probably, %ENV, but show simple "ISE" screen to user
18:23 sri yes
18:24 sri not sure if i'll bring back stack traces
18:24 nuclon sri: move it to plugin :)
18:24 sri don't think thats possible
18:25 sri goes rather deep
18:25 nuclon I really liked this thing in Catalyst
18:27 sri do you just like it or actually use it a lot?
18:30 perlrocks Twitter: "Experimenting with stacktraces in #mojolicious again, not sure yet if i should bring them back. http://bit.ly/ffilF3 #perl" --kraih http://twitter.com/kraih/status/13299555156103168
18:30 nuclon good question. :)
18:31 janus mhm, if a stacktrace, please with a know to turn it off
18:31 nuclon probably - file / line is enough
18:32 sri ye, they will be invisible by default
18:32 janus well, for the actuall point where the error occurs, sure...
18:33 janus but i have hard times reading nasty inheritance chains
18:35 janus you sure know those nifty tomcat errors *g*
18:36 sri my main problem with stacktraces is that they depend on __DIE__
18:40 sri does anyone here actually want stacktraces back?
18:40 fhelmber_ left #mojo
18:43 marty I've never used them.
18:43 sri yko: didn't you like stacktraces?
18:47 jamesw left #mojo
18:52 perlrocks Twitter: "RT @ kraih: Here's a preview for the new # mojolicious exception template I'm working on. :) # Perl http://bit.ly/e3OGg0" (de) --2mad4milk http://twitter.com/2mad4mil​k/status/13305171152994304
19:12 jamesw joined #mojo
19:16 yko sri, i don't like damn bowling balls 8kg weight dropped on my foot
19:17 yko but let me check how it looks now
19:20 josh sri, yes to stacktraces, please.
19:26 Akron Another vote against bowling balls.
19:27 josh the thing is, without a stack trace, its difficult to reproduce certain errors *with* a stack trace outside of mojo... ignoring or disabling a stacktrace via css is much easier
19:28 jfuller Could we get away with an environmental flag for it?
19:28 josh or that
19:31 perlrocks Twitter: "Can I mix # gettext'ish Locale:: TextDomain and # Mojolicious? I'll try ..." (sq) --shoorick77 http://twitter.com/shoorick​77/status/13315000202428416
19:35 tempire left #mojo
19:36 Akron left #mojo
19:36 josh man i just don't understand twitter
19:36 Akron_ joined #mojo
19:36 Akron_ left #mojo
19:36 marty <----- does not understand twitter either
19:36 josh no offense to this guy who's sharing his every thought with the world... but why do programmers love twitter so much? its like irc i have to read on 50 tabs
19:36 josh if you want to share short amounts of text on a specific topic, /join #mojo and talk about it :P
19:36 daviddelikat1 joined #mojo
19:36 josh marty, i do sometimes feel like we're being left behind by *not* understanding it
19:36 tempire- joined #mojo
19:36 marty Yep.  I'm just waiting for the BBS to make its comeback.   Then I'd be right at home.  :)
19:37 daviddelikat left #mojo
19:37 josh haha i doubt itll make a comeback... but they do still exist.
19:37 josh i run citadel for my mail services, which is basically a bbs-in-a-box for the internet
19:38 josh they have a very active community... and citadel includes a text client with ansi colors and all that. you can ssh or telnet or even dial in
19:38 josh its pretty cool, in an ultranerdy kind of way
19:39 marty I used to run a TBBS system.  Assembler and dBase.   Scarry.  :)  but fun.
19:39 marty I ssh in and check it out.  Thanks for the info
19:40 marty Does anyone know how to set a default layout in Mojo?
19:40 josh marty, i believe you have to call layout 'default' in your templates
19:40 garu sri: here's a question for MojoX::Log::Log4perl. I set Mojo 0.991251 as a dep, but the distro name changed to Mojolicious now. What should I do?
19:40 marty I'm tring to use the defaults as much as possible to keep the routes under control.  I'm trying to eliminate the %layout 'whatever" in each template
19:40 josh and then put the layout in templates/layouts/default.html.ep
19:41 garu sri: I'm inclined to forcing a newer version
19:41 marty Ya, that's what I figured.  No problem.  It's only one line.  :)
19:41 josh marty, i looked through the source for a solution to that issue... and couldnt find it
19:42 marty Ahhh, I should have talked to you sooner.  I just got done digging through the docs myself looking for the same thing.  :)
19:42 josh i think you could probably get really hacky and set it in the stash from inside your own controller base class's new(), or hook some callback
19:42 garu sri: yeah, I'll just move it to snowman
19:42 josh but that kind of thing is a lot less readable than just saying % layout 'default'
19:43 MojoGuest986 joined #mojo
19:43 MojoGuest986 From: http://news.ycombinator.com/item?id=1277067 (90 hits)
19:43 MojoGuest986 left #mojo
19:43 marty Yep, agreed.   I'll just stick with the % layout 'default' for now and I can always yank them out if I find a more elegant solution later
19:57 yko sri, actually, i don't remember stack traces in mojo
19:58 yko thing i really don't like at the moment - it's croak behavior
19:58 yko for example, url_for('wrong route name') will show error at M9s::Controller
19:59 yko and then i should grep all my controllers and templates for that route name
19:59 spleenjack left #mojo
20:00 yko @CARP_NOT (as i told before) brings more understanding for templates (at least show template file, but always 'line 1')
20:00 yko but in case with controller ( sub example { shift->url_for('lalala') } ) it doesn't work
20:05 yko marty: why don't you just do sub startup { ... $self->default(layout => 'default') }
20:05 yko if you have single layout in your application it's a solutiun
20:07 yko other way is to set stash value in routes: my $art = $self->routes->waypoint('/articles', layout => 'articles')->to(...); $art->route('/lates')->to(...)
20:08 yko /articles/latest will have layout 'articles' by default
20:09 josh thats clever
20:10 yko ye, if you have few layouts you can spread them with routing tree, assigning with starting waypoints.
20:10 yko but keep this tree can be hard, so i prefer to have one default layout in defaults and if i need change it i jsut type % layout '...' in non-default templates
20:11 yko or even % layout 'undef'; or  $c->render(layout => undef) if i don't want layout at all
20:11 josh how would you disable a layout from a template then? % delete stash->{layout}
20:11 yko fix: % layout undef;
20:11 josh ah
20:11 yko haha, i faced with that questin by mysels for month ago :)
20:11 marty That's good advice yko, thank you
20:12 yko np, i\m always pleased to find good solution for frequently appearing situation
20:12 yko ...but then sri cames back and telling i'm wrong. ... always -_-
20:13 yko hehe
20:13 marty hehehe.   :)
20:52 MojoGuest659 joined #mojo
20:52 MojoGuest659 left #mojo
21:08 nuclon left #mojo
21:42 MojoGuest28 joined #mojo
21:42 MojoGuest28 From: http://news.ycombinator.com/x?fnid=HAw0XBfjry (2 hits)
21:49 MojoGuest28 left #mojo
21:55 josh is url_for('') purposely dropping the query string?
22:00 yko josh: looks like that
22:00 josh ive been doing url_for($self->tx->req->url) to work around it
22:01 josh seems like a bug though
22:01 yko josh... you can use just $self->req->url
22:02 yko it returns url of current request
22:02 yko with query string and #lalala anchor
22:03 josh hm yeah
22:03 yko :)
22:03 yko you see, its easy :)
22:03 josh still, i feel like url_for() should be returning the correct url
22:04 josh youre good at these, though
22:04 josh heres another one for you :)
22:04 josh replacing a specific query param
22:04 yko you see, url_for is designed to return url for named route
22:04 yko in this way it must return url without any query params. so i think it's absolutely logic
22:04 josh well i made a helper to return the current_url
22:05 yko btw, you may like the way to change url query params
22:05 josh ive been doing this:  my %params = %{ $self->req->params->to_hash }; current_url->query([%{{ %params, page => pager->next_page }}])
22:06 josh which is a huge mess
22:06 yko ouch...
22:06 josh otherwise its like current_url->query->remove('page'); current_url->query->param(page => 1)
22:06 yko try $self->req->url->clone->param('xx' => 'yy')
22:06 josh that will add the param
22:07 yko maybe, i should check
22:07 josh if i already have an 'xx' param, itll send ?xx=1&xx=2
22:07 yko not absolutely sure :)
22:07 josh M::Parameters needs a replace() method ;)
22:08 josh when im doing LWP i usually use URI::QueryParam
22:08 josh maybe ill make MojoX::QueryParam
22:09 yko josh : it's even easier
22:09 yko try $self->req->url->clone->query('xx' => 'yy') -- that one
22:09 josh ok lets see
22:09 yko actually you can test it as oneliner: perl -MMojo::URL -e ' print Mojo::URL->new("/test?xx=yy")->query(xx => "zz")'
22:10 josh perl -MMojo::URL -le 'print Mojo::URL->new("/test?xx=yy​&aa=bb")->query(xx=>"zz")' # -> /test?xx=zz
22:11 yko damn :)
22:11 josh so i will lose my other params
22:13 yko we both should read Mojo documentation
22:13 yko that's a point to start
22:13 josh ive read the docs and the source to M::URL
22:13 meraxes left #mojo
22:13 josh thats where i got that crazy ref-deref-ref-deref nonsense
22:14 josh as a workaround
22:14 vel left #mojo
22:14 josh param(ARRAYREF) will replace all args, to_hash will retrieve multi-valued params as arrayref
22:15 yko just wait
22:15 yko https://gist.github.com/736917
22:16 josh param(LIST) and param(HASHREF) do the same -- append. itd be nice if one was replace and one was append
22:16 yko you can not modify single param in that short way. you should access param method of query object. look at that gist
22:16 josh yeah i see it
22:17 josh thats what im doing, using the param method
22:17 josh id call it a defect that i can't replace a particular query param
22:17 josh *at all* without that crazy nonsense
22:21 * josh looks at his feet
22:21 josh i see what you did there.
22:24 josh i still would like query() to do it all and return the url ;)
22:24 yko the same
22:24 josh so its not param(LIST) and param(HASH) but query(LIST) and query(HASH)
22:24 josh maybe its time for MojoX::QueryParam then ;)
22:25 josh http://search.cpan.org/dist/Moj​olicious/lib/Mojo/URL.pm#query   two ways to do the same thing, zero ways to do another
22:25 yko hmm. both hash and array reserved in query() method. i don't know if sri will appreciate idea of change query(ARRAYREF) from query->append() to query->merge()
22:26 josh merge needs a M::Params object as arg though, i think
22:27 yko parameters can be transparently transformed in sub query
22:30 josh yeah i feel like the LIST form should replace a single param (or append if it doesnt exist) and ARRAY should replace all params
22:30 josh or reverse that with the HASH, which appends... HASH seems 'replacey' to me
22:31 josh anyway, im going to write that query_param method
22:34 yko ha! arrayref even was not tested :)
22:34 josh ooooh
22:34 josh does that mean if we submit a patch he can't say no? :)
22:40 yko sure no
22:43 yko argh, ->merge doesnt act as i expected
22:47 josh yeah basically just pushes the output of params() onto the current params
22:47 josh not that useful :x
23:02 yko josh: well, there's patch http://bit.ly/igrFhk that extends Mojo::URL->query and does'nt break existing tests
23:03 josh :D awesome
23:03 yko you can lobby it, or discuss, or not :)
23:04 josh so this will replace existing params and append others
23:04 yko ye, there's test. you can check it
23:04 Akron joined #mojo
23:05 josh ah beautiful
23:05 josh yko++
23:06 ashleydev_logbot left #mojo
23:06 josh youve got my support then
23:06 ashleydev_logbot joined #mojo
23:06 yko but anyway it shuld be reviewed by maintainer. very often there's global things i don't see/know/remember that can be affected by such patches
23:10 josh http://paste.scsys.co.uk/59726 thats what i had
23:11 josh which i'll be using until your patch goes upstream ;)
23:11 nuclon joined #mojo
23:12 yko http://paste.scsys.co.uk/59726 doesn't work
23:12 josh the url or the code
23:14 yko Zzz...
23:14 josh well the url works for me
23:14 josh anyway thanks for the patch ;)
23:15 MojoGuest892 joined #mojo
23:15 MojoGuest892 left #mojo
23:22 nuclon left #mojo
23:38 su-bzero_ joined #mojo
23:43 su-bzero left #mojo

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