<zenspider>
deryldoucette: yeah... that NEVER gets old
<deryldoucette>
hehe
<jaimef>
is there a way to "unload" active record extentions to the hash class?
<zenspider>
not really, no
<drbrain>
jaimef: not really
<zenspider>
BEAT YOU DAMNIT!
<zenspider>
HAH
burns180 has joined #ruby-lang
gsav has joined #ruby-lang
<jaimef>
something was working in irb because the hash#deep_diff without active record works fine
<zenspider>
buggy code is buggy
<zenspider>
dunno what to say
<jaimef>
yeah looks like irb returns a Hash from a Json.parse, whereas the other is bringing back Ohai::system
<deryldoucette>
is that the json profiler?
<deryldoucette>
(heard of it, but you're the first i've met that has used it. so was just wondering if it was the same thing)
<jaimef>
no just home grown stuff
<deryldoucette>
ah
tenderlove has joined #ruby-lang
<zenspider>
jaimef: Json.parse returns an Ohai instance when you have AR loaded?
<zenspider>
that doesn't sound right... sounds like something else is also interacting
<zenspider>
how are you running irb?
<zenspider>
can you try script/console?
<jaimef>
rails?
<jaimef>
I dumped an Ohai::system object to a json file. just oddly some version difference in either a library of gem is resulting in different behavior
<jaimef>
no doubt user error
slyphon has joined #ruby-lang
<erikh>
you can pull in specific parts of activesupport
<erikh>
most of the files can be required independently.
<zenspider>
Json.parse doesn't do any type casting, unlike yaml... so I don't see how you could possibly get an Ohai instance back
m3nd3s has joined #ruby-lang
<jaimef>
agreed
<jaimef>
the difference is in irb vs bundle exec irb. so will figure out what I broke
l0st1 has joined #ruby-lang
<jaimef>
ahh it pulls in chef
<jaimef>
different versions of json, one appears to use the "json_class" field which is Ohai::System and the other one does not
<zenspider>
nonstandard json is nonstandard
thone has joined #ruby-lang
tomzx has joined #ruby-lang
jkyle_ has joined #ruby-lang
tommyvyo_ has joined #ruby-lang
burns180_ has joined #ruby-lang
wmoxam has joined #ruby-lang
gsav has joined #ruby-lang
Avanine has joined #ruby-lang
heppy_ has joined #ruby-lang
igotnolegs has joined #ruby-lang
Technodrome has joined #ruby-lang
srbartlett has joined #ruby-lang
Technodrome has quit [#ruby-lang]
takaokouji has joined #ruby-lang
takaokouji has joined #ruby-lang
rohit has joined #ruby-lang
m3nd3s has joined #ruby-lang
neilc has joined #ruby-lang
chimkan has joined #ruby-lang
burns180 has joined #ruby-lang
QoQOoO has joined #ruby-lang
<zenspider>
sup bitches?
<andrewvos>
meh
<andrewvos>
is zenspider drunk?
QaDeS_ has joined #ruby-lang
Kero has joined #ruby-lang
<neilc>
zenspider: digging around in ruby2ruby at the moment, as it happens
agib has joined #ruby-lang
havenn has joined #ruby-lang
shtirlic has joined #ruby-lang
io_syl_ has joined #ruby-lang
Kuukunen has joined #ruby-lang
<neilc>
zenspider: btw, is it expected that ~155 of the ruby2ruby tests fail out of the box?
<kyrylo>
Gray, you could've click that link and read the first sentence, at least.
<kyrylo>
*clicked
aza_kibo_ has joined #ruby-lang
Stalkr_ has joined #ruby-lang
<Gray>
kyrylo, i read. But i don't understand why i can't subtract 2 DateTime objects?
leriksenau has joined #ruby-lang
leriksenau has quit [#ruby-lang]
<sym->
intruitively, that would make sense, what would e.g. the difference be between 2011 and 1988? the year 33?
<sym->
23*
futurechimp has joined #ruby-lang
<Gray>
sym-, i new in ruby and in programming. So, here is a book: http://pine.fm/LearnToProgram/?Chapter=01 and here is the simple task: how many seconds old are you?
<Gray>
so i need substract now date time - birth date time
francisfish has joined #ruby-lang
<beiter>
hi, is there a good way to parse a tree into a xml file ?
burns180 has joined #ruby-lang
<sym->
Gray: it's not trivial because of leap years, leap seconds, etc
<sym->
Gray: but there should be a good chance one of these classes has a "to seconds" method, I would read the docs
victork has joined #ruby-lang
<rippa>
Time#-
<rippa>
gives you seconds
Hakon|mbp has joined #ruby-lang
zerokarmaleft has joined #ruby-lang
Guest16561 has joined #ruby-lang
Zolrath has joined #ruby-lang
vcashk has joined #ruby-lang
andee_marks_ has joined #ruby-lang
sandbags has joined #ruby-lang
nevynxxx has joined #ruby-lang
Fractality has joined #ruby-lang
victork has joined #ruby-lang
Hakon|mbp has joined #ruby-lang
Joeysomo_ has joined #ruby-lang
jbsan has joined #ruby-lang
zerokarmaleft has joined #ruby-lang
DarkGray has joined #ruby-lang
Stalkr_ has joined #ruby-lang
rohit has joined #ruby-lang
reitelles has joined #ruby-lang
L0rdShrek has joined #ruby-lang
PhilCK has joined #ruby-lang
roadkith has joined #ruby-lang
seoaqua has joined #ruby-lang
burns180_ has joined #ruby-lang
canton7 has joined #ruby-lang
srbartlett has joined #ruby-lang
A124 has joined #ruby-lang
Muz has joined #ruby-lang
srbartlett has joined #ruby-lang
davidw has joined #ruby-lang
workmad3 has joined #ruby-lang
QaDeS has joined #ruby-lang
IPGlider has joined #ruby-lang
neoesque has joined #ruby-lang
verto has joined #ruby-lang
adambeynon has joined #ruby-lang
burns180 has joined #ruby-lang
Hakon|mbp has joined #ruby-lang
reitelles has quit [#ruby-lang]
reitelles has joined #ruby-lang
<kalleth>
scumbag ruby: allows simple command execution through output = `command`, doesn't sanitise it automatically
<kalleth>
:(
<injekt>
kalleth: sanitize how?
<kalleth>
i dunno, escape it somehow ;p
<injekt>
escape.. what?
<injekt>
lol
<kalleth>
i hasten to add i'm not the genius that passed unsanitised user-entered strings to a bash script call ;)
<kalleth>
(as root!)
<injekt>
oh
<injekt>
there are lots of shell util libraries
<kalleth>
yeah, there's Escape
<injekt>
there's shellescape in shellwords which is in stdlib
<A124>
Moorning. (Not for me really) What whould you advise as a storage for tens of thousands small (~5kB) images?
<kalleth>
A124: reiserfs
* kalleth
giggles
<kalleth>
seriously, some kind of filesystem
<A124>
kalleth: Umm.. is reser maintained even. But, thanks for that.
<kalleth>
i was taking the piss, A124 ;p
<kalleth>
obv
<A124>
xD
<A124>
Not obv for me
<erikh>
injekt: I never went to sleep in the first place
Para has joined #ruby-lang
<kalleth>
A124: you _could_ use a database, I guess, but using databases for filestores seems a bit..dodgy for me
<A124>
kalleth: The thing is taking a lot of inodes and slow directories. And the files are really small.
<erikh>
kalleth: look into the C that handles that array form
<kalleth>
are you talking local storage to your app or remote storage like amazon cdn etc?
<erikh>
it's ... shellwords
<A124>
kalleth: Yeah. I have second folder with larger images, which is other case. But the very small ones .. and very many..
<kalleth>
erikh: so why does my Shellwords.escape not work with ls -ltr / (i.e. escapes it so much it produces invalid output), but Open3.popen3([array,of,args]) works fine?
<A124>
kalleth: Some storage system usable with Ruby
<erikh>
kalleth: because they aren't the same implementation.
<erikh>
and what does shell words do to ls -ltr / ?
<A124>
kalleth: FS works for large files obviously, but this is not the case.
<kalleth>
A124: local to the app on the same machine, right? I think there's a filesystem specifically designed for lots of small files, format a partition with that fstype, and use that
<kalleth>
*shrug*
<kalleth>
alternatively there's probably some open source project out there i'm not aware of
<injekt>
if you have a string, you want to shellwords split it, then you want to shellwords join it before you execute it
<injekt>
boom, I worked that out from the docs
<kalleth>
yeah :) I'll just use an array of arguments
<erikh>
also note that array forms of system() and friends go through similar escaping routines before being passed to exec-alikes
<erikh>
they are not parameterized execs
<kalleth>
one question though, all of these exec mechanisms fork() or equiv and fire up a shell, right?
<yxhuvud>
erikh: well, not the first argument to system. only the latter ones
<kalleth>
is there a way to execute a command from ruby without doing that?
<matled>
kalleth: I'd always recommend to use exec in a way that allows to pass parameters. i.e. http://pastie.org/3547803
<kalleth>
i.e. issue it without shell interp
<erikh>
yxhuvud: probably correct; I source dove with raggi until we found the strtok calls and then we both just threw up in our mouths a little and stopped
<matled>
kalleth: no, they only fire up a shell if there is only one argument (and maybe that is checked if it is an executable in $PATH or not)
<yxhuvud>
:D
<injekt>
wow the ruby-doc website is NOT easy to navigate
<kalleth>
matled: aah, so exec "ls -ltr /" does fire up a shell, but exec ["ls", "-ltr", "/"] doesn't?
<matled>
kalleth: yep
<erikh>
what I'm trying to say is that parameterized system and friends does not change anything
<kalleth>
got it :)
<injekt>
my face hurts
<erikh>
ugh
<erikh>
going to break stuff now, later
<matled>
kalleth: and that exec "sh", "-c", ... fires up the shell manually and passes the arguments as arguments to the shell
<injekt>
enjoy!
<matled>
kalleth: the extra sh is $0
<kalleth>
:)
erpelchen has joined #ruby-lang
<A124>
kalleth: Any other ideas? .. I only heard of xfs. But I don't see at as a best solution. Also, I haven't mentioned. Mostly all files will remain untouched.
rohit has joined #ruby-lang
<matled>
kalleth: I've got to go now
m3nd3s has joined #ruby-lang
sandbags has joined #ruby-lang
<kalleth>
matled: that's ok, I'm done, thanks very much :)
<kalleth>
A124: i'm not au fait with all the open source projects to do it
<A124>
kalleth: ok. Thank you. All I have though about was some MangoDB, flatfile database, filesystem tweaks / change
<kalleth>
well, surely the db would still have to go to disk to get the data
<kalleth>
and my guess is a filesystem will be better at getting to the right data on disk than a database
<kalleth>
and better @ using less memory, too
<kalleth>
:P
<kalleth>
but that's just a guess, i'd research it more and chat to some more dudes before you settle on an approach
<A124>
kalleth: Maybe. The problem is not with the data, but with the count of the files.
<kalleth>
*shrug*
<kalleth>
mongodb actually looks reasonable, why not performance benchmark both
<A124>
kalleth: Umm.. Well, I gues I maybe should xD Thanks.
<kalleth>
write a wrapper to return the path to the file/get the file data, and then write a Filesystem based implementation and a Mongodb based implementation, compare the two over a million files
<A124>
kalleth: I also remeber xfs being used on news server and other alike things. So it maybe could permform well, except it's stale.
<kalleth>
maybe it's stale because it does what it says on the tin? :P
<kalleth>
i dunno, i'm no guru
<kalleth>
i know that with filesystems dealing with lots of very small files, the blocksize is important
<kalleth>
but potentially mongodb will perform better
<A124>
kalleth: Mongo is pretty sable and has ClusterFS, which is extension backed up by MongoDB. The FS is not a FS though.
<kalleth>
the more i read up on it, the more a key-value type document/nosql db seems good
<kalleth>
"imageid: binary representation of image"
<kalleth>
but as i said, best to benchmark them :)
<A124>
kalleth: To be honest. I advocated nosql when everyone was killing others for not using SQL xD
<kalleth>
A124: the more I read about them, the more I think they have a very specific set of use cases
<kalleth>
for example, I wouldn't use a key-value store only to develop a rails application with relationships :P
<A124>
kalleth: They are not that specific. And also work as a SQL in a little. But without the complex, not often used sh*t. So they are more robust and faster and simpler.
<kalleth>
it depends if it's the right tool for the job
<kalleth>
can you enforce referential integrity at the datastore level? can you run complex queries with dependent relationships etc?
<injekt>
stop talking about it and try both? ;)
<kalleth>
^
<erikh>
use sysbench
<erikh>
or bonnie++
<injekt>
I just typed boonie into google
<injekt>
fuck you
<injekt>
@ fingers
<A124>
kalleth: exactly, but some relations are good anyway.
<erikh>
bonnie++ is a filesystem benchmarking tool
<injekt>
i've not heard of it before
<injekt>
interesting
<kalleth>
anyway, i have to go back to work now, listen to erikh and injekt and try both and see which works best :)
<A124>
erikh: Thanks. Although CLusterFS from mongo is not a standard FS, though
<injekt>
oO
<erikh>
I don't even know what clusterfs is
<erikh>
it sounds very hip
<A124>
kalleth: Yup. Thanks.
<injekt>
clusterfucks
<injekt>
I should get back to work
<A124>
erikh: It's a layer on top of MongoDB
<erikh>
mongodb isn't exactly famous for its reliability
<A124>
erikh: Takes care of names, md5 checksums, integrity checking, and splitting large files.
<andrewvos>
erikh: Well, you could say that is is famous for it's reliability.
<erikh>
andrewvos: heh.
<A124>
Umm. I don't know much, so that is why I ask, if anyone has any idea ;)
<erikh>
we use it at work. it's been ok
<erikh>
I just know of several nightmare scenarios with it.
<A124>
erikh: Which scenarios please? So I could avoid them possibly xD
<erikh>
the database soiling itself
<erikh>
to the point of no return
<erikh>
you should research it and see if it's worth the trouble for you.
<erikh>
fwiw, sql databases are pretty mature products these days and you really have to try hard to get them to crash.
<yxhuvud>
heh, I get mysql to dump almost daily ;)
<erikh>
shit man, how do you manage that?
<erikh>
I mean a few years ago I wouldn't have been surprised
<erikh>
but 5.1 and up are pretty solid
<yxhuvud>
well, the cli isn't very stable if you do certain things while it is exiting.
<yxhuvud>
so it is not as if it matters
gasbakid has joined #ruby-lang
DarkGray has joined #ruby-lang
<andrewvos>
how do I ack search loads of files like this "ack --all base.spv -l" but then open all those files at once in vim?
<andrewvos>
So I can use :n
<erikh>
use the Ack plugin?
<erikh>
:)
<andrewvos>
erikh: hehe fair enough
<erikh>
it opens a debug window
<erikh>
you can just enter through the files
<erikh>
takes you right to the line, etc.
<erikh>
it's pretty awesome.
<andrewvos>
It's only finding one match :/
<erikh>
did you :Ack -a or w/e
<erikh>
sooooo tired
<andrewvos>
ohhhh right
<andrewvos>
Thanks erikh
<andrewvos>
That's amazing
<injekt>
<3 the Ack plugin
<erikh>
yeah the plugin really rules
<injekt>
although I have been using sublime for the last week
WillMarshall has joined #ruby-lang
y3llow_ has joined #ruby-lang
fayimora has joined #ruby-lang
burns180_ has joined #ruby-lang
jhchabran has joined #ruby-lang
znz_v has joined #ruby-lang
apeiros_ has joined #ruby-lang
rolfb has joined #ruby-lang
reitelles has quit [#ruby-lang]
QaDeS has joined #ruby-lang
<DarkGray>
is any difference?
<DarkGray>
puts str.ljust(50)
<DarkGray>
puts str.ljust 50
<apeiros_>
DarkGray: no, it's the same
<roadkith>
the one as ()
<apeiros_>
all you have to do is pay attention with regards to precedence
<roadkith>
and readability
<roadkith>
no?
<rolfb>
apeiros_: weren't you happy with the Apple TV update?
<apeiros_>
rolfb: no, I'm disappointed
<rolfb>
apeiros_: why?
<DarkGray>
thx
<rolfb>
apeiros_: what did you want?
<apeiros_>
rolfb: same bad software. I'll take a look at it tonight. maybe it's better than it looks…
<roadkith>
what do you buy appleTV for btw?
<roadkith>
what does it do?
<apeiros_>
rolfb: better software. f.ex.: filter movies by language, play mp3-streams in my itunes library, better internet radio, being able to use a bluetooth keyboard…
<rolfb>
roadkith: movies, tv shows, major league baseball, podcasts (especially TED talks), netflix, vimeo, youtube
<roadkith>
does it store movies?
<rolfb>
roadkith: it has cloud locker for movies
<apeiros_>
have already rented/watched movies marked. then (not a software problem) the selection of movies and tv shows in switzerland is a joke…
<rolfb>
as in, you can stream at will
<rolfb>
if you've bought it
<rolfb>
i mean "on demand" :)
<roadkith>
hm
<apeiros_>
roadkith: I use it to connect my computer with my tv
<roadkith>
you cannot watch blurays on it can you?
<apeiros_>
also to rent movies and show photos to friends
<rolfb>
apeiros_: yeah, i buy gift cards on ebay and use an US account
<apeiros_>
roadkith: it has no drive, so no
<apeiros_>
rolfb: ah, good idea
<roadkith>
hmm guess i dont need it then
<rolfb>
and the new software update gave you "complete my season"
<roadkith>
need/want
<rolfb>
which is nice
<apeiros_>
rolfb: you're from NO?
<rolfb>
apeiros_: YES, NO
<rolfb>
:)
<apeiros_>
lol
<apeiros_>
your country caused troubles with our localization files… :)
<apeiros_>
no is a literal for false in yaml…
voker57 has joined #ruby-lang
voker57 has joined #ruby-lang
<yxhuvud>
:D
<rolfb>
apeiros_: ohrly? either way, there is no such thing as "no"
<rolfb>
there is no-NB and no-NO
<rolfb>
i think
<rolfb>
(but i'm not sure how yaml handles that)
<apeiros_>
rolfb: hu?
<rolfb>
sorry, no-NB and no-NN
<rolfb>
the language is split
djh has joined #ruby-lang
<apeiros_>
ah, you mean locales?
<rolfb>
yes
<apeiros_>
na, we had a list of countries
<rolfb>
ah
<apeiros_>
but tbh, the bigger issue was italian, where we had a couple of 'no' values.
burns180 has joined #ruby-lang
<rolfb>
:)
<apeiros_>
anyway, HD ipad gives me hopes for an HD MBA
<rolfb>
hmm
<rolfb>
that could be nice
<rolfb>
would love some antiglare on it too
<apeiros_>
that hasn't bothered me much. but I can understand those whom it does bother.
<rolfb>
have you had antiglare?
<apeiros_>
you mean the way screens have been before high-glossy, right?
<rolfb>
i had on my previous mac
<rolfb>
hmm, no
<apeiros_>
oh, ok, then I misunderstood
<rolfb>
i think it's better than that
<darix>
i think the bigger disappointment is lenovo. like all their business laptops are non-glare display. but their tablet gets a glare display -.-
<rolfb>
it works rather good in sunshine
<apeiros_>
hm, no, the only thing I've seen working well in sunshine was a technology called "transflective" (iirc)
<apeiros_>
that was very nice. I wonder why nobody uses it - too expensive? not manufacturable in those sizes? no idea…
<rolfb>
i would buy that in a heartbeat
<apeiros_>
eInk is also very readable in sunlight. too bad it's too slow for anything but static content…
jxie has joined #ruby-lang
<apeiros_>
anyway, I'll have to pay attention wrt anti-glare then
<rolfb>
eInk is awesome :)
* ruskie
loves eInk
adambeynon has joined #ruby-lang
Sailias has joined #ruby-lang
* shevy
loves ruskie
<ruskie>
heh
<ruskie>
what did I do to deserve that?
<A124>
shevy: Hey. Any progress? xD
looopy has joined #ruby-lang
mark_locklear has joined #ruby-lang
<cout>
I had high hopes for Pixel Qi
vcashk has joined #ruby-lang
ankurgel has joined #ruby-lang
<apeiros_>
cout: had? no longer?
<cout>
apeiros_: well it doesn't seem to be hoing anywhere
<cout>
going
<apeiros_>
:-/
* apeiros_
had high hopes in polymer-memory
<apeiros_>
but that went nowhere either :(
<apeiros_>
another one of those "just around the corner!" technologies…
burns180_ has joined #ruby-lang
<cout>
I'm glad we do have eink now. I was afraid it was going to die with that silly phone motorola used it on.
<cout>
motorola f3
<cout>
for some reason they thought it would be a good idea to only support lowercase letters, and the battery life wasn't any better than a regular phone
<imperator>
cout, unemployed but happy, designed another game i'm hoping to get published, but gotta start looking for a job :(
<cout>
DarkGray: before you call srand the first time, save a random number, then when you want to "go back to random mode", use that number as the seed
<cout>
imperator: job hunting isn't much fun
<cout>
imperator: especially when it means you lose your freedom
<imperator>
cout, indeed
futurechimp has joined #ruby-lang
<imperator>
cout, what are you going (back?) to school for? you may have told me and i've forgotten
<cout>
imperator: MD
<imperator>
srsly? wow
<imperator>
i guess you won't be needing ruby much longer then
<cout>
actually I'm getting a job doing ruby for the medical university
<cout>
I hope to combine software engineering with being a doctor, but I'm not sure what that's going to look like yet
coreydaley has joined #ruby-lang
<DarkGray>
cout ?
<cout>
DarkGray: s = rand(2**31); srand(10); p rand(10); srand(s); p rand(10)
dejongge has joined #ruby-lang
<kalleth>
lmao
<kalleth>
computers are random, rite guys
JEG2 has joined #ruby-lang
virunga has joined #ruby-lang
virunga_ has joined #ruby-lang
tomzx has joined #ruby-lang
ezkl has joined #ruby-lang
* imperator
randomly mentions SecureRandom
<imperator>
cout, i'll be interested to see what that looks like, too :)
fayimora has joined #ruby-lang
lchi has joined #ruby-lang
mistym has joined #ruby-lang
ezkl has joined #ruby-lang
burns180 has joined #ruby-lang
burns180 has joined #ruby-lang
dajmon has joined #ruby-lang
tbuehlmann has joined #ruby-lang
<sym->
did you expect different results the second time around or what? O_O
<dajmon>
hello! i am a master's student observing this chatroom for a research study. click here for more info - http://pastie.org/3547791
outoftime has joined #ruby-lang
<andrewvos>
hmmm
futurechimp has joined #ruby-lang
<dajmon>
(and i hope that's better, dominikh :p)
wmoxam has joined #ruby-lang
* imperator
has done the study and encourages others to do it
<dajmon>
:) thanks!
* apeiros_
doesn't like being a research subject…
<apeiros_>
guinea pig?
<apeiros_>
ah, interviews…
<dajmon>
don't worry, no vivisection necessary
<apeiros_>
aaaaaw =(
<dajmon>
i mean, i guess if you WANT i could write it into my proposal
macmartine has joined #ruby-lang
rayners has joined #ruby-lang
Spooner has joined #ruby-lang
sym_ has joined #ruby-lang
ankurgel has joined #ruby-lang
dhruvasagar has joined #ruby-lang
m3nd3s has joined #ruby-lang
lchi has quit [#ruby-lang]
lchi has joined #ruby-lang
<andrewvos>
fuck everything about programming today
<andrewvos>
You know the problem with programming? Fucking programmers.
<deryldoucette>
fuck everything about everything today
<deryldoucette>
today is about reading and learning. programming can be done tomorrow.
<ankurgel>
what the fuck is wrong?
<deryldoucette>
the problem with programming is knowitall programmers with attitudes :)
srbaker has joined #ruby-lang
<dajmon>
what are you reading and learning?
Phrogz has joined #ruby-lang
mytrile has joined #ruby-lang
<andrewvos>
deryldoucette: Nope, even the stupid programmers
<deryldoucette>
dajmon: freeswitch cookbook
kng has joined #ruby-lang
<andrewvos>
deryldoucette: But I agree. The hotshot programmers are the worst. They always look good because they write the most complex bullshit and nobody has the heart to even begin to try understand it.
<lianj>
bad mood day?
<deryldoucette>
andrewvos: hehe i wouldn't say no one has the heart, more like people don't want to question the hotshots. because if they are wrong even ONCE.. they lose ALL credibility. The hotshot gets it wrong, THEY get forgiven with ease because they ARE hotshot programmers.
robgough has quit [#ruby-lang]
<deryldoucette>
I'd keep my mouth shut too
<deryldoucette>
i question something zenspider does and I'm wrong, I become a laughing stock within the (company|project) for example. He.. he gets forgiven if he makes a mistake usually with just a chuckle because he's got a proven solid track record.
<andrewvos>
yeah
<andrewvos>
oh well
<andrewvos>
oh well, back to trying to do something completely trivial but failing at it for an entire day. Yay!
<deryldoucette>
hehe been there done that.
<mistym>
andrewvos: Keep fighting the good fight!
<deryldoucette>
it don't get no better
reitelles has joined #ruby-lang
<andrewvos>
mistym: I'm getting to the point where I would rather just take the money and try not get too upset
<deryldoucette>
some days you'' kill the beast. some days the beast kills you. nature of the world :)
burns180_ has joined #ruby-lang
<felideon>
is there a common ruby idiom where I can either iterate over an array, or do something else if the array is empty?
<reitelles>
felideon: a simple if?
<felideon>
right now i just have if foo.empty? then frob else foo.each { |x|
<felideon>
... }
<felideon>
right
darkf has joined #ruby-lang
jenrzzz has joined #ruby-lang
<felideon>
I was tryin: if foo.each do ... end else ... end but that doesnt seem to work :)
vienneau has joined #ruby-lang
gregmore_ has joined #ruby-lang
dfr|mac has joined #ruby-lang
<reitelles>
felideon: guess not, afaik 'else' just works with 'if'
<reitelles>
but that would be cool, it it worked :)
<cout>
reitelles: it also works with rescue
<reitelles>
cout: you're right, didn't know that
<reitelles>
i checked a manual and found that it also works in 'case' expressions
<reitelles>
hadn't use that yet... thought was something like 'default' :P
io_syl has joined #ruby-lang
<rue>
One of these cases, or else
<cout>
arr = [1, 2, 3 ]; class Empty; def ===(x); x.empty?; end; end; case arr; when Empty; puts "EMPTY"; else puts "NOT EMPTY"; end
<cout>
idiomatic but overkill :(
tenderlove has joined #ruby-lang
hangingclowns has joined #ruby-lang
<hangingclowns>
I have a sentence like string and I want to use a regular expression to pull out just the alphabet letters from the string and store it into another string for manipulation
<hangingclowns>
how can I do that?
<hangingclowns>
i have the regular expressoin, but I can't seem to find the right method
wyhaines has joined #ruby-lang
<hangingclowns>
I tried chars = string[/[a-zA-Z]/] <— but this just seems to return everything up until the first whitespace
v0yager has joined #ruby-lang
<hangingclowns>
actually, i tjust returns the first character
<andrewvos>
hangingclowns: "weewf@£235235231131!!££!!$!%!£%! ".chars.select{|c| c =~ /\w/}.join
<andrewvos>
hangingclowns: Is that what you want? it's ugly but works
<andrewvos>
I'm sure you can do it with a clever regex but I hate programming too much to think about it right no
<hangingclowns>
hmm
<hangingclowns>
seems a bit more complicated than I thought it would be?
<hangingclowns>
i thought you can just take out the characters, now I have to go through every one instead?
<rippa>
string.scan(/a-zA-Z/)
<rippa>
string.scan(/[a-zA-Z]/)
<rippa>
I mean
curtism has joined #ruby-lang
<rippa>
and .join
<rippa>
ofc
<hangingclowns>
yes, seems good i think
<hangingclowns>
thanks rippa
<hangingclowns>
trying to make a palindrome? function
<hangingclowns>
where it examines a string to see if it's the same both forwards and back
<hangingclowns>
but i have punctuation marks to consider.
<rippa>
make a clever recursive regexp
<rippa>
to check for palindromness
<hangingclowns>
recursive?
<mortice>
string.gsub([^\w],"").reverse == string
<mortice>
sorry, with / / around the regex
<Phrogz>
mortice: Nope; you need gsub! there, but then that mutates.
<mortice>
Phrogz: right you are unless you apply the gsubbing on both sides :)
<rue>
hangingclowns: Consider, or ignore?
<hangingclowns>
i think this looks good
<hangingclowns>
string.scan(/[a-zA-Z]/).join()
burns180 has joined #ruby-lang
burns180 has joined #ruby-lang
<Phrogz>
hangingclowns: /[a-z]/i at least
<Phrogz>
Er, /[a-z]+/i
apeiros_ has joined #ruby-lang
<Phrogz>
hangingclowns: Or are you allowing foo-oof ?
<hangingclowns>
just legal alphabet as far as I know
<hangingclowns>
it reads the same backwards as forwards, ignoring case, punctuation, and nonword characters
<hangingclowns>
so it should be a non-word character, right?
<apeiros_>
mortice: assuming you meant [^\w], then you can replace it with \W instead
<mortice>
I meant [^\w], and that's what I typed. But good point :)
<apeiros_>
hm, well, I see [^w] here…
<mortice>
oh, my bad. Late in the day and the week here!
<mortice>
knew I should have copy-pasted from irb
<hangingclowns>
ahhh
<hangingclowns>
that does look more "ruby-like"
<hangingclowns>
i like that better
EvilJStoker has joined #ruby-lang
<mistym>
I have a directory with a '/' in its name. That's obviously wreaking havoc on File and Dir operations. I know where the / is - how can I escape it so it isn't interpreted as a folder division?
<apeiros_>
\
<mistym>
apeiros_: Tried that. Oddly enough replacing the / with a \/ doesn't seem to have helped.
<apeiros_>
mistym: you may need \\/
<mistym>
apeiros_: I'll try that, thanks.
<andrewvos>
o/
<andrewvos>
|o| <-- tie fighter
burns180_ has joined #ruby-lang
<mistym>
<('.')> <-- kirby
<andrewvos>
ooohhh
<andrewvos>
I love kirby
<dajmon>
t('.'t)
<andrewvos>
hahaha
<mistym>
ꖯ
<mistym>
Argh. dirname.gsub! '/', "\/" and .gsub! '/', "\\/" did not help.
<rippa>
maybe it's not really a "/"
<rippa>
maybe it just looks like
<rippa>
unicode has many characters
<mistym>
rippa: No, it replaced them - it just didn't help File/Dir correctly locate files in them.
darkf has joined #ruby-lang
futurechimp has joined #ruby-lang
<mistym>
rippa: Problem is the directory is named 'foo/bar'. File and Dir, which work with strings, quite sensibly assume that means it's two nested directories.
<rippa>
you renamed it and it still doesn't work?
<hangingclowns>
What is \b in a regular expression? i need to pull out whole words, not just characters, now
<rippa>
word boundary
<hangingclowns>
like a space or a comma?
<Tasser>
hangingclowns, like not a word anymore
flak has joined #ruby-lang
<hangingclowns>
ahh, so this should work: [^\W]{1,}\b
<hangingclowns>
any word character together with 1 or more characters
<hangingclowns>
this should pull out full words
Tearan has joined #ruby-lang
QaDeS has joined #ruby-lang
<hangingclowns>
i really gotta get into regexp
<hangingclowns>
so powerful if you know how to write them
<deryldoucette>
hangingclowns: i bought the mastering regular expressions book. become like a freakin bible
<hangingclowns>
there's an expressions book!?
<hangingclowns>
all i found was a cheatsheet online and its' been dogshit for me
<mortice>
hangingclowns: you can write \w+ instead of [^\W]{1,}
<deryldoucette>
yeah sec. lemme see if i can find the url for it
<mortice>
\W means 'not a word character' and \w means 'word character', so there's no need to double-negate
<Gray>
t will do the same thing every time you seed it with the same number. If you want to get different numbers again (like what happens if you never use srand), then just call srand 0. This seeds it with a really weird number, using (among other things) the current time on your computer, down to the millisecond.
<Gray>
but if i set srand 0 - random don't works.
<rippa>
how?
macmartine has joined #ruby-lang
<apeiros_>
Gray: use `srand` instead of `srand 0`
<apeiros_>
(or just don't call srand at all)
<Gray>
aperios_, hmm let me try...
<apeiros_>
Gray: hint, use tab-completion for nicks
<apeiros_>
then you don't typo them…
<Gray>
apeiros_: thx)))
<Gray>
apeiros_: doubles thx, `srand` works fine)
krzyhoo has joined #ruby-lang
<krzyhoo>
andrewvos: my man
<krzyhoo>
you made my day yesterday
<krzyhoo>
did some work today
<krzyhoo>
and manage to create an awesome xml erb template for my project
wyhaines_ has joined #ruby-lang
tekin has joined #ruby-lang
wyhaine__ has joined #ruby-lang
<hangingclowns>
anyone know of an easy way to loop through an array of arrays with a 2 element array of strings for player data?
<hangingclowns>
the arrays in a form of a tournament
<Phrogz>
hangingclowns: Depends on what you need. You could just nested_array.flatten.each{ |str| ... }
<burgestrand>
I heard you like arrays, so I put some arrays in your arrays with arrays in them :x
<Phrogz>
Is it [ [ ['foo', 'bar'], ['jim', 'jam'] ] ] or [ ['foo', 'bar'], ['jim', 'jam'] ]? It's the former, right?
<burgestrand>
I was also a bit confused by that one
<hangingclowns>
no
<Phrogz>
You could also (Ruby 1.9) nested.flatten(1).each{ |p1,p2| ... }
<Phrogz>
Oh, then just array_of_tuples.each{ |p1,p2| ... }
<hangingclowns>
maybe my coding is not so great :(
<hangingclowns>
but i think it's readable
<Phrogz>
Oh, so it's an array of arrays of arrays of two-element arrays?
<hangingclowns>
yeah
<krzyhoo>
f***. i think i really F-ed up. Had to install git on windpows and now some of the documents i am watching on windows are marked as Macintosh (even though i use only windows and linux)
<hangingclowns>
you'll see at the bottom of my gist, tourney =
<hangingclowns>
then you'll see what i mean
<Phrogz>
So tourney.flatten(2).each{ |p1,p2| ... }
<hangingclowns>
well I have a get winner that will return the winner array
<hangingclowns>
any need for flatten?
<jaimef>
can you specify the location of a Rakefile with rake(1)?
* Phrogz
HATES the game where the rules are figuring out what the OP actually needs.
<Phrogz>
krzyhoo: Sounds like you need to change your line ending settings on git.
<hangingclowns>
this is definitely a fun game, though
<hangingclowns>
this kind of exercise is fun, i think
<dajmon>
as short as you like, typically it's taken about half an hour but if you have less time than that i can just cover the main topics w/o going into details with you
ilyam has joined #ruby-lang
<burgestrand>
Oh, yeah, you were the talk of the channel last time I was in here too
<dajmon>
uh oh
<dajmon>
that doesn't bode well for observational bias
<burgestrand>
I could talk to you for a little while if it would help you, can’t make any guarantees it’ll be a full half hour though :)
<dajmon>
that'd be great :)
senj has joined #ruby-lang
Stalkr_ has joined #ruby-lang
naz has joined #ruby-lang
vmatiyko has quit [#ruby-lang]
virunga has joined #ruby-lang
H2H has joined #ruby-lang
ascarter has joined #ruby-lang
publicvoid has joined #ruby-lang
justinmcp has joined #ruby-lang
<krzyhoo>
Phrogz: can i use nokogiri to validate my document against an external dtd file?
butchanton has joined #ruby-lang
<Phrogz>
krzyhoo: I don't know the answer, but I think not. XSD yes, DTD no (I think).
pw_ has joined #ruby-lang
<Phrogz>
If libxml2 does it, I bet Nokogiri does. Let's see.
<rue>
That's basically what it boils down to
nevynxxx has joined #ruby-lang
<krzyhoo>
the software i am usingf (Informatica PowerCenter) uses DTD to validate
<Phrogz>
urbino: What's 'wrong' with it is that it has no side effects.
<heftig>
urbino: everything. what are you trying to do?
<darkf>
urbino: everything you do is wrong
<urbino>
NoMethodError: undefined method
<wmoxam>
so helpful :D
<yorickpeterse>
Is there a clean way of completely disabling shell access from Ruby? The laziest way is to redefine Kernel#system and Kernel#` but that's not very bulletproof
<Phrogz>
urbino: Is 'array2' actually an array? What does it mean to ask if [1,2,3] < 'z' ?
<heftig>
yorickpeterse: $SAFE
<heftig>
only available in MRI
<Asher>
urbino - you're giving little bits of information that aren't enough to direct you properly
<urbino>
I would like to unest a list of lists one level at a time (not flatten)
<Phrogz>
"unest"?
<urbino>
un-nest
<yorickpeterse>
heftig: SAFE disables much more than that
<wmoxam>
urbino: I think you mean array2 << x
<urbino>
and << to append the array was my intention
<yorickpeterse>
I can't really use it since some of the code actually needs, for example, File.expand_Path
<wmoxam>
urbino: you are trying to append, right?
<urbino>
right
<Phrogz>
urbino: So does your code actually do <<, or what you wrote above?
Faris has joined #ruby-lang
<urbino>
Yes it <<
<Asher>
yorickpeterse - my understanding is that there are some sandboxing efforts but that the most successful thus far involve patching the ruby install (recompiling)
<wmoxam>
urbino: how about array2.concat(array1)
<Gray>
Guys, after i finish that book: http://pine.fm/LearnToProgram. Can i start learn Ruby on Rails? Or i should focus on Ruby?
<urbino>
array1.each {|x| array2 < x}
<Phrogz>
urbino: Then what's your real code and real error message?
<wmoxam>
urbino: that is easier and better
<urbino>
array2 was already initialized earlier
<urbino>
array2 = Array
<urbino>
then
<yorickpeterse>
Asher: ugh
<Phrogz>
urbino: No no no
<urbino>
the block I posted
<Phrogz>
array2 = [] If you do array2 = Array then array2 is the class Array
<Phrogz>
(Or perhaps you meant array2 = Array.new
<urbino>
Ahh.
<Spooner>
And in your pasted example, < is not at all the same as <<
<Asher>
urbino - also, have you looked at Array#flatten
<wmoxam>
...
<urbino>
I want to un-nest one level at a time not flatten
<Asher>
what does un-nest mean to you
WillMarshall has joined #ruby-lang
havenn has joined #ruby-lang
<yorickpeterse>
Blegh, tempted to just redefine all shell related methods in Ruby
<Asher>
yorickpeterse - what's the context you need/want to do this?
<urbino>
iteratate over elem[0] and elem[1]
<urbino>
each elem has more in them but I do not want to flatten it yet
<urbino>
more arrays in them
<Asher>
so flatten to depth of 1
<urbino>
array.flatten(1) ?
<Asher>
ya
<Asher>
or flatten!
<urbino>
Hmm
<Asher>
if you want to modify the array instead of create a copy
<yorickpeterse>
Asher: I'm running a demo of a CMS which takes user input and sanitizes it. Technically this means Ruby code can't be executed in any way. However, I want to be 110% sure that people can't do things like `rm -rf * # herp derp`.
<yorickpeterse>
Or using FileUtils for that matter
<yorickpeterse>
$SAFE would be suitable if it wouldn't kill the entire app
<Phrogz>
Asher: not "to a depth of 1", but "by a depth of 1"
tekin has joined #ruby-lang
<Asher>
phrogz - sure but you understood what i meant
gsav has joined #ruby-lang
<Phrogz>
Yes, but urbino seems to understand so little, I thought it best to be clear in front of him/her :)
<shevy>
hehe
<shevy>
urbino will master ruby in less than 4 weeks
<shevy>
yorickpeterse you can check the input via a method you can control?
<shevy>
I mean before the ``
<shevy>
cant believe master matz would not have thought about this!
<yorickpeterse>
That's already done sort of. The method checks for certain template tags (which would allow Ruby code) and escapes them
<yorickpeterse>
Like I said, I just want to be 110% sure it's not possible in this case :)
<yorickpeterse>
Playing around with $SAFE now and it seems my app actually works with it, I thought it would break it
<postmodern>
yorickpeterse, use Shellwords.shellescape
<postmodern>
yorickpeterse, or your evaling it?!
<yorickpeterse>
No
<shevy>
hmm
<yorickpeterse>
Basically what the method does is 1. escaping template tags 2. optionally cleaning HTML using Loofah
<shevy>
_why used to have this sandbox, which then led to the creation of BasicObject
<postmodern>
yorickpeterse, you could spawn a new Thread and set $SAFE to 4
<yorickpeterse>
So for example, if somebody inserts "#{herp derp}" that will result in "\#\{herp derp\}" which isn't evaluated by the template engine
<Asher>
it would be neat to have a history page about the various developments that have happened to ruby
<urbino>
Shevy: I hope so. Ruby has been nagging at me for a while, but I program in python so there was never a better then good reason to switch
benanne has joined #ruby-lang
<urbino>
Phrogz: I am a dude, don't know what to say except thanks for your help, and it is somewhat funny being a complete noob
<yorickpeterse>
Hm, $SAFE = 3 seems to be the way to go
havenn has joined #ruby-lang
<yorickpeterse>
Thanks for the suggestions/help :)
RomyRomy has joined #ruby-lang
<urbino>
I thought I would have gotten flamed once or twice already : )
<yorickpeterse>
People only flame when it involves Rails
<yorickpeterse>
or Coffeescript
burns180 has joined #ruby-lang
<Phrogz>
urbino: We're all complete noobs in the things we haven't learned yet. It happened to us all, and is ongoing. (I had to pay someone $50 to get ImageMagick working again on my linux box because I'm such a noob at managing packages and cleaning up my own shit.)
<shevy>
yeah urbino I can understand that
<shevy>
ruby and python seem to overlap in their respective niche more than other languages
<shevy>
with perl it is easier - you can switch to a new language :D
<Asher>
Phrogz - admittedly, ImageMagick is one of the biggest messes around
<urbino>
With the success of the higher level languages, I worry no one will be competent enough to maintain the legacy opensource stuff in c/c++
WillMarshall has joined #ruby-lang
jenrzzz has joined #ruby-lang
<yorickpeterse>
Aw fuck, $SAFE is file specific
<drbrain>
yorickpeterse: no it's not
<heftig>
urbino: no, compilers aren't yet good enough
<drbrain>
it's thread-specific though
<yorickpeterse>
drbrain: hold on, let me crack open some code
<yorickpeterse>
Either that means I'm an idiot and don't understand $SAFE or its file specific :)
<matti>
drbrain: Hi ;]
<rue>
It'd be so useless if it was…
<drbrain>
hi matti
<urbino>
heftig: Yes, but the virtual machines are taking over, LLVM and JVM and making room for coffeescript and ruby-cuda
<heftig>
urbino: they still don't produce code that's good enough to replace C at a low level
leonL has joined #ruby-lang
<drbrain>
yorickpeterse: looking at safe.c, and printing the threads, the safe level should be the same across the require
<heftig>
also, there's a world of difference between LLVM and JVM
<drbrain>
but… obviously not
<yorickpeterse>
Perhaps a bug?
mytrile has joined #ruby-lang
srbartlett has joined #ruby-lang
<yorickpeterse>
Onwards my Chrome, to the Ruby bugtracker we go!
<rue>
Could it be because the require *is* an unsecure operation?
<rue>
Er, insecure
<urbino>
heftig: Different directions in goals?
<yorickpeterse>
Wouldn't it throw an exception in that case?
<rue>
That's my point
<rue>
Seems a little iffy to roll it back because of that, though
<rue>
With no warning
Boohbah has joined #ruby-lang
<drbrain>
yorickpeterse: perhaps
<heftig>
urbino: yes. the jvm is high-level, pretty much compile-once run-anywhere, has its own code loader, ABI, memory model, is object-oriented, stack-based
lightcap has joined #ruby-lang
<rue>
Am I entirely fabricating a recollection that the rule is to load everything first, and only then change the safe level?
<yorickpeterse>
That's what I'm doing in that example
<yorickpeterse>
err wait
<rue>
No, not exactly
<yorickpeterse>
hmm
<yorickpeterse>
hold on, let me test this with the particular app
rdeshpande has joined #ruby-lang
<yorickpeterse>
Nope, doesn't make a difference
<heftig>
urbino: LLVM is pretty much just used as part of a compiler (JIT or AOT). it's a register-based vm that abstracts the architecture, so you can do architecture-agnostic transformations on it
<shevy>
does anyone know offhand whether it is possible to use different colours with awesome_print?
<shevy>
for the keys of a hash specifically... right now it conflicts with my terminal colours :(
<drbrain>
so you can bump safe in your file, but it won't blow up other code until you actually use it (not while building it
achiu has joined #ruby-lang
<Asher>
anyone know how to create a DOCTYPE tag in nokogiri for HTML 5?
<Asher>
ie <!DOCTYPE html>
<yorickpeterse>
drbrain:hmmm
<urbino>
Heftig: so java not being focused on abstracting the registers on the underlying system is why java/jvm has not taken over as the language for cell processors and gpus?
<yorickpeterse>
Ah well, I'll just have to trust my tag escaper
<heftig>
you don't do object-oriented programming on GPUs
<yorickpeterse>
drbrain: The problem is that it's escaped way before being executed and I have no control over the latter
H2H has joined #ruby-lang
<drbrain>
yorickpeterse: ah :/
lightcap has joined #ruby-lang
<drbrain>
heftig: are there any OO processors at the instruction level?
RomyRomy_ has joined #ruby-lang
<Asher>
drbrain - hum that seems to create <DOCTYPE></DOCTYPE>
<drbrain>
Asher: dang
<Asher>
is there a way to make it not have a closing tag?
<heftig>
drbrain: don't know of any
chimkan has joined #ruby-lang
<drbrain>
Asher: also, it should be <!DOCTYPE>
<Asher>
right
<Asher>
and have html, i believe
<urbino>
RIght, JVM was built to not crash the underlying system, manage memory, and provide better OO support. LVM is built to abstract underlying architechter and make it available for compilers in a language agnostic way.
<Asher>
the problem is that it makes me create the DTD with the same #new as Nokogiri::XML::Node, which takes 2 args - the name and a document
<Asher>
so i have the name as either DOCTYPE or !DOCTYPE, both of which create a pair
<Asher>
not sure what else to try
<Asher>
and telling the document to render to html creates an HTML 4.01 DTD
woollyams has joined #ruby-lang
Heimidal has joined #ruby-lang
dreinull- has joined #ruby-lang
RomyRomy_ has joined #ruby-lang
<Asher>
what an asshole comment: def initialize name, document ; # ... Ya. This is empty on purpose. ; end
<yorickpeterse>
lol
retro-in-better- has joined #ruby-lang
<yorickpeterse>
So before I "casually" dump a Reddit link in here, what's the policy of this channel about self promotion?
<Asher>
it would have been so easy to write # defined in parallel C source file
<Asher>
i'd say self promotion is encouraged so long as it doesn't suck
<yorickpeterse>
Hopefully that raises some awareness amongst Rubyists, Reddit usually works quite well for it
lightcap has joined #ruby-lang
RomyRomy has joined #ruby-lang
RomyRomy_ has joined #ruby-lang
<shevy>
I am so slow
<shevy>
on my todo list is to write something larger with sinatra
<andkerosine>
Define "larger".
<shevy>
hmm
workmad3 has joined #ruby-lang
<shevy>
something that is non-trivial to do in good ancient ruby-cgi for instance
burns180 has joined #ruby-lang
<shevy>
I dunno... something that displays data from some yaml files and has fancy buttons and thingies to re-arrange the page... and store the position of rearranged boxes and stuff
<andkerosine>
Ooh, that's fancy.
<urbino>
How do I get just the values from a Hash?
<zenspider>
yay! lots of cleanup on sexp_processor, ruby2ruby, and ParseTree!
<andkerosine>
Question: Why would allowing block methods with parameters be bad?
<andkerosine>
%w[foo bar baz].map { |e| e[2] }
<andkerosine>
%w[foo bar baz].map(&:[2])
<andkerosine>
Trite example, but the gist is there.
<andkerosine>
I saw that somebody monkey-patched it together, although I can't remember where, but I recall both he and ruby-lang saying it's frowned upon, and I can't quite grasp why.
t has joined #ruby-lang
Sailias has joined #ruby-lang
<workmad3>
andkerosine: are you wondering why monkey-patching is bad in general, or why adding the ability to respond directly to :[2] is bad, or something else?
<andkerosine>
The latter.
<andkerosine>
We can pass methods as symbols to Enumerable methods, which is awesome, but why only parameter-less ones?
<Phrogz>
andkerosine: The proc returned by Symbol#to_proc can already receive multiple parameters from the block:
<Phrogz>
So you're not so much asking about the proc receiving parameters, but rather you want to create a curried lambda based on parameters you pass in.
<Phrogz>
You could make your own Symbol#curried_proc method, but it wouldn't get to use the & syntax.
<andkerosine>
New terms.
<Phrogz>
You'd have to do .map(:[].curried_proc(2))
<andkerosine>
Mm-hmm.
<andkerosine>
I'll have to look for where I saw it.
<Phrogz>
I suppose you could override Symbol#to_proc with your own version that looked for () or [] and pulled the value out from the string.
<workmad3>
andkerosine: I can guess how to monkey-patch that support on... you'd monkey-patch a method-missing on to Array that matches against a regex like: /\[[\d]+\]/
<Phrogz>
And then eval'd it in the binding of the caller, so that bar=42; ... &:foo(bar) would work. Oof.
Swimming_Bird has joined #ruby-lang
<Phrogz>
Er, &:"foo(bar)" rather. Uglier and uglier.
<andkerosine>
Mm-hmm.
<andkerosine>
It's certainly not a pretty way to go about it, I just thought it was nice syntactic sugar.