Camelia, the Perl 6 bug

IRC log for #mojo, 2012-02-17

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

All times shown according to UTC.

Time Nick Message
00:09 briang joined #mojo
00:11 jnap joined #mojo
00:35 * chansen ETOOMUCHBACKLOG
00:35 chansen whats new and exiting?
00:40 hshong joined #mojo
00:57 * tempire understands it
00:57 purl hmmm... understands it is hard work learning
01:01 d4rkie joined #mojo
01:02 hshong joined #mojo
01:02 scott joined #mojo
01:18 vervain Anyone know why www.cpan.org dropped out of DNS?
01:20 tempire works for me
01:21 vervain Ok... let me try some other servers.
01:30 tempire whoa.  homebrew package of Xcode command tools.
01:30 tempire !
01:41 vervain joined #mojo
02:01 jnap joined #mojo
02:02 GitHub31 joined #mojo
02:02 GitHub31 [mojo] kraih pushed 1 new commit to master: http://git.io/gZTrnQ
02:02 GitHub31 [mojo/master] added graceful shutdown test for Mojo::IOLoop - Sebastian Riedel
02:02 GitHub31 left #mojo
02:10 maluco ls
02:12 sri Password:
02:16 tempire ponycorns
02:16 purl i think ponycorns is at http://ponycorns.com/
02:20 sri Sorry, try again.
02:20 sri Password:
02:25 tempire PONYCORNS
02:25 purl hmmm... PONYCORNS is at http://ponycorns.com/
02:26 sri Sorry, try again.
02:26 sri Password:
02:26 tempire FRIGGIN PONYCORNS!
02:27 sri Sorry, try again.
02:27 sri Password:
02:27 tempire :(
02:53 crab joined #mojo
03:32 bird joined #mojo
03:59 tempire ugh.  I shouldn't have gotten the chocolate cake, cheesecake, and cookie
06:02 Foxcool joined #mojo
06:07 Vandal joined #mojo
06:08 AmeliePoulain joined #mojo
06:10 d4rkie joined #mojo
07:22 berov joined #mojo
07:25 d4rkie joined #mojo
07:47 melmothX joined #mojo
08:01 hshong joined #mojo
08:40 spleenjack joined #mojo
09:58 cosmincx joined #mojo
10:34 random joined #mojo
10:47 * sri yawns
10:48 memowe o/
10:54 dolmen joined #mojo
11:18 daxim joined #mojo
11:24 vervain joined #mojo
11:28 TheAthlete joined #mojo
11:44 marcus sri: shouldn't '/miniguide' => 'miniguide#view' and a request to /miniguide.js set the format to 'js'?
11:44 marcus sri: trying a respond_to, but it is triggering 'html' rather than 'js' block.
11:45 sri yes, should
11:48 marcus sri: works now, no idea wht. is going on on that developer's environment.
11:48 sri http://pastie.org/3400836 # wonder if this example is better
11:48 marcus wth. even
11:48 sri (than the second example here http://mojolicio.us/perldoc/Mojoli​cious/Guides/Cookbook#Event_loops)
11:49 marcus seems better to me
11:49 sri it doesn't highlight condvar use very well
11:49 sri :/
11:50 marcus really like the xcode / dev tools split
11:50 sri does the pastie example make it clear you can just use the user agent from anyevent?
12:18 GitHub175 joined #mojo
12:18 GitHub175 [mojo] kraih pushed 1 new commit to master: http://git.io/SFNMuw
12:18 GitHub175 [mojo/master] added another event loop embedding recipe - Sebastian Riedel
12:18 GitHub175 left #mojo
12:18 sri i'm just using both ;p
12:22 dolmen thanks for the example (I'm @omengue)
12:22 dolmen It works only with io loops shared by Mojo::IOLoop and AnyEvent, isn't it?
12:28 GitHub23 joined #mojo
12:28 GitHub23 [mojo] kraih pushed 1 new commit to master: http://git.io/pBGdqA
12:28 GitHub23 [mojo/master] improved resilience of Mojo::IOLoop::Client slightly - Sebastian Riedel
12:28 GitHub23 left #mojo
12:29 sri dolmen: please rephrase that
12:32 dolmen sri: 3-4 months ago I understood that AnyEvent could work with Mojolicious because both Mojo::IOLoop and AnyEvent were on top of EV
12:32 sri yesterday i've extended that a bit, AnyEvent/EV can now even be in control
12:33 sri "sri: such as using the user agent non-blocking in some AnyEvent based psgi server running a catalyst app :)"
12:33 sri to quote my example from yesterday
12:34 sri to put it bluntly, we are now so embeddable mlehmann might ban us from using AnyEvent ;p
12:35 dolmen I will look closely at the Changes for the next AnyEvent release ;)
12:35 dolmen that's good news
12:37 dolmen So far we were using a dirty hack (Mojo::Server::PSGI fork) to make work our webapp on top of Twiggy embedded in our AnyEvent app.
12:37 sri ah, yea, that's not necessary anymore
12:38 sri let me know how it works for you, the change is still fresh, there be dragons
12:40 sri (unless of course you need to share the same port with psgi apps, that will still require such hacks)
12:40 sri maybe just partially ;p
12:41 sri well, it depends what you're using :)
12:50 noganex_ joined #mojo
12:51 diegok Hi!, any idea on why Data::Printer do print nothing when a Mojo::Collection in list context is given? (collection has elements and it works with Data::Dumper)
13:03 ki0 joined #mojo
13:05 TheAthlete left #mojo
13:07 TheAthlete joined #mojo
13:07 TheAthlete left #mojo
13:16 abra joined #mojo
13:33 jnap joined #mojo
13:41 judofyr joined #mojo
13:42 judofyr sri: you know HTTP right? if a client sends a "Expect: 100-continue", but the server doesn't need to look at the request body to fulfill the request, can the server just return a final response right away?
13:46 sri in theory
13:46 sri in practice i've not seen 100 continue ever get used properly
13:47 judofyr the spec says "It MUST NOT perform the requested method if it returns a final status code" though
13:47 judofyr An origin server MAY omit a 100 (Continue) response if it has already received some or all of the request body for the corresponding request
13:47 judofyr but also that…
13:47 sri bottom line... nobody does 100 continue
13:48 judofyr sri: so Mojolicious sends a 100 Continue whenever it sees a 100-continue?
13:48 sri yea, always
13:48 sri and the client discards it right away
13:49 judofyr but starts route dispatching before it is finished parsed the formdata/multipart, right?
13:49 judofyr parsing*
13:49 sri no
13:49 sri that's otional
13:49 sri optiona;
13:49 sri argh
13:49 judofyr o p t i o n a l
13:49 judofyr there
13:49 sri by default we wait for the whole request
13:50 sri streaming big ones into temporary files
13:50 sri that part is a read event we have registered by default
13:51 sri https://github.com/kraih/mojo/blob/m​aster/lib/Mojo/Content/Single.pm#L12
13:52 sri normal content
13:52 sri https://github.com/kraih/mojo/blob/mas​ter/lib/Mojo/Content/MultiPart.pm#L10
13:52 sri and upgraded multipart content
13:57 TheAthlete joined #mojo
13:57 judofyr sri: I'm thinking that Zoid will not parse formdata/multiple until you explicitly asks for it
13:57 judofyr e.g. "params['foo']" will do it
13:58 judofyr and if it's a long request, the actor can easily be blocked (and resumed when the whole request has been parsed)
13:59 sri i've thought about doing the same, but i hate disk io roundtrips
13:59 sri stream big content to file, stream file for parsing, stream big individual parts back into multiple files
14:00 judofyr hm, that's a good point
14:01 judofyr there's probably a way around it though
14:01 sri you could take the node.js approach
14:01 sri and wait with reading the content
14:02 sri you have to be prepare to trash the connection though if it gets tainted
14:02 judofyr actually, I don't intend on reading all the content before running the action
14:02 judofyr the moment you do "req.body.read" and there's pending body, the actor can go to sleep and wake up later.
14:03 judofyr sri: tainted?
14:03 purl tainted is a fancy way of saying, "This will fuck your shit up!". Go read perlsec for more details. or once I ran to you, now I run from you.
14:03 sri well corrupted with bytes you never read
14:04 sri should your user decide he doesn't need the content
14:04 sri can't keep it alive then unless you read all data
14:04 judofyr well, I could always just read the data, but never store it anywhere
14:05 judofyr but I guess it's better to just close the connection
14:05 judofyr sri: is it okay to send a response before the data is read?
14:05 judofyr I guess so?
14:05 sri depends entirely on the client implementation
14:06 sri take the spec with a grain of salt
14:06 judofyr so you would make sure all the body is read before sending a response?
14:06 inokenty joined #mojo
14:06 sri i don't enforce it, it's the default in mojolicious however
14:07 D4RK-PH0ENiX joined #mojo
14:07 sri reading the whole request before dispatching makes things easy
14:07 judofyr how so?
14:08 sri like what you're just asking about
14:08 sri ;p
14:08 sri it's hard to say how a client reacts when you mix things up
14:09 judofyr ah :)
14:10 sri and even if the spec says you're right, that doesn't matter when there are so many shitty implementations out there
14:10 judofyr sri: why isn't there a comment HTTP server test-suite out there?
14:10 judofyr common*
14:10 sri hahaha
14:10 sri i've asked the exact same question when i started Mojo
14:11 judofyr too bad you didn't write Mojo's test suite in that way…
14:12 sri i think the truth is that nobody really knows how a web server should exactly behave, it's an ongoing battle, trial and error over and over
14:13 sri just look at http 1.1 pipelining and 100 continue
14:13 sri i don't think anyone ever got those right
14:13 judofyr 100 continue is at least backwards-compatible
14:13 netfeed or go those part right and everything else wrong? :P
14:13 judofyr 1.1 pipelining is hard for the client to use :/
14:14 sri both are a mess, and should have never gotten into the spec
14:14 sri clean multiplexing would have been so much better
14:14 judofyr does any client actually use pipelining?
14:14 sri yes
14:15 sri firefox for example has a setting to enable it
14:15 judofyr I'd love to have interrupts (or something like it). so you can start sending out a response, but later say "oops, something went wrong, treat this as a 500 instead"
14:16 judofyr so you can actually send out the first part of the layout (which includes scripts'n'stuff) pretty fast
14:17 judofyr and still have proper error handing
14:17 judofyr oh well
14:19 sri trashing a connection with pipelined requests is also an interesting problem
14:20 sri that was the point where i gave up on client side support for pipelining :)
14:22 judofyr hehe
14:22 sri new camel book has been released \o/
14:23 sri soon things will get even more interesting, with SPDY and possibly HTTP/2.0
14:23 TheAthlete joined #mojo
14:24 amoore joined #mojo
14:26 sri hmm
14:26 sri i have an EV problem
14:27 sri how do you check if EV is currently running?
14:37 sri ah
14:37 sri EV::depth
14:39 jnap joined #mojo
14:45 vervain Any examples of an EP site 'skeleton' like you would get from Catalyst::Helper::View::TTSite?
14:46 GitHub181 joined #mojo
14:46 GitHub181 [mojo] kraih pushed 1 new commit to master: http://git.io/jvGxTg
14:46 GitHub181 [mojo/master] added experimental is_running method to Mojo::IOWatcher and Mojo::IOWatcher::EV - Sebastian Riedel
14:46 GitHub181 left #mojo
14:46 vervain I'd really like to get 'comfortable' with EP but it's just not coming together for me... and I'm trying to resist the (quite strong) temptation to just go back to TT.
14:46 sri now Mojo::IOLoop->is_running even detects if EV is in control \o/
14:51 judofyr sri: what do you think about TT btw?
14:51 judofyr also, what about http://slim-lang.com/ ?
14:52 sri used to like TT in the catalyst days, but it got too inflexible and slow for me
14:52 sri it's a good template system overall though
14:53 sri kinda like languages like slim, but significant whitespace turns me off
14:53 abra_ joined #mojo
14:54 sri one of the two reasons i'm not a yaml fan either
14:55 sri i'm more likely to start using a slim-ish language though than going back to TT
14:56 sri when it comes to less powerful template systems i'd go with Mustache i guess
14:58 judofyr sri: when parsing multipart-stuff, does Mojo just not store the body (but rather just the parsed params)?
14:58 sri that's correct
14:58 sri or half correct
14:59 sri we parse it into individual parts, param parsing is another on-demand step
14:59 melmothX joined #mojo
15:00 judofyr and by "param parsing" you mean "grouping equal parts together"?
15:01 sri i mean splitting form values and uploaded files
15:01 judofyr ah
15:01 judofyr because there isn't that "param parsing" after you've done part-parsing, no?
15:02 sri https://github.com/kraih/mojo/blo​b/master/lib/Mojo/Message.pm#L447
15:02 sri it's a rather trivial step
15:03 sri https://github.com/kraih/mojo/blo​b/master/lib/Mojo/Message.pm#L341
15:03 sri uploads get wrapped in another container after that
15:03 judofyr ah
15:03 sri https://github.com/kraih/mojo/blo​b/master/lib/Mojo/Message.pm#L66
15:04 sri and params turned into a Mojo::Parameters object
15:04 judofyr where did the file upload go?
15:04 judofyr next if defined $filename
15:05 judofyr also, why don't you store the file uploads together with params?
15:05 judofyr sri: thanks a lot for going through this stuff btw! very helpful!
15:05 sri i think that was cargo cultet from catalyst
15:05 judofyr ah
15:06 sri np, but there's a lot i don't remember anymore :)
15:07 sri a Mojo::Parameters object can be stringified again though, so Mojo::Upload objects in between could be ugly, depending on use case
15:07 sri on a higher level it might actually make sense though
15:08 judofyr it's pretty common in Ruby at least
15:08 sri $self->param in mojolicious could return uploads too
15:08 judofyr it's a little weird that file uploads are treated differently…
15:08 judofyr what about large, regular, multipart parts?
15:08 judofyr do they get backed to disk?
15:08 judofyr or is it only uploads?
15:09 sri if they exceed the size limit
15:09 judofyr what about short uploads? they're in memory too?
15:09 sri yes
15:09 judofyr small*
15:09 sri it's entirely based on size
15:09 sri Mojo::Asset layer
15:10 judofyr then it makes even more sense to put uploads in $params too
15:10 sri it upgrades itself to a file once the asset gets too big
15:10 sri i don't see how that's connected
15:11 judofyr it could make sense that "$params is for small stuff, $upload (or whatever it's called) is for file-backed stuff"
15:11 sri Mojo::Upload objects in a Mojo::Parameters object is just weird
15:11 sri if it's an unparsed string, ok
15:15 mattastrophe joined #mojo
15:16 judofyr but yeah, I agree that the way Mojo::Parameters is currently used today doesn't work so well with uploads
15:23 judofyr sri: how did you test HTTP 0.9 support btw?
15:25 crab hi
15:25 purl bonjour, crab.
15:25 sri 0.9 support is mostly just for fun
15:25 * sri waves
15:31 black joined #mojo
15:32 d4rkie joined #mojo
15:39 kaare joined #mojo
15:54 cosimo joined #mojo
16:05 sri marcus/tempire/crab: what do you think? $self->param for uploads too?
16:06 tempire what's the downside?
16:06 sri unknown
16:06 sri just implemented it, no tests break
16:07 batman joined #mojo
16:08 batman joined #mojo
16:10 ki0 joined #mojo
16:11 tempire $self->param('thing') would return a Mojo::Upload object?
16:12 sri yes
16:12 tempire I like it.
16:12 tempire I've often wondered why it wasn't that way already.
16:17 judofyr sri: does $self->params include uploads too?
16:18 sri *cough*
16:18 sri see above
16:19 judofyr hm? I meant with the code you just implemented
16:19 sri i thought that's what i said
16:20 judofyr you say $self->param, not $self->params
16:20 * sri scratches head
16:20 judofyr said*
16:20 sri what is $self->params?
16:20 judofyr hm
16:20 judofyr good question :P
16:21 sri ;p
16:21 judofyr I think I meant $self->req->params
16:22 sri nope
16:25 GitHub63 joined #mojo
16:25 GitHub63 [mojo] kraih pushed 1 new commit to master: http://git.io/vYRzHQ
16:25 GitHub63 [mojo/master] added file upload support to param method in Mojolicious::Controller and improved protection from excessively large form values - Sebastian Riedel
16:25 GitHub63 left #mojo
16:29 * tempire is excessively large
16:30 ccushing joined #mojo
16:33 GabrielVieira joined #mojo
16:34 sri i really like how easy AnyEvent embedding has become, would be nice to have a POE backend too
16:34 * sri wonders if it's possible to make it "just work" with POE too
16:36 judofyr POE?
16:36 purl POE is buu's last refuge from the Moose or perl -MAcme::POE::Acronym::Generator -le '$x = Acme::POE::Acronym::Generator->new();  print join " ", $x->generate for (0..100);' or Powers Of Editing or an American writer, poet, editor and literary critic, best known for his tales of mystery and the macabre or ovid or just not only my work, i dont see it as "karma for yourself" if you vote it +1
16:46 sri perls oldest event loop
16:46 judofyr ah
16:46 Foxcool joined #mojo
16:46 sri not very pretty by todays standards, but tons of modules
17:03 TheAthlete left #mojo
17:09 TheAthlete joined #mojo
17:11 judofyr joined #mojo
17:12 TheAthlete left #mojo
17:18 melmothX joined #mojo
17:28 xaka joined #mojo
17:57 vervain if I add <p><%= localtime time %></p> to the line immediately following Welcome.... in a generated lite_app... I seem to get a two digit integer... with %== I get a date string... neither of which are expected.  Any pointers?
18:01 vervain Scratch that... with %= I get the 'seconds' element.
18:02 vervain Still - neither behaviors are expected. ;-)
18:07 sri it's how perl works
18:07 sri perl -MMojo::Util=xml_escape -E'my $foo = ""; $foo .= xml_escape localtime time; say $foo'
18:18 dolmen left #mojo
18:24 chorny joined #mojo
18:38 tempire vervain: what are you expecting?
18:41 GitHub63 joined #mojo
18:41 GitHub63 [mojo] kraih pushed 1 new commit to master: http://git.io/ypeB8A
18:41 GitHub63 [mojo/master] slightly better event loop embedding example - Sebastian Riedel
18:41 GitHub63 left #mojo
18:42 melmothX is there a canonical or preferred way to check if a file upload is really an image and not, for example, a binary executable?
18:44 sri maybe another release might not be such a bad idea, i'd like to see people try the new event loop features :)
18:47 tempire ok
18:47 tempire I fixed it in one line of code :)
18:47 tempire mission accomplished, SIR YES SIR
18:47 sri lies
18:48 * sri is not sure what we're talking about
18:48 tempire generate makefile lite app thingy
18:48 sri oh, i fixed that in two lines :/
18:49 tempire well you didn't commit it
18:49 sri pretty sure i did
18:49 tempire not for lite, full, mojo command, and ../app
18:49 sri https://github.com/kraih/mojo/commit/d4​2e7102484c491433787d573930ffde8a06cf7d
18:51 tempire check that with the mojo command directly
18:51 sri yes, works
18:51 tempire and also from a sub dir
18:52 sri i'm not sure what you mean
18:52 sri the problem you found was because MOJO_APP was a reference, which happens for lite apps
18:53 sri i made a fallback that should cover all those cases
18:53 tempire yeah but it uses MyApp for that
18:53 sri of course
18:53 tempire instead of the lite app
18:53 tempire so it will fail when building
18:53 sri the lite app is not a cpan module
18:54 tempire but it needs to work in order to have a workflow for deployment
18:54 tempire 3 commands for deployment
18:54 tempire generate makefile, generate [deploything]; deploy [thing]
18:54 sri then fix it quick :)
18:54 tempire https://gist.github.com/03e912800043ab8d8431
18:55 tempire or this for more obvious reading: https://gist.github.com/3e2238ce4b78dd14aea7
18:56 sri looks ok, commit and release :p
18:56 tempire go go go!
18:56 * tempire is going
18:56 sri moar glitter
18:57 * sri goes to get some pizza now
18:57 GitHub23 joined #mojo
18:57 GitHub23 [mojo] tempire created generate-lite-makefile (+1 new commit): http://git.io/5LphNQ
18:57 GitHub23 [mojo/generate-lite-makefile] makefile generation for lite apps - Glen Hinkle
18:57 GitHub23 left #mojo
18:58 netfeed i'm trying to build a plugin that i would fetch through $app, kinda like config, but i'd like it to be a something like $app->some_method(%params); do you know of a plugin that work that way where i could look at the code?
19:00 tempire nearly all of them
19:00 purl nearly all of them are .dwf files, too
19:01 netfeed maybe i should look at another instead of config then :)
19:02 vel joined #mojo
19:03 tempire sri: one moar thing
19:03 tempire I'd like to include a version in the lite file
19:04 tempire otherwise people will have to put it in manually for the makefile to build
19:06 netfeed ah, ok, maybe i'm making it harder then i thought it would be
19:06 tempire Netfeed: probably.  plugins are dead simple.
19:06 tempire have you watched mojocast on plugins?
19:06 d4rkie joined #mojo
19:07 Netfeed hmm, don't remember, problably not
19:08 tempire mojocasts.com/e4
19:08 tempire er, no
19:09 Netfeed e3 :)
19:09 tempire yes
19:09 tempire you can jump directly to the plugin spot
19:09 tempire http://mojocasts.com/e3#Make a Plugin
19:09 Netfeed yeah
19:10 tempire but it might help to watch it from earlier, 'cause it leads into it
19:10 marcus /me us a but sceptical of versions in lite apps.
19:10 marcus A butt!
19:10 tempire I don't care about the version specifically, but makefile fails without a VERSION_FROM
19:11 tempire if there's a way to make it go, then I'd like to know
19:11 marcus But why does it need a makefile?
19:11 tempire heroku deployment
19:12 marcus Judofyr should make that support cpanfile or carton instead :)
19:12 tempire I suppose so.
19:12 * tempire looks up cpanfile
19:13 tempire hmm
19:13 vervain From earlier: I missed the fact that localtime in scalar extends to an extended format.  But why does <%= localtime time %> only give the first element in the localtime array?
19:17 Netfeed tempire: that was dead simple, now i just have to do something more interesting the dumping self :)
19:18 tempire :)
19:18 Netfeed i think i should try to build some sort of oembed plugin
19:19 * tempire replanes
19:20 marcus Netfeed sounds nice. :)
19:20 sri hmm
19:20 marcus Tempire: no wifi onboard?
19:20 sri tempire: so can it be fixed in perloku too?
19:21 sri now i'm a little sceptical of tempires fix
19:21 sri oh, tempire made a branch, that's great
19:22 sri tempire++
19:22 marcus Sri: I think judofyr already is looking at carton, which supports cpanfile. actually cpanm supports it top.
19:22 marcus Too.
19:22 marcus Would make more sense to add a cpanfile generator.
19:22 marcus Mojo is for apps, not modules.
19:22 * sri nods
19:29 * marcus switches to mbp. Can't work on ipad.
19:29 marcus Which is actually one of my favorite things about the ipad =)
19:34 Netfeed what is it you get sent in to the helper function? helper(method =>  sub { my ($something) = @_; });, what is $something? is it $app or is it $self from the class that called the helper?
19:36 * sri delays release until tempire has found out if a cpanfile would work better
19:37 xaka joined #mojo
19:38 * sri really loves the mountain lion background
19:38 * marcus makes a branch with a cpanfile generator for any case
19:39 sri doesn't belong in core imo
19:39 marcus sri: well, it can easily be moved.
19:39 marcus sri: I think it belongs in the core just as much as a makefile generator
19:40 sri you got a point, maybe a good idea to remove generators that don't need to be in core
19:41 sri makefile generator is at least used in the cookbook
19:41 marcus well, that's because it exists :)
19:41 sri but the gitignore one really seems like a bad idea now
19:41 marcus ah
19:42 marcus mm, it might be superfluous
19:42 sri yea, undecided about the makefile one though
19:43 marcus I think cpanfile could be considered a feature in the future, if it allows heroku and dotcloud deployment.
19:44 marcus it's trivial to write your own tho.
19:44 marcus given that the dsl is not very wordy
19:44 sri well, judging by recent interest, i think heroku will be the number one platform
19:44 marcus in fact the default one would just be "requires 'Mojolicious' => '2.0';", I guess
19:45 sri heh
19:45 sri that's cute
19:45 mattastrophe joined #mojo
19:46 * tempire delays
19:47 tempire it is trivial, but only if you know how to do it
19:47 tempire mostly for marketing, a simple command is super sweet.
19:47 tempire although, I wonder if "generate heroku" should make the makefile/cpanfile
19:49 GitHub101 joined #mojo
19:49 GitHub101 [mojo] marcusramberg created cpanfile (+1 new commit): http://git.io/dMD61A
19:49 GitHub101 [mojo/cpanfile] Add cpanfile command - Marcus Ramberg
19:49 GitHub101 left #mojo
19:49 marcus tempire: it's more generally useful tho.
19:50 tempire I'd rather have it separate at any rate.
19:50 tempire single-concerns and such
19:50 marcus tempire: would you like to remove the makefile generator from core as well?
19:50 GitHub9 joined #mojo
19:50 GitHub9 [mojo] kraih pushed 1 new commit to master: http://git.io/nqE08A
19:50 GitHub9 [mojo/master] removed gitignore and makefile commands - Sebastian Riedel
19:50 GitHub9 left #mojo
19:50 tempire no, I meant separate from deploy heroku
19:50 marcus ah, yes.
19:50 sri bye bye generators
19:51 tempire :(
19:51 d4rkie joined #mojo
19:51 marcus alas poor generators, I knew you well.
19:51 tempire I agree gitignore is useless
19:51 sri i barely knew them :/
19:51 tempire but makefile?
19:51 purl makefile is fine
19:52 marcus tempire: removing makefile from the guide makes that reciepe very puzzling
19:52 marcus sri even
19:52 sri how often do you really use it?
19:53 marcus sri: I have a makefile in all my apps
19:53 tempire clarification: I am *not* advocating for generate makefile being removed from the core
19:53 marcus how else would you track dependencies?
19:53 marcus unless you have a cpanfile of course :p
19:53 marcus but for instance startsiden deploys to debian packages
19:53 marcus so they need a makefile for the deb generator
19:54 sri :S
19:54 marcus sri: I'd rather we just removed the gitignore command and added the cpanfile one. optimize for usefulness.
19:54 tempire I'm ok with that.  cpanfile seems to work.
19:55 tempire or, seems to be a good idea.
19:55 tempire BUT
19:55 tempire I wonder how many people depend on it
19:55 tempire it's been the only way to track deps from the beginning
19:56 marcus tempire: note that I did not suggest removing makefile.
19:56 marcus it's probably needed for hysterical raisins
19:56 marcus but I believe cpanfile is the way forward.
19:56 tempire Agreed.
19:56 tempire I vote for keeping makefile.
19:56 * marcus migrates letmein to cpanfile.
19:57 tempire mainly 'cause I don't see a real reason to remove it, since it requires almost no effort.
19:57 tempire and all the previous bugs have been fixed
19:57 tempire ALL THE BUGS
19:58 Netfeed what is wrong with the ff9 xslt renderings of xml to view raw xml?
19:58 GitHub33 joined #mojo
19:58 GitHub33 [mojo] kraih pushed 1 new commit to master: http://git.io/MAbtIg
19:58 GitHub33 [mojo/master] welcome back makefile command - Sebastian Riedel
19:58 GitHub33 left #mojo
20:01 tempire soo
20:01 tempire cpanm --installdeps .
20:01 marcus oh, cpanm doesn't actually support it yet
20:01 Netfeed lib for parsing xml suggestion?
20:01 marcus just found out it will be in 1.6
20:02 marcus git push --set-upstream origin cpanfile
20:02 marcus oops
20:02 marcus http://nordaaker.com/docs/skitch/cpanf​ile___Speaker_Deck-20120217-210208.jpg
20:02 tempire bah.
20:02 tempire USELESS!
20:02 purl patches welcome!
20:02 * marcus hunts down miyagawa :)
20:03 sri ok, so what do we do?
20:03 marcus flee
20:03 tempire neat idea, though.  love the events for building
20:04 tempire use makefile for the first implementation of deploy heroku
20:04 sri that means ugly hack makefile generator and $VERSION in generated lite app?
20:04 tempire maybe…will make work without a VERSION_FROM?
20:05 tempire checking..
20:06 trek1s joined #mojo
20:07 marcus mst says we don't need version in lite apps
20:09 marcus tempire: you can include VERSION => in WriteMakefile
20:10 sri seems like a reasonable default
20:11 sri tempire: try VERSION => '0.01'
20:12 tempire yeah.  especially since you have to add version # to the full app anyway.
20:12 sri yea
20:12 tempire pushing to heroku to verify er'thing
20:12 tempire works
20:13 sri \o/
20:13 sri wait
20:13 sri what about NAME and EXE_FILES?
20:13 tempire lulz.
20:13 tempire let me try
20:13 sri does NAME => 'MyApp' cause problems?
20:16 sri pretty sure name won't cause problems
20:16 tempire removed everything except for prereq and tests.
20:16 tempire http://simple-dusk-4870.herokuapp.com
20:16 tempire \o/
20:16 sri wait
20:16 marcus so VERSION is not required?
20:16 sri wo what is our default makefile now?
20:16 tempire doesn't seem to be.
20:16 sri so
20:17 tempire https://gist.github.com/1855214
20:17 sri hmm
20:17 sri what about the secondary use case?
20:18 sri makefile for normal apps
20:18 marcus sri: apparently, it still just works
20:18 sri http://pastie.org/3403716
20:18 marcus and even generates MyApp-.tgz based on the dir name
20:18 sri that's what i have now
20:18 tempire yeah, but thing-.tgz isn't happy.
20:19 sri wait
20:19 tempire I mean it works, but it's ugly.
20:19 sri the minimal one just works? Oo
20:19 tempire yes.
20:19 marcus tempire: that's just cause your own app doesn't have a $VERSION
20:19 sri lulz
20:20 sri so you want VERSION, PREREQ_PM and test?
20:23 marcus VERSION => 'unset' ?
20:23 marcus unknown?
20:23 purl I wonder how you un-knew it.
20:23 sri VERSION => 'FUN'
20:23 marcus MyApp-unversioned.tgz
20:25 sri http://pastie.org/3403764 # that's all?
20:26 tempire apparently
20:26 purl That's a great theory.
20:26 tempire glen_app-0.01.tar.gz
20:26 tempire replanes
20:27 marcus looks good to me.
20:27 GitHub150 joined #mojo
20:27 GitHub150 [mojo] kraih pushed 1 new commit to master: http://git.io/nV83cA
20:27 GitHub150 [mojo/master] minified makefile command - Sebastian Riedel
20:27 GitHub150 left #mojo
20:29 sri what about the makefiles the plugin generator creates?
20:29 noganex joined #mojo
20:30 sri https://github.com/kraih/mojo/blob/master/lib​/Mojolicious/Command/generate/plugin.pm#L107
20:32 marcus http://nordaaker.com/docs/skitch/theron17.githu​b.com_Twitter-Friends-Map_-20120217-211554.jpg
20:32 marcus my tweeps
20:33 sri didn't you two have a skype date or so?
20:34 marcus sri: I postponed until monday, because tempire is flying, and it's the weekend.
20:39 vervain What exactly is meant by 'Perl expression' with regards to %= and %== in ep... I can't make sense of it.
20:42 vervain Simple scalar values are fine... but anything else just seems to behave oddly.
20:42 batman vervain: you probably just want % when doing "just" expressions
20:42 batman like: % if($foo) {
20:43 vervain What I can't wrap my head around is what is happeing when %= qw/a b c/ just spits out an a.
20:43 batman %= means "take the last value and embed it in the document" sort of...
20:44 batman hm... that is a bit strange yes... don't have the details, but i would expect it to print 3 :/
20:44 vervain ding
20:44 batman what do you expect %= qw/ foo bar /; to do?
20:44 vervain eheheh and %== qw/a b c/ prints out c :-D
20:45 vervain WTF? :-)
20:45 sri i showed you exactly what's happening earlier
20:45 batman why do you care about the details? the "right" way to do it is %== $scalar
20:45 batman not a list
20:46 vervain Because the example in the docs uses 'localtime time' which got me off on this track.
20:46 batman and?
20:48 vervain If only scalar values make sense in that context then the docs should say as much.
20:48 vervain I've have save an hour or so.
20:48 vervain But... I'm still trying to understand... so the details do count.
20:49 GitHub95 joined #mojo
20:49 GitHub95 [mojo] kraih pushed 1 new commit to master: http://git.io/TP3YLA
20:49 GitHub95 [mojo/master] fixed examples in rendering guide - Sebastian Riedel
20:49 GitHub95 left #mojo
20:49 vervain sri: I'm not sure what I was supposed to get from your example besides proof that calling the method provides the same result... not much to learn there.
20:49 * vervain pulls
20:49 sri umm
20:50 sri my oneliner is exactly what %= localtime time gets compiled to
20:50 batman ...
20:51 vervain Right... if my next step is to go and review that method code then so be it... but that's about the only hint the example gave me.
20:51 vervain That and it made me doulbe check what happens when localtime is called in scalar context.
20:52 batman sometimes i don't get people :(
20:52 sri i don't get it either
20:53 sri context matters in perl, that shouldn't be a big surprise
20:53 vervain It's not.
20:53 batman it's not what? :S
20:53 vervain a surprise
20:53 purl COCKSUCKING! HLAGLAHGLAHLGHALG
20:54 batman purl++
20:55 marcus purl: jerk it!
20:55 purl marcus: If I could jerk off to one thing I'd jerk off to you you and you
20:56 marcus :o
20:58 vervain I'm trying to phrase this right... but I don't know if it'll be any better...
20:58 vervain In what context does the evaluation of an array results in the value of it it's first (or last) element?
21:02 vervain s/array/list/
21:02 alnewkirk vervain: "@array" strigifies, $var = (@array) left-to-right in list context
21:04 batman vervain: look up "," operator in perlop
21:05 batman vervain: a,b == do b if a is true, iirc
21:10 sri the fact that %= and %== stringify differently is unfortunate, but i'm not sure it's fixable
21:10 marcus sri: btw, did you get your book yet?
21:10 vervain ^ That sentence right there has helped me with this problem more than any before it.
21:11 sri marcus: nope
21:11 marcus :(
21:11 vervain ^^^^ That sentence that is. ;-)
21:15 marcus sri: sucks. I heard some other people got it already. You're not the only one tho - http://twitter.com/#!/criogra​phy/status/170479579922829312
21:34 tempire hmm
21:35 tempire is it ok to have the directory name be the base for the built .tar.gz?
21:35 tempire when using lite, I would expect a lite app named hello to be named hello-0.01.tar.gz
21:38 sri hmmm
21:38 sri i have a patch that makes %= and %== consistent
21:39 sri it changes a lot though
21:39 sri (internals)
21:40 tempire if we decide, I can release from 40,000ft!
21:40 sri :)
21:40 tempire or however high I am
21:42 vervain Not that I have a vote... but you can guess how I feel :-)
21:44 tempire everyone has a vote
21:44 sri http://pastie.org/3404215 # my proposal
21:44 vervain I say do it... or explain the difference in the docs ( the former is probably easier) ;-)
21:44 sri it changes everything from string to be array based
21:45 sri it's closer to erubis
21:45 marcus My main worry is if it's the right fix.
21:46 sri marcus: what's wrong about it?
21:46 marcus I kinda hate that TT is always in list context.
21:46 sri make a counter proposal
21:46 marcus Not sure this is as bad tho.
21:46 tempire TT always in list context is horrible
21:47 sri it's at least predicable
21:47 tempire At least I think that was it.  there was something it was always enforcing.
21:47 tempire what was the problem again?
21:48 tempire %== was scalar and %= was list?
21:48 marcus album.songs.count is broken for instance. It is why dbic had to add songs_rs
21:48 sri see test case in my patch
21:48 sri $mt->render('<%= @{["a", "b", "c"]} %>:<%== @{["a", "b", "c"]} %>');
21:48 sri that's a test case
21:48 sri right now you get two different results
21:49 marcus A and c?
21:49 purl a and c are both given in units of the master log.
21:49 sri can you tell without trying?
21:50 marcus And now you will get abc?
21:50 sri abc:abc
21:51 tempire ok, I don't have any problem with it.
21:51 tempire if you need scalar, you can always scalar/int it
21:52 tempire oh wait
21:52 * tempire gets installs confused
21:52 marcus It will probably break some templates out there.
21:53 marcus Probably ones expecting the first value of arrayd.
21:53 marcus Arrays.
21:53 sri that's already unpredictable
21:53 sri %= and %== get different results
21:54 marcus I understand that. Designers probably don't tho :)
21:54 sri so stay broken?
21:55 marcus I'm torn
21:55 marcus Would like to hear from crab.
21:56 tempire it seems strange to me to make join'' a default
21:56 tempire can you make this a branch?
21:56 sri perl -Mojo -E'a("/" => {inline => q/<%= @{["a", "b", "c"]} %>:<%== @{["a", "b", "c"]} %>/})->start' get /
21:57 sri here's an example
21:57 sri tempire: why? do you have a better idea?
21:58 tempire my first thought is that if it's going to auto-stringify, then it should work like "@hello"
22:00 marcus Hello. Is it me you're looking for?
22:00 GitHub51 joined #mojo
22:00 GitHub51 [mojo] kraih created arraytemplates (+1 new commit): http://git.io/uUmiOg
22:00 GitHub51 [mojo/arraytemplates] made templates array based - Sebastian Riedel
22:00 GitHub51 left #mojo
22:00 sri there you have your branch, do something with it! :)
22:01 marcus How does this work in php? :)
22:01 sri TIL "git checkout -b arraytemplates"
22:01 sri makes a branch for uncommitted changes
22:02 * tempire waits for airplane latency
22:02 marcus I knew that :)
22:02 sri then use it ;p
22:02 * tempire uses it
22:02 tempire look at all these hip new branches!
22:03 marcus I made a branch today :p
22:03 tempire only crab is missing.
22:04 sri https://github.com/kraih/mojo/commit/68e9282#L2R34
22:04 sri i wouldn't mind if this test resulted in 3:3 or a:a, but i want it to be consistent
22:05 marcus I guess a:a would be least disruptive.
22:05 sri right now it's a:3
22:05 sri no idea how to make a:a happen
22:07 marcus $join[0] ? :)
22:07 yko joined #mojo
22:08 * marcus waves to yko.
22:09 tempire marcus: your vote is a so that it doesn't mess with existing behavior, right?
22:09 sri that's not possible
22:09 sri the current behavior is broken
22:10 marcus Tempire: i am still undecided.
22:10 sri the choice is which behavior to break and make things consistent
22:10 marcus I agree current is broken.
22:10 tempire objectively, I don't like a.  I like 3 the best, consistent across <%= and <%==
22:11 tempire I would be ok with 'a b c', but I vote 3.
22:11 sri you're assuming that choice is possible
22:12 marcus scalar() ?
22:12 purl scalar() is not a function, per se.
22:12 sri so far i've only proven that abc:abc is possible
22:12 sri marcus: make a patch please :)
22:12 tempire um.
22:12 vervain Personally if I had got 3 earlier today I'd have instantly glocked why... not understanding 'a' is what lead to this discussion.
22:12 * marcus is in bed on ipad.
22:12 tempire n00b question: how does one get a remote branch?
22:13 vervain git pull
22:13 purl git pull is not bringing anything down to me.
22:13 marcus co foo origin/foo
22:13 vervain git checkotu branchname should do it.
22:13 batman i agree with marcus: use scalar
22:13 vervain git branch -a will list all branches including remote
22:13 sri HOW?
22:13 sri you're all assuming scalar will magically fix it, but didn't even try
22:13 tempire ok, nevermind.
22:14 sri it does not
22:14 sri the problem is complex
22:14 batman wantarray sucks :(
22:14 sri right now you're arguing about choices that are not available ;p
22:15 sri a:3 vs abc:abc... that's it for now
22:16 marcus Sri: if you replace join with scalar in your test, doesn't it generate 3:3?
22:17 sri ?
22:17 * marcus is cloning, but very slowly.
22:21 batman sri: what about just saying: return a scalar or go to hell?
22:21 batman :)
22:21 sri that would make breakage ok? Oo
22:22 batman sure. enforce rules instead of enforcing fixes ;)
22:22 batman j/k
22:22 vervain That would be fine as long as 'go to hell' means 'error out'
22:24 sri i hava a hacky 3:3 solution
22:24 marcus I want to throw my ipad in the wall.
22:24 marcus Think I need a bt keyboard. :)
22:25 sri http://pastie.org/3404492
22:25 tempire ssh on the iPad does that
22:26 batman sri: can't you do escape(scalar return_value_from_template()) ?
22:26 batman instead of hacking escape() ?
22:26 sri batman: don't ask, patch
22:27 batman i really don't have any idea and i'm actually too tired to even say anything
22:27 batman will try to stfu :(
22:30 sri oh i'm stupid
22:31 batman i doubt that
22:31 sri http://pastie.org/3404516 # here's a much simpler single line workaround
22:32 batman :)
22:32 marcus Yupp
22:32 marcus Looks good.
22:33 marcus Sri: think you just started with your previous patch.
22:34 marcus I vote for that solution, I think.
22:34 marcus Saner than the join, imho
22:34 sri i guess :/
22:35 marcus Can be useful too. I have <%= @children %> illegitimate children.
22:36 tempire I like it.  Though I hate patch.
22:37 tempire also, someone tell me what @_M is
22:37 marcus Tempire: make something better? :)
22:37 marcus I wondered that too.
22:38 tempire github is my patch.
22:38 tempire I only hate it because I don't know how to use it.
22:38 GitHub129 joined #mojo
22:38 GitHub129 [mojo] kraih pushed 1 new commit to master: http://git.io/kdaPrw
22:38 GitHub129 [mojo/master] fixed inconsistency between expressions and escaped expressions in Mojo::Template - Sebastian Riedel
22:38 GitHub129 left #mojo
22:39 tempire and I don't want to read the man page.  but maybe I should.
22:39 marcus --pa ++bi
22:39 sri i suppose it's the right thing to do
22:39 tempire it makes the most sense to me.
22:39 tempire if people want to do something listy, they should construct it accordingly with perl
22:40 * sri nods
22:40 sri if you're still flying upload a release ;p
22:40 sri or do we have anything else on the todo for today?
22:41 tempire regarding the makefile.  does anyone see any problem with having the built .tar.gz be the name of the directory?
22:41 tempire (for a lite app)
22:41 sri not at all
22:41 tempire as opposed to the liteappname-0.01.tar.gz
22:41 tempire ok
22:41 marcus +1
22:41 purl 1
22:41 sri +1
22:41 purl 1
22:42 sri purl: you're doing it wrong
22:42 purl sri: i'm not following you...
22:43 marcus Purl: http://knowyourmeme.com/photos/122
22:43 purl marcus: what?
22:45 sri tempire: well, branches should always be our first choice from now on
22:45 sri at least i'll try to push a branch instead of pasting :)
22:46 sri but we may need a janitor to clean up old branches *cough*
22:46 tempire careful.  you're well on your way to being a GOP member.
22:46 tempire #dowhatisaynotwhatido
22:46 tempire :)
22:47 batman sri: you could call the branches sri/some-feature and maintain the branches yourself...
22:47 sri naaaaaah
22:48 vervain man gitworkflows
22:49 vervain One of my favorite things to do is 'git branch -d master' right at the beginning.
22:49 marcus :o
22:49 sri :o
22:49 tempire :o
22:50 tempire seriously, what is @_M?
22:50 sri doesn't exist in master
22:51 sri $_M there
22:51 sri it's the buffer we append stuff to
22:51 tempire oh.  lulz. Here I was thinking it was something special.
22:52 sri never know with perl :D
22:52 tempire SRSLY
22:52 sri where's the obligatory not sure if fry image?
22:52 sri purl: not sure if
22:52 purl i think not sure if is H or 6.xx
22:55 marcus http://diylol.com/meme-generator/futurama-fry/​memes/not-sure-if-still-funny-or-just-annoying
22:56 sri :)
22:57 vervain No seriously... deleting master and naming something different stops a lot of accidents becuse of command operating on master by default... forces people to be explicit.
22:59 tempire who's getting an iPad in 20 days?
22:59 tempire <- this guy
23:02 marcus <- too
23:02 sri <- not :(
23:03 marcus y U NO IPAD?
23:04 tempire by the way: this is my official release instruction document: http://irclog.perlgeek.de/​mojo/2011-12-10#i_4814856
23:05 vervain Interesting... if I put a ('a','b','c') in my template I now get 3:c for %=:%==
23:05 * sri wants a retina display macbook
23:07 sri vervain: and you get warnings that tell you how wrong you are
23:08 vervain Yep... all good.
23:08 vervain Back to localtime time and I get something that is understandable.
23:10 sri it's still bugged
23:10 sri tempire: abort abort abort
23:11 * tempire reverts time
23:11 * tempire holds release in stasis
23:13 tempire ah.  git checkout -t origin/feature for tracking someone else's remote branch.
23:16 sri dammit
23:16 sri of course
23:16 sri localtime is context aware, so it behaves differently for %= and %==
23:17 sri the fix was pointless
23:17 sri doesn't work
23:17 purl Look buddy, doesn't work is a strong statement. Does it sit on the couch all day? Is it making faces at you? Does it want more money? Is it sleeping with your girlfriend? Please be specific!
23:20 GitHub99 joined #mojo
23:20 GitHub99 [mojo] kraih pushed 1 new commit to master: http://git.io/APQD5Q
23:20 GitHub99 [mojo/master] removed Mojo::Template workaround - Sebastian Riedel
23:20 GitHub99 left #mojo
23:20 sri back to the drawingboard
23:21 sri but i'm kinda losing motivation
23:29 vervain What was broken about it?
23:29 vervain The 'fix' that is?
23:31 sri it doesn't enforce context
23:31 xaka joined #mojo
23:32 sri test case was wrong
23:32 sri http://pastie.org/3404810 # here's a real test case, if someone wants to give it a try
23:32 sri i give up
23:32 tempire a patch
23:33 tempire :s
23:34 sri perl -Mojo -E'a("/" => {inline => q/<%= localtime 784111777 %>:<%== localtime 784111777 %>/})->start' get /
23:34 sri for the lazy
23:34 vervain Ah yes... but both tests are valid I think.
23:34 sri both need to be the formatted date
23:36 sri perl -E'say scalar localtime time'
23:36 sri that's the fix
23:36 sri perl -E'say +localtime time'
23:37 sri that's what we currently do
23:37 sri + instead of scalar so we can support a few very weird cases
23:37 sri it's screwed up
23:38 sri to fix it properly i have to break real features people use
23:39 sri nothing that can be done as far as i can see
23:41 sri the problem is shit like <%= my $foo = begin %>lalala<% end %>
23:42 vervain shit being the operative word there ;-)
23:42 tempire why is that a problem?
23:43 sri $_M .= escape +my $foo = sub {...
23:43 vervain Because templates are supposed to be where designer and programmer interact... and no designer is going to deal with that correctly.
23:43 sri with the fix it would compile to
23:43 sri $_M .= escape scalar my $foo = sub {...
23:43 sri which doesn't work
23:44 sri vervain: if you don't have something constructive to say please don't
23:45 * tempire sprinkles glitter
23:46 vervain Sorry about hte 'shit' comment.. but templates being functionally clear is important.
23:46 tempire vervain: the begin was settled upon after much discussion as a declarative solution that didn't require perl
23:46 tempire at any rate, it's easily replaceable through configuration
23:47 tempire the more important point being that sri is frustrated, so best not rock the boat ;)
23:47 vervain Reverting all available power to inertial dampeners. :-)
23:50 sri "shit" is of course the my $foo assignment in an expression
23:51 sri that should never have worked
23:52 vervain That's what was confusing me... and if I bang that in my template it outputs a code reference.
23:52 vervain Is there a cookbook recipe or some other example where I can see that idea in practice?
23:54 preflex_ joined #mojo
23:54 tempire vervain: rendering guide
23:54 tempire it's a code reference, and executed as such
23:59 sri hmm
23:59 sri this is undocumented behavior
23:59 sri i can actually fix it

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