ChanServ changed the topic of #ruby-lang to: Ruby 1.9.3-p125: http://ruby-lang.org | Paste >3 lines of text on http://pastie.org or use a gist
Sambalero has quit [Remote host closed the connection]
<andrewvos> rue: It does.
blazes816 has joined #ruby-lang
krohrbaugh has joined #ruby-lang
wyhaines has joined #ruby-lang
mupilot has quit [Ping timeout: 245 seconds]
__butch__ has quit [Remote host closed the connection]
chimkan_ has quit [Quit: chimkan_]
__butch__ has joined #ruby-lang
atmosx has left #ruby-lang ["WeeChat 0.4.0-dev"]
__butch__ has quit [Remote host closed the connection]
enebo has quit [Quit: enebo]
__butch__ has joined #ruby-lang
robbyoconnor has joined #ruby-lang
robbyoconnor has quit [Ping timeout: 256 seconds]
mjio has joined #ruby-lang
tenderlove has quit [Remote host closed the connection]
Kuukunen has quit [Ping timeout: 255 seconds]
Kuukunen has joined #ruby-lang
anjen has quit [Quit: anjen]
tenderlove has joined #ruby-lang
krohrbaugh has quit [Quit: Leaving.]
tenderlove has quit [Remote host closed the connection]
tenderlo_ has joined #ruby-lang
Averna has joined #ruby-lang
cldwalker_ has quit [Remote host closed the connection]
jmeeuwen has quit [Quit: Disconnecting from stoned server.]
ryanf_ has joined #ruby-lang
davidbalber|away is now known as davidbalbert
wycats_ has quit [Remote host closed the connection]
cldwalker_ has joined #ruby-lang
jmeeuwen has joined #ruby-lang
wycats_ has joined #ruby-lang
ryanf has quit [Ping timeout: 260 seconds]
<zenspider> rawr
enebo has joined #ruby-lang
<zenspider> rawr. committed 37916 adding StringScanner#charpos. pls beat up.
znz_v0 has quit [Quit: kill -QUIT $$]
flori has joined #ruby-lang
thone_ has joined #ruby-lang
znz_v has joined #ruby-lang
enebo has quit [Client Quit]
Mon_Ouie has quit [Ping timeout: 260 seconds]
seanstickle has joined #ruby-lang
<rue> Sounds like a Greek localization patch?
thone has quit [Ping timeout: 250 seconds]
shike has joined #ruby-lang
seanstickle has quit [Client Quit]
x0F has joined #ruby-lang
spuk has joined #ruby-lang
<rking> ggreer: I can't figure out what's up with Ack 2.0
<rking> The niceness of "It's just a single perl script" is gone. They've changed up the way the file filtering works.
<ggreer> I haven't tried ack 2.0
<rking> I think ag has a real chance to move in. It did for me at least.
<rking> I wonder if it's hard to make ag work in Ack.vim
<ggreer> I just assumed ack 2.0 would suffer from second system syndrome
<rking> In what ways, specifically?
<rking> Actually, I'm not sure if it is that.
<rking> It's reduced in some ways.
<ggreer> it'd be overdesigned. too many features interacting in too many ways
<ggreer> ah
<rking> But I think C is the right tool for this job.
<ggreer> yeah. process startup time is faster than perl
<ggreer> and C is easier to optimize, since you can get at the low-level implementation details
<rking> ggreer: Is the --type thing an intentional feature-removal or is it a TODO?
<rking> I actually never really used it in ack, using recursive globs for similar tasks
<ggreer> I never used --type, so I never wrote it
<ggreer> underneath, --type mostly looks at file extensions. I think there are some one-off bits of code in ack for special things like makefiles and rakefiles
mpan has joined #ruby-lang
gregmoreno has quit [Ping timeout: 256 seconds]
postmodern has joined #ruby-lang
krohrbaugh has joined #ruby-lang
__butch__ has quit [Quit: Leaving.]
<zenspider> vlad 2.3.1 released
havenn has quit [Read error: Connection reset by peer]
havenn has joined #ruby-lang
mjio has quit []
seanstickle has joined #ruby-lang
<zenspider> headius: oi
sabfer has joined #ruby-lang
<drbrain> what do you think of this change to rubygems:
<drbrain> `gem search` defaults to remote, and anchors on the first character (like `gem list` today)
<drbrain> `gem list` defaults to local (like today)
<drbrain> I like it
<drbrain> does anybody use `gem search`?
<zenspider> works for me
<zenspider> yeah. one japanese core guy
mistym has joined #ruby-lang
mistym has quit [Changing host]
<zenspider> search through the tix
mistym has joined #ruby-lang
<zenspider> he uses it all the time
<drbrain> yeah, and he wants it to be remote like this :)
<zenspider> done
<drbrain> … naruse
<zenspider> right
davidbalbert is now known as davidbalber|away
<zenspider> headius: https://github.com/seattlerb/minitest/issues/191 eyeballs pls
jds_ has joined #ruby-lang
havenn has quit [Read error: Connection reset by peer]
havenn has joined #ruby-lang
havenn has quit [Remote host closed the connection]
sush24_ has joined #ruby-lang
jds has quit [Ping timeout: 248 seconds]
mrsolo has quit [Quit: Leaving]
<headius> zenspider: looking
<zenspider> thanks
<zenspider> I suspect it will also be the case on rubinius
<zenspider> transparent message sends
mpan has quit [Ping timeout: 248 seconds]
<zenspider> tho... I'd guess taht mocha and others have the same problem... no?
wyhaines has quit [Remote host closed the connection]
<headius> I'll have to look at how you're mocking
CoverSlide is now known as CoverSlide|Away
<headius> hmm
<zenspider> isn't there a fairly standard C pretty printer / reformatter ?
<zenspider> I don't want to ungolf by hand
<headius> zenspider: do you have any more information than is in the bug, like what we might be doing differently?
<zenspider> indent... right.
gregmoreno has joined #ruby-lang
sabfer has quit [Quit: sabfer]
<headius> the error message is very strange
<zenspider> headius: no. I'm only guessing that internally you're doing a call to == or something and my stupid proxy is recording it as if it were a user level msgsend
<headius> ahhh
seanstickle has quit [Quit: seanstickle]
seanstickle has joined #ruby-lang
sabfer has joined #ruby-lang
<zenspider> hah. and worse.. it seems to be generated from mock.rb itself? haha
sush24_ has quit [Quit: This computer has gone to sleep]
<headius> reproduced here, anyway
<zenspider> kk
<zenspider> is this a bug in my code being too deep or what?
BigO has joined #ruby-lang
<headius> hmm
<headius> this error comes directly from the mock's method_missing eh?
<zenspider> BUGS: indent has even more switches than ls(1).
<zenspider> hahaha
<zenspider> headius: I believe so
<headius> hmm
<headius> triggered from the include? call in verify
havenn has joined #ruby-lang
<headius> that's strange
sabfer has quit [Quit: sabfer]
tridge_ has quit [Remote host closed the connection]
BigO has quit [Remote host closed the connection]
<zenspider> line 134 of mock.rb pushes on a hash w/ the retval as a value
<zenspider> I don't see how/why that's getting hit via @actual_calls[name].include?
<zenspider> unless I'm forgetting a step
<headius> [{:retval=>#<MiniTest::Mock:0x40573eeb @actual_calls={:foo=>[...]}, @expected_calls={:foo=>[{:retval=>#<MiniTest::Mock:0x40573eeb ...>, :args=>[]}]}>, :args=>[]}]
<headius> that's what I'm seeing for @actual_calls[name] right before it fails
thatdutchguy has quit [Remote host closed the connection]
<headius> I think you're right about us calling == somewhere, but for us to call it on the mock it would have to be in the array we're calling include? against
<headius> something like that
<headius> so yeah, the returning the mock seems to be the key
<headius> the mock is returned from foo, which leads to it being stored as retval in that hash, which leads to us eventually calling methods against it to do include?
<headius> that is probably an impl difference in our include? somewhere
<headius> theory sounding good so far?
<zenspider> yeah
<zenspider> maybe MRI does extra checks before trying msgsend ==
<zenspider> *shrug*
<headius> yeah I'm trying that
<headius> passes
Guest65901 has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<headius> I just added an == check in Hash comparison before the == send to the values
<zenspider> heh. kk. thanks.
bryanl has quit [Read error: Operation timed out]
devn has quit [Ping timeout: 252 seconds]
Aiur has quit [Quit: Computer has gone to sleep.]
mephux has quit [Ping timeout: 240 seconds]
bryanl has joined #ruby-lang
canton7 has quit [Ping timeout: 246 seconds]
devn has joined #ruby-lang
mephux has joined #ruby-lang
faustman has quit [Ping timeout: 255 seconds]
sepp2k1 has quit [Remote host closed the connection]
tenderlo_ has quit [Remote host closed the connection]
alvaro_o has quit [Quit: Ex-Chat]
afgeneralist has joined #ruby-lang
tridge has joined #ruby-lang
achiu has quit [Quit: WeeChat 0.3.9.1]
<headius> zenspider: I have a good fix; we were going straight to == send rather than calling the equivalent of rb_equal (or rb_eql)
<headius> modified to do that instead
<headius> that's what MRI does
towski has quit [Remote host closed the connection]
mjio has joined #ruby-lang
achiu has joined #ruby-lang
* zzak phew
Dan- has quit [Quit: Leaving...]
datanoise has joined #ruby-lang
shike has quit [Remote host closed the connection]
madish has quit [Quit: ChatZilla 0.9.89 [Firefox 16.0.1/20121026125834]]
krohrbaugh has quit [Quit: Leaving.]
kain has quit [Read error: Connection reset by peer]
kain has joined #ruby-lang
sush24_ has joined #ruby-lang
sush24_ has quit [Client Quit]
yellow5 has quit [Ping timeout: 252 seconds]
datanoise has quit [Ping timeout: 245 seconds]
afgeneralist has quit [Ping timeout: 260 seconds]
matti has quit [Ping timeout: 252 seconds]
yellow5 has joined #ruby-lang
matti has joined #ruby-lang
matti has quit [Changing host]
matti has joined #ruby-lang
ryanlecompte has quit [Remote host closed the connection]
aetcore has joined #ruby-lang
<zzak> fiddle is awesome
jnoon has quit []
rekky has joined #ruby-lang
jnoon has joined #ruby-lang
lcdhoffman has joined #ruby-lang
rekky has quit [Client Quit]
rekky has joined #ruby-lang
rekky has quit [Client Quit]
dankest has joined #ruby-lang
ddd has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
ryanlecompte has joined #ruby-lang
aetcore has quit [Remote host closed the connection]
ryanlecompte has quit [Read error: Connection reset by peer]
aetcore has joined #ruby-lang
ryanlecompte has joined #ruby-lang
afgeneralist has joined #ruby-lang
mupilot has joined #ruby-lang
mpan has joined #ruby-lang
ddd has quit [Quit: Leaving.]
krohrbaugh has joined #ruby-lang
jxie has quit [Read error: Connection reset by peer]
jxie has joined #ruby-lang
jxie has quit [Read error: Connection reset by peer]
jxie has joined #ruby-lang
brunocoelho has joined #ruby-lang
tenderlove has joined #ruby-lang
ryanf_ has quit [Ping timeout: 240 seconds]
havenn has quit [Remote host closed the connection]
havenn has joined #ruby-lang
havenn has quit [Ping timeout: 246 seconds]
xyzodiac has quit [Quit: Computer has gone to sleep.]
seanstickle has quit [Quit: seanstickle]
Aiur has joined #ruby-lang
thatdutchguy has joined #ruby-lang
<headius> zenspider: fixed, and I referenced your issue
xyzodiac has joined #ruby-lang
xyzodiac has quit [Client Quit]
charliesome has joined #ruby-lang
areil has joined #ruby-lang
xyzodiac has joined #ruby-lang
afgeneralist has quit [Ping timeout: 260 seconds]
mjio has quit []
Guest59321 has joined #ruby-lang
B|aster has quit []
krz has joined #ruby-lang
havenn has joined #ruby-lang
headius has quit [Quit: headius]
thatdutchguy has quit [Remote host closed the connection]
aetcore has quit [Remote host closed the connection]
havenn has quit [Remote host closed the connection]
havenn has joined #ruby-lang
datanoise has joined #ruby-lang
mjio has joined #ruby-lang
brunocoelho has quit [Remote host closed the connection]
havenn has quit [Ping timeout: 245 seconds]
datanoise has quit [Ping timeout: 252 seconds]
<zenspider> minitest 4.3.2 released
datanoise has joined #ruby-lang
blowmage` has left #ruby-lang [#ruby-lang]
blowmage has joined #ruby-lang
postmodern has quit [Quit: Leaving]
stefff has quit [Ping timeout: 264 seconds]
<whitequark> for extra horror, read the comments
stefff has joined #ruby-lang
<drbrain> whitequark: yo dawg…
s0ber_ has joined #ruby-lang
nvoyager has joined #ruby-lang
jMCg_ has joined #ruby-lang
s0ber has quit [Remote host closed the connection]
jMCg has quit [Ping timeout: 244 seconds]
s0ber_ is now known as s0ber
ryanf has joined #ruby-lang
Guest59321 has left #ruby-lang [#ruby-lang]
Guest59321 has joined #ruby-lang
<whitequark> drbrain: the thing that strikes me most is that you can write ${date("M")}
tridge has quit [Remote host closed the connection]
<whitequark> that is just... so... evil...
<heftig> whitequark: what's evil?
<whitequark> heftig: see the PHP link above
<heftig> i don't get why that is evil
retro|cz has joined #ruby-lang
<whitequark> heftig: because of the potential for abuse?
<whitequark> it's basically eval which doesn't look like eval and doesn't have any of the valid uses eval has
<erikh> what's funny is that perl, which php was originally written in, has had soft references since the dawn of time
xyzodiac has quit [Quit: Computer has gone to sleep.]
<erikh> not sure why they needed to rename them to "variable variables"
hahuang65 has joined #ruby-lang
<whitequark> oh. i thought it was C.
<whitequark> that explains a lot.
<erikh> it is C nowadays
<erikh> early php was perl though
Guest59321 has quit [Remote host closed the connection]
<erikh> and perl just takes the idea from bourne shell, where it is still used liberally.
<erikh> best perl practice is to 'use strict', which turns them off by default.
james has joined #ruby-lang
james is now known as Guest51695
* whitequark has started programming in C++ Builder, and then continued along to PHP
ryanf has quit [Ping timeout: 246 seconds]
<whitequark> then rails, and it was the best career decision in my life
headius has joined #ruby-lang
<whitequark> erikh: somehow that feature isn't abused in bourne shells
<whitequark> not sure about perl through
tenderlove has quit [Remote host closed the connection]
r0bglees0n has quit [Ping timeout: 264 seconds]
<erikh> eh?
ryanf has joined #ruby-lang
<erikh> your OS likely uses it all over the place. it's how you meta-program in shell.
nvoyager has quit [Quit: nvoyager]
<erikh> init scripts, packaging systems pretty much bank on shit like that.
<whitequark> erikh: I said "abused", not "used"
Aiur has quit [Quit: Computer has gone to sleep.]
<whitequark> I know when it's used in shell.
<erikh> perhaps you should define abused
<whitequark> "considered a bad practice"?
* whitequark checks the IRC log
<whitequark> ✓ hours wasted discussing synchronous I/O
<whitequark> I'm not doing that again.
headius has quit [Client Quit]
spuk has quit [Quit: Human beings were created by water to transport it uphill.]
WillMarshall has joined #ruby-lang
WillMarshall has quit [Client Quit]
WillMarshall has joined #ruby-lang
WillMarshall has quit [Client Quit]
<erikh> stop expressing your opinions as gospel and it probably wouldn't be an issue
ryanf has quit [Ping timeout: 264 seconds]
Guest51695 has left #ruby-lang [#ruby-lang]
datanoise has quit [Ping timeout: 256 seconds]
<whitequark> erikh: everything expressed is an opinion, by definition
<erikh> I'm not stepping into this metaphysical pile of horseshit. You can phrase things like "I don't like that" or "that's a stupid, useless idea". one of them actually has merit, the other is bullshit that can be argued out of existence.
<whitequark> they're equivalent, and unless you can justify the point, both useless
<charliesome> variable variables are mostly a stupid useless idea
<charliesome> i'd like to see a valid use for them in php
ryanf has joined #ruby-lang
<erikh> whitequark: because you're frequently wrong, and almost always say the latter.
r0bglees0n has joined #ruby-lang
<whitequark> erikh: it's not like I would agree with you easier if I phrase it as the former.
<erikh> if you phrased it as the former it's actually your opinion, and doesn't attack the need for such a thing.
<erikh> for what it's worth, perl (and probably php, but I don't know) do things with soft references that you'd use ruby's #send or #instance_variable_get for
gnufied has joined #ruby-lang
<whitequark> "attack the need"? like the ramblings of a random guy on irc would actually affect something
<erikh> right, like taking stock in a 20 year old kid who thinks he knows everything
gregmoreno has quit [Remote host closed the connection]
rekky has joined #ruby-lang
<whitequark> I don't quite understand what do you mean by "taking stock" here
jxie has quit [Ping timeout: 246 seconds]
<erikh> oh, nevermind. we can have this conversation when you grow up.
jxie has joined #ruby-lang
tenderlove has joined #ruby-lang
<whitequark> (#send in php) yeah, I recall seeing that construct used for programmatically specifying the name of method being called. it's funny how almost none of the comments below list that feature.
wmoxam_ is now known as wmoxam
blazes816 has quit [Quit: blazes816]
<whitequark> erikh: I wonder where you've learned my age. as in, I know it's somewhere on the internet, but I wonder where is it in particular.
<erikh> you said it in here once
<erikh> I have a knack for remembering details.
wmoxam has quit [Changing host]
wmoxam has joined #ruby-lang
<erikh> besides, it's not exactly hard to figure out.
<whitequark> ha. nice memory.
wyhaines has joined #ruby-lang
<erikh> extreme devotion to a one true programming style, emphasizing cultural programming fads over solving the problem, inability to empathize with others that work differently
brianpWins has joined #ruby-lang
<erikh> early 20's, probably fresh out of college. I'd put a month's salary on that prediction any day of the week.
JohnBat26 has joined #ruby-lang
<whitequark> erikh: you're mostly correct, through the way I actually work somewhat differs from the way I discuss things on IRC when I'm bored.
<whitequark> and a college dropout, but that doesn't matter much.
<zenspider> gah
datanoise has joined #ruby-lang
<zenspider> man... I need an on demand sysadmin... I hate this shit. it should just work
<zenspider> and stay up
<zenspider> and heal itself
<zenspider> and and and... pony
<erikh> did you see that minitest project thingy I messaged you?
<erikh> I applied minitest to integration testing entire networks of machines
<erikh> working pretty well. the code is still pretty much ass but it does work.
<zenspider> skimmed it
<erikh> we already have a few tests; I can already verify that many scenarios where chef might break some machine interop (zone transfers, syslog, redis replication for example) will be determined long before they even make it into git, much less our systems
<erikh> anyhow, if it isn't obvious I'm really excited about it and where it's going
<zenspider> heh
<erikh> largely because it's working and I started on the idea at seattle.rb
<zenspider> yeah... it is a bit obvious :P
<erikh> so it's a long time coming
<erikh> heheh
<zenspider> nice
<zenspider> ok. I'm out.
<erikh> later.
datanoise has quit [Ping timeout: 255 seconds]
mistym has quit [Remote host closed the connection]
tridge has joined #ruby-lang
burgestrand has quit [Quit: Leaving.]
thinkdevcode has quit [Remote host closed the connection]
burgestrand has joined #ruby-lang
towski has joined #ruby-lang
burgestrand has quit [Ping timeout: 245 seconds]
gregmoreno has joined #ruby-lang
tenderlove has quit [Remote host closed the connection]
rekky has quit [Quit: rekky]
rekky has joined #ruby-lang
replore has joined #ruby-lang
towski has quit [Remote host closed the connection]
replore has quit [Remote host closed the connection]
ryanf has quit [Ping timeout: 245 seconds]
gregmoreno has quit [Ping timeout: 264 seconds]
bluepojo has quit [Quit: Leaving.]
mupilot has quit [Quit: mupilot]
datanoise has joined #ruby-lang
mpan has quit [Ping timeout: 248 seconds]
RickHull has left #ruby-lang [#ruby-lang]
mrsolo has joined #ruby-lang
Nisstyre has quit [Quit: Leaving]
burgestrand has joined #ruby-lang
rippa has joined #ruby-lang
mjio has quit []
datanoise has quit [Ping timeout: 252 seconds]
robbyoconnor has joined #ruby-lang
havenn has joined #ruby-lang
havenn has quit [Remote host closed the connection]
<epitron> hmmm... this seems like an odd question, and it's a weird scenario because i want to keep all my code in one file *and* be performant...
<epitron> but, does anyone know of a good way of defining a class from within a method?
<epitron> (i'm defining a class in a method because i want to lazy load a gem only if it's needed)
<drbrain> Class.new
<epitron> lemme see
<drbrain> epitron: you'll need const_set to give it a name
<drbrain> ruby -e 'loop do Class.new end' # all the classes
<epitron> hahah
<epitron> i just realized it would be way easier if i wrapped my code in a string, and evaled it
<epitron> but i've got interpolation in there... and heredoc is eagerly evaluating that
<epitron> is there a way to make a heredoc-like thing that's not interpolated?
<epitron> (this is disgustinly hacky, i know)
<epitron> oh
<drbrain> <<'NOT_INTERPOLATED'
<epitron> I could use __END__
<drbrain> ?
<epitron> that's still doing it
<drbrain> not for me
<epitron> yay, DATA.read works
<epitron> hmm
<epitron> weird
ryanf has joined #ruby-lang
<drbrain> unless you mean something different and I'm not understanding
<drbrain> that's very plausible
<epitron> ohhhh
<epitron> sorry, i didn't notice the single quotes
<drbrain> they're hiding all up in those capital letters
<epitron> i find __END__ somewhat more paletteable for some reason though
<epitron> but that's really good to know :)
mwjcomputing has joined #ruby-lang
<epitron> lovely.. my cat script now prints out markdown rendered as ansi \o/
<epitron> c <anyfile> => renders using coderay or redcarpet, and pipes it to less :D
<epitron> i suppsoe you guys call that vim ;)
Brainix has quit [Quit: Brainix]
mwjcomputing has quit [Ping timeout: 260 seconds]
Nisstyre has joined #ruby-lang
<Spaceghostc2c> epitron: Show!
<epitron> sec
rippa has quit [Ping timeout: 245 seconds]
<epitron> requires coderay, redcarpet, and epitools
mrsolo has quit [Quit: Leaving]
Glass_saga has quit [Remote host closed the connection]
Glass_saga has joined #ruby-lang
apeiros_ has quit [Ping timeout: 245 seconds]
Glass_saga has quit [Remote host closed the connection]
Glass_saga has joined #ruby-lang
r0bglees0n has quit [Ping timeout: 250 seconds]
dc5ala has joined #ruby-lang
<ryanf> haha
<ryanf> oops, wrong window :(
r0bglees0n has joined #ruby-lang
mpan has joined #ruby-lang
tridge has quit [Remote host closed the connection]
Nisstyre has quit [Ping timeout: 252 seconds]
zmack has joined #ruby-lang
shtirlic_ has joined #ruby-lang
crudson has left #ruby-lang [#ruby-lang]
<charliesome> solved my encoding problems by using Marshal instead of JSON
<charliesome> feels good
r0bglees0n has quit [Ping timeout: 248 seconds]
dr_bob has joined #ruby-lang
mytrile has joined #ruby-lang
workmad3 has joined #ruby-lang
Nisstyre has joined #ruby-lang
ryanlecompte has quit [Remote host closed the connection]
tridge has joined #ruby-lang
tridge has quit [Remote host closed the connection]
|Vargas| has joined #ruby-lang
|Vargas| has quit [Changing host]
|Vargas| has joined #ruby-lang
rolfb has joined #ruby-lang
riteshno has joined #ruby-lang
<rue> Terrible
postmodern has joined #ruby-lang
towski has joined #ruby-lang
workmad3 has quit [Ping timeout: 240 seconds]
rolfb has quit [Quit: Leaving...]
solars has joined #ruby-lang
riteshno has quit [Remote host closed the connection]
riteshno has joined #ruby-lang
jMCg_ is now known as jMCg
apeiros_ has joined #ruby-lang
datanoise has joined #ruby-lang
riteshno has left #ruby-lang [#ruby-lang]
riteshno has joined #ruby-lang
towski has quit [Remote host closed the connection]
datanoise has quit [Ping timeout: 264 seconds]
towski has joined #ruby-lang
towski has quit [Remote host closed the connection]
rekky has quit [Quit: rekky]
solars has quit [Ping timeout: 265 seconds]
mrsolo has joined #ruby-lang
riteshno has quit [Quit: riteshno]
riteshno has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
<yorickpeterse> Morning
mytrile has quit [Remote host closed the connection]
riteshno has left #ruby-lang [#ruby-lang]
riteshno has joined #ruby-lang
judofyr has joined #ruby-lang
BlaXpirit has joined #ruby-lang
Silex has quit [Quit: WeeChat 0.3.8]
rolfb has joined #ruby-lang
Silex has joined #ruby-lang
solars has joined #ruby-lang
<charliesome> yorickpeterse: evening
agarcia has joined #ruby-lang
Paradox has quit [Quit: derpderp]
Paradox has joined #ruby-lang
tjadc has joined #ruby-lang
ryanf has quit [Quit: leaving]
krz has quit [Read error: Connection reset by peer]
krz has joined #ruby-lang
ryanlecompte has joined #ruby-lang
tbuehlmann has joined #ruby-lang
zenspider has quit [Quit: Terminated with extreme prejudice - dircproxy 1.1.0]
ryanlecompte has quit [Ping timeout: 250 seconds]
riteshno has left #ruby-lang [#ruby-lang]
blacktulip has joined #ruby-lang
Paradox has quit [Quit: derpderp]
Paradox has joined #ruby-lang
riteshno has joined #ruby-lang
riteshno has left #ruby-lang [#ruby-lang]
Paradox has quit [Quit: derpderp]
Mon_Ouie has quit [Ping timeout: 245 seconds]
Mon_Ouie has joined #ruby-lang
Paradox has joined #ruby-lang
Paradox has quit [Client Quit]
Paradox has joined #ruby-lang
Weems has quit []
Mon_Ouie has quit [Ping timeout: 245 seconds]
tridge has joined #ruby-lang
mrsolo has quit [Quit: Leaving]
workmad3 has joined #ruby-lang
adambeynon has joined #ruby-lang
<charliesome> lol ruby http://eval.in/3993
<judofyr> nice one
<judofyr> () == nil, right?
<charliesome> yeah
<charliesome> that's where ruby took a bit too much of lisp!
<andrewvos> charliesome: Ergh. What is the value of the first argument in the second call?
<charliesome> andrewvos: nil
<andrewvos> charliesome: Waa?
swav has joined #ruby-lang
<andrewvos> Ohh
<charliesome> andrewvos: () is nil
<andrewvos> I get it
<charliesome> most of ruby's grammar works mostly as you'd expect most of the time
<judofyr> in my little language, you can do: `a = (1, 2, 3); foo.bar a` and it's exactly the same as `foo.bar(1, 2, 3)`
<charliesome> judofyr: like perl?
<judofyr> charliesome: well, not quite. every function just take a single value.
<charliesome> oh
<judofyr> (1, 2, 3) is a one value
<judofyr> (a record)
<charliesome> so if you write
<charliesome> foo.bar(1,2,3), then that passes (1,2,3) as one argument?
<judofyr> yes
<charliesome> interesting
<charliesome> can you write 'foo.bar 1 2' if foo.bar returns another function?
tridge has quit [Remote host closed the connection]
<judofyr> maybe :)
<judofyr> but I have pattern matching for functions to make it easier. e.g: def foo [bar, baz] { … }
<judofyr> [bar, baz] matches a record of size 2
<judofyr> [bar] matches anything else than void or record
<judofyr> [] matches void
<charliesome> smells like haskell and ruby got intimate
vlad_starkov has joined #ruby-lang
<chendo> bow chika wow wow
<charliesome> hi chendo
<chendo> sup
vlad_starkov has quit [Read error: Connection reset by peer]
<judofyr> charliesome: generally, I want `a = …; foo a` to always be equal to `foo …`
<charliesome> judofyr: i feel like copying perl's argument semantics would be a nicer way to achieve that than restricting functions to taking one argument
<judofyr> charliesome: well, it's pretty much the same, no?
<judofyr> all perl functions take a single value (an array that's automatically de-referenced) ?
<judofyr> or, all functions take a list
<judofyr> in my lang, all functions take a record
<charliesome> say you had
<judofyr> the only difference is in the treatment of single values (e.g. there's no such thing as a single-element record)
<charliesome> a = …; foo(1, a, 3)
dankest has quit [Quit: Leaving...]
<charliesome> would that pass (1, …, 3) or (1, (…), 3)
<judofyr> (1, …, 3)
<judofyr> a = (1, 2, 3); would lead to (1, (1, 2, 3), 3)
<charliesome> so records are flattened when put inside other records?
<judofyr> no
<judofyr> records must have parenthesize around them :)
<charliesome> perl would flatten that
<charliesome> http://eval.in/3997
<judofyr> a = 1; would lead to (1, 1, 3)
<judofyr> I know
<chendo> i wouldn't want a language to flatten it if i passed an array in
<chendo> i like it how you make ruby splat the array with *
<judofyr> it works the same way here
<judofyr> (1, *a, 3)
tridge has joined #ruby-lang
<judofyr> records are kinda like arrays, but they're immutable and can have keys
<judofyr> foo(bar: 123)
<judofyr> kinda like PHP arrays
<charliesome> judofyr: that's a nice way to approach keyword arguments too
<charliesome> and your pattern matching handles pulling the values you want out of the argument record?
<judofyr> sure: [foo: bar] = (foo: 123)
rippa has joined #ruby-lang
<judofyr> sets bar to 123
<judofyr> and I'm considering that `[foo:] = (foo: 123)` sets foo to 123
<charliesome> why do you have square brackets on the left hand side?
vlad_starkov has joined #ruby-lang
<judofyr> because it's a pattern
banisterfiend has joined #ruby-lang
<judofyr> I don't want to overload the syntax
<charliesome> i'm not a fan of pattern matching having an explicit syntax
<judofyr> charliesome: lambdas/functions are written as: [foo, bar] { … }
<judofyr> or in short, just { … }
<judofyr> a = { puts "Hello" }
<charliesome> what if you had something like (foo, bar) -> { … }
<judofyr> don't like arrows :)
<charliesome> are there any ambiguities that could arise out of allowing (foo, bar) { … } ?
<judofyr> charliesome: you won't see `[foo:] = …` a lot anyway. patterns are mostly used for function parameters
thisirs has joined #ruby-lang
<judofyr> charliesome: (foo) { … } is ambiguous
<judofyr> or, maybe not
ben___ has joined #ruby-lang
<charliesome> you mentioned earlier that you don't have single element records
<charliesome> if you wanted a unary function, would [a] { … } work?
ben___ has left #ruby-lang [#ruby-lang]
<judofyr> no, because [a] matches anything else than a record and void. there's [*a] that matches anything.
<judofyr> but I'm still not quite sure about that behaviour
<judofyr> because it means that [*a] could lead to a being three different objects/values: record, void or anything else
Averna has quit [Quit: Leaving.]
<judofyr> and that seems like a hassle to work with
<judofyr> so maybe I do need single/zero-element records :/
<judofyr> charliesome: my language is far from done yet. I've only been working on the parser + thinking about semantics :)
<judofyr> charliesome: I'll publish it here when I'm getting somewhere: https://github.com/judofyr/0
vlad_starkov has quit [Read error: Connection reset by peer]
<charliesome> static or dynamic?
<judofyr> dynamic, although I am thinking about have "incidental typing"
<judofyr> and type "checking"
<judofyr> def to_s [Int base] { … }
<judofyr> Int is just a function: Int = [value] { fail unless value.is_a?(Integer) }
<judofyr> so it's really more a pre-condition thing than a type thing
<judofyr> but the goal is that the interpreter/compiler can do these checks on compile-time
seoaqua has joined #ruby-lang
shtirli__ has joined #ruby-lang
shtirlic has quit [Ping timeout: 264 seconds]
Theueip has joined #ruby-lang
banisterfiend has quit [Remote host closed the connection]
tridge has quit [Remote host closed the connection]
Assurbanipal has joined #ruby-lang
seoaqua has quit [Ping timeout: 240 seconds]
mars777 has quit [Quit: mars777]
cultureulterior_ has joined #ruby-lang
AndChat| has quit [Remote host closed the connection]
rippa has quit [Ping timeout: 264 seconds]
fully_baked has joined #ruby-lang
fully_baked has left #ruby-lang [#ruby-lang]
kain has quit [Read error: Connection reset by peer]
wallerdev has quit [Quit: wallerdev]
kain has joined #ruby-lang
GarethAdams has joined #ruby-lang
banisterfiend has joined #ruby-lang
ottbot has quit [Quit: WeeChat 0.3.9.1]
kitallis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<stardiviner> What does the `<<` mean in `class << fido ; end` ?
<andrewvos> rue: Mars?
<rue> Told you
sepp2k has joined #ruby-lang
sush24_ has joined #ruby-lang
<banisterfiend> stardiviner: "open singleton class for fido"
<judofyr> stardiviner: heh, we had the exactly same question/discussion yesterday :D
<stardiviner> banisterfiend: thanks, judofyr really ? I will check out the log
leopard_me has joined #ruby-lang
<stardiviner> but where to see this channel's log ?
<judofyr> stardiviner: short story: methods you define inside a singleton class are available on that object
<stardiviner> I checked the /topic
<andrewvos> banisterfiend: So "class << self" is opening the singleton class for class when it's inside the class level?
<banisterfiend> stardiviner: stackoverflow also has a bunch of answers
<andrewvos> banisterfiend: Is that how it works?
<judofyr> andrewvos: yes
<banisterfiend> andrewvos: Yeah, it opens the singleton class for the object to the right of the >>
<andrewvos> I don't like the "class << whatever" syntax then
<andrewvos> I always look at is as "add self to class"
<judofyr> stardiviner: a = "hello"; class << a; def t; size; end; end; a.t #=> 5
<banisterfiend> right of the <<*
<stardiviner> judofyr: I see
<judofyr> andrewvos: use singleton_class.class_eval then
<judofyr> :)
<andrewvos> judofyr: :)
<banisterfiend> andrewvos: that's a weird-ish mental model ;)
<judofyr> stardiviner: it's most commonly used for class methods: class Foo; class << self; def bar; end; end; end.
<andrewvos> banisterfiend: I've not ever been called normal.
<judofyr> stardiviner: that bar is available as Foo.bar
<banisterfiend> hehe
<banisterfiend> andrewvos: i guess you're trying to give "<<" similar meaning to Array#<< ?
<andrewvos> banisterfiend: Yeah
<banisterfiend> fair enough
<andrewvos> banisterfiend: My point exactly.
<andrewvos> banisterfiend: It should be something like "singleton; def singleton_method; end; end;"
<stardiviner> judofyr: why use that style ? class Foo; class << self; ... Does it has some difference with instance method or class method ?
<judofyr> stardiviner: `def self.bar` is just a short-cut for `class << self; def bar; end; end`
<banisterfiend> andrewvos: yeah the "class << o" syntax is kind of weird
<banisterfiend> i wonder why he selected it
<stardiviner> judofyr: thanks, I see. I think def self.bar is better.
<judofyr> stardiviner: people use `class << self` for mostly two reasons: (1) it's a way to group several class methods without repeating "self."
<judofyr> stardiviner: and (2) you can do stuff like attr_accessor: `class << self; attr_accessor :bar; end`
<judofyr> stardiviner: Foo.bar = 1; p Foo.bar
<stardiviner> banisterfiend: Actually I'm reading an article "Just Enough Ruby", it has add a instance method to an instance with this singleton class style.
<banisterfiend> stardiviner: yu can just do it with: def obj.meth; end
<stardiviner> judofyr: I see. good idea
<banisterfiend> stardiviner: though sadly you see a lot of people doing this instead: class << obj; define_method(:meth) { }; end
<banisterfiend> which is totally unnecessary
<stardiviner> banisterfiend: really , this is a short-cut again ?
<banisterfiend> stardiviner: Yeah
<stardiviner> banisterfiend: cool. I like your style
<banisterfiend> stardiviner: it's not my style, it's ruby's ;)
<stardiviner> banisterfiend: you're right.
<stardiviner> :)
<stardiviner> And one more question, I'm going to confused on those lot of ruby concepts, like upper thing. So, is there a complete tutorial or reference about this ?
<andrewvos> Upper thing?
<stardiviner> And actually I'm going to read book Programming Ruby. Does it will explain this completely ? If yes, I have no other needs
<stardiviner> andrewvos: yes, like that, and something like Kernel is mix in Object etc
carloslopes has joined #ruby-lang
<stardiviner> I hope my first understanding is correct, instead of correct after found what I have in my brain is wrong. So the first reading is important.
<stardiviner> s/correct/correct them/
robotmay has joined #ruby-lang
robotmay has quit [Remote host closed the connection]
robotmay has joined #ruby-lang
<burgestrand> stardiviner: explain upper thing
<stardiviner> burgestrand: upper thing: class << object ; end is a singleton class, the method inside it will be available on that object.
<rue> Correct
<stardiviner> so, Does anybody has good suggestion for my second question ?
<andrewvos> Ruby Koans stardiviner.
carloslopes has quit [Remote host closed the connection]
<judofyr> stardiviner: Run Paint Run Run's book is pretty good: http://ruby.runpaint.org/
carloslopes has joined #ruby-lang
<stardiviner> andrewvos: judofyr thanks very much
dRbiG has quit [Ping timeout: 245 seconds]
<judofyr> maybe a little dense
<stardiviner> judofyr: not at all, I like this style
heftig has quit [Quit: leaving]
dc5ala has quit [Quit: Ex-Chat]
<judofyr> stardiviner: this channel is also a pretty good place to ask for help ;)
<stardiviner> judofyr: Read by self is a good and basic skill for a person who want to be a hacker .... ;) And ask in IRC can not always get in time answer, also sometimes not correct, even the interactive is check and humanable for human.
<judofyr> stardiviner: all true
<stardiviner> ;) back to read book
dRbiG has joined #ruby-lang
<judofyr> stardiviner: this is also a pretty good book: http://shop.oreilly.com/product/9780596516178.do
<judofyr> not free though
<judofyr> but written by matz :)
<stardiviner> judofyr: added
vlad_starkov has joined #ruby-lang
hahuang65 has quit [Quit: Computer has gone to sleep.]
stardiviner has quit [Quit: my website: http://stardiviner.dyndns-blog.com/]
krz has quit [Quit: krz]
Theueip has quit [Quit: Bye!]
mwjcomputing has joined #ruby-lang
mwjcomputing has left #ruby-lang [#ruby-lang]
gaveen has joined #ruby-lang
gaveen has joined #ruby-lang
gaveen has quit [Changing host]
zz_chrismcg is now known as chrismcg
tbuehlmann has quit [Remote host closed the connection]
gaveen has quit [Remote host closed the connection]
Arnvald has joined #ruby-lang
Arnvald has quit [Remote host closed the connection]
Arnvald has joined #ruby-lang
BlaXpirit has quit [Quit: Quit Konversation]
BlaXpirit has joined #ruby-lang
gaveen has joined #ruby-lang
gaveen has quit [Changing host]
gaveen has joined #ruby-lang
heftig has joined #ruby-lang
fully_baked has joined #ruby-lang
fully_baked has left #ruby-lang [#ruby-lang]
rolfb has quit [Quit: Linkinus - http://linkinus.com]
<masterkorp> Hello
x0F has quit [Disconnected by services]
x0F_ has joined #ruby-lang
x0F_ is now known as x0F
mwjcomputing has joined #ruby-lang
mwjcomputing has left #ruby-lang [#ruby-lang]
BlaXpirit has quit [Quit: Quit Konversation]
znake has joined #ruby-lang
kitallis has joined #ruby-lang
<andrewvos> I wish when doing an #each I could have something like last_element?
kitallis has quit [Excess Flood]
kitallis has joined #ruby-lang
jgomez has joined #ruby-lang
<heftig> andrewvos: well, each_with_index or Enumerator#with_index
<andrewvos> heftig: I know :(
sailias has joined #ruby-lang
leopard_me has quit [Quit: Computer has gone to sleep.]
<ddfreyne> andrewvos: something like #each_with_prv?
<ddfreyne> prev rather
kitallis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
postmodern has quit [Quit: Leaving]
<judofyr> andrewvos: I'd prefer #each_with_state where the state object includes e.g. the index, the next object, the prev object, last? and first`
kitallis has joined #ruby-lang
<judofyr> first?*
<andrewvos> judofyr: Yeah
mupilot has joined #ruby-lang
<andrewvos> judofyr: I have a class that can parse either a file or the contents of that file as a String. Is it sane to have a method #parse that takes both, and then tests for file existence at the beginning?
TommyBlue has quit [Quit: Coyote finally caught me]
<andrewvos> def parse(file_or_text)
<judofyr> andrewvos: I prefer def parse_file(file); parse(File.read(file)) end
<andrewvos> judofyr: Wow that is literally my code exactly :/
<andrewvos> Code review: https://gist.github.com/4161339
<andrewvos> If anyone is bored. I am.
sailias has quit [Quit: Leaving.]
<andrewvos> The write_out_all_steps is so ugly with all that string interpolation
masterkorp has left #ruby-lang ["WeeChat 0.3.2"]
banisterfiend has quit [Remote host closed the connection]
xyzodiac has joined #ruby-lang
chrismcg is now known as zz_chrismcg
<andrewvos> Okay, a bit cleaner maybe https://gist.github.com/4161380
<erikh> \t is shorter to write than setting a variable to tab and interpolating it
<erikh> \t\t is also shorter than tab*2
<erikh> :P
<andrewvos> erikh: Hmm, I suppose
<andrewvos> erikh: I'm using spaces though
<andrewvos> erikh: But, yeah
<erikh> also FeatureParser isn't ever used as a state carrying object
<erikh> make it a module and use class methods
<andrewvos> erikh: Agreed.
<erikh> Dir.glob takes its own block, and you use map with puts
<erikh> you don't need map's transforming and glob's block works better than each for this situation
<erikh> are you planning to modularize write_out_all_steps?
<erikh> like, make it callable or something?
<andrewvos> erikh: Well, no
<erikh> then nuke the args and nuke the method definition. YAGNI
<rue> Globble globble
<erikh> it's just more indirection and doesn't really serve a purpose.
chimkan has joined #ruby-lang
stardiviner has joined #ruby-lang
<erikh> in parse, you create a StringIO from the text. In parse_file, you slurp the whole file and hten pass it to parse
<erikh> maybe breaking that out so you can just pass an IO object from two different places would be a better solution
<judofyr> parse(io) and `def parse_text(text); parse(StringIO.new(text)) end` maybe
<judofyr> no
<judofyr> wait
<judofyr> erikh: the StringIO isn't related to the input
nvoyager has joined #ruby-lang
<andrewvos> judofyr: It's just something the the gherkin shit needs
<erikh> oh, wow, yeah
<erikh> I read that wrong. very sorry!
vlad_starkov has quit [Ping timeout: 256 seconds]
pab|o has joined #ruby-lang
<erikh> latest gist looks good other than the requires in parse
xyzodiac has quit [Quit: Computer has gone to sleep.]
<andrewvos> Chaning #parse to #parse_text
<erikh> it's always going to hit it, no need to be fancy
<andrewvos> erikh: I kind of picked that up from writing lots of rake tasks. It can really slow shit down if you always require everything.
<erikh> you have a 36 line script here
<erikh> not a giant collage of rake tasks that need to be sewn together.
<andrewvos> fair enough
<erikh> fix it when it's actually a problem.
<rue> Of course, it’s already there
<erikh> *slow clap*
chimkan___ has joined #ruby-lang
chimkan has quit [Ping timeout: 245 seconds]
chimkan___ is now known as chimkan
kurko_ has joined #ruby-lang
<rue> andrewvos: Poor guy, you and the cucumber
<andrewvos> rue: I know :( :(
<andrewvos> rue: HIRE ME?
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
mistym has quit [Remote host closed the connection]
<rue> andrewvos: Relocate to .fi, then we can talk
gaveen has quit [Remote host closed the connection]
<andrewvos> rue: That is not a real country
<rue> Too. We have a flag
<erikh> and I hear the weather's great
spike|spiegel has joined #ruby-lang
<Smol> -2°C and windy, couldn't ask for better weather
vlad_starkov has joined #ruby-lang
fletch` has joined #ruby-lang
leopard_me has joined #ruby-lang
<andrewvos> rking: ?
<andrewvos> rking: Ahh, I was showing how you can edit messages in Skype
<rking> Hehe
<rking> Actually, how does it work?
<rking> I gotcha, nm.
spike|spiegel has quit [Quit: WeeChat 0.3.9.2]
<andrewvos> How do you guys unhilight search text in vim?
spike|spiegel has joined #ruby-lang
<andrewvos> Typing /scewcewcwew2223f2 is a bit irritating
<andrewvos> Typing :noh is a bit slow
Hakon has joined #ruby-lang
<rking> andrewvos: Most people :map <C-L> :nohl<CR><C-L>
<rking> (Or similar)
<rking> Whoops, definitely want to 'noremap' that one. ☺
<rking> Here's what I have:
<rking> nnoremap <silent> <c-l> :nohl<CR><C-l>
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
<andrewvos> Hmm
<andrewvos> I used to use the key under the escape on a UK keyboard, and it was nice having one press access to it.
<andrewvos> I suppose C-l
<andrewvos> will do
Hakon has quit [Client Quit]
bolivar has joined #ruby-lang
bolivar has left #ruby-lang [#ruby-lang]
lenilson-dias has joined #ruby-lang
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
havenn has joined #ruby-lang
carloslopes has quit [Remote host closed the connection]
leopard_me has quit [Quit: Computer has gone to sleep.]
sailias has joined #ruby-lang
<kalleth> rking: i usemap <F8> :set invhlsearch hlsearch?<CR>
<rking> Hrm, odd
<kalleth> so it acts as a toggle
<rking> But then the next time you search it's off
<kalleth> yeah
<kalleth> its modal
<kalleth> ;)
<judofyr> I have nnoremap <silent> <Space> :nohlsearch<Bar>:echo<CR>
<rking> Well, fwiw you can golf that down to :set hlsearch!<cr>
<apeiros_> are there established and good patterns for libs which are implemented both, in pure ruby and as C extension?
<rking> But I like the way it works where it's on most of the time and I only clear it when I'm feeling OCD.
<apeiros_> I mean with regards to how the requires are done
<judofyr> apieros: I think having foo_ext and lib/foo.rb with require "foo_ext" is common
<apeiros_> judofyr: and how do you handle the duality part?
<apeiros_> i.e., I have foo/bar, foo/baz etc. in pure ruby
<judofyr> and the problem?
<rking> apeiros_: Aren't they normally separate gems? E.g. ruby-mysql
<apeiros_> do you just require them all before requiring foo_ext and wrap the foo_ext require in begin/rescue in case it doesn't work (unsupported platform)?
<apeiros_> judofyr: overriding the methods is one problem, handling availability of the native extension the other
<apeiros_> or, another
anannie has quit [Ping timeout: 248 seconds]
outoftime has joined #ruby-lang
shtirlic has joined #ruby-lang
Weems has joined #ruby-lang
Weems has joined #ruby-lang
Weems has quit [Changing host]
tjadc has quit [Ping timeout: 248 seconds]
shtirlic_ has quit [Read error: Operation timed out]
tjadc has joined #ruby-lang
chimkan has quit [Quit: chimkan]
smaddock has joined #ruby-lang
anannie has joined #ruby-lang
thinkdevcode has joined #ruby-lang
banisterfiend has joined #ruby-lang
chimkan_ has joined #ruby-lang
leopard_me has joined #ruby-lang
zmack has quit [Remote host closed the connection]
znake has quit [Read error: Connection reset by peer]
enebo has joined #ruby-lang
mistym has quit [Remote host closed the connection]
thinkdevcode has quit [Remote host closed the connection]
BlaXpirit has joined #ruby-lang
mars777 has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
r0bglees0n has joined #ruby-lang
tjadc has quit [Quit: No Ping reply in 180 seconds.]
tjadc has joined #ruby-lang
kith has quit [Ping timeout: 244 seconds]
<andrewvos> What's a nice way to detect OS?
kith has joined #ruby-lang
kith has quit [Changing host]
kith has joined #ruby-lang
Croms has joined #ruby-lang
retro|cz has quit [Ping timeout: 244 seconds]
tjadc_ has joined #ruby-lang
<andrewvos> Like, #windows?, #osx?
<yorickpeterse> You'd have to check RUBY_PLATFORM to see if it matches something
<andrewvos> yorickpeterse: I jst want a gem
tjadc has quit [Ping timeout: 256 seconds]
davidbalber|away is now known as davidbalbert
jgomez has quit [Ping timeout: 256 seconds]
gsav has joined #ruby-lang
<yorickpeterse> Don't know of any sadly
sush24_ has quit [Quit: This computer has gone to sleep]
gsav_ has joined #ruby-lang
gsav has quit [Client Quit]
gsav_ has quit [Client Quit]
gsav has joined #ruby-lang
gsav_ has joined #ruby-lang
<andrewvos> :( :(
<workmad3> andrewvos: ohai gives that sort of info
anannie has quit [Remote host closed the connection]
gsav_ has quit [Client Quit]
anannie has joined #ruby-lang
<andrewvos> workmad3: Kind of just want a tiny little gem that does it.
mistym has joined #ruby-lang
xyzodiac has joined #ruby-lang
Uranio has joined #ruby-lang
retro|cz has joined #ruby-lang
methods has joined #ruby-lang
<workmad3> andrewvos: rbconfig?
Hakon has joined #ruby-lang
<workmad3> andrewvos: 'require "rbconfig"; RbConfig::CONFIG['host_os'] '
xyzodiac has quit [Quit: Computer has gone to sleep.]
<andrewvos> havenn: Nice thanks
rekky has joined #ruby-lang
<workmad3> heh
lenilson-dias has quit [Remote host closed the connection]
<havenn> andrewvos: I just tested it with OS X on 1.9, 2.0, Jruby, and RBX. I don't know if my matching for window and linux work across the board?
<workmad3> I'd call the method 'name' rather than 'name?' personally
<havenn> andrewvos: Would be easy enough to roll a gem, but a pain to test all those rubies on all those platforms
<andrewvos> havenn: travis-ci?
<andrewvos> havenn: Oh wait, not hat wouldn't work
<andrewvos> that*
<workmad3> https://github.com/opscode/ohai/blob/master/lib/ohai/plugins/os.rb <-- that's what ohai does for os btw
<havenn> andrewvos: That would cover one OS.
gnufied has quit [Quit: Leaving.]
sush24_ has joined #ruby-lang
<havenn> workmad3: Agreed, fixed. :)
davidbalbert is now known as davidbalber|away
GarethAdams has quit [Remote host closed the connection]
dankest has joined #ruby-lang
xyzodiac has joined #ruby-lang
carloslopes has joined #ruby-lang
sush24_ has quit [Ping timeout: 256 seconds]
<andrewvos> havenn: Thanks what is the gem name now?
<andrewvos> havenn: `bundle gem os`
fletch` has quit []
fletch` has joined #ruby-lang
sush24_ has joined #ruby-lang
davidbalber|away is now known as davidbalbert
rippa has joined #ruby-lang
headius has joined #ruby-lang
gnufied has joined #ruby-lang
totallymike has joined #ruby-lang
mupilot has quit [Quit: mupilot]
davidbalbert is now known as davidbalber|away
imperator has joined #ruby-lang
GarethAdams has joined #ruby-lang
gregmoreno has joined #ruby-lang
<havenn> andrewvos: os-name
sailias1 has joined #ruby-lang
dr_bob has quit [Quit: Leaving.]
sailias has quit [Ping timeout: 256 seconds]
sailias has joined #ruby-lang
|Vargas| has quit [Quit: ...]
dr_bob has joined #ruby-lang
burgestrand has quit [Quit: Leaving.]
methods has quit [Quit: Leaving.]
sailias1 has quit [Ping timeout: 246 seconds]
ddd has joined #ruby-lang
methods has joined #ruby-lang
<andrewvos> havenn: YAY!!
<andrewvos> havenn: Thanks!
<havenn> andrewvos: Hehe, de nada!
<imperator> hm?
<judofyr> andrewvos: I'd like a method that returns a Symbol too
agarcia has quit [Quit: Konversation terminated!]
<judofyr> and maybe windows? and unix? too :)
methods has quit [Client Quit]
methods has joined #ruby-lang
thatdutchguy has joined #ruby-lang
solars has quit [Ping timeout: 260 seconds]
<havenn> judofyr: Like?: OS.to_s #=> "OS X"; OS.to_sym #=> :osx
<judofyr> yes
<andrewvos> havenn: Pull Request :)
Taranis has joined #ruby-lang
<imperator> gem install sys-uname
methods has left #ruby-lang [#ruby-lang]
<judofyr> imperator: not bad
vlad_starkov has joined #ruby-lang
sush24_ has quit [Ping timeout: 255 seconds]
krohrbaugh has quit [Quit: Leaving.]
tjadc has joined #ruby-lang
tjadc_ has quit [Ping timeout: 240 seconds]
vlad_starkov has quit [Ping timeout: 256 seconds]
apeiros_ has quit [Remote host closed the connection]
alejandrito has joined #ruby-lang
mupilot has joined #ruby-lang
alejandrito has left #ruby-lang [#ruby-lang]
pab|o has quit [Ping timeout: 245 seconds]
alejandrito has joined #ruby-lang
<anannie> Can anyone suggest me a good intermediate book to learn essential ruby concepts such as rescue, yield, enumerators and so on?
alejandrito has left #ruby-lang [#ruby-lang]
imperator has quit [Read error: Connection reset by peer]
<judofyr> anannie: I like The Ruby Programming Language: http://shop.oreilly.com/product/9780596516178.do
<mistym> I've heard good things about that one. Haven't read it myself though.
alejandrito has joined #ruby-lang
alejandrito has left #ruby-lang [#ruby-lang]
<mistym> I also liked Programming Ruby.
<anannie> I've heard of that, but it requires a lot more programming experience than I have, because some of it seems magical. One of the most amazing things is the sudoku example they give in the first chapter or so... I can't even imagine implementing something like that
imperator has joined #ruby-lang
<imperator> blerg
tjadc has quit [Ping timeout: 256 seconds]
<anannie> I'm being honest over here
<judofyr> anannie: maybe http://beginningruby.org/ ?
retro|cz is now known as simi
<anannie> I've done that level through Learn Ruby The Hard Way
<havenn> andrewvos: Merged and released. :) judofyr: OS.to_sym now works as well.
<judofyr> havenn: nice!
<judofyr> havenn: did you see sys-uname btw?
<anannie> Hrm it seems to be more extensive judofyr, perhaps I could jump into the middle or something over there
<havenn> judofyr: Yeah, very cool. :)
faustman has joined #ruby-lang
<judofyr> "and why I’m happy with you pirating my book if you so choose"
xyzodiac has quit [Quit: Computer has gone to sleep.]
<anannie> judofyr: I meant ex*t*ensive not expensive
<judofyr> haha
<anannie> I can afford books :)
<judofyr> :)
<andrewvos> I can afford GOLD PLATED books
<anannie> I ain't *that* broke
* imperator discovers that he reintroduced a bug in sys-uname on windows, dammit
<anannie> What I'm more concerned about is finding a book that matches my level and takes me on to the next one in terms of programming and understanding of the language.
BigO has joined #ruby-lang
<zzak> the well grounded rubyist
<zzak> it's a little dated but still good
<havenn> andrewvos: Why's Poignant Guide (there is a soundtrack that goes along with it as well): http://www.rubyinside.com/media/poignant-guide.pdf
<havenn> anannie: **
<andrewvos> havenn: Yeah I know that, and I know the soundtrack :)
<judofyr> havenn: heh, I was just about to mention that anannie stole andrewvos' "an"-prefix tab-completion :)
mupilot has quit [Read error: Connection reset by peer]
<havenn> andrewvos: I like track 2.
mupilot has joined #ruby-lang
<andrewvos> anannie: GIVE IT BACK
<judofyr> havenn: is that "This Book is made from …"?
<havenn> judofyr: Yup.
<judofyr> been a while since I've listened to it
<anannie> andrewvos: Never!
<judofyr> what was it again? lemonades?
<andrewvos> havenn: I like Arm In The Foam
<judofyr> smoke?
<havenn> ^
<judofyr> rabbits!
<judofyr> of course
<anannie> So the two suggestions is The well grounded rubyist and Why's poignant guide to ruby. What do both teach me in terms of programming and the depth of understanding of ruby?
<judofyr> and "smoke and mayonnaise"
<anannie> * two suggestions are
<havenn> anannie: Well Grounded Rubyist is more modern and less whimsical.
<judofyr> anannie: _why's guide is more of a wild ride. I never finished it to be honest.
<zzak> anannie: just read it, google's your friend
<anannie> andrewvos: Give me a gold plated book and I shall add a z the an to become anzannie
<zzak> The Well-Grounded Rubyist takes you from interested novice to proficient practitioner.
banisterfiend has quit [Remote host closed the connection]
<zzak> the pickaxe book is also good, though a little more verbose
<havenn> anannie: Not a book but Ruby Koans is worth going through if you haven't already: http://rubykoans.com/
<andrewvos> havenn: Yes, books are for nerds. Ruby Koans are good.
<anannie> zzak: I usually try to learn from people first before I can turn to other resources
<zzak> now go, spend all your monies and free time
<havenn> anannie: Not free, but I'm enjoying RubyTapas: http://devblog.avdi.org/rubytapas/
<zzak> there are reviews of each of those books out there
banisterfiend has joined #ruby-lang
<anannie> So to sum up The Well Grounded Rubyist + Ruby Koans + _why's guide + RubyTapas. I shall do my research and figure out which is a better fit and I'll follow through on that
nazty has quit [Read error: Connection reset by peer]
<banisterfiend> anannie: i thoguht "the ruby programming language" was great
nazty has joined #ruby-lang
<judofyr> anannie: the most important thing is to always program. find interesting problems and try to solve them in Ruby.
<havenn> banisterfiend: I soo agree. I <3 that book. Gets hard near the end, I'm still trying to plow through. :)
<anannie> zzak: I can't immediately gauge the earnestness of a reviewer through reading a few paragraphs. Over here I have an understanding that the regulars are competent and generally people I want to take advice from, that's why I asked before doing an extensive Google search
<zzak> right, no book is going to teach you all of the semantics
davidbalber|away is now known as davidbalbert
<zzak> anannie: fair enough
<anannie> banisterfiend: I'm afraid it's above my level a bit. I gave the example of the bruteforce soduku solver he writes at the starting and that was mindblowing to read. I can't build something like that on my own. I'm not sure if I'm ever going to be able to create something like that on my own, so it's a bit above me I'm afraid
<banisterfiend> anannie: skip that, i did
<banisterfiend> it's just showing you the kind of things u can do, you're def. not meant to understnad it at that point
<judofyr> anannie: it's also a great book to have as a reference
<banisterfiend> just glance over it and pick u a few things
dankest has quit [Quit: Leaving...]
<anannie> judofyr: The problem with me is that the problems I want to solve are always seemingly out of reach of my understanding and abilities. My actual understanding and abilities are so limited that almost everything I could try has been done before. It's hard to find an unsolved problem *I* could tackle that hasn't been done before
<banisterfiend> pick up*
<havenn> anannie: Have you gotten through tryruby.org?
<anannie> That makes sense. I'll make sure that I buy a copy
<judofyr> don't worry if it's been done before
<anannie> havenn: I did learn code the hard way
imajes has quit [Excess Flood]
<banisterfiend> anannie: writing a game is fast and fun way to learn a language IMO
<havenn> anannie: Then you should be able to breeze through tryruby.org, that is another fun half-hour thing to do.
<banisterfiend> libgosu.org
<anannie> havenn: Okay it's on my to-do list
* anannie goes to libgosu.org
<judofyr> banisterfiend: releasy looks interesting. haven't seen it before. how does it bundle into .exe?
xyzodiac has joined #ruby-lang
shtirli__ has quit [Remote host closed the connection]
imajes has joined #ruby-lang
shtirlic_ has joined #ruby-lang
<banisterfiend> judofyr: it just uses ocra
<anannie> Not a game but I could use Gosu to make a 2D control environment for a machine on the ground, and then pipe through a camera feed and put it up or something
banisterfiend has quit [Remote host closed the connection]
<judofyr> anannie: sounds like a fun project
<darix> anannie: also keep in mind the rule: write it once, throw it away. write it again with the knowledge you gained when you did the prototype :)
<anannie> judofyr: Yes it would be an awesome project
kurko_ has quit [Ping timeout: 246 seconds]
<judofyr> anannie: I also had projects like that, but I was always distracted by the small stuff
<anannie> darix: That's an awesome way to approach things!
<judofyr> like, "oh, I need a way to communicate with the camera" and then I'm stuck making that thing perfect :P
<anannie> judofyr: Don't worry it's not likely that I'll be able to achieve this any time soon
alvaro_o has joined #ruby-lang
<darix> *takes note* judofyr has the perfect lib to talk to a camera;)
kurko_ has joined #ruby-lang
heftig has quit [Quit: leaving]
shtirlic_ has quit [Ping timeout: 255 seconds]
brianpWins has quit [Quit: brianpWins]
datanoise has joined #ruby-lang
vlad_starkov has joined #ruby-lang
dc5ala has joined #ruby-lang
judofyr has quit [Remote host closed the connection]
<andrewvos> Want vim plugin that loads output from `ps ax`, and then stores all pids, and then when you delete lines it goes off and `kill -9`s them.
ulisescab has joined #ruby-lang
dankest has joined #ruby-lang
dous has joined #ruby-lang
lupine has joined #ruby-lang
Uranio has quit [Remote host closed the connection]
krohrbaugh has joined #ruby-lang
<imperator> andrewvos, how much does this gig pay?
thisirs has quit [Remote host closed the connection]
<andrewvos> imperator: You will get to make me happy, which is enough for any man.
<andrewvos> Wait hang on
afgeneralist has joined #ruby-lang
madish has joined #ruby-lang
CoverSlide|Away is now known as CoverSlide
thatdutchguy has quit [Remote host closed the connection]
thatdutchguy has joined #ruby-lang
kitallis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
dr_bob has quit [Quit: Leaving.]
apeiros_ has joined #ruby-lang
<darix> i wonder how long it will take until andrewvos presses d once to often and kills the wrong process
<darix> andrewvos: do you know about pkill ?
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
rippa has joined #ruby-lang
<andrewvos> darix: Yeah
ulisescab has quit [Remote host closed the connection]
thatdutchguy has quit [Remote host closed the connection]
dr_bob has joined #ruby-lang
ryanlecompte has joined #ruby-lang
GarethAdams has quit [Quit: Leaving...]
blazes816 has joined #ruby-lang
gnufied has quit [Quit: Leaving.]
sent-hil has joined #ruby-lang
brianpWins has joined #ruby-lang
<sent-hil> is there something like 'gf' vim command in rails for plain ruby libraries?
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
wallerdev has joined #ruby-lang
shtirlic has quit [Remote host closed the connection]
tbuehlmann has joined #ruby-lang
enebo has quit [Quit: enebo]
<Smol> I'd use exuberant ctags
shtirlic has joined #ruby-lang
rekky has quit [Quit: rekky]
<sent-hil> Smol: I do use that, just needed something for require ...
shtirlic_ has joined #ruby-lang
<Smol> ah
<havenn> Ry, the newest Ruby version manager this week: https://github.com/jayferd/ry
<havenn> MT, sry
<Smol> not sure if or how you can jump to requires
rekky has joined #ruby-lang
Uranio has joined #ruby-lang
<sent-hil> Smol: rails.vim has 'gf' command that works with requires, so I was hoping someone wrote one for ruby as well
shtirlic has quit [Ping timeout: 255 seconds]
Mon_Ouie has joined #ruby-lang
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby-lang
<darix> sent-hil: does it work for normal ruby libraries when called from your rails project?
vlad_starkov has quit [Ping timeout: 246 seconds]
davidbalbert is now known as davidbalber|away
<darix> tpope: you could probably answer this question. ;)
<sent-hil> darix: nah i think it just looks in app/*, maybe lib/*, it would be cool if it did though
thatdutchguy has joined #ruby-lang
naquad has quit [Ping timeout: 260 seconds]
Uranio has quit [Quit: WeeChat 0.3.8]
__butch__ has joined #ruby-lang
<darix> sent-hil: lets wait for a word from tpope ;)
thatdutchguy has quit [Remote host closed the connection]
sio has left #ruby-lang ["WeeChat 0.3.9.2"]
<sent-hil> darix: will do, thx :)
rippa has joined #ruby-lang
dr_bob has quit [Quit: Leaving.]
Arnvald has quit [Remote host closed the connection]
davidbalber|away is now known as davidbalbert
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
pryno is now known as bryno
<Smol> I think the 'path' variable determines where vim will search for files, so you could write a small ruby script that appends $LOAD_PATH to it
Aiur has joined #ruby-lang
<Smol> hmm, I think https://github.com/vim-ruby/vim-ruby/blob/master/ftplugin/ruby.vim actually does something like that
wallerdev has quit [Quit: wallerdev]
thatdutchguy has joined #ruby-lang
<Smol> line 71
__butch__ has quit [Quit: Leaving.]
heftig has joined #ruby-lang
pab|o has joined #ruby-lang
thatdutchguy has quit [Remote host closed the connection]
AlHafoudh has joined #ruby-lang
AlHafoudh has quit [Max SendQ exceeded]
towski has joined #ruby-lang
AlHafoudh has joined #ruby-lang
AlHafoudh has quit [Max SendQ exceeded]
eyda|mon has left #ruby-lang ["WeeChat 0.3.9"]
AlHafoudh has joined #ruby-lang
banisterfiend has joined #ruby-lang
thatdutchguy has joined #ruby-lang
sent-hil has quit [Remote host closed the connection]
rolfb has joined #ruby-lang
justinram has joined #ruby-lang
<tpope> darix: well against all odds I actually saw this, but he still didn't stick around long enough
mrsolo has joined #ruby-lang
<tpope> Smol is dead on. Add bundler.vim to the mix and you're in business
robbyoconnor has quit [Ping timeout: 250 seconds]
thatdutchguy has quit [Remote host closed the connection]
naquad has joined #ruby-lang
<yorickpeterse> Is there a method in the Array class that behaves like [x..y] but also deletes the elements? So basically delete/delete_at but with a range
Aiur has quit [Quit: Computer has gone to sleep.]
workmad3 has quit [Ping timeout: 250 seconds]
<tpope> slice!
<yorickpeterse> Example: `foo = [10, 20, 30]; foo.the_method_im_looking_for(0, 2) # => [10, 20]; foo # => [30]`
<yorickpeterse> tpope: hmm
<yorickpeterse> tpope: awesome! That's the one
<yorickpeterse> Thanks
<chris2> ggreer: does ag support default arguments?
wallerdev has joined #ruby-lang
__butch__ has joined #ruby-lang
phlipper has joined #ruby-lang
tenderlove has joined #ruby-lang
<apeiros_> tpope: wow, long time no see
<apeiros_> hi there :)
<tpope> hi
<imperator> and chris2!
<ggreer> chris2: default arguments?
<ggreer> alias a='ag --smart-case ...other options I like...'
<ggreer> if you mean what I think you mean, the solution is to use aliases
ryez has quit [Ping timeout: 245 seconds]
<chris2> okay :)
<chris2> i just want to ignore *~ etc
<chris2> but that probably should go into .agignore
<chris2> but i hate colors etc, so i want to disable that
<chris2> hey imperator
<imperator> maybe dblack, hal9000 and mfg will make an appearance, too ;)
<chris2> hehe
<chris2> mfp
<chris2> havent heard of him in ages
<cout> hi imperator
<chris2> cout!
<cout> hio
tankdilla has joined #ruby-lang
<imperator> oops, yes, mfp
<imperator> hey cout
<imperator> yeah, left us for ocaml, and his blog went dead i think
<chris2> not sure he does ocaml these day
<chris2> probably sauna only :D
__butch__ has quit [Quit: Leaving.]
thatdutchguy has joined #ruby-lang
__butch__ has joined #ruby-lang
havenn has quit [Read error: Connection reset by peer]
havenn has joined #ruby-lang
xyzodiac has quit [Quit: Computer has gone to sleep.]
achiu1 has joined #ruby-lang
cultureulterior_ has quit [Quit: cultureulterior_]
achiu has quit [Ping timeout: 248 seconds]
AlHafoudh has quit [Quit: Computer has gone to sleep.]
xalei has joined #ruby-lang
Aiur has joined #ruby-lang
robotmay has quit [Remote host closed the connection]
imperator has quit [Read error: Connection reset by peer]
<darix> tpope: good to know. and yeah people lack patience in these days.
imperator has joined #ruby-lang
nvoyager has quit [Quit: nvoyager]
vlad_starkov has joined #ruby-lang
<rue> Ehmaged, what is this, 2007?
<rue> Hidyho
<manveru> :)
leopard_me has quit [Quit: Computer has gone to sleep.]
shtirlic_ has quit [Remote host closed the connection]
dc5ala has quit [Quit: Ex-Chat]
cardoni has joined #ruby-lang
mupilot_ has joined #ruby-lang
sent-hil has joined #ruby-lang
mistym is now known as mistym_lunch
areil has quit [Remote host closed the connection]
mupilot has quit [Ping timeout: 265 seconds]
mupilot_ is now known as mupilot
vlad_starkov has quit [Remote host closed the connection]
rekky has quit [Quit: rekky]
Assurbanipal has quit [Quit: Konversation terminated!]
aetcore has joined #ruby-lang
JohnBat26 has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
brianpWins has quit [Quit: brianpWins]
cultureulterior_ has joined #ruby-lang
davidbalbert is now known as davidbalber|away
kain has quit [Quit: exit]
nvoyager has joined #ruby-lang
AlHafoudh has joined #ruby-lang
brianpWins has joined #ruby-lang
davidbalber|away is now known as davidbalbert
_br_- has quit [Excess Flood]
enebo has joined #ruby-lang
_br_ has joined #ruby-lang
banisterfiend has quit [Remote host closed the connection]
<akahn> what is the difference between writing a file in binary mode and writing a file not in binary mode?
xsdg_ has quit [Quit: Reconnecting]
xsdg has joined #ruby-lang
nvoyager has quit [Quit: nvoyager]
_br_ has quit [Excess Flood]
havenn has quit [Ping timeout: 264 seconds]
_br_ has joined #ruby-lang
kain has joined #ruby-lang
_br_ has quit [Excess Flood]
sent-hil has quit [Remote host closed the connection]
shtirlic has joined #ruby-lang
_br_ has joined #ruby-lang
towski has quit [Remote host closed the connection]
_br_ has quit [Excess Flood]
<yorickpeterse> I think I can safely say that parsing and handling Ruby expander assignments is a bitch
<yorickpeterse> Took me a few days to nail it, quite happy with the results so far
_br_ has joined #ruby-lang
mistym_lunch is now known as mistym
voker57 has quit [Ping timeout: 260 seconds]
xyzodiac has joined #ruby-lang
_br_ has quit [Excess Flood]
kain has quit [Quit: exit]
kain has joined #ruby-lang
havenn has joined #ruby-lang
_br_ has joined #ruby-lang
_br_ has quit [Excess Flood]
AlHafoudh has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
wyhaines has quit [Ping timeout: 256 seconds]
bluepojo has joined #ruby-lang
_br_ has joined #ruby-lang
wyhaines has joined #ruby-lang
xyzodiac has quit [Quit: Computer has gone to sleep.]
_br_ has quit [Excess Flood]
<whitequark> yorickpeterse: mhmm, I found it quite simple actually
_br_ has joined #ruby-lang
<yorickpeterse> well the end solution is not too difficult
<yorickpeterse> but it took me quite a few iterations to get there
bluepojo has left #ruby-lang [#ruby-lang]
<yorickpeterse> and 4 pages in my notebook full of ideas/implementations written down
_br_ has quit [Excess Flood]
rippa has quit [Ping timeout: 255 seconds]
<whitequark> let me show what I wrote
_br_ has joined #ruby-lang
mupilot has quit [Remote host closed the connection]
Nisstyre has quit [Read error: Connection reset by peer]
mupilot has joined #ruby-lang
ebouchut_ has joined #ruby-lang
ebouchut_ has quit [Client Quit]
voker57 has joined #ruby-lang
_br_ has quit [Excess Flood]
ryanf has joined #ruby-lang
Nisstyre has joined #ruby-lang
<yorickpeterse> basically the values are determined using `expander_values = values.slice(current_index - vars_before_expander, val_length - (vars_length - 1))`
<yorickpeterse> if that makes any sense
<whitequark> ah, that's for masgn nodes
_br_ has joined #ruby-lang
<whitequark> it's a bit simpler as you don't need to handle optional arguments
<yorickpeterse> the stuff like `*foo, foo = 10, 20`
<whitequark> yup
<yorickpeterse> Not sure what those are called, I call them expander assignments
carloslopes has quit [Remote host closed the connection]
<whitequark> it's called "multiple assignment" I believe
<whitequark> note that there are some corner cases with 'foo, bar = *a'
<yorickpeterse> hm, haven't tested that yet
<yorickpeterse> though I think I can't really solve that on a parser level
<yorickpeterse> since the parser doesn't know what "a" contains
imajes has quit [Excess Flood]
_br_ has quit [Excess Flood]
_br_ has joined #ruby-lang
<whitequark> yorickpeterse: "f, b = 1", "f, b = *1", "f, b = *[1]" and "f, b = [1]" all behave the same
imajes has joined #ruby-lang
<yorickpeterse> Hm
xyzodiac has joined #ruby-lang
tenderlove has quit [Remote host closed the connection]
_br_ has quit [Excess Flood]
_br_ has joined #ruby-lang
<naquad> i have 2 objects, both include Enumerable, both implement indexer ([]) and i need to set values of first to second. what's the best way to do this? atm I have: FIELDS.each {|f| dst[f] = src[f]} ## where FIELDS is constant containing array of field names
_br_ has quit [Excess Flood]
wyhaines has quit [Ping timeout: 246 seconds]
_br_ has joined #ruby-lang
xyzodiac has quit [Quit: Computer has gone to sleep.]
rolfb has quit [Quit: Linkinus - http://linkinus.com]
_br_ has quit [Excess Flood]
_br_ has joined #ruby-lang
xyzodiac has joined #ruby-lang
_br_ has quit [Excess Flood]
erpuds has joined #ruby-lang
_br_ has joined #ruby-lang
_br_ has quit [Excess Flood]
cultureulterior_ has quit [Quit: cultureulterior_]
datanoise has quit [Ping timeout: 255 seconds]
canton7 has joined #ruby-lang
sepp2k1 has joined #ruby-lang
<whitequark> naquad: yeah
_br_ has joined #ruby-lang
<naquad> whitequark, yeah?
_br_ has quit [Excess Flood]
sepp2k has quit [Ping timeout: 245 seconds]
_br_ has joined #ruby-lang
jnoon has quit []
<whitequark> naquad: the way you're currently solving this problem is probably the best
<whitequark> at least I don't see how I can make it better.
<naquad> whitequark, ok, thanks
_br_ has quit [Excess Flood]
havenn has quit [Ping timeout: 244 seconds]
bluepojo has joined #ruby-lang
_br_ has joined #ruby-lang
_br_ has quit [Excess Flood]
justinra_ has joined #ruby-lang
savage- has joined #ruby-lang
seydar has joined #ruby-lang
<seydar> i have some ffi questions
<seydar> can i use the ffi gem to GENERATE a C function?
_br_ has joined #ruby-lang
weeb1e_ has joined #ruby-lang
<seydar> i want to create a C function that takes a float, casts it to a char, prints it, and then returns 1
<whitequark> seydar: try ffi-inline
<seydar> boom. thank you
_br_ has quit [Excess Flood]
<whitequark> fwiw, you could achieve the same result as the C level casting with #pack/#unpack
jxie_ has joined #ruby-lang
havenn has joined #ruby-lang
<seydar> clever, i didn't think of that
<seydar> unfortunately, i'm using this in tandem with ruby-llvm, so i need to use a straight C func
<seydar> thank you though
_br_ has joined #ruby-lang
Brainix has joined #ruby-lang
<whitequark> seydar: I wonder what are you writing with ruby-llvm
xyzodiac has quit [Quit: Computer has gone to sleep.]
gix- has joined #ruby-lang
gix has quit [Disconnected by services]
ryanlecompte has quit [*.net *.split]
headius has quit [*.net *.split]
justinram has quit [*.net *.split]
jxie has quit [*.net *.split]
weeb1e has quit [*.net *.split]
fuzzy8balls has quit [*.net *.split]
_br_ has quit [Excess Flood]
<seydar> whitequark: implementing kaleidoscope
mars777_ has joined #ruby-lang
swav_ has joined #ruby-lang
<seydar> i have no print function
<seydar> and i'd like to see the value of the loop each time it runs
_br_ has joined #ruby-lang
datanoise has joined #ruby-lang
havenn_ has joined #ruby-lang
rue_XIV has joined #ruby-lang
<zzak> i think that might help, maybe?
<seydar> not really, but thank you anyways. it was interesting to read
_br_ has quit [Excess Flood]
pab|o has left #ruby-lang [#ruby-lang]
fuzzy8balls has joined #ruby-lang
<zzak> im new to this
bjoern has joined #ruby-lang
jaymes_ has joined #ruby-lang
<zzak> parse_signature seems like it would do what you want, sorta
TheMoonMaster_ has joined #ruby-lang
<seydar> well i don't need the signature, i need the actual function to be defined in the world of C such that i can extern it
<seydar> the type sig is useful, though, but it's not what i need
havenn has quit [*.net *.split]
gsav has quit [*.net *.split]
outoftime has quit [*.net *.split]
mars777 has quit [*.net *.split]
TheMoonMaster has quit [*.net *.split]
rue has quit [*.net *.split]
swav has quit [*.net *.split]
jaymes has quit [*.net *.split]
mars777_ is now known as mars777
bjoern has quit [Excess Flood]
datanoise has quit [Ping timeout: 255 seconds]
_br_ has joined #ruby-lang
charliesome has joined #ruby-lang
<zzak> you can import extern functions with Fiddle::Import
<zzak> but i think you need to load a dlib first
<seydar> i'll have to play with it, then
<akahn> whitequark: does that mean that using binary mode has lower overhead?
_br_ has quit [Excess Flood]
outoftime has joined #ruby-lang
headius has joined #ruby-lang
wyhaines has joined #ruby-lang
mjio has joined #ruby-lang
<zzak> seydar: check out Fiddle::Function too https://github.com/ruby/ruby/blob/trunk/ext/fiddle/function.c
<zzak> the whole library got a face-lift
<zzak> it ate up most of DL
45PABEM79 has joined #ruby-lang
bjoern has joined #ruby-lang
<seydar> ooh, looks good
45PABEM79 has quit [Ping timeout: 264 seconds]
bjoern has quit [Excess Flood]
_br_ has joined #ruby-lang
tenderlove has joined #ruby-lang
blacktulip has quit [Remote host closed the connection]
seydar has quit [Quit: leaving]
<zzak> that _should_ make it into 2.0 preview2
gsav has joined #ruby-lang
tenderlove has quit [Ping timeout: 246 seconds]
_br_ has quit [Excess Flood]
tenderlove has joined #ruby-lang
kurko_ has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
sailias has quit [Quit: Leaving.]
<whitequark> zzak: I wonder why don't import existing ffi implementation
Hakon has quit [Ping timeout: 264 seconds]
<zzak> i'm not sure i understand that statement
<zzak> whitequark: can you rephrase?
BigO has quit [Remote host closed the connection]
_br_ has joined #ruby-lang
<whitequark> zzak: sorry I wasn't clear in that. what I meant is that there is already an FFI interface which is more or less well-supported in jruby and rubinius
<whitequark> and on MRI too, with the ruby-ffi gem
<whitequark> it seems logical to implement a compatible interface in MRI core, as it's done in other implementations
_br_ has quit [Excess Flood]
<zzak> Fiddle is an ffi interface
<zzak> it's in the stdlib
burgestrand has joined #ruby-lang
<zzak> DL is going to be deprecated
<whitequark> zzak: this FFI: https://github.com/ffi/ffi
<zzak> whitequark: fiddle is a wrapper for libffi
_br_ has joined #ruby-lang
davidbalbert is now known as davidbalber|away
<lianj> fiddle is in stdlib?
<zzak> lianj: yessir
<zzak> it was added in 1.9
<chris2> /usr/lib/ruby/1.9.1/fiddle.rb
<lianj> yep, just noticed
<lianj> why not ruby-ffi?
<whitequark> lianj: that's easy, ruby-ffi is under LGPL
<whitequark> so it cannot be simply imported
_br_ has quit [Excess Flood]
<lianj> duh
<whitequark> but I don't see value in creating yet another incompatible interface either
sent-hil has joined #ruby-lang
<lianj> me loves ffi. change license and include it :D
datanoise has joined #ruby-lang
erpuds has quit [Quit: erpuds]
<zzak> whitequark: i think fiddle is good and it's there for a reason
<zzak> if you want to file a ticket for any incompatibilities or bugs, be my guest :)
<whitequark> zzak: as I understand it, fiddle is an iterative improvement for DL
<lianj> bug: this lib
<zzak> yah
rolfb has joined #ruby-lang
rolfb has quit [Client Quit]
<whitequark> zzak: so yeah, I'd phrase the bug as "deprecating DL not in favor of ruby-ffi", but I understand that licensing in this case prohibits the inclusion. which is a pity.
<zzak> what is wrong with fiddle?
<zzak> other than, it's not library X
_br_ has joined #ruby-lang
_br_ has quit [Excess Flood]
<lianj> if ffi license would be changed, is there a change to include it in mri stdlib?
<drbrain> lianj: there's always a chance
<whitequark> zzak: the API provides significantly less features than ffi gem
<lianj> drbrain: ;)
<whitequark> zzak: it's not fiddle being bad as of itself, it's about increasing fragmentation
_br_ has joined #ruby-lang
erpuds has joined #ruby-lang
<lianj> zzak: any lib using fiddle?
<lianj> drbrain: *high chance?
<whitequark> lianj: stdlib does for things like win32ole
<drbrain> lianj: if it's more featureful than ffi and tenderlove agrees, yes
<lianj> you mean more featureful than fiddle thereß
<lianj> sadly iirc tenderlove dislikes ffi already, so i should get my hopes down
<zzak> because of licensing, i think there is better chance to implement requested features in fiddle than to replace it
_br_ has quit [Excess Flood]
erpuds has quit [Client Quit]
<lianj> zzak: but from a usage view, fiddle is/wants to replace ffi. not the other way around
<whitequark> zzak: there isn't any value in adding features to fiddle when you already can use ffi and have all three platforms supported
enebo has quit [Quit: enebo]
davidbalber|away is now known as davidbalbert
<zzak> i thought fiddle also supported all three platforms?
<zzak> they're both based on libffi
<whitequark> zzak: just checked, it's an open issue in jruby and it doesn't grep in rbx
<whitequark> ruby-ffi interface is the only option now, if you want to be cross-platform
<zzak> oh, i thought by platform you mean windows, osx, etc
<zzak> cross-implementation you mean
<whitequark> yes
sent-hil has quit [Remote host closed the connection]
_br_ has joined #ruby-lang
<whitequark> or cross-engine (given that we have RUBY_ENGINE...)
<zzak> lianj: what is the difference?
<lianj> zzak: people use ffi
srbaker has joined #ruby-lang
<lianj> i cant find a single project that uses fiddle
_br_ has quit [Excess Flood]
_br_ has joined #ruby-lang
_br_ has quit [Excess Flood]
<lianj> drbrain: oh, tenderlove added fiddle like 3 years ago
_br_ has joined #ruby-lang
<lianj> stdlib is a ghetto :(
<drbrain> lianj: lies
<whitequark> it should get better with gemification of stdlib
BlaXpirit has quit [Quit: Quit Konversation]
<zzak> X is bettar than Y
<lianj> zzak: again, dl/fiddle is rarly used in libs while ffi a lot
<lianj> also the rbx/jruby argument is there
<zzak> looks like jruby is using DL
<headius> our fiddle is implemented atop FFI
<headius> ditto for DL
<zzak> for win32ole
<zzak> ?
shtirlic has quit [Remote host closed the connection]
<zzak> ahh, i was looking at 1.6
<lianj> headius: atop of libffi, not the ruby-ffi gem api. which even jruby/rbx build into their core
<lianj> headius: is there a project using fiddle?
<headius> lianj: hmm?
<headius> our dl and fiddle are implemented using the ruby-ffi API
<headius> we just happen to ship it
<headius> I don't know of any projects using fiddle
srbaker has quit [Quit: Computer has gone to sleep.]
<lianj> then im just stupid and confused again. link?
brianpWins has quit [Remote host closed the connection]
brianpWins has joined #ruby-lang
jnoon has joined #ruby-lang
<headius> entirely Ruby code since it just leverages ffi
<lianj> oh youre talking about jruby. yea, that how i thought it should/could be in mri too
<headius> yeah
xyzodiac has joined #ruby-lang
<headius> I don't really get the justification for not including libffi
<headius> that's the reason they did fiddle
imperator has quit [Ping timeout: 260 seconds]
<headius> a new API that's not bound to libffi and can use libdl instead
mupilot_ has joined #ruby-lang
<lianj> jruby ffi stuff is license independet of the ruby-ffi gem, no?
justinra_ has quit [Remote host closed the connection]
gregmoreno has quit [Remote host closed the connection]
<lianj> ok, so its not. is it really the same code? i recall having some trouble with jruby ffi not implementing some methods ruby-ffi had, or it was just out of sync
Xzyx987X_ has joined #ruby-lang
<lianj> s/is it/didnt know it is/
gregmoreno has joined #ruby-lang
mupilot has quit [Ping timeout: 265 seconds]
mupilot_ is now known as mupilot
thatdutchguy has quit [Remote host closed the connection]
jnoon has quit [Ping timeout: 255 seconds]
Xzyx987X has quit [Ping timeout: 276 seconds]
TheMoonMaster_ is now known as TheMoonMaster
<lianj> haha, let me get this right, if your lib uses dl, you would use ffi within fiddle within dl. yo dawg
lcdhoffman has joined #ruby-lang
<lianj> great stuff
postmodern has joined #ruby-lang
datanoise has quit [Ping timeout: 255 seconds]
tankdilla has quit [Ping timeout: 246 seconds]
benanne has joined #ruby-lang
gsav has quit [Ping timeout: 255 seconds]
davidbalbert is now known as davidbalber|away
tankdilla has joined #ruby-lang
<headius> lianj: ruby-ffi is apache-2.0, and the code in JRuby is one of three licenses (including the BSD-like CPL)
mistym has quit [Remote host closed the connection]
thatdutchguy has joined #ruby-lang
davidbalber|away is now known as davidbalbert
wyhaines has quit [Remote host closed the connection]
thatdutchguy has quit [Remote host closed the connection]
webdesserts has joined #ruby-lang
dankest is now known as dankest|away
tbuehlmann has quit [Remote host closed the connection]
mjio has quit []
mjio has joined #ruby-lang
mupilot has quit [Quit: mupilot]
thatdutchguy has joined #ruby-lang
mupilot has joined #ruby-lang
pdswan has quit [Quit: pdswan]
pdswan has joined #ruby-lang
datanoise has joined #ruby-lang
dankest|away is now known as dankest
fletch` has quit [Ping timeout: 246 seconds]
mistym has joined #ruby-lang
webdesserts has quit [Quit: Leaving]
ubsest has joined #ruby-lang
ubsest has quit [Client Quit]
fletch` has joined #ruby-lang
mcmullins has joined #ruby-lang
mcmullins is now known as webdesserts
<webdesserts> Does reopening an IO with a new stream have any advantages over just using the new stream?
Axsuul has joined #ruby-lang
havenn_ has quit [Remote host closed the connection]
<tenderlove> lianj: yup. fiddle wraps libffi, as the ffi gem wraps libffi :-)
havenn has joined #ruby-lang
<tenderlove> dl existed before libffi, so we back dl with fiddle in order to remain backwards compatible
havenn has quit [Ping timeout: 248 seconds]
<lianj> tenderlove: why was fiddle added, when besides dl no one uses it?
datanoise has quit [Ping timeout: 260 seconds]
<lianj> ok, because fiddle wraps libffi. but why create another libffi wrapping lib?
<cout> what's fiddle?
<tenderlove> lianj: licenses for the ffi gem, and the size of it's source
tankdilla has quit [Ping timeout: 246 seconds]
<lianj> was a license changed asked, or is the source size the/that major issue?
<lianj> tenderlove: looks like fiddle only provides the thinest ffi wrap one could think of, prolly thats why none use it in favor to ffi
Averna has joined #ruby-lang
<tenderlove> yes, it does provide the thinnest wrapper
jnoon has joined #ruby-lang
cardoni has quit [Quit: cardoni]
<lianj> tenderlove: if wmeissner decidees you change the license, would ruby-core reconsider using ruby-ffi?
<tenderlove> why?
<lianj> because jruby/rbx has it in stdlib/core and mri's fiddle in core is close to useless (as in no one uses it, and i guess plans to use it)
<headius> we're still talking about fiddle?
<headius> tenderlove: is the apache-2.0 license for ruby-ffi a problem?
<lianj> kinda. i have no voice anyway. just curious
<headius> I know there's questions about libffi's license, but it has become the bastard child of a thousand projects now
_n0b0dy_ has joined #ruby-lang
<tenderlove> headius: *shrug*
<tenderlove> fiddle's API is a superset of what the ffi gem provides
<tenderlove> e.g., it should be possible to implement ffi in terms of fiddle
<tenderlove> but the other way around isn't so easy
<postmodern> why does stdlib have both dl and fiddle?
<tenderlove> postmodern: backwards compatibility. dl will be removed
<postmodern> tenderlove, when?
<postmodern> tenderlove, ruby 3.0?
<tenderlove> probably 2.1?
<tenderlove> ya
<tenderlove> I'm not sure
<cout> I don't like any of the ffi options I've seen because none of them read the header files to find out what C typedefs you get (e.g. if a particular type is 64-bit on one platform and 32-bit on another)
workmad3 has joined #ruby-lang
<cout> once upon a time I thought about writing a C parser just for that
havenn has joined #ruby-lang
<postmodern> i like ffi, i've written a dozen ffi bindings, works fine
<tenderlove> cout: DL has a simple C parser, but ya, dealing with that stuff sucks
<postmodern> auto-parsing the headers is nice, but parsing and evaluating macros is not trivial
<cout> tenderlove: it's easy with ruby's C API
<lianj> cout: in luajit's ffi you have to run the header files with a preprocessor or they fail. so ffi.include('/usr/include/foo.h') wont work in most cases either
<cout> tenderlove: my code just doesn't work with jruby easily :(
<cout> lianj: that's odd; why doesn't the library just preprocess the input?
jsaak has quit [Ping timeout: 246 seconds]
<postmodern> downside of parsing the header files, is your library than requires the C library and the headers
<lianj> tenderlove: your plan would be to write on fiddle to drop require 'dl' in your gist and then impelemnt the ruby-ffi api ontop of fiddle?
<tenderlove> ya
<postmodern> why not just use ffi?
<tenderlove> lianj: in trunk ruby you don't need the `dl` require