Jake232 [Jake232!~textual@5e0ecfc2.bb.sky.com] has joined #ruby-lang
pet_r [pet_r!~petr@85.132.143.21] has joined #ruby-lang
<ryanf>
I feel like round is kind of cheating, but you could use (+ 0.5).floor too
<ryanf>
btw i is a confusing name for that param, since i is almost always a loop index
<shevy>
thanks
flip_digits [flip_digits!~textual@c-76-122-14-228.hsd1.fl.comcast.net] has joined #ruby-lang
igotnolegs [igotnolegs!~igotnoleg@75-162-83-166.slkc.qwest.net] has joined #ruby-lang
<josh9>
is there a convention for naming my test files? activerecord uses the model name, like car.rb, activesupport and sinatra uses *_test.rb
brianpWins [brianpWins!~brianpWin@hlfxns0169w-142068026252.dhcp-dynamic.FibreOp.ns.bellaliant.net] has joined #ruby-lang
dejongge1 [dejongge1!~jonke@pD9E0DFFD.dip0.t-ipconnect.de] has joined #ruby-lang
<andrewvos>
josh9: use the same name with either _test or _spec added the filename
bjensen [bjensen!~brianj@3007ds3-ar.0.fullrate.dk] has joined #ruby-lang
<andrewvos>
josh9: sinatra doesn't use test file names
<andrewvos>
josh9: if you get what I mean
<josh9>
andrewvos: ok
<andrewvos>
josh9: So if you're using test::unit or minitest or whatever, use class_name_test.rb and if you're using rspec use class_name_spec.rb
ryanf [ryanf!~revfitz@118.sub-174-253-248.myvzw.com] has joined #ruby-lang
<zenspider>
rawr
<samuelkadolph>
Meow
zzak [zzak!~zzak@ec2-107-20-68-16.compute-1.amazonaws.com] has joined #ruby-lang
<zenspider>
I use test_*.rb, but I'm old skool
<samuelkadolph>
*_test.rb is the best! Death to all unbelievers!
<samuelkadolph>
...
<samuelkadolph>
I just saw a commerical for Chunk Norris approved Tide
<andrewvos>
Aww man using a vpn and getting netflix/hulu in the uk is awesome.
<andrewvos>
zenspider: You're a freak of nature.
elux [elux!~peter@67.70.37.175] has joined #ruby-lang
<samuelkadolph>
Isn't everyone?
<andrewvos>
samuelkadolph: Everyone I know
<andrewvos>
samuelkadolph: Oh wait, you meant on a deeper level? haha
<andrewvos>
samuelkadolph: I would disagree. We are the only possible outcome.
<samuelkadolph>
I rest my case. Just look at andrewvos.
jthomas_ [jthomas_!~jthomas@c-98-222-28-137.hsd1.il.comcast.net] has joined #ruby-lang
<andrewvos>
:)
ttilley [ttilley!~ttilley@unaffiliated/lv] has joined #ruby-lang
Sailias [Sailias!~jonathan@CPE0018f85e576d-CM001bd7aaaf96.cpe.net.cable.rogers.com] has joined #ruby-lang
ryanf [ryanf!~revfitz@50.0.160.40] has joined #ruby-lang
towski [towski!~towski@65.14.229.26] has joined #ruby-lang
lake [lake!lake@bbis.us] has joined #ruby-lang
diegoviola [diegoviola!~viola@host-1-211.b15.cvc.com.py] has joined #ruby-lang
cynosure [cynosure!~cynosure@centrumnet.hu] has joined #ruby-lang
lake1 [lake1!~lake@li71-228.members.linode.com] has joined #ruby-lang
bglusman [bglusman!~bglusman@c-68-80-200-61.hsd1.pa.comcast.net] has joined #ruby-lang
jmontross [jmontross!~Adium@75-35-173-1.lightspeed.dllstx.sbcglobal.net] has joined #ruby-lang
lake [lake!~lake@li71-228.members.linode.com] has joined #ruby-lang
lake [lake!~lake@li71-228.members.linode.com] has joined #ruby-lang
cartercheng [cartercheng!~carterche@173-11-117-109-SFBA.hfc.comcastbusiness.net] has joined #ruby-lang
<cartercheng>
Hello, I was wondering if I could get some help with something. How is it possible to setup of the ./configure script to compile with an alternate compiler say clang?
lake [lake!~lake@li71-228.members.linode.com] has joined #ruby-lang
<andrewvos>
cartercheng: I assume you can just change the script
<andrewvos>
cartercheng: But I would first have to ask why
<andrewvos>
Wow. If I had known doctest had existed I might not have written docu
<queequeg1>
So it looks like I have to learn cucumber before I can use aruba?
<andrewvos>
queequeg1: Nope
<andrewvos>
queequeg1: Disclaimer: you may be right
<queequeg1>
I'm thinking that there might not be a simple way to test gets inside my prompt function.
<andrewvos>
queequeg1: There is
<andrewvos>
queequeg1: Wait, I misunderstood what you want to do.
<andrewvos>
queequeg1: What does doctest have to do with this/
<queequeg1>
Doctest runs your function in irb and tests the output.
<queequeg1>
But my function asks for input.
<queequeg1>
So right now I can only test the prompt.
<queequeg1>
I mean, I can only test that my function is printing the right string before it asks for input.
<queequeg1>
Ah, I see.
<queequeg1>
gets takes a test file.
<queequeg1>
or can take a test file.
<queequeg1>
That is what I need.
<queequeg1>
I assumed. And that made an ass out of me.
<queequeg1>
So now I will modify my prompt function to accept a second parameter and give that parameter a default nil. If the second parameter is present it will be the test file.
<andrewvos>
queequeg1: Did you just say "test code in production code"?
<queequeg1>
No, I'm just a learner. No such thing as production for me yet.
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
<queequeg1>
I have a basic understanding of ruby, now I want to get a basic understanding of TDD.
mndoci [mndoci!~mndoci@216.9.28.154] has joined #ruby-lang
<andrewvos>
In general, or in Ruby?
<queequeg1>
In Ruby.
Tick-Tock [Tick-Tock!~Tick-Tock@2607:f358:1:fed5:22:0:b683:4295] has joined #ruby-lang
hangingclowns [hangingclowns!~Adium@58.247.100.206] has joined #ruby-lang
twittard [twittard!~twittard@cpe-76-169-74-39.socal.res.rr.com] has joined #ruby-lang
<hangingclowns>
does anyone know if there's a way to hook up so if all tests pass on rspec to build the gem?
<hangingclowns>
or even call a rake task?
<lsegal>
hangingclowns i assume you can use exit codes
<lsegal>
you know, like, rspec spec && gem build mygem.gemspec
neoesque [neoesque!~neoesque@210.59.147.232] has joined #ruby-lang
<hangingclowns>
mmm
<hangingclowns>
something like that?
<lsegal>
the above should work verbatim iirc
<hangingclowns>
lsegal: I'm using guard, and I was thinking as I'm building the gem, I can rebuild it whenever I finished adding a feature so I can pass it to a coworker
<hangingclowns>
but, I see what you're saying
<hangingclowns>
the exit code
me345 [me345!~me345@75.15.180.69] has joined #ruby-lang
<hangingclowns>
another question, anything I can use to make fixtures and/or factory-girl like models I can reuse?
livinded [livinded!~lolwut@pool-108-23-242-132.lsanca.fios.verizon.net] has joined #ruby-lang
cartercheng [cartercheng!~carterche@173-11-117-109-SFBA.hfc.comcastbusiness.net] has joined #ruby-lang
slaytanic [slaytanic!~slaytanic@host226.190-31-167.telecom.net.ar] has joined #ruby-lang
takaokouji [takaokouji!~takaokouj@FLA1Aam052.hrs.mesh.ad.jp] has joined #ruby-lang
<andrewvos>
hangingclowns: If one rake task fails the next rake task will *not* be invoked
ryanf [ryanf!~revfitz@50.0.160.40] has joined #ruby-lang
<andrewvos>
task :default => [:spec, :build]
<andrewvos>
hangingclowns: ^
<queequeg1>
gets only takes a limit and a line separator. No test file. I got my hopes up because I misread the example code.
gnufied1 [gnufied1!~gnufied@122.167.91.153] has joined #ruby-lang
<hangingclowns>
oh
<hangingclowns>
i see
<hangingclowns>
hmm
<hangingclowns>
i'm using guard, though
<hangingclowns>
so I wonder if that can be used to call the build or not?
<andrewvos>
so?
<hangingclowns>
i'm trying to think of how guard works
<hangingclowns>
i think it works by using the binaries and not the rake tasks
<andrewvos>
hangingclowns: You can change that
<andrewvos>
hangingclowns: And I don't know from experience, but I'm pretty sure you can.
<hangingclowns>
yeah, i think I can
<hangingclowns>
i'm just thinking about it in my head
<andrewvos>
hangingclowns: Sounds like you're inventing your own yaks to shave though.
<hangingclowns>
what do you mean?
<andrewvos>
hangingclowns: Well, why would you want to build the gem when rspec succeeds?
Defusal_ [Defusal_!DeFi@196-209-19-202.dynamic.isadsl.co.za] has joined #ruby-lang
Defusal_ [Defusal_!DeFi@unaffiliated/ecnerifed] has joined #ruby-lang
<hangingclowns>
well, what's going on, is when i was buildling this gem, like an idiot, I built it without BDD or even tests
<hangingclowns>
and we're discovering problems later
<hangingclowns>
so now i"m using rspec to test all of the problems after we find them
<andrewvos>
hangingclowns: rewrite?
<hangingclowns>
so building up my BDD during use
<hangingclowns>
just changes, here and there
<hangingclowns>
so all I 'm doing is, writing a test that fails on our production end, and then fixing the gem to make it pass the test, then giving them the updated gem
<andrewvos>
hangingclowns: Ok well, regardless of what you're doing, building the gem after rspec succeeds == slow test runs.
<andrewvos>
hangingclowns: So just build it manually after you commit or whatever
<hangingclowns>
yeah, that's what I'm doing
<hangingclowns>
wanted to include it after it passes
<hangingclowns>
yeah it's "slow" but also requires me to do less
<andrewvos>
Not really
<andrewvos>
"rake build" after writing some code isn't exactly any work
<hangingclowns>
any work?
<hangingclowns>
yeah, but, like I said, I've got guard running in one terminal
<hangingclowns>
so gotta switch terminal, invoke the task by hand
<andrewvos>
hangingclowns: So after a successful build, you send someone a .gem file?
perryh [perryh!~perryh@unaffiliated/perry753] has joined #ruby-lang
<hangingclowns>
kind of
<hangingclowns>
not necesarily, a successful build
<hangingclowns>
it's, I find a problem
<hangingclowns>
or someone else does
<hangingclowns>
i write a test, make the test pass
<hangingclowns>
then rebuild the gem and reissue it to everyone
<andrewvos>
hangingclowns: Why don't you bump the version and release?
<hangingclowns>
wether I bump the version and release, still need to rebuild the gem
<hangingclowns>
you know what I mean?
<hangingclowns>
either way, wanted to know if there was something inside of rspec that can trigger an acction
<hangingclowns>
such as a commit to a repo, a build of the gem, an email to someone
<hangingclowns>
you know what I mean?
<andrewvos>
hangingclowns: Yeah
<andrewvos>
hangingclowns: Just make your own rake task
<hangingclowns>
i ahve that, already
<hangingclowns>
you mean, the thing you just said?
<hangingclowns>
where you order it?
<andrewvos>
yea you could
<andrewvos>
Or does guard try and only execute tests that have changed?
<postmodern>
raggi_, thanks! that got me around the edge-case
<raggi_>
the inverted range trick is interesting, but i've not found a good use for it
<erikh>
maybe I have the dumb; how is that inverted?
<raggi_>
[][0..-2]
<raggi_>
range.end comes before range.begin
<erikh>
oh I have my perl hat on I think
<erikh>
sorry.
<erikh>
-2 in perl is "the second to last element" fwiw
<raggi_>
yes
<raggi_>
the second to last element in a 0 lenght array is, in theoretical indexes, less than the first element
<rippa>
in ruby too
<erikh>
ah, point
srbaker [srbaker!~srbaker@70.28.245.63] has joined #ruby-lang
lake [lake!~lake@li71-228.members.linode.com] has joined #ruby-lang
lake [lake!~lake@li71-228.members.linode.com] has joined #ruby-lang
RORgasm [RORgasm!~rorgasm@pool-71-127-136-103.rcmdva.east.verizon.net] has joined #ruby-lang
gnufied [gnufied!~gnufied@122.167.91.153] has joined #ruby-lang
elux [elux!~peter@67.70.37.175] has joined #ruby-lang
havenn [havenn!~skipper@pool-72-67-31-69.lsanca.fios.verizon.net] has joined #ruby-lang
andrewhl [andrewhl!~andrew@CPE687f7402a2d8-CM00195ed25a2a.cpe.net.cable.rogers.com] has joined #ruby-lang
Oloryn_lt1 [Oloryn_lt1!~Oloryn@strider-laptop.broker.freenet6.net] has joined #ruby-lang
srbaker [srbaker!~srbaker@184.66.82.213] has joined #ruby-lang
<rue>
Hmm
ryanf [ryanf!~revfitz@adsl-71-141-89-169.dsl.snfc21.sbcglobal.net] has joined #ruby-lang
t-mart [t-mart!~t-mart@c-174-49-68-22.hsd1.ga.comcast.net] has joined #ruby-lang
|Vargas| [|Vargas|!~luke@pdpc/supporter/profesional/vargas] has joined #ruby-lang
cartercheng [cartercheng!~carterche@173-11-117-109-SFBA.hfc.comcastbusiness.net] has joined #ruby-lang
Oloryn_lt1 [Oloryn_lt1!~Oloryn@strider-laptop.broker.freenet6.net] has joined #ruby-lang
pinage404 [pinage404!~pinage404@APuteaux-651-1-53-20.w81-249.abo.wanadoo.fr] has joined #ruby-lang
thone_ [thone_!~thone@g230185238.adsl.alicedsl.de] has joined #ruby-lang
<lake>
/join #ubuntu
yango [yango!~yango@85.48.193.157] has joined #ruby-lang
<erikh>
rue: my C is getting better, or so I'm being told
pinage404 [pinage404!~pinage404@APuteaux-651-1-53-20.w81-249.abo.wanadoo.fr] has joined #ruby-lang
solars [solars!~solars@mk089144206030.a1.net] has joined #ruby-lang
pinage404 [pinage404!~pinage404@APuteaux-651-1-53-20.w81-249.abo.wanadoo.fr] has joined #ruby-lang
pinage404 [pinage404!~pinage404@APuteaux-651-1-53-20.w81-249.abo.wanadoo.fr] has quit [#ruby-lang]
shevy [shevy!~shevy@188-23-93-216.adsl.highway.telekom.at] has joined #ruby-lang
saLOUt [saLOUt!~rriemann@91-65-223-29-dynip.superkabel.de] has joined #ruby-lang
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby-lang
gnufied [gnufied!~gnufied@122.167.91.153] has joined #ruby-lang
jredville [jredville!~james@c-66-235-23-17.sea.wa.customer.broadstripe.net] has joined #ruby-lang
Oloryn_lt1 [Oloryn_lt1!~Oloryn@strider-laptop.broker.freenet6.net] has joined #ruby-lang
phaedrix [phaedrix!~phaedrix@c-24-22-86-235.hsd1.or.comcast.net] has joined #ruby-lang
nibbo [nibbo!nibbo@gateway/shell/blinkenshell.org/x-mfzuhcizbfsuzkko] has joined #ruby-lang
srbaker [srbaker!~srbaker@184.66.82.213] has joined #ruby-lang
lsegal [lsegal!jinx@modemcable249.109-177-173.mc.videotron.ca] has joined #ruby-lang
pet_r [pet_r!~petr@85.132.143.21] has joined #ruby-lang
giaohuyen007 [giaohuyen007!~giau-x1@222.253.94.97] has joined #ruby-lang
mytrile [mytrile!~mytrile@77.70.29.148] has joined #ruby-lang
giaohuyen007 [giaohuyen007!~giau-x1@222.253.94.97] has quit [#ruby-lang]
kyrylo [kyrylo!~kyrylo@46.118.222.153] has joined #ruby-lang
chrismcg [chrismcg!~chrismcg@pdpc/supporter/active/chrismcg] has joined #ruby-lang
pet_r [pet_r!~petr@85.132.143.21] has joined #ruby-lang
bjensen [bjensen!~brianj@3007ds3-ar.0.fullrate.dk] has joined #ruby-lang
yxhuvud [yxhuvud!mongo@h-17-181.a149.priv.bahnhof.se] has joined #ruby-lang
jbsan [jbsan!~jbsan@m83-188-244-236.cust.tele2.se] has joined #ruby-lang
Heimidal [Heimidal!~heimidal@c-67-165-197-126.hsd1.co.comcast.net] has joined #ruby-lang
mytrile [mytrile!~mytrile@77.70.29.148] has joined #ruby-lang
banisterfiend [banisterfiend!~baniseter@122.63.231.172] has joined #ruby-lang
bglusman [bglusman!~bglusman@c-68-80-200-61.hsd1.pa.comcast.net] has joined #ruby-lang
robgleeson [robgleeson!~rob@subtle/contributor/robgleeson] has joined #ruby-lang
path[l] [path[l]!~path@115.114.59.182] has joined #ruby-lang
chrismcg_ [chrismcg_!~chrismcg@pdpc/supporter/active/chrismcg] has joined #ruby-lang
fatnic388 [fatnic388!~fatnic388@027c5fd6.bb.sky.com] has joined #ruby-lang
<yakkof>
hello? I'm trying to convert a 64-bit integer to binary with pack("Q")... and read it back with Java on the other end. not getting the same result there. is pack("Q") appropriate here?
<rue>
Could be an endianness problem?
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby-lang
<rue>
You can use Q> for big-endian or Q< for little-endian
<rue>
Also, Q is uint, q is int
<rue>
yakkof: Er, ^
<yakkof>
rue: if I pack("Q"), and unpack("l") I get the same as lsb conversion - 1 on the java side
<yakkof>
have to double check my conversion...
mytrile [mytrile!~mytrile@77.70.29.148] has joined #ruby-lang
toretore [toretore!~toretore@ti0006a380-0261.bb.online.no] has joined #ruby-lang
ltd [ltd!~z@zx.io] has joined #ruby-lang
dous [dous!~dous@unaffiliated/dous] has joined #ruby-lang
tbuehlmann [tbuehlmann!~Tobias@unaffiliated/tovias] has joined #ruby-lang
<rue>
Does the JVM assure 64-bit longs?
<rue>
Ensure
<zvrba>
yes
mytrile [mytrile!~mytrile@77.70.29.148] has joined #ruby-lang
gnufied [gnufied!~gnufied@122.167.229.3] has joined #ruby-lang
mytrile [mytrile!~mytrile@77.70.29.148] has joined #ruby-lang
benanne [benanne!~rijdier@ip-213-49-107-198.dsl.scarlet.be] has joined #ruby-lang
saLOUt [saLOUt!~rriemann@91-65-223-29-dynip.superkabel.de] has joined #ruby-lang
Banistergalaxy [Banistergalaxy!~AndChat@222.153.223.44] has joined #ruby-lang
dous [dous!~dous@unaffiliated/dous] has joined #ruby-lang
dustin__ [dustin__!~ddeyoung@99-7-24-156.lightspeed.iplsin.sbcglobal.net] has joined #ruby-lang
fatnic388 [fatnic388!~fatnic388@027c5fd6.bb.sky.com] has joined #ruby-lang
Dreamer3 [Dreamer3!~Dreamer3@74-134-34-116.dhcp.insightbb.com] has joined #ruby-lang
cartercheng [cartercheng!~carterche@173-11-117-109-SFBA.hfc.comcastbusiness.net] has quit [#ruby-lang]
dr_bob [dr_bob!~dr_bob@p549E7E45.dip.t-dialin.net] has joined #ruby-lang
rippa [rippa!~rippa@109-161-78-129.pppoe.yaroslavl.ru] has joined #ruby-lang
dous [dous!~dous@unaffiliated/dous] has joined #ruby-lang
gnufied [gnufied!~gnufied@122.167.126.245] has joined #ruby-lang
gnufied [gnufied!~gnufied@122.167.126.245] has joined #ruby-lang
gnufied1 [gnufied1!~gnufied@122.178.197.11] has joined #ruby-lang
gnufied [gnufied!~gnufied@122.178.197.11] has joined #ruby-lang
imperator [imperator!~djberg96@c-98-224-203-221.hsd1.mi.comcast.net] has joined #ruby-lang
Manhose [Manhose!~Manhose@bl17-17-151.dsl.telepac.pt] has joined #ruby-lang
beiter [beiter!~beiter@manz-590f0663.pool.mediaWays.net] has joined #ruby-lang
Foxmaster [Foxmaster!~root@c-83-219-199-232.cust.bredband2.com] has joined #ruby-lang
tommyvyo [tommyvyo!~tommyvyo@38.123.129.115] has joined #ruby-lang
lianj [lianj!~lianj@17.145.34.193.static.giga-dns.com] has joined #ruby-lang
lianj [lianj!~lianj@subtle/user/lianj] has joined #ruby-lang
bjensen [bjensen!~brianj@3007ds3-ar.0.fullrate.dk] has joined #ruby-lang
petercooper [petercooper!~petercoop@82.144.254.2] has joined #ruby-lang
kain [kain!~kain@151.64.211.61] has joined #ruby-lang
ezkl [ezkl!ezkl@ezkl.net] has joined #ruby-lang
yfeldblum [yfeldblum!~Jay@pool-71-246-76-76.bltmmd.east.verizon.net] has joined #ruby-lang
RickHull [RickHull!~rhull@pool-96-246-22-58.nycmny.fios.verizon.net] has joined #ruby-lang
RickHull [RickHull!~rhull@pdpc/supporter/active/rickhull] has joined #ruby-lang
sodani [sodani!~cmiso@user-387hpcb.cable.mindspring.com] has joined #ruby-lang
sandelius [sandelius!~textual@90-231-202-62-no214.tbcn.telia.com] has joined #ruby-lang
Sailias [Sailias!~jonathan@CPE0018f85e576d-CM001bd7aaaf96.cpe.net.cable.rogers.com] has joined #ruby-lang
tomzx [tomzx!~tomzx@dsl-132-26.aei.ca] has joined #ruby-lang
enebo [enebo!~enebo@75-168-44-241.mpls.qwest.net] has joined #ruby-lang
terrence [terrence!~terrence@112.254.75.76] has joined #ruby-lang
sodani [sodani!~cmiso@user-387hpcb.cable.mindspring.com] has quit [#ruby-lang]
<terrence>
hi
<rue>
HI THERE
<shevy>
DIE THERE
confounds [confounds!~confounds@CPE78cd8e667600-CM78cd8e6675fd.cpe.net.cable.rogers.com] has joined #ruby-lang
Manhose_ [Manhose_!~Manhose@bl17-17-151.dsl.telepac.pt] has joined #ruby-lang
Manhose__ [Manhose__!~Manhose@bl17-17-151.dsl.telepac.pt] has joined #ruby-lang
<rue>
Why so hostile?
<shevy>
rue because I can!
<rue>
N-uh
Marco [Marco!~marco@c-98-254-52-240.hsd1.fl.comcast.net] has joined #ruby-lang
<zzak>
roooooo
<kalleth>
ruh roh roo?
<rue>
Zazzles?
rayners [rayners!~rayners@pool-141-157-43-32.balt.east.verizon.net] has joined #ruby-lang
RickHull [RickHull!~rhull@pool-96-246-22-58.nycmny.fios.verizon.net] has joined #ruby-lang
terrence [terrence!~terrence@112.254.75.76] has joined #ruby-lang
chrismcg [chrismcg!~chrismcg@pdpc/supporter/active/chrismcg] has joined #ruby-lang
RickHull [RickHull!~rhull@pool-96-246-22-58.nycmny.fios.verizon.net] has joined #ruby-lang
<dr0id>
row
andrewhl [andrewhl!~andrew@CPE687f7402a2d8-CM00195ed25a2a.cpe.net.cable.rogers.com] has joined #ruby-lang
RickHull [RickHull!~rhull@pool-96-246-22-58.nycmny.fios.verizon.net] has joined #ruby-lang
rayners [rayners!~rayners@pool-141-157-43-32.balt.east.verizon.net] has joined #ruby-lang
RickHull [RickHull!~rhull@209.119.14.25] has joined #ruby-lang
RickHull [RickHull!~rhull@pdpc/supporter/active/rickhull] has joined #ruby-lang
Jake232 [Jake232!~textual@5e04eaa6.bb.sky.com] has joined #ruby-lang
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
bglusman [bglusman!~bglusman@c-68-80-200-61.hsd1.pa.comcast.net] has joined #ruby-lang
goshakkk [goshakkk!~goshakkk@46.28.101.224] has joined #ruby-lang
<Harzilein>
it's not exactly orthogonal, don't you think?
<robgleeson>
goshakkk: Hmmm, I'm not sure.
<heftig>
Harzilein: what do you mean?
<robgleeson>
it seems okay
<heftig>
something similar used to work in ruby 1.8, but only in blocks, not methods
<heftig>
it got removed in 1.9
<goshakkk>
well, I'm talking about objects initializers. it would really save some time/LOC I think. On object initialization often all the params just go to instance vars w/o any modification
<robgleeson>
goshakkk: not a whole lot of time, though
<robgleeson>
you're talking seconds :)
<robgleeson>
benefits are small, and im not sure if i like the syntax a lot
takaokouji [takaokouji!~takaokouj@FLA1Aam052.hrs.mesh.ad.jp] has joined #ruby-lang
<robgleeson>
I can't seem to find any replies to the thread
<petercooper>
matz concluded..
<petercooper>
<< I personally feel like that method paremeters are names to the values passed, not hidden assignment, regardless of how implementation works. >>
<petercooper>
and that was that
<goshakkk>
petercooper: oh interesting.
<petercooper>
if you ever hit a direct link on the ruby-talk archives, click the "_|_" link at the top to get a tree
<robgleeson>
oh nice, thanks =)
<petercooper>
Personally, I quite like the idea, but, well, matz :)
<petercooper>
I don't see the harm in it being batted around again though since that's what Ruby 2.0 is mostly about and it doesn't break backwards compatibility from my POV.
<robgleeson>
I don't. I feel it makes the meaning of method arguments ambiguous.
<robgleeson>
(plus it's ugly.)
<robgleeson>
I agree ^
<robgleeson>
its ugly in that form
<robgleeson>
IMO
<petercooper>
Maybe it's the wrong approach but I tend to look at what other languages are doing when presented with something like that.
<petercooper>
And I think Python and Java, at least, do it much like Ruby does it now.
<robgleeson>
its definitely a nice-to-have if anything, though
<robgleeson>
i don't see it as that important to DRY up something like that
<petercooper>
I'd prefer it to some sort of ActiveSupport "AwesomeClass" metaprogramming bastardized solution though ;-)
<petercooper>
(unless it were in the stdlib)
<robgleeson>
not sure how AS would do that, they'd need to hook into the parser and assign everything to nil in the arg list
<robgleeson>
seems Ruby even got guard against it: "SyntaxError: (irb):8: formal argument cannot be an instance variable"
<RickHull>
it seems "hacky" to me. inconsistent and inexplicable in terms of ruby's basic behavior
<petercooper>
That doesn't bother me quite so much given a lot of Ruby's existing bizarreness
<petercooper>
but maybe that's the broken window theory coming into play :-)
<RickHull>
heh
jthomas__ [jthomas__!~jthomas@c-98-222-28-137.hsd1.il.comcast.net] has joined #ruby-lang
<Harzilein>
heftig: what i mean with lack of orthogonality is that when you see initialize work that way, you expect it would become a replacement to attr_writer
<Harzilein>
for*
<Harzilein>
(and if you would go that way that would certainly be ugly)
<Harzilein>
s/would/would also/
<Harzilein>
so you'd write class Me def age(@age) ; end end
<Harzilein>
uhm
<Harzilein>
i mean
<Harzilein>
so you'd write class Me def age=(@age) ; end end
<shevy>
what is age= doing on its inside
<petercooper>
Another issue is that passing in a big bundle o attributes in some specific order is a little unattractive too.
<Harzilein>
that's part of the uglyness, it would imply the result of
<Harzilein>
class Me def age=(age) ; @age = age ; end end
<petercooper>
Although I guess at least it would sit OK with named parameters..
gnufied [gnufied!~gnufied@122.178.197.11] has joined #ruby-lang
skinnymuch [skinnymuch!~skinnymuc@static-173-61-113-6.cmdnnj.fios.verizon.net] has joined #ruby-lang
<robgleeson>
It could get really weird with named arguments.
<robgleeson>
Foo.new bar: @bar ?
<shevy>
smalltalk!
<petercooper>
on the receiving end ;-)
<erikh>
not enough punctuation
<erikh>
@+bar
<RickHull>
doubleplus ungood
<erikh>
yes
<erikh>
I think you could do this pretty trivially with a small dsl-like method
<erikh>
auto_attr :setter, [:one, :two, :three]
<erikh>
or something.
<erikh>
without changing the language structure
<erikh>
I guess what my complaint is, @foo changes context between the class definition and the method definition -- which one is it for def foo(@bar) and def self.foo(@bar), is it different and how so?
<erikh>
also, is it obvious? I'm not sure.
<erikh>
it could get more fun with default variables.
<erikh>
.. and by fun I mean "confusing"
<robgleeson>
and to gain so little as well...
jarrod__ [jarrod__!~jarrod@rrcs-24-153-217-133.sw.biz.rr.com] has joined #ruby-lang
Oloryn_lt1 [Oloryn_lt1!~Oloryn@strider-laptop.broker.freenet6.net] has joined #ruby-lang
havenn [havenn!~skipper@pool-72-67-31-69.lsanca.fios.verizon.net] has joined #ruby-lang
path[l] [path[l]!~path@115.114.59.182] has quit [#ruby-lang]
voker57 [voker57!~voker57@128-70-103-103.broadband.corbina.ru] has joined #ruby-lang
voker57 [voker57!~voker57@kvirc/developer/Voker57] has joined #ruby-lang
jarrod__ [jarrod__!~jarrod@rrcs-24-153-217-133.sw.biz.rr.com] has joined #ruby-lang
bjensen [bjensen!~brianj@3007ds3-ar.0.fullrate.dk] has joined #ruby-lang
bglusman [bglusman!~bglusman@c-68-80-200-61.hsd1.pa.comcast.net] has joined #ruby-lang
darkf [darkf!~darkf_dix@unaffiliated/darkf] has joined #ruby-lang
Jay_Levitt [Jay_Levitt!~Jay_Levit@home.jay.fm] has joined #ruby-lang
<Jay_Levitt>
Is there a way to do something like "next 2" in a loop, to end the current iteration and skip the next one, too?
JoelMcCracken [JoelMcCracken!~user@c-71-60-19-216.hsd1.pa.comcast.net] has joined #ruby-lang
<injekt>
Jay_Levitt: why would you want that?
<Jay_Levitt>
injekt: Probably because I'm thinking about something the wrong way ☺ I want to write a wrapper for ssh that (a) actually ssh's through a gateway and then does the original ssh, and (b) rewrites the hostname to add our site domain name (as if it were in the DNS search path)
<Jay_Levitt>
So.. how do I figure out which ssh argument is the hostname? I decided it's the first string that isn't an option itself, and that isn't the parameter value for an option (e.g. "-f filename").
<injekt>
Jay_Levitt: im confused you're telling me too much at once ;) simplify your problem
<Jay_Levitt>
yeah.. lemme gist it
<injekt>
Jay_Levitt: also, use an option parser if you're.. parsing options
<injekt>
there's this cool gem i heard of
<Jay_Levitt>
no way
<injekt>
called slop, which is pretty awesome
<Jay_Levitt>
I hear it doesn't handle completions at ALL
<injekt>
oh
<injekt>
OH SIR
<injekt>
it is you!
<injekt>
haha
<Jay_Levitt>
:)
<injekt>
nice issue btw
<injekt>
thumbs up
<Jay_Levitt>
Yeah, I thought about slop but do I really want to specify each ssh option in the wrapper?
<injekt>
heh
<injekt>
you can use slops auto complete feature
<injekt>
if you dont want to write them
<injekt>
anyway I'm getting ahead of it
<injekt>
er auto create feature*
<Jay_Levitt>
well, so essentially, the tool is "gwssh". If invoked like "gwssh -p 22 db.production -A", I want it to actually execute "ssh -t gate.tiptap.com 'ssh -p 22 db.production.tiptap.com -A'"
benanne [benanne!~rijdier@ip-213-49-107-198.dsl.scarlet.be] has joined #ruby-lang
zzak [zzak!~zzak@ec2-107-20-68-16.compute-1.amazonaws.com] has joined #ruby-lang
andrewhl [andrewhl!~andrew@66.78.101.2] has joined #ruby-lang
<rue>
Is anyone using **-args?
<jarib>
**-args?
<injekt>
rue: na
spuk [spuk!~spuk@186.222.1.205] has joined #ruby-lang
<Jay_Levitt>
ah, back to indexes! yeah, that still looks cleaner, thanks
Jake232 [Jake232!~textual@5e04eaa6.bb.sky.com] has joined #ruby-lang
<Jay_Levitt>
injekt: _ is just "I don't care about this block argument, call it underscore for all I care"?
<injekt>
Jay_Levitt: yeah, and it stops warnings in 1.9.3
<injekt>
unused variable warnings
<rippa>
* works too
<injekt>
they do different things
<injekt>
but in that situation (my code) yeah they'll work the same
<Jay_Levitt>
speaking of, is there a way to get ruby to output all warnings -except- unused variable?
<injekt>
* is greedy
<injekt>
Jay_Levitt: why would you want that? :P
<Jay_Levitt>
SublimeLinter
<Jay_Levitt>
I know it's unused! I just typed it in!
<Jay_Levitt>
I'm getting to it!
<injekt>
do you run with warnings on then?
<Jay_Levitt>
well, thinking about turning that off, but some warnings are awful handy
<injekt>
:)
<Jay_Levitt>
especially (the new?) mismatched indentation on end
<injekt>
no idea my editor doesn't let me mismatch indentation
<Jay_Levitt>
I might have to learn enough Python to exclude arbitrary regexes from the linter output, but that's another project
<Jay_Levitt>
What editor?
<injekt>
vim
<Jay_Levitt>
Ah :)
nofxx [nofxx!~nofxx@unaffiliated/nofxx] has joined #ruby-lang
pet_r [pet_r!~petr@85.132.143.21] has joined #ruby-lang
workmad3 [workmad3!~workmad3@host-84-13-69-129.opaltelecom.net] has joined #ruby-lang
Weems [Weems!~frodo@unaffiliated/weems] has joined #ruby-lang
<rue>
Veeeeeeeeemmm
workmad3 [workmad3!~workmad3@host-84-13-69-129.opaltelecom.net] has joined #ruby-lang
<shevy>
how much % percent of code worldwide is written in vim?
<rippa>
percent percent
<shevy>
hmm going to ask in #vim
<manveru>
lol
<injekt>
funny, when I google 'code editor usage' the first hit is a vim website
<manveru>
that's like asking americans who invented the telephone :)
<injekt>
hehe
igotnolegs [igotnolegs!~igotnoleg@75-162-83-166.slkc.qwest.net] has joined #ruby-lang
<injekt>
yeah, ask in #emacs after
<shevy>
yeah
<rue>
Realistically, it's like 0.5%
<shevy>
I think I got some pretty solid numbers by now
<rue>
Because we all write nice, concise programs. Some douchebag using Eclipse probably produces 5x the amount of code.
<shevy>
vim:
<shevy>
ddv> I think about 23.4923923%
<shevy>
emacs:
<shevy>
<mavr> shevy, 100%
<shevy>
<mavr> shevy, code written not in emacs is not a real code
<rue>
Well, 15x if you include the XML
<shevy>
hehe
<Jake232>
How can I check, what fields a database table has
<Jake232>
eg: can I go user.fields
<Jake232>
or something?
<Jake232>
wrong chat, meant for rails
tbuehlmann [tbuehlmann!~Tobias@unaffiliated/tovias] has joined #ruby-lang
<hagabaka>
Jake232, could also use ARGV.each_cons(2).reject {|arg, _| arg[0,1] == '-' && OPTIONS_WITH_ARGUMENTS.include?(arg[1,1])}.map(&:first)
<Jake232>
hagabaka: o.O
<manveru>
wut?
<hagabaka>
oops
<injekt>
no
<injekt>
:P
<hagabaka>
Jay_Levitt
<Jake232>
haha
andrewhl [andrewhl!~andrew@66.78.101.2] has joined #ruby-lang
<Jay_Levitt>
that hurts!
<Jay_Levitt>
and man, I missed an emacs debate.
<Jay_Levitt>
MY first editor was called "emacs", but it was not emacs. It was a thing that was shaped vaguely LIKE emacs, and the only macros it had were keystroke-playback.
<hagabaka>
hmm maybe not
ascarter [ascarter!~ascarter@209.119.253.66] has joined #ruby-lang
<shevy>
back to the roots wasn't that Jay_Levitt
<Jay_Levitt>
So I wrote a CRM app that used the screen as a buffer and made self-modifying macros.
<Jay_Levitt>
So nyah.
<shevy>
self modifying ruby code
<shevy>
now that would be neat
<shevy>
objects that evolve on their own
<Jay_Levitt>
Isn't that just called "ruby"?
<manveru>
indeed
RickHull1 [RickHull1!~rhull@209.119.14.25] has joined #ruby-lang
havenn [havenn!~skipper@pool-71-189-193-157.lsanca.fios.verizon.net] has joined #ruby-lang
RickHull1 [RickHull1!~rhull@209.119.14.25] has quit [#ruby-lang]
<Jay_Levitt>
Is there really nothing like Array#sub or Enumerable#sub? I really have to do a.map{|i| i == old_value ? new_value : i }
<Jay_Levitt>
I feel like I'm forgetting something basic
<manveru>
?
<rue>
What would #sub do?
<andrewvos>
WWSD
<Jay_Levitt>
:)
<rue>
How would it know? array.sub old, new or something?