<zenspider>
yes, either during install with gem i -i <dir>, or by `export GEM_HOME=<dir>`
<Steve_Jobs>
zenspider: but I'd like to do it only for a couple of specific ones
<zenspider>
don't tack on requirements after the fact
<zenspider>
ask your actual question, up front
<zenspider>
we're not mind readers here
amsi has quit [Quit: Leaving]
<Steve_Jobs>
zenspider: thanks for the attitude, I'm new to ruby so phrasing my questions to your liking is going to take practice
migbar has quit [Ping timeout: 246 seconds]
tdy has joined #ruby-lang
SuMo_D has joined #ruby-lang
|jemc| has quit [Ping timeout: 244 seconds]
dm78 has joined #ruby-lang
dm78 has quit [Client Quit]
<zenspider>
I don't see what ruby has to do with this. this is simply asking good questions in general.
dagda1 has quit [Ping timeout: 245 seconds]
sdmx_ has joined #ruby-lang
chouhoulis has joined #ruby-lang
dagda1 has joined #ruby-lang
<sdmx_>
Is there a better channel for new learners of ruby asking likely dumb questions? I have a question about the map method and type conversion that is likely very basic
red_menace has joined #ruby-lang
chills42 has joined #ruby-lang
<zenspider>
sdmx_: go for it
bruno- has joined #ruby-lang
<sdmx_>
zenspider: I'm trying to iterate through array of strings and convert them to integers, but array.map { |a| a.to_i} isn't doing what I expect. I literally have to do something like sum=adds[0].to_i+adds[1].to_i to get it to sum right.
<sdmx_>
On ruby 1.8.7, by the way. I know 1.9 and over handled it differently.
symm- has quit [Ping timeout: 245 seconds]
<zenspider>
map returns a new collection
<zenspider>
nums = array.map { ... }
<zenspider>
and if you want to sum as well as convert, you can either use each, and just do this with an external sum variable
<zenspider>
or you can use inject
konr has joined #ruby-lang
<zenspider>
(which I don't like, but in this case is appropriate)
wallerdev has quit [Quit: wallerdev]
bruno- has quit [Ping timeout: 250 seconds]
<sdmx_>
Alright, let me look at both map and inject and try to work out why the former doesn't work the way I think. I did try the each method and that still gave me a nil to int error.
centrx has quit [Ping timeout: 246 seconds]
<sdmx_>
Trying to do as much due diligence as I can here. =]
diegoviola has joined #ruby-lang
mistym has quit [Remote host closed the connection]
<zenspider>
sdmx_: nil to int error means the contents of your collection contains non-strings.
<zenspider>
assuming I read that correctly
<sdmx_>
It does, you're right. So this needs to be a multiple step process then? Replace the nil sections of the array with an empty string so that they can be converted to 0 integers?
<ammar>
sdmx_: been a while since I used 1.8.7, but try: array.compact.inject(:+)
<sdmx_>
Thanks, ammar. Compact is a good method here. I got thrown off thinking that the index needed to be correctly preserved with the zeros in place, but that's not really the case. Out of curiosity, how would that be different in 1.9? I'm not using 1.8.7 for any reason other than whats currently on my vagrant box.
<zenspider>
sdmx_: you can compact, or if you're doing each `next unless s`
<zenspider>
sdmx_: there'd be no diff on 1.9 for this
mjc_ has quit [Ping timeout: 260 seconds]
SkramX_ has quit [Ping timeout: 260 seconds]
moogumbo has quit [Ping timeout: 260 seconds]
paulog__ has quit [Ping timeout: 272 seconds]
mattyohe has quit [Ping timeout: 272 seconds]
shennyg__ has quit [Ping timeout: 260 seconds]
eristic has quit [Ping timeout: 260 seconds]
lacrosse__ has quit [Ping timeout: 260 seconds]
Shoffner____ has quit [Ping timeout: 272 seconds]
ggherdov___ has quit [Ping timeout: 272 seconds]
koos303 has quit [Ping timeout: 260 seconds]
rickruby has quit [Ping timeout: 260 seconds]
lewix has joined #ruby-lang
th2389_____ has quit [Ping timeout: 272 seconds]
benlakey has quit [Ping timeout: 272 seconds]
strmpnk has quit [Ping timeout: 272 seconds]
Guest85414______ has quit [Ping timeout: 260 seconds]
ta has quit [Read error: Connection reset by peer]
ta___ has joined #ruby-lang
yfeldblum has joined #ruby-lang
DEac-_ has joined #ruby-lang
DEac- has quit [Read error: Connection reset by peer]
yfeldblum has quit [Ping timeout: 240 seconds]
ledestin_ has joined #ruby-lang
snsei has joined #ruby-lang
ledestin has quit [Ping timeout: 260 seconds]
ledestin_ is now known as ledestin
ikrima has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Remote host closed the connection]
apeiros has joined #ruby-lang
charliesome has quit [Quit: zzz]
ffmegaman has joined #ruby-lang
hahuang65 has quit [Ping timeout: 272 seconds]
migbar has joined #ruby-lang
mistym has joined #ruby-lang
tkuchiki has joined #ruby-lang
migbar has quit [Ping timeout: 260 seconds]
smoitra has joined #ruby-lang
tkuchiki has quit [Ping timeout: 272 seconds]
<smoitra>
Hi I am smoitra . I am new to ruby language but what the little I have learnt I love this language but I am still learning
<ffmegaman>
Hi smoitra, I'm learning ruby every day too and I'm loving it.
<smoitra>
ffmegaman, which book or website are you using
<ffmegaman>
I liked The Well Grounded Rubyist by David A Black... Really helped me a lot
tectonic has quit []
<ffmegaman>
what are you using smoitra?
<smoitra>
ffmegaman, I have started my journey from rails therefore studied quite a bit of M Hartl's book and for basic understanding of ruby I used rubymonks.com
<ffmegaman>
M Hartl's book is great! I used that too
Phrogz_ is now known as Phrogz
<smoitra>
I am interested in doing any projects also in ruby if someone can help me find one
centrx has joined #ruby-lang
shinnya has joined #ruby-lang
snoopybbt has quit [Ping timeout: 245 seconds]
symm- has quit [Ping timeout: 258 seconds]
yfeldblum has joined #ruby-lang
yfeldblum has quit [Ping timeout: 250 seconds]
lewix has quit [Remote host closed the connection]
migbar has joined #ruby-lang
houhoulis has joined #ruby-lang
seamon has joined #ruby-lang
smoitra has quit [Quit: bye]
tectonic has joined #ruby-lang
snoopybbt has joined #ruby-lang
yfeldblum has joined #ruby-lang
bsvineeth has joined #ruby-lang
Phrogz has quit []
migbar has quit [Remote host closed the connection]
migbar has joined #ruby-lang
relix has joined #ruby-lang
kgrz has quit [Remote host closed the connection]
seamon has quit [Quit: Bye]
seamon has joined #ruby-lang
bsvineeth has quit [Ping timeout: 245 seconds]
snoopybbt has quit [Ping timeout: 245 seconds]
seamon has quit [Client Quit]
seamon has joined #ruby-lang
skammer1 has joined #ruby-lang
mistym has quit [Remote host closed the connection]
migbar has quit [Ping timeout: 272 seconds]
seamon has quit [Client Quit]
seamon has joined #ruby-lang
seamon has quit [Client Quit]
seamon has joined #ruby-lang
seamon has quit [Client Quit]
seamon has joined #ruby-lang
seamon has quit [Client Quit]
seamon has joined #ruby-lang
seamon has quit [Client Quit]
seamon has joined #ruby-lang
seamon has quit [Client Quit]
seamon has joined #ruby-lang
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Paul_McFreely has joined #ruby-lang
emmesswhy has quit [Quit: This computer has gone to sleep]
_ht has quit [Remote host closed the connection]
kgrz has joined #ruby-lang
kgrz has quit [Remote host closed the connection]
lsegal has joined #ruby-lang
Cakey has joined #ruby-lang
t_ has quit [Ping timeout: 246 seconds]
arBmind1 has joined #ruby-lang
shennyg___ has joined #ruby-lang
x0f_ has joined #ruby-lang
ffmegaman has quit [Remote host closed the connection]
pabs_ has joined #ruby-lang
ffmegaman has joined #ruby-lang
brianpWins has joined #ruby-lang
shennyg__ has quit [Ping timeout: 260 seconds]
pipework has quit [Ping timeout: 260 seconds]
Caius has quit [Ping timeout: 260 seconds]
pabs has quit [Ping timeout: 260 seconds]
x0f has quit [Ping timeout: 260 seconds]
arBmind has quit [Ping timeout: 260 seconds]
tpope has quit [Ping timeout: 260 seconds]
Caius has joined #ruby-lang
vladgh has quit [Ping timeout: 260 seconds]
coffeejunk has quit [Ping timeout: 260 seconds]
Caius has quit [Changing host]
Caius has joined #ruby-lang
vladgh has joined #ruby-lang
Cakey has quit [Ping timeout: 245 seconds]
Paul_McFreely_ has joined #ruby-lang
lewix has joined #ruby-lang
ngw_ has joined #ruby-lang
pipework has joined #ruby-lang
pipework has quit [Changing host]
pipework has joined #ruby-lang
kith_ has joined #ruby-lang
t_ has joined #ruby-lang
jdecuirm_ has quit [Ping timeout: 244 seconds]
konr_ has joined #ruby-lang
hagebake has joined #ruby-lang
arooni-mobile has joined #ruby-lang
lewix has quit [Remote host closed the connection]
valeri_uF0 has joined #ruby-lang
ffmegaman has quit [Ping timeout: 258 seconds]
chris2_ has joined #ruby-lang
ozzloy_ has joined #ruby-lang
jxport_ has joined #ruby-lang
shaman42_ has joined #ruby-lang
maloik has joined #ruby-lang
neurodam1ge has joined #ruby-lang
bnagy_ has joined #ruby-lang
tpope has joined #ruby-lang
dr_tobog1an has joined #ruby-lang
shaman42 has quit [Write error: Connection reset by peer]
bnagy has quit [Write error: Connection reset by peer]
valeri_ufo has quit [Write error: Connection reset by peer]
maloik_ has quit [Write error: Broken pipe]
jxport has quit [Write error: Connection reset by peer]
neurodamage has quit [Write error: Connection reset by peer]
hagabaka has quit [Write error: Connection reset by peer]
chris2 has quit [Write error: Broken pipe]
ozzloy has quit [Write error: Broken pipe]
whitequark has quit [Read error: Connection reset by peer]
Gate has quit [Read error: Connection reset by peer]
valeri_uF0 is now known as valeri_ufo
womble has quit [Excess Flood]
whitequark has joined #ruby-lang
womble has joined #ruby-lang
Gate has joined #ruby-lang
Gate has quit [Changing host]
Gate has joined #ruby-lang
nofxx has quit [Ping timeout: 272 seconds]
Paul_McFreely has quit [Ping timeout: 268 seconds]
konr has quit [Ping timeout: 268 seconds]
Hanmac has quit [Ping timeout: 268 seconds]
konr_ is now known as konr
Hanmac has joined #ruby-lang
ngw has quit [Ping timeout: 272 seconds]
xvqq17 has quit [Ping timeout: 272 seconds]
dr_toboggan has quit [Ping timeout: 272 seconds]
kith has quit [Ping timeout: 272 seconds]
xvqq17 has joined #ruby-lang
ffmegaman has joined #ruby-lang
t_ has quit [Read error: Connection reset by peer]
jdecuirm_ has joined #ruby-lang
seamon has quit [Quit: Zzzzzzz]
jgpawletko has joined #ruby-lang
t_ has joined #ruby-lang
kgrz has joined #ruby-lang
tylersmith has quit [Remote host closed the connection]
lewix has joined #ruby-lang
pabs_ is now known as pabs
nofxx has joined #ruby-lang
nofxx has joined #ruby-lang
nofxx has quit [Changing host]
nofxx has quit [Read error: Connection reset by peer]
oleo has quit [Ping timeout: 272 seconds]
kgrz has quit [Ping timeout: 258 seconds]
oleo has joined #ruby-lang
coffeejunk has joined #ruby-lang
tkuchiki has joined #ruby-lang
DEac-_ has quit [Quit: leaving]
tkuchiki has quit [Ping timeout: 250 seconds]
tectonic has quit []
DEac- has joined #ruby-lang
seamon has joined #ruby-lang
DEac- has quit [Client Quit]
DEac- has joined #ruby-lang
sMecKs has joined #ruby-lang
justinmburrous has joined #ruby-lang
tylersmith has joined #ruby-lang
tylersmith has quit [Ping timeout: 240 seconds]
bin7me has quit [Quit: Leaving]
sMecKs_ has joined #ruby-lang
sMecKs has quit [Ping timeout: 272 seconds]
arooni-mobile has quit [Ping timeout: 272 seconds]
dr_tobog1an is now known as dr_toboggan
GBrawl has joined #ruby-lang
GBrawl has quit [Client Quit]
dagda1 has quit [Ping timeout: 272 seconds]
dagda1 has joined #ruby-lang
tylersmith has joined #ruby-lang
lacrosse__ has joined #ruby-lang
tylersmith has quit [Ping timeout: 245 seconds]
syva has joined #ruby-lang
tectonic has joined #ruby-lang
skammer2 has joined #ruby-lang
elia has joined #ruby-lang
skammer1 has quit [Ping timeout: 250 seconds]
nofxx has joined #ruby-lang
nofxx has joined #ruby-lang
havenwood has joined #ruby-lang
arooni-mobile has joined #ruby-lang
dorei has quit []
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
banister has joined #ruby-lang
seamon has quit [Quit: Zzzzzzz]
shinnya has quit [Ping timeout: 258 seconds]
shinnya has joined #ruby-lang
lewix has quit [Remote host closed the connection]
tylersmith has joined #ruby-lang
sarkyniin has quit [Ping timeout: 246 seconds]
tylersmith has quit [Ping timeout: 272 seconds]
seamon has joined #ruby-lang
banister is now known as banisterfiend
elia has quit [Quit: Computer has gone to sleep.]
tkuchiki has joined #ruby-lang
arooni-mobile has quit [Ping timeout: 246 seconds]
centrx has quit [Read error: Connection reset by peer]
kith_ is now known as kith
tkuchiki has quit [Ping timeout: 260 seconds]
apeiros has quit [Remote host closed the connection]
seamon has quit [Quit: Zzzzzzz]
apeiros has joined #ruby-lang
tylersmith has joined #ruby-lang
tectonic_ has joined #ruby-lang
AKASkip has quit [Ping timeout: 260 seconds]
tectonic has quit [Ping timeout: 245 seconds]
Forgetful_Lion has joined #ruby-lang
arooni-mobile has joined #ruby-lang
tylersmith has quit [Ping timeout: 258 seconds]
seamon has joined #ruby-lang
tectonic_ has quit []
tectonic has joined #ruby-lang
chris2_ is now known as chris2
lewix has joined #ruby-lang
tectonic has quit [Ping timeout: 246 seconds]
tectonic has joined #ruby-lang
arooni-mobile has quit [Ping timeout: 260 seconds]
zenojis has quit [Ping timeout: 260 seconds]
hagebake has quit [Ping timeout: 245 seconds]
marr has quit [Ping timeout: 245 seconds]
zenojis has joined #ruby-lang
hagabaka has joined #ruby-lang
justinmburrous has quit [Remote host closed the connection]