jhass changed the topic of #ruby to: Rules & more: https://ruby-community.com || Ruby 2.3.1; 2.2.5; 2.1.9: https://ruby-lang.org || Paste >3 lines of text on https://gist.github.com || logs @ http://irclog.whitequark.org/ruby/
zarubin has quit [Quit: leaving]
shmuli has joined #ruby
Gasher has quit [Quit: Leaving]
kyleolivo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
flashpoint9 has joined #ruby
kyleolivo has joined #ruby
kyleolivo has quit [Client Quit]
RegulationD has quit [Ping timeout: 260 seconds]
ddffg has quit [Quit: Leaving]
ICantCook has joined #ruby
shmuli has quit [Ping timeout: 260 seconds]
jaguarmagenta has joined #ruby
the_rhizo has joined #ruby
LebedevRI has quit [Quit: LebedevRI]
<baweaver> Lambda shorthand syntax
<baweaver> xpitr
tubuliferous has joined #ruby
jaguarmagenta has quit [Ping timeout: 260 seconds]
TheWhip has joined #ruby
adeleon has quit [Read error: Connection reset by peer]
A_Drone has joined #ruby
adeleon has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
LoneHermit has joined #ruby
xlegoman has joined #ruby
swills_ has joined #ruby
<adeleon> hellp
<adeleon> hello
nerium has quit [Quit: nerium]
adeleon has quit [Quit: Leaving]
LoneHermit has quit [Ping timeout: 244 seconds]
titusx has quit [Quit: Leaving...]
Pupeno has quit [Remote host closed the connection]
nertzy has joined #ruby
hahuang61 has joined #ruby
TheWhip has quit [Remote host closed the connection]
SteenJobs has joined #ruby
SteenJobs has quit [Client Quit]
dminuoso has joined #ruby
davedev24 has quit []
djbkd has quit [Quit: My people need me...]
johnmilton has joined #ruby
<ardian_> dminuoso: thanks for your suggestion on Hash#keys, but what if it's a mixed hash that has another hash inside, the only solution I see is iterating over the elements
shazaum__ has quit [Quit: Leaving]
flashpoint9 has quit [Remote host closed the connection]
flashpoint9 has joined #ruby
hahuang61 has quit [Ping timeout: 260 seconds]
dminuoso has quit [Ping timeout: 244 seconds]
byteflame has joined #ruby
AndChat347529 has joined #ruby
JeanCarloMachado has quit [Ping timeout: 252 seconds]
Pupeno has joined #ruby
AndChat347529 has quit [Quit: Bye]
flashpoint9 has quit [Ping timeout: 250 seconds]
AndChat347529 has joined #ruby
flashpoint9 has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
TheWhip has joined #ruby
flashpoint9 has joined #ruby
astrobunny has quit [Read error: Connection reset by peer]
AndChat347529 has quit [Client Quit]
astrobunny has joined #ruby
bkxd has joined #ruby
nadir has quit [Ping timeout: 250 seconds]
shinnya has quit [Ping timeout: 258 seconds]
TheWhip has quit [Ping timeout: 240 seconds]
flashpoint9 has quit [Ping timeout: 264 seconds]
Madplatypus has joined #ruby
nertzy has quit [Ping timeout: 258 seconds]
kyleolivo has joined #ruby
jenrzzz has joined #ruby
nadir has joined #ruby
tejasmanohar has quit [Quit: tejasmanohar]
rajdesai has joined #ruby
jgt has joined #ruby
<roflmyeggo> why do we _need_ to use accessor methods to access instance variables OR use instance_get_variable?
<roflmyeggo> why doesnt ruby allow access via Class.@variable?
tejasmanohar has joined #ruby
sarbs has quit [Max SendQ exceeded]
sarbs has joined #ruby
<roflmyeggo> especially since there is no notion of private in ruby
<roflmyeggo> is it just to force good principles ?
cyphase has quit [Ping timeout: 244 seconds]
rajdesai has quit [Ping timeout: 250 seconds]
matt3 has joined #ruby
johnmilton has quit [Ping timeout: 240 seconds]
hipertracker has quit [Quit: hipertracker]
cyphase has joined #ruby
xaxisx has quit [Ping timeout: 258 seconds]
Bugboy1028 has quit [Remote host closed the connection]
bkxd has quit [Ping timeout: 265 seconds]
matt3 has quit [Ping timeout: 252 seconds]
RegulationD has joined #ruby
shmuli has joined #ruby
RegulationD has quit [Read error: Connection reset by peer]
RegulationD has joined #ruby
RegulationD has quit [Read error: Connection reset by peer]
grenierm has quit [Quit: grenierm]
RegulationD has joined #ruby
snath has joined #ruby
zacts has joined #ruby
macsteps has joined #ruby
Bugboy1028 has joined #ruby
RegulationD has quit [Read error: Connection reset by peer]
snath has left #ruby [#ruby]
marxarelli has quit [Quit: Textual IRC Client: www.textualapp.com]
Dimik has quit [Ping timeout: 258 seconds]
RegulationD has joined #ruby
RegulationD has quit [Read error: Connection reset by peer]
RegulationD has joined #ruby
tekneek has joined #ruby
RegulationD has quit [Read error: Connection reset by peer]
RegulationD has joined #ruby
RegulationD has quit [Read error: Connection reset by peer]
RegulationD has joined #ruby
marr has quit [Ping timeout: 260 seconds]
RegulationD has quit [Read error: Connection reset by peer]
sarbs has quit [Max SendQ exceeded]
Bugboy1028 has quit [Remote host closed the connection]
sarbs has joined #ruby
shmuli has quit [Ping timeout: 264 seconds]
jackjackdripper1 has quit [Quit: Leaving.]
A_Drone has quit [Remote host closed the connection]
jhack has quit [Quit: jhack]
jhack has joined #ruby
matp has joined #ruby
cyphase has quit [Ping timeout: 264 seconds]
A_Drone has joined #ruby
Bugboy1028 has joined #ruby
bad_ip has joined #ruby
Bugboy1028 has quit [Remote host closed the connection]
cyphase has joined #ruby
ixti has quit [Ping timeout: 276 seconds]
matt4 has joined #ruby
Bugboy1028 has joined #ruby
JeanCarloMachado has joined #ruby
craysiii has joined #ruby
Bugboy1028 has quit [Remote host closed the connection]
TheWhip has joined #ruby
TheWhip has quit [Remote host closed the connection]
TheWhip has joined #ruby
ponga has quit []
matt4 has quit [Ping timeout: 250 seconds]
r_rios has joined #ruby
Bugboy1028 has joined #ruby
davedev24 has joined #ruby
Ropeney has joined #ruby
tekneek has quit [Quit: Leaving]
macsteps has quit [Remote host closed the connection]
craysiii has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ixti has joined #ruby
ec is now known as ELLIOTTCABLE
the_rhizo has quit [Ping timeout: 250 seconds]
dminuoso has joined #ruby
tubuliferous has quit [Ping timeout: 258 seconds]
jhack has quit [Quit: jhack]
lel has joined #ruby
A_Drone has quit [Remote host closed the connection]
TheWhip_ has joined #ruby
Nahra has quit [Read error: Connection reset by peer]
Nahra has joined #ruby
dminuoso has quit [Ping timeout: 240 seconds]
TheWhip has quit [Ping timeout: 276 seconds]
aredridel has quit [Ping timeout: 240 seconds]
the_rhizo has joined #ruby
spudowiar has quit [Quit: Leaving.]
sdothum has joined #ruby
aredridel has joined #ruby
spudowiar has joined #ruby
matp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
A_Drone has joined #ruby
jackjackdripper has joined #ruby
the_rhizo has quit [Ping timeout: 240 seconds]
<havenwood> roflmyeggo: There's a notion of private even though you're able to ignore it. You can respect the public interface or disregard it. It's valuable to communicate what's meant to be public.
tejasmanohar has quit [Quit: tejasmanohar]
frozengeek has quit [Quit: frozengeek]
r_rios has quit [Ping timeout: 240 seconds]
phredus_ has quit [Ping timeout: 240 seconds]
Spami has quit [Quit: This computer has gone to sleep]
TPug has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Zapperino has quit [Read error: Connection reset by peer]
Zapperino has joined #ruby
ur5us has joined #ruby
Silthias1 has joined #ruby
Sucks has joined #ruby
Bugboy1028 has quit [Remote host closed the connection]
Silthias has quit [Ping timeout: 260 seconds]
A_Drone has quit [Remote host closed the connection]
bkxd has joined #ruby
A_Drone has joined #ruby
jenrzzz has quit [Ping timeout: 258 seconds]
A_Drone has quit [Remote host closed the connection]
airdisa has quit []
shmuli has joined #ruby
Pupeno has quit [Remote host closed the connection]
Bugboy1028 has joined #ruby
umdstu has quit [Ping timeout: 244 seconds]
memorasus1 has joined #ruby
memorasus has quit [Ping timeout: 260 seconds]
memorasus1 is now known as memorasus
vF3hNGxc47h8 has quit [Ping timeout: 250 seconds]
axsuul has quit [Quit: Textual IRC Client: www.textualapp.com]
Bugboy1028 has quit [Remote host closed the connection]
umdstu has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
jaguarmagenta has joined #ruby
nando293921 has quit [Quit: Lost terminal]
blackgoat has quit [Ping timeout: 244 seconds]
nando293921 has joined #ruby
Bugboy1028 has joined #ruby
shmuli has quit [Remote host closed the connection]
sdothum has joined #ruby
axsuul has joined #ruby
shmuli has joined #ruby
bad_ip has quit [Ping timeout: 276 seconds]
TPug has joined #ruby
bkxd has quit [Ping timeout: 265 seconds]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
A_Drone has joined #ruby
LoneHermit has joined #ruby
sdothum has joined #ruby
craysiii has joined #ruby
leea has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ev__ has joined #ruby
LoneHermit has quit [Ping timeout: 240 seconds]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
jdawgaz has joined #ruby
ctp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tejasmanohar has joined #ruby
sdothum has joined #ruby
yfeldblum has quit [Ping timeout: 258 seconds]
tejasmanohar has quit [Client Quit]
hahuang61 has joined #ruby
A_Drone has quit [Remote host closed the connection]
dminuoso has joined #ruby
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jdawgaz has joined #ruby
statelesscode has quit [Ping timeout: 244 seconds]
statelesscode has joined #ruby
tubuliferous has joined #ruby
Sucks has quit [Ping timeout: 264 seconds]
hahuang61 has quit [Ping timeout: 250 seconds]
rehat has joined #ruby
A_Drone has joined #ruby
dminuoso has quit [Ping timeout: 250 seconds]
govg has quit [Ping timeout: 258 seconds]
griffindy has quit [Read error: Connection reset by peer]
spudowiar has quit [Quit: Leaving.]
davedev24 has quit [Remote host closed the connection]
flashpoint9 has joined #ruby
sp_ has quit [Ping timeout: 265 seconds]
davedev24 has joined #ruby
davedev24 has quit [Client Quit]
shmuli has quit [Remote host closed the connection]
statelesscode_ has joined #ruby
mjuszczak has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
statelesscode has quit [Ping timeout: 250 seconds]
statelesscode_ is now known as statelesscode
flashpoint9 has quit [Ping timeout: 276 seconds]
jenrzzz has joined #ruby
spudowiar has joined #ruby
spudowiar has quit [Client Quit]
Sucks has joined #ruby
shmuli has joined #ruby
spudowiar has joined #ruby
matt4 has joined #ruby
tmtwd has joined #ruby
pawnbox has quit [Ping timeout: 250 seconds]
sdothum has joined #ruby
matt4 has quit [Ping timeout: 244 seconds]
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
SteenJobs has joined #ruby
rajdesai has joined #ruby
memorasus has quit [Ping timeout: 244 seconds]
shmuli has quit [Remote host closed the connection]
shmuli has joined #ruby
shmuli has quit [Remote host closed the connection]
meinside has joined #ruby
JeanCarloMachado has quit [Ping timeout: 244 seconds]
shmuli has joined #ruby
TheWhip_ has quit [Ping timeout: 265 seconds]
duncannz has joined #ruby
duncannz has quit [Max SendQ exceeded]
braincras has quit [Quit: bye bye]
duncannz has joined #ruby
duncannz has quit [Max SendQ exceeded]
duncannz has joined #ruby
duncannz has quit [Max SendQ exceeded]
statelesscode_ has joined #ruby
duncannz has joined #ruby
statelesscode has quit [Ping timeout: 250 seconds]
statelesscode_ is now known as statelesscode
syndikate has quit [Quit: WeeChat 1.5]
jaguarmagenta has quit [Remote host closed the connection]
bkxd has joined #ruby
tejasmanohar has joined #ruby
kavanagh has quit [Quit: That's all folks!]
mistermocha has joined #ruby
the_rhizo has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
mistermocha has quit [Ping timeout: 250 seconds]
LoneHermit has joined #ruby
rehat has quit [Remote host closed the connection]
braincras has joined #ruby
jaguarmagenta has joined #ruby
LoneHermit has quit [Ping timeout: 260 seconds]
sdothum has joined #ruby
Contigi has joined #ruby
sdothum has quit [Client Quit]
bkxd has quit [Ping timeout: 260 seconds]
jaguarmagenta has quit [Remote host closed the connection]
Zapperino has quit [Read error: Connection reset by peer]
spudowiar has quit [Quit: Leaving.]
Zapperino has joined #ruby
dminuoso has joined #ruby
r_rios has joined #ruby
r_rios has quit [Changing host]
r_rios has joined #ruby
mjuszczak has quit []
pawnbox has joined #ruby
dminuoso has quit [Ping timeout: 258 seconds]
flashpoint9 has joined #ruby
sdothum has joined #ruby
s2013 has joined #ruby
Dimik-- has joined #ruby
craigp has quit [Ping timeout: 240 seconds]
flashpoint9 has quit [Ping timeout: 250 seconds]
jsfowles has joined #ruby
Vingador has joined #ruby
Spami has joined #ruby
indistylo has joined #ruby
rajdesai has quit [Remote host closed the connection]
gix has quit [Ping timeout: 260 seconds]
jsfowles has quit []
shmuli has quit [Remote host closed the connection]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
maloik has quit [Remote host closed the connection]
maloik has joined #ruby
gix has joined #ruby
craigp has joined #ruby
sdothum has joined #ruby
AndrewIsHere has quit [Remote host closed the connection]
hutch34_ has joined #ruby
pawnbox has quit [Remote host closed the connection]
rajdesai has joined #ruby
c355e3b has quit [Quit: Connection closed for inactivity]
der-landgraf has quit [Ping timeout: 240 seconds]
SilverKey has joined #ruby
jtd has quit [Ping timeout: 276 seconds]
sdothum has quit [Client Quit]
A_Drone has quit [Remote host closed the connection]
craigp has quit [Ping timeout: 250 seconds]
the_drow has joined #ruby
mistergibson has quit [Read error: Connection reset by peer]
rajdesai has quit [Ping timeout: 260 seconds]
TheWhip has joined #ruby
sdothum has joined #ruby
dminuoso has joined #ruby
sarbs has quit [Ping timeout: 250 seconds]
pawnbox has joined #ruby
Dimik-- has quit [Read error: Connection reset by peer]
Dimik-- has joined #ruby
sdothum has quit [Read error: Connection reset by peer]
arescorpio has joined #ruby
sarbs has joined #ruby
arescorpio has quit [Max SendQ exceeded]
Vingador has quit [Ping timeout: 244 seconds]
sdothum has joined #ruby
diegoviola has quit [Quit: WeeChat 1.5]
dminuoso has quit [Ping timeout: 250 seconds]
jhack has joined #ruby
freerobby has quit [Quit: Leaving.]
roflmyeggo has quit [Ping timeout: 265 seconds]
Dimik-- has quit [Ping timeout: 244 seconds]
A_Drone has joined #ruby
nando293921 has quit [Ping timeout: 260 seconds]
alfiemax has quit [Ping timeout: 240 seconds]
A_Drone has quit [Remote host closed the connection]
jhack has quit [Quit: jhack]
nando293921 has joined #ruby
pokalyis has quit [Ping timeout: 240 seconds]
Velizar has joined #ruby
<Velizar> I've got two style questions
<Velizar> 1. should I sometimes use method() instead of method, if I think that makes it more readable? RubyMine flags that as a warning.
pokalyis has joined #ruby
<Velizar> actually forget about the second one, it's just this one for now
der-landgraf has joined #ruby
aryaching has joined #ruby
bkxd has joined #ruby
arescorpio has joined #ruby
arescorpio has quit [Max SendQ exceeded]
nanoz has quit [Read error: Connection reset by peer]
<Ropeney> Velizar, when passing parameters or not?
<Velizar> Ropeney: No parameters.
nando293921 has quit [Ping timeout: 260 seconds]
<Ropeney> then you should be consistent, and preferably not use
<Velizar> the first time I used it, I did trip.optimize() because it's a very important mutable operation
roflmyeggo has joined #ruby
<Velizar> the second time is in `if rand > probability_of_missing_distance`
<Velizar> rand() is much less confusing in my mind
shmuli has joined #ruby
hahuang61 has joined #ruby
<Ropeney> it always comes down to personal preference
jishankai has joined #ruby
<Ropeney> i'd probably agree with you right there
jaguarmagenta has joined #ruby
<Velizar> it's a relief to hear that, because I'm occassionally violating several style guidelines in favor of what I think would work better in practice
<Ropeney> just remember they are "guidelines"
<Velizar> hopefully whoever reviews the code will remember that :D
hahuang61 has quit [Ping timeout: 258 seconds]
d0lph1n98 has joined #ruby
EdwardIII has quit [Ping timeout: 260 seconds]
cibs has quit [Ping timeout: 240 seconds]
hutch34_ has quit [Ping timeout: 244 seconds]
cibs has joined #ruby
EdwardIII has joined #ruby
dminuoso has joined #ruby
bkxd has quit [Ping timeout: 244 seconds]
eljimador has quit [Read error: Connection reset by peer]
tmtwd has quit [Ping timeout: 265 seconds]
Zapperino has quit [Remote host closed the connection]
d0lph1n98 has quit [Quit: leaving]
matt4 has joined #ruby
l4v2 has quit [Quit: l4v2]
matt4 has quit [Ping timeout: 250 seconds]
grenierm has joined #ruby
A_Drone has joined #ruby
icey has quit [Remote host closed the connection]
the_rhizo has quit [Ping timeout: 260 seconds]
byteflame has quit [Ping timeout: 240 seconds]
yfeldblum has joined #ruby
jgt has quit [Ping timeout: 264 seconds]
indistylo has quit [Remote host closed the connection]
AndrewIsHere has joined #ruby
govg has joined #ruby
icey has joined #ruby
pawnbox has quit [Remote host closed the connection]
roflmyeggo has quit [Ping timeout: 252 seconds]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
lonewolf_ has joined #ruby
AndrewIsHere has quit [Ping timeout: 250 seconds]
craigp has joined #ruby
alfiemax has joined #ruby
Niham has joined #ruby
tmtwd has joined #ruby
Niham has quit [Client Quit]
xlegoman has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sdothum has joined #ruby
TheWhip has quit [Remote host closed the connection]
sdothum has quit [Client Quit]
brandon_ has joined #ruby
TheWhip has joined #ruby
sdothum has joined #ruby
cd-rum has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tubuliferous has quit [Ping timeout: 258 seconds]
RegulationD has joined #ruby
sdothum has quit [Client Quit]
sdothum has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nando293921 has joined #ruby
mistermocha has joined #ruby
RegulationD has quit [Ping timeout: 260 seconds]
lonewolf_ has quit [Quit: Leaving]
dminuoso has quit [Remote host closed the connection]
brandon_ is now known as yomama
A_Drone has quit [Ping timeout: 258 seconds]
nando293921 has quit [Ping timeout: 265 seconds]
mistermocha has quit [Ping timeout: 250 seconds]
yomama is now known as feargorm
feargorm has quit [Quit: leaving]
kp666 has quit [Remote host closed the connection]
bocaneri has joined #ruby
pawnbox has joined #ruby
A_Drone has joined #ruby
Nahra has quit [Remote host closed the connection]
xall has quit [Ping timeout: 244 seconds]
tmtwd has quit [Ping timeout: 252 seconds]
SilverKey has quit [Quit: Halted.]
triangles has quit [Ping timeout: 240 seconds]
dminuoso has joined #ruby
govg has quit [Ping timeout: 250 seconds]
A_Drone has quit [Read error: Connection reset by peer]
Dimik-- has joined #ruby
sneakerhax has quit [Ping timeout: 252 seconds]
govg has joined #ruby
bkxd has joined #ruby
A_Drone has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
flashpoint9 has joined #ruby
<Velizar> if I have a huge string called str, how fast is str[0...-2] and does it allocate a lot of memory ?
kyleolivo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
shmuli has quit [Remote host closed the connection]
yardenbar has joined #ruby
<dminuoso> Velizar: It should be O(n) for a string of n characters.
<dminuoso> Velizar: As for the memory requirements, it just needs the memory to hold the output string.
Nahra has joined #ruby
flashpoint9 has quit [Ping timeout: 250 seconds]
<Velizar> dminuoso: Is there an alternative which just removes the last 2 characters and is O(2)?
jaguarmagenta has quit []
yfeldblum has quit [Ping timeout: 240 seconds]
<Velizar> I'm doing str = str[0...-2]
<dminuoso> Velizar: No because the string has to be copied still.
<dminuoso> Ah.
<Velizar> ah right, strings are immutable
<Velizar> but not in Ruby actually?
<dminuoso> I slightly misunderstood your requirements.
<dminuoso> Velizar: Actually it seems the internal strings are in fact immutable. All Ruby methods (even things like chop) seem to copy strings around.
cfec0b8d has joined #ruby
<dminuoso> Well, immutable in length at any rate.
<Velizar> yeah, the docs are a bit unclear about Big O
<dminuoso> Velizar: It's quite simple: Use the (undocumented and sometimes badly written) source, Luke.
<Velizar> fair enough
aupadhye has joined #ruby
xall has joined #ruby
xall has quit [Client Quit]
xall has joined #ruby
xlegoman has joined #ruby
flashpoint9 has joined #ruby
tmtwd has joined #ruby
pawnbox has quit [Remote host closed the connection]
tejasmanohar has quit [Quit: tejasmanohar]
bkxd has quit [Ping timeout: 244 seconds]
<dminuoso> Velizar: Array has that semantics though, so depending on your requirements unpacking the string into a byte array and packing it back can be beneficial.
flashpoint9 has quit [Ping timeout: 250 seconds]
tejasmanohar has joined #ruby
<Velizar> dminuoso: Turns out that [0...-2] is instantaneous.
<dminuoso> Velizar: How long is your string?
<Velizar> dminuoso: SQL query for inserting 2k records. It was slow if I calculated it from a hash.
<Velizar> so <100k characters probably
Bugboy1028 has quit [Remote host closed the connection]
Sucks has quit [Quit: Leaving]
Dimik-- has quit [Ping timeout: 240 seconds]
pawnbox has joined #ruby
Dimik-- has joined #ruby
<dminuoso> Velizar: It is not instantaneous. It is O(n).
<dminuoso> 100k is just very small.
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
<Velizar> I call it instantaneous if it's too fast to notice in practice
<dminuoso> Velizar: a = 'c' * (2**30); a[0..-2].length
<dminuoso> Just as an example.
<Velizar> I'm not arguing with that
Bugboy1028 has joined #ruby
lxsameer has joined #ruby
ericsupreme has joined #ruby
<Velizar> only instantaneous for my usage
<dminuoso> Velizar: It's just dangerous to use the word "instantaneous" when we have already established it's O(n). It gives the impression that you think it's O(1) :)
<dminuoso> (Especially since you started with the Big O notation)
<dminuoso> Anyway. Glad it works for you.
devbug has joined #ruby
dminuoso has quit [Quit: Lost terminal]
djbkd has joined #ruby
Dimik-- has quit [Ping timeout: 250 seconds]
Bugboy1028 has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
Dimik-- has joined #ruby
hipertracker has joined #ruby
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pawnbox has joined #ruby
mistermocha has joined #ruby
connor_goodwolf has quit [Ping timeout: 260 seconds]
Bugboy1028 has joined #ruby
last_staff has joined #ruby
connor_goodwolf has joined #ruby
mistermocha has quit [Ping timeout: 250 seconds]
dminuoso has joined #ruby
rclsilver has left #ruby [#ruby]
jgt has joined #ruby
tubuliferous has joined #ruby
dreamyspell has joined #ruby
solars has joined #ruby
Macaveli has joined #ruby
Dimik-- has quit [Ping timeout: 250 seconds]
Dimik-- has joined #ruby
SilverKey has joined #ruby
Nahra has quit [Read error: Connection reset by peer]
Nahra` has joined #ruby
A_Drone has quit [Remote host closed the connection]
shmuli has joined #ruby
kobain has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
A_Drone has joined #ruby
hahuang61 has joined #ruby
firstdayonthejob has joined #ruby
<SteenJobs> if i’m writing a script for someone that’s supposed be “user friendly”, is the best way to automate the dependencies by writing a bash script to install the necessary gems on the person’s computer who’s executing the script (through a simple GUI)?
TomyLobo has quit [Ping timeout: 264 seconds]
A_Drone has quit [Read error: Connection reset by peer]
hahuang61 has quit [Ping timeout: 250 seconds]
amclain has quit [Quit: Leaving]
tmtwd has quit [Ping timeout: 276 seconds]
jishankai has quit [Ping timeout: 244 seconds]
ntt has joined #ruby
jishankai has joined #ruby
firstdayonthejob has quit [Ping timeout: 250 seconds]
<dminuoso> SteenJobs: No. Use bundler.
<SteenJobs> but then they need to install bundler
<dminuoso> SteenJobs: Actually you dont even need bundler. Just use gem properly.
<dminuoso> SteenJobs: Gem already has "dependencies" for free.
<SteenJobs> right that was why i didn’t mention it
<SteenJobs> but
govg has quit [Ping timeout: 240 seconds]
<SteenJobs> i need to automate all of it - it’s a web scraper for someone that won’t know how to run gem install
<SteenJobs> so i’m wondering if i should include a bash script that runs gem install for each gem
<dminuoso> Then write a bash script that executes "gem install"
<SteenJobs> :)
astrobun_ has joined #ruby
akira616 has joined #ruby
der-landgraf has quit [Ping timeout: 258 seconds]
A_Drone has joined #ruby
haxrbyte has joined #ruby
<ntt> Hi, I have an hash of hashes: {"A" => { :key1 => "v1", :key2 => "v2"}, "B" => { :key1 => "v1", :key2 => "v3" }, "C" => { :key1 => "v1", :key2 => "v2" } } . I'd like to group elements using :key2 . For example: [{ :key2 => "v2", :new_field => ["A", "C"], :key1 => "v1"}, { :key2 => "v3", :new_field => ["B"], :key1 => "v1" }] . Someone can help me please?
anisha has joined #ruby
matt4 has joined #ruby
submitnine has joined #ruby
haxrbyte has quit [Ping timeout: 244 seconds]
<Zarthus> SteenJobs, dminuoso: And what if the user *does* have ruby installed? I'd make it an optional part of the installation.
SilverKey has quit [Quit: Halted.]
<SteenJobs> Zarthus: script ain’t gonna work without the gems - it’s a web scraper, needs nokogiri and a parsing library i’m using
hipertracker has quit [Quit: hipertracker]
<Zarthus> I'd package it in a thing like apt-get, so they can just do that.
<Zarthus> which manages the dependencies (i'm relatively sure you can apt-get nokogiri?) for you
matt4 has quit [Ping timeout: 276 seconds]
<Zarthus> yep
A_Drone has quit [Remote host closed the connection]
<Zarthus> if that's not an option, make sure to use bundle install --path
<SteenJobs> no dependencies. gem install is fine.
<Zarthus> you just said it depends on njokogiri
<SteenJobs> i just need a way to run gem install without the user ever having to open up terminal
bkxd has joined #ruby
<Zarthus> my point is not everyone is clueless, make sure you don't crowd my system gems ;)
xlegoman has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Zarthus> and don't rm -rf my things either, like steam may have done in the past :~D
zarubin has joined #ruby
<dminuoso> >> [{a: 1}, {a: 2, c: 1}].reduce({}) { |h, p| p.each { |k, v| (h[k] ||= []) << v }; h } # ntt
<ruby[bot]> dminuoso: # => {:a=>[1, 2], :c=>[1]} (https://eval.in/617300)
<dminuoso> ntt: Note how unreadable this has become? Don't try to do something elegant, do it explicitly.
AndrewIsHere has joined #ruby
<dminuoso> Especially since your code would use something like hash.values.reduce({}) { |h, p| p.each { |k, v| (h[k] ||= []) << v }; h } # even an experienced ruby programmer would have to stare at this for a while to know what this is doing.
<Zarthus> i'll admit the variable names aren't helping
<Zarthus> or the fact it's on one line :P
A_Drone has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
AndrewIsHere has quit [Ping timeout: 250 seconds]
m1dnight1 has joined #ruby
ta_ has joined #ruby
shmuli has quit [Remote host closed the connection]
A_Drone has quit [Remote host closed the connection]
<ntt> dminuoso.... thank you but I think my example is wrong. Can you check example data here => https://gist.github.com/anonymous/4f49580726887e142a62b65c9b551cfc please?
TomyWork has joined #ruby
RegulationD has joined #ruby
<ntt> I need to group mac addresses by common_name
<dminuoso> ntt: &ri Enumerable#group_by
<dminuoso> &ri Enumerable#group_by
shmuli has joined #ruby
<ntt> dminuoso: How can I group_by hash of hashes using the key of the nested hash?
grenierm has quit [Quit: grenierm]
<dminuoso> ntt: like vpn1.status[:routes].group_by { |mac_addr, hash| hash[:common_name] }
<ntt> ok, but mac_address in my case is a key, not a value...
dionysus69 has joined #ruby
RegulationD has quit [Ping timeout: 252 seconds]
djbkd has quit [Remote host closed the connection]
<dminuoso> ntt: hash.group_by { |mac_addr, hash| hash[:common_name] }.map { |(k, v)| [k, v[0][0]] }
bkxd has quit [Ping timeout: 240 seconds]
<dminuoso> There's probably a slightly more elegant version to this.
<dminuoso> ntt: hash.group_by { |mac_addr, hash| hash[:common_name] }.map { |(k, v)| [k, v.map(&:first)] }.to_h
<dminuoso> I got this right I think.
<ntt> it seems to work, but I'm using ruby 1.8.7 and it seems that to_h doesn't exists
nertzy has joined #ruby
Pupeno has joined #ruby
<dminuoso> ntt: Any chance you can upgrade ruby to 2.3.1? 1.8.7 is very old and long unsupported.
<ntt> unfortunately no...
pawnbox_ has joined #ruby
<dminuoso> ntt: You can use Hash[*ary] instead of ary.to_h
bweston92 has quit [Read error: Connection reset by peer]
TheWhip_ has joined #ruby
teclator has quit [Ping timeout: 260 seconds]
xsdg has joined #ruby
pawnbox has quit [Ping timeout: 240 seconds]
TheWhip has quit [Ping timeout: 244 seconds]
<ntt> can you give me an example please?
<dminuoso> 18>> ary = [:a, 1, :b, 2]; Hash[*ary]
<ruby[bot]> dminuoso: # => {:b=>2, :a=>1} (https://eval.in/617311)
<dminuoso> 23>> ary = [:a, 1, :b, 2]; ary.to_h
<ruby[bot]> dminuoso: # => wrong element type Symbol at 0 (expected array) (TypeError) ...check link for more (https://eval.in/617312)
<dminuoso> oh
<dminuoso> 23>> ary = [[:a, 1], [:b, 2]]; ary.to_h
<ruby[bot]> dminuoso: # => {:a=>1, :b=>2} (https://eval.in/617315)
<dminuoso> 18>> ary = [[:a, 1], [:b, 2]]; Hash[*ary.flatten]
<ruby[bot]> dminuoso: # => {:b=>2, :a=>1} (https://eval.in/617316)
<dminuoso> ntt: ^- there.
<ntt> dminuoso: thank you
dreamyspell_ has joined #ruby
symm- has quit [Ping timeout: 252 seconds]
TheWhip_ has quit [Remote host closed the connection]
aganov has joined #ruby
dreamyspell has quit [Ping timeout: 258 seconds]
A_Drone has joined #ruby
lemunayd has joined #ruby
tvw has joined #ruby
ur5us has quit [Remote host closed the connection]
Torrone has joined #ruby
tejasmanohar has quit [Quit: tejasmanohar]
antgel has joined #ruby
frozengeek has joined #ruby
<ntt> dminuoso: unfortunately, if I pass an odd number of arguments to Hash I have an error :" ArgumentError: odd number of arguments for Hash"
edwinvdgraaf has joined #ruby
<ntt> if ary has an odd number of elements I mean
<dminuoso> ntt: Why should it have an odd number of elements?
bjh13 has joined #ruby
<ntt> it can happens.... ary may have an odd number of elements I think
<dminuoso> Why should it happen?
pawnbox_ has quit [Remote host closed the connection]
akira616 has quit [Quit: Leaving]
bjh13 has quit [Client Quit]
<dminuoso> ntt: Ahh, use flatten(1)
<dminuoso> If you don't, then it will get flattened all the way which is not what you want.
<dminuoso> ntt: https://eval.in/617348
bjh13 has joined #ruby
teclator has joined #ruby
raeoks has joined #ruby
hahuang65 has quit [Read error: Connection reset by peer]
dreamyspell_ is now known as dreamyspell
yeticry has quit [Ping timeout: 244 seconds]
der-landgraf has joined #ruby
Tempesta has quit [Ping timeout: 264 seconds]
bjh13 has quit [Quit: testing]
blaxter has joined #ruby
blaxter has quit [Client Quit]
pandaant has joined #ruby
bjh13 has joined #ruby
marr has joined #ruby
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Coldblackice_ has quit [Ping timeout: 240 seconds]
hahuang65 has joined #ruby
<dminuoso> ntt: I just came to my senses though. Dont do it like that.
<dminuoso> ntt: https://eval.in/617368
Velizar has quit [Ping timeout: 260 seconds]
<dminuoso> This actually shows intend.
Silthias1 has quit [Ping timeout: 265 seconds]
mim1k has joined #ruby
<dminuoso> It probably also is a lot faster. )
jaruga____ has joined #ruby
naftilos76 has joined #ruby
Dimik-- has quit [Ping timeout: 264 seconds]
SteenJobs has quit [Quit: SteenJobs]
postmodern has quit [Quit: Leaving]
A_Drone has quit [Remote host closed the connection]
TheWhip has joined #ruby
ctp has joined #ruby
zarubin has quit [Remote host closed the connection]
SteenJobs has joined #ruby
Velizar has joined #ruby
teclator has quit [Ping timeout: 276 seconds]
<ntt> dminuoso: thank you.... but can you explain how can I access an has without fixed key names?
<ntt> I'm searching here ->
Velizar has quit [Client Quit]
aupadhye has quit [Quit: Leaving]
SteenJobs has quit [Client Quit]
<dminuoso> ntt: "fixed key names" ?
ctp has quit [Max SendQ exceeded]
<dminuoso> ]
<ntt> {"l2vpn_client_3_301_432"=>["AA:BB:CC:45:ae:e1", "BB:CC:DD:23:77:64",...], "another_l2vpn_client" => ["another", "array", ...] }
<ntt> h = {"l2vpn_client_3_301_432"=>["AA:BB:CC:45:ae:e1", "BB:CC:DD:23:77:64",...], "another_l2vpn_client" => ["another", "array", ...] }
craysiii has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bkxd has joined #ruby
shmuli has quit [Remote host closed the connection]
<ytti> grumble, i need to remove 'ntt' from my highlights :/
<dminuoso> ntt: I don't understand the question or the problem.
<ntt> h.each .... but how can I print the "l2vpnclient" ?
<dminuoso> >> {a: 1, b: 2}.each { |(key, value)| puts key }
<ruby[bot]> dminuoso: # => a ...check link for more (https://eval.in/617380)
aryaching has quit [Ping timeout: 265 seconds]
<ntt> so key,value are reserved workds or I can use anything?
shmuli has joined #ruby
<dminuoso> ntt: You can use anything.
mistermocha has joined #ruby
<dminuoso> I just used the names to denote which is which.
<jhass> just .each {|key, value| ... } works too
Snowy has joined #ruby
<jhass> at the first level the (...) are sort of implicit
<dminuoso> jhass: Indeed. I just developed this to be a style to make it explicit that an array is being expanded.
shmuli has quit [Remote host closed the connection]
<dminuoso> (Not a big fan of this array expansion, as it quickly behaves very strangely in some cases)
poguez_ has quit [Quit: Connection closed for inactivity]
mrgrieves has joined #ruby
tomphp has joined #ruby
yeticry has joined #ruby
xxneolithicxx has quit [Ping timeout: 258 seconds]
mistermocha has quit [Ping timeout: 250 seconds]
xxneolithicxx has joined #ruby
shmuli has joined #ruby
A_Drone has joined #ruby
hahuang61 has joined #ruby
elaptics`away is now known as elaptics
cfec0b8d has quit [Quit: KVIrc 4.9.1 Aria http://www.kvirc.net/]
mark_66 has joined #ruby
TheWhip has quit [Read error: Connection reset by peer]
hahuang61 has quit [Ping timeout: 264 seconds]
TheWhip has joined #ruby
bkxd has quit [Ping timeout: 265 seconds]
A_Drone has quit [Remote host closed the connection]
aupadhye has joined #ruby
yfeldblum has joined #ruby
teclator has joined #ruby
A_Drone has joined #ruby
Ropeney has joined #ruby
glcx has joined #ruby
glcx has quit [Changing host]
glcx has joined #ruby
A_Drone has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 265 seconds]
A_Drone has joined #ruby
teclator has quit [Ping timeout: 276 seconds]
<ntt> dminuoso: How can I print an array removing "[" and quotes for each element? I need to use the array inside a mysql query ....
<ljarvis> D:
zarubin has joined #ruby
* dminuoso facepalms
matt4 has joined #ruby
TheWhip has quit [Ping timeout: 258 seconds]
giz|work|2 has joined #ruby
Derperperd has quit [Quit: Derperperd]
<jhass> ntt: mysql2 gem, sequel, activerecord?
matt4 has quit [Ping timeout: 244 seconds]
zarubin has quit [Ping timeout: 264 seconds]
c355e3b has joined #ruby
TheWhip has joined #ruby
Silthias has joined #ruby
TPug has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<hanmac> ntt: normaly you should not use an array directly in sql ... the better way would be to let the adapter (like jhass said) handle it. specially important when you are working with user input
toretore has joined #ruby
aupadhye has quit [Quit: Leaving]
aupadhye has joined #ruby
axsuul has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<gregf_> ntt: you can provide them as a comma delimited string(bind param)?
pawnbox has joined #ruby
<ntt> I'm using mysql gem and array.join(',') works well
<ljarvis> please dont do that
<ntt> the query is .... where id NOT IN (1,2,3)
<ljarvis> use a binding
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
<ljarvis> jhass asked which adapter you were using so we can suggest how to do it properly
jobat has joined #ruby
<jhass> ntt: https://github.com/luislavena/mysql-gem#maintainer-needed consider moving to the mysql2 gem
nofxx has quit [Ping timeout: 250 seconds]
the_drow has quit [Quit: This computer has gone to sleep]
nofxx has joined #ruby
nofxx has quit [Changing host]
nofxx has joined #ruby
the_drow has joined #ruby
shmuli has quit [Remote host closed the connection]
andikr has joined #ruby
ev__ has quit [Ping timeout: 250 seconds]
<jhass> especially sincde it doesn't look like the mysql gem supports bind parameters
<jhass> and has a terrible API, how does anyone work with that
RegulationD has joined #ruby
ixti has quit [Quit: WeeChat 1.5]
phrozen77 has quit [Ping timeout: 252 seconds]
pawnbox has quit [Remote host closed the connection]
DaniG2k has joined #ruby
armyriad has quit [Ping timeout: 276 seconds]
cyphase has quit [Ping timeout: 250 seconds]
mark_66 has quit [Remote host closed the connection]
shmuli has joined #ruby
mark_66 has joined #ruby
RegulationD has quit [Ping timeout: 244 seconds]
Gasher has joined #ruby
minimalism has quit [Quit: minimalism]
cyphase has joined #ruby
<dminuoso> jhass: Im guessing that the gem was designed by a previous PHP developer.
armyriad has joined #ruby
teclator has joined #ruby
janno_ has quit [Quit: leaving]
<ljarvis> but php mysql has real_mysql_real_no_seriously_real_escape_pls_dnt_hack_me(...)
<dminuoso> Is that a new function?
gdp has joined #ruby
<ljarvis> i think they actually have a newer version with another real_ prepended
zarubin has joined #ruby
fergal has joined #ruby
<dminuoso> Looking at the mysql extension, it's absolutely mind blowing how that crap C code actually works.
janno has joined #ruby
<lizard2010> (=
braincras has quit [Ping timeout: 260 seconds]
pawnbox has joined #ruby
zarubin has quit [Ping timeout: 276 seconds]
lemunayd has quit [Ping timeout: 265 seconds]
jaruga____ has quit [Quit: jaruga____]
Pupeno has quit [Remote host closed the connection]
braincrash has joined #ruby
A_Drone has quit [Remote host closed the connection]
hahuang61 has joined #ruby
Billias has quit [Ping timeout: 250 seconds]
bkxd has joined #ruby
Evesy_ has joined #ruby
hahuang61 has quit [Ping timeout: 250 seconds]
ddffg has joined #ruby
<Evesy_> Hi, I'm wondering if someone can help point out what is probably an obvious mistake with a Ruby class I have (https://gist.github.com/Evesy/c0d056b2eafb8bdad81b05e3b8c7da2a). When it runs I'm getting "undefined method `include?' for nil:NilClass"
A_Drone has joined #ruby
<Evesy_> If I swap the instance vars out for class vars it works fine (but then Rubocop complains that I shouldn't be doing that)
<dminuoso> Evesy_: You get the error when you attempt to call that method ("include?") on nil.
<dminuoso> >> nil.include?
<ruby[bot]> dminuoso: # => undefined method `include?' for nil:NilClass (NoMethodError) ...check link for more (https://eval.in/617492)
Billias has joined #ruby
govg has joined #ruby
shmuli has quit [Remote host closed the connection]
<dminuoso> Evesy_: The underlying issue is subtle actually.
teclator has quit [Ping timeout: 244 seconds]
jishankai has quit [Read error: Connection reset by peer]
<dminuoso> Evesy_: https://gist.github.com/Evesy/c0d056b2eafb8bdad81b05e3b8c7da2a#file-gistfile1-txt-L2-L5 -- this will set instance variables for the object of the class itself.
A_Drone has quit [Remote host closed the connection]
<dminuoso> >> class MyClass; @foo = 23; end; puts MyClass.instance_variables
<ruby[bot]> dminuoso: # => @foo ...check link for more (https://eval.in/617497)
<dminuoso> Evesy_: Does this make enoguh sense to you?
<Evesy_> Unfortunately not
<dminuoso> Evesy_: Do you care to understand the subtlety here?
<dminuoso> Or do you just want a fix for your problem?
<Evesy_> Both would be nice, however I have to admit I'm not very familiar with Ruby
ferr has joined #ruby
<dminuoso> Evesy_: First you have to grasp that even classes are objects in Ruby.
Vingador has joined #ruby
<dminuoso> So a class itself can have instance variables.
<dminuoso> They are not the same as the instance variables of objects of the same class.
<Evesy_> Right ok, so when I'm defining those instance variables, they're just instance variables for the object of that environment class, rather than instance variables /for/ that class?
tomchapi_ has joined #ruby
<dminuoso> Evesy_: https://eval.in/617512
<dminuoso> Evesy_: Exactly!
<dminuoso> Evesy_: The class has no access to instance variables of objects based on the same class. But instance methods do!
bjh13 has quit [Quit: bedtime]
phrozen77 has joined #ruby
tomchapin has quit [Ping timeout: 240 seconds]
A_Drone has joined #ruby
<dminuoso> Evesy_: Is this enough for you to figure out the solution for your problem?
<Evesy_> Isn't my method get_dc already an instance method though?
jaruga____ has joined #ruby
<dminuoso> Evesy_: Yes it is, which is precisely the problem.
bkxd has quit [Ping timeout: 264 seconds]
<dminuoso> Evesy_: That instance method gets executed in the context of instances of that class, so they are different instance variables.
jaruga____ has quit [Client Quit]
vdamewood has joined #ruby
<Evesy_> !!! I think it might have just clicked
<Evesy_> Going to try my fix now
<dminuoso> Evesy_: Once you have your fix let me know :)
<dminuoso> Evesy_: It works with class variables, because they are treated a bit special actually.
<dminuoso> (Having instance variables, class instance variables and class variables can be quite confusing at times)
<Evesy_> I've changed the method from get_dc to self.get_dc, then when I later call the class I was previously doing Environment.new.get_dc, now it's just Environment.get_dc
skade has joined #ruby
devbug has quit [Quit: ZZZzzz…]
A_Drone has quit [Remote host closed the connection]
<dminuoso> Evesy_: Alright great. You should in that case use class variables instead.
skade has quit [Client Quit]
devbug has joined #ruby
sp_ has joined #ruby
<Evesy_> I was originally using class variables and rubocop complained :(
<dminuoso> Evesy_: if you use def self.get_dc inside the class, you are writing an "instance method for your class object", so it has access to "instance variables of your class object" if that makes any sense.
duncannz has quit [Remote host closed the connection]
<dminuoso> Evesy_: Well, if it never changes you should use a constant instead.
skweek has quit [Remote host closed the connection]
<dminuoso> Evesy_: Also note, if you never intend to construct it, use a module instead of a class.
<Evesy_> You're correct that they won't be changing so I can change those to constants
<dminuoso> Evesy_: Another thing is, don't blindly accept everything rubocop says. Some things make sense, others are a matter of taste or discussion.
vuoto has joined #ruby
<Evesy_> Do constants adhere to the same scopes as variables?
teclator has joined #ruby
<Evesy_> global, class, instance etc.
<dminuoso> Evesy_: That is a rather complicated question..
<dminuoso> Evesy_: The simple answer is: No.
gdp has quit [Ping timeout: 240 seconds]
<Evesy_> That class snippet I provided earlier is actually inside of a module
<dminuoso> Evesy_: Doesn't matter.
<dminuoso> Evesy_: Essentially a module and class is the same, except you cant construct modules no matter how hard you try (and you cant include classes)
<jhass> well, here I agree with rubocop that class level instance vars are to prefer over class vars
spudowiar has joined #ruby
xall has quit [Ping timeout: 244 seconds]
cfec0b8d has joined #ruby
<dminuoso> jhass: Im curious, what is your reason?
haxrbyte has joined #ruby
Nahra` has quit [Read error: Connection reset by peer]
dionysus69 has quit [Ping timeout: 265 seconds]
Nahra` has joined #ruby
<dminuoso> Evesy_: As for the "scope" question, the reason its a bit complicated is because of Module#include #prepend
<jhass> I think their behavior is less surprising
mim1k has quit [Ping timeout: 260 seconds]
skweek has joined #ruby
jishankai has joined #ruby
<jhass> unless you explicitly need the scoping behavior of class vars, not using them prevents from it biting you
<dminuoso> Evesy_: But if we ignore ignore/prepend for a moment and just look locally inside the same class, then the scope is the same.
<dminuoso> *include/prepend
vuoto has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 240 seconds]
vuoto has joined #ruby
<dminuoso> jhass: Okay, I can accept that reason.
<jhass> and having to have accessors when instances want to access the class level data makes it obvious who owns the data at all points
djellemah_ is now known as djellemah
<dminuoso> Didn't consider data hiding before, that's a good point.
<jhass> class Child < Something; code code code; def foo; @@var = 1; end; end; now who owns it?
<jhass> vs Soemthing.var = 1 or Child.var = 1 or even SomethingsParent.var = 1
ur5us has joined #ruby
vuoto has quit [Remote host closed the connection]
<Evesy_> dminuoso: So you think the best thing for me to do is leave those methods as instance methods and use class variables, also change that Environment class to a method?
vuoto has joined #ruby
vuoto has quit [Remote host closed the connection]
<dminuoso> Evesy_: Change the class to be a module, not a method. :)
<Evesy_> Yes, brain is in a twist! :P
skweek has quit [Ping timeout: 250 seconds]
<jhass> Evesy_: I didn't look close enough to recommend one specifically but let me list the three choices I would recommend in general: 1) define the variables in def initialize, use .new and only instance methods 2) use a module and only def self.foo methods 3) use the singleton stdlib and do 1) but use .instance
<dminuoso> Evesy_: In a nutshell: Use a module with "class methods" and use constants (or class instance variables if you have to)
vuoto has joined #ruby
<dminuoso> jhass: Actually I wonder, is there some idiomatic name for "class methods" in modules?
mim1k has joined #ruby
<jhass> I say class methods most of the time, one could argue module function given Module#module_function but meh, they're not functions
<dminuoso> Technically they are instance methods of the modules singleton class.. :P
<dminuoso> But boy, I wouldn't want that in a book teaching ruby to people.
<jhass> yeah, singleton method or so was briefly in my mind too, but nobody ever says that
vuoto has quit [Remote host closed the connection]
A_Drone has joined #ruby
vuoto has joined #ruby
<dminuoso> jhass: Ruby should just let us include classes and throw away modules - then we dont need to distinguish anymore.
<jhass> mh, I'm not sure about that
nofxx has quit [Ping timeout: 244 seconds]
<jhass> dminuoso: btw crystal for now did away with class level instance vars and made @@vars scoping behavior the same as them, so far nobody wanted ruby's scoping behavior for them back
craigp has quit [Ping timeout: 264 seconds]
shmuli has joined #ruby
Ropeney_ has joined #ruby
<jhass> well, almost the same, I think you can directly access them from instances
<jhass> but not child class instances
<jhass> or child classes
<dminuoso> jhass: But then again I expect the crystal user base to be filled with people who are not happy with some subtleties of Ruby.
Ropeney_ has quit [Client Quit]
<dminuoso> So it's not surprising that crystal users don't want Ruby-magic in crystal.
spudowiar has quit [Quit: Leaving.]
zarubin has joined #ruby
<jhass> mh, I'd say 60% are actually rubyists looking for a faster ruby
<jhass> maybe even more
<jhass> though of course that doesn't mean those people don't recognize areas where we can improve over ruby
freerobby has joined #ruby
<Evesy_> dminuoso: I've changed that Environment class into a module, and I'm now calling it with Environment.get_dc (rather than the previous Envrionment.new.get_dc). The methods inside the module are now class methods (e.g. self.get_dc), and the variables I have previously I had are now just constants
yfeldblum has quit [Ping timeout: 250 seconds]
<dminuoso> Evesy_: Sounds perfectly adequate.
<Evesy_> So, "Dc1_prod = IPAddr.new('172.28.8.0/18')", then just referenced in the methods as Dc1_prod
<Evesy_> Perfectly adequate is what I always shoot for :) ... I've got an awful lot to learn
<Evesy_> But thank you so much for the assistance, you've been a great help
A_Drone has quit [Remote host closed the connection]
<jhass> eh, well, okay you can access them but you get a new version https://carc.in/#/r/15je
DaniG2k_ has joined #ruby
LoneHermit has joined #ruby
shmuli has quit [Ping timeout: 250 seconds]
<jhass> Evesy_: btw in Ruby we tend to just drop get_ prefixes and use foo= instead of set_foo
jenrzzz has joined #ruby
<jhass> and foo? instead of is_foo
zarubin has quit [Ping timeout: 250 seconds]
<Evesy_> jhass: Just as in 'self.dc' instead of 'self.get_dc' ? Purely a naming convention thing?
<dminuoso> Evesy_: Yes.
<jhass> yes and yes
DaniG2k has quit [Read error: No route to host]
Ropeney has quit [Quit: Leaving]
<dminuoso> Evesy_: It's spread enough to know that any "bang" method (ending with a !) usually modifies the receiver, whereas a question method yields a truth value.
<apeiros> another naming convention is PascalCase for constants. i.e. Dc1Prod instead of Dc1_Prod
<jhass> oh and if all your def self.dc does is return some constant, say DC, maybe consider doing Environment::DC directly
* dminuoso pokes apeiros in the eye
<dminuoso> Hello there.
* apeiros pokes dminuoso in the nose
<apeiros> hi there too
<dminuoso> Thanks, there was something stuck in there.
<jhass> well, I guess the community is split between PascalCase and SCREAMING_SNAKE_CASE for data holding constants ;)
<apeiros> good thing I wear gloves
* apeiros burns the gloves
<jhass> I do tend to see the latter more often tbh
<apeiros> true @ split
<apeiros> I tend to use PascalCase for all constants, not just classes & modules
giz|work|2 has quit [Ping timeout: 244 seconds]
<dminuoso> Evesy_: Either way, pick something adn stick to it.
<Evesy_> jhass: You've confused me with: "oh and if all your def self.dc does is return some constant, say DC, maybe consider doing Environment::DC directly". Could you elaborate?
A_Drone has joined #ruby
<apeiros> indeed
<apeiros> styleguides are about a group working together
<dminuoso> Evesy_: It was just a theoretical remark.
hahuang61 has joined #ruby
Snowy has quit [Quit: ragequit]
<jhass> Evesy_: if your module looks like module Environment; DC = 123; def self.dc; DC; end; end; you might as well just skip the method and do Environment::DC in the code instead of Environment.dc
<dminuoso> Evesy_: If you want to hide the data (say because you want to have a class invariant), then revert back to class instance variables (these work for modules too). I
LoneHermit has quit [Ping timeout: 252 seconds]
<dminuoso> If not, then you don't need the accessor.
jenrzzz has quit [Ping timeout: 252 seconds]
<dminuoso> apeiros: I found that even weird coding styles are fine, as long as the codebase is using it consistently.
<dminuoso> But then again I had the pleasure of writing Python code for 2 weeks of my life.
<dminuoso> After that I appreciated this more than ever.
<apeiros> dminuoso: yupp. which fits with "about a group working together"
<apeiros> IME you can get used to almost any style
Velizar has joined #ruby
<apeiros> but it's hard to get used to inconsistency
<apeiros> so: "disliked, but consistent style" >> "inconsistent code"
<dminuoso> Evesy_: Do you ever intend to access DC1_PROD etc outside the module?
haxrbyte has quit [Remote host closed the connection]
<jhass> Evesy_: okay, nvm then ;)
<dminuoso> Evesy_: If you can answer this with yes, then you can actually use class instance variables instead (your code is still fine)
<jhass> while we're at the btw, if you name your gist file something.rb you get great syntax highlighting!
hahuang61 has quit [Ping timeout: 250 seconds]
<dminuoso> Evesy_: Let me just emphasize that this is not necessary, but a question of whether you want to enforce it.
<jhass> well, there is private_const if it's about hiding
<Evesy_> dminuoso: Nope, those constants will only ever live in that module, any information I want to derive from them will be done as a method in the class.
<dminuoso> jhass: Mmm.
<Evesy_> Module... not class*
<jhass> private_constant actually
<dminuoso> Evesy_: Then you could hide them from the outside.
<dminuoso> Otherwise people might see them and start using them.
<dminuoso> And then you decide to rework your module and suddenly unrelated parts break.
astrobun_ has quit [Remote host closed the connection]
<jhass> Evesy_: oh and looks like something were returning symbols might be more idiomatic, :DC1 or :DC2 respectively
<jhass> *where
<dminuoso> Evesy_: Also note, this battery of recommentations is just smoothing the last bits things out. :)
bigkevmcd has quit [Ping timeout: 265 seconds]
<jhass> yeah totally
skweek has joined #ruby
araujo has joined #ruby
Vingador has quit [Ping timeout: 244 seconds]
<jhass> and I should add a unless your only purpose is to compare them to some external data source or print them into some template or so
araujo has quit [Max SendQ exceeded]
Velizar has quit [Quit: Velizar]
MarkBilk__ has joined #ruby
SJr has quit [Ping timeout: 252 seconds]
<dminuoso> Evesy_: There is one more ruby idiom that can truly make this elegant!
craigp has joined #ruby
bigkevmcd has joined #ruby
glcx has quit [Quit: This computer has gone to sleep]
araujo has joined #ruby
araujo has quit [Changing host]
araujo has joined #ruby
araujo has quit [Max SendQ exceeded]
<dminuoso> (I didnt apply any of the other recommendations, just look at the method body)
blackgoat has joined #ruby
araujo has joined #ruby
<dminuoso> It's using the fact that case calls #=== which for IPAddr is an alias for #include?
araujo has quit [Remote host closed the connection]
<dminuoso> (You can quickly add more nets to it, or a default case in a readable fashion)
<fergal> guys, for yardoc, what’s the format of an @option that specifies an array of strings? like, if my @option is a boolean i think i should be doing: `@option x [Boolean] …` what’s the format if my option is an array of strings?
<jhass> Array(String) iirc
<fergal> jhass: within square brackets? so `@option x [Array(String)] …`
<jhass> yes
<dminuoso> Evesy_: And then you could refactor this to look like this: https://gist.github.com/anonymous/d3f3f77b169da8cbacd2b3b01f27091b
<dminuoso> Oops, I missed a closing array bracket there.
<Evesy_> I've just tried changing that to a symbol similar to what you mentioned, however when I then call it later with: Environment.get_dc(node['ipaddress'] nothing is returned
sp_ has quit [Ping timeout: 264 seconds]
<dminuoso> jhass: Something feels off about that dispatch. Do you see a way to avoid the case entirely?
<dminuoso> (If I think about how you could have DC3, DC4, DC5.. it feels like there should be a more elegant way)
<Evesy_> I'm happy to make the assumption that there will never be DC3, DC4 etc.
<jhass> fergal: so Array<String> or just <String> actually
dionysus69 has joined #ruby
<dminuoso> Evesy_: Can you quickly make a test case, and show it on eval.in ?
vuoto has quit [Remote host closed the connection]
SJr has joined #ruby
vuoto has joined #ruby
<Evesy_> When you do something like 'when *DC1 then :DC1', what is that :DC1 symbol pointing to?
<dminuoso> Evesy_: Symbols dont point at things.
<dminuoso> Evesy_: Symbols are just "numbers that look like strings"
<jhass> dminuoso: well, could do a hash and .find { .any? }.first but probably not worth it
<dminuoso> jhass: Mmm.
<Evesy_> The get_dc method I would rather have return a string (DC1 or DC2) and then I can use that string elsewhere, otherwise with the symbol I then need to say in other places, if symbol equals :DC1 then use this string... if that makes sense?
bkxd has joined #ruby
<dminuoso> Evesy_: You can convert strings to symbols and back using to_sym/to_s if needed.
<dminuoso> Evesy_: Though if most operations assume strings, you might as well simply use a string in that case.
Xiti has quit [Quit: Xiti]
<jhass> Evesy_: the question is whether you ever do something if get_dc(ip) == 'DC1' or not
<jhass> if not, then stay with returning strings indeed
gdp has joined #ruby
<Evesy_> get_dc is just used to return the DC (either DC1 or DC2) based on those IP ranges, and that returned value is placed inside of a json config
<jhass> yup then stay with strings
yeticry has quit [Ping timeout: 264 seconds]
<dminuoso> Evesy_: https://eval.in/617579
yeticry has joined #ruby
<dminuoso> I would even go as far as naming it "dc_of" .
Xiti has joined #ruby
hutch34_ has joined #ruby
matt4 has joined #ruby
KaliLinuxGR has quit [Ping timeout: 252 seconds]
<Evesy_> dminuoso: I have another method that decides whether it's Prod/Non-Prod too, so I'd need to keep those IP ranges all defined seperately I think
<Evesy_> Actually, I'd just add 'Prod=[IPAddr.new('172.28.136.0/18'), IPAddr.new('172.28.192.0/20')]' I suppose
<jhass> something like class Hash; def find_value(pattern); find {|k, _| pattern === key }.last; end; end; would be handy here
<dminuoso> Evesy_: That's not a problem, then just list them comma separated in the case.
<dminuoso> Evesy_: You shouldnt redo this.
<dminuoso> Here's what you could do:
eprasad has joined #ruby
matt4 has quit [Ping timeout: 265 seconds]
mtkd has quit [Ping timeout: 258 seconds]
DaniG2k_ has quit [Quit: leaving]
Velizar has joined #ruby
mtkd has joined #ruby
<dminuoso> Evesy_: https://eval.in/617592
<Evesy_> Wow, awesome
<dminuoso> Though this really gets in the realm of "you can tackle this from so many angles"
<Evesy_> I'll give that a go after lunch!
sp_ has joined #ruby
<dminuoso> Evesy_: This is specifically designed for the case that you don't add more environments or DCs.
<dminuoso> (It's super crappy if that list of private method has to be modified)
Pupeno has joined #ruby
* apeiros bets dminuoso could make it dynamical for that use-case too
xall has joined #ruby
<dminuoso> apeiros: Already on it!
hutch34_ has quit [Quit: WeeChat 1.5]
AndrewIsHere has joined #ruby
<apeiros> what does "DC" stand for?
<jhass> datacenter I guess
<apeiros> ah
<apeiros> would make sense
xall has quit [Ping timeout: 244 seconds]
bkxd has quit [Ping timeout: 258 seconds]
rodfersou has joined #ruby
AndrewIsHere has quit [Ping timeout: 250 seconds]
<Velizar> time_object.in_time_zone('London') gives me an incorrect time zone. How can I convert it to the time zone in London, UK?
<Velizar> it's off by 1 hour
<dminuoso> https://eval.in/617610 ## why is this returning the hash and not the dc?
<apeiros> dminuoso: it returns the k/v pair
<apeiros> and that'd be because that's what find does :)
<apeiros> you have to do the attributes[attr] after the find
<apeiros> ?rails Velizar
<ruby[bot]> Velizar: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
sdothum has joined #ruby
<Velizar> ah yes that's Rails-specific
RegulationD has joined #ruby
<dminuoso> apeiros: Ah. My pry skills are not so great it seems.
<dminuoso> Not sure whether I like this though.
<dminuoso> (I mean that safe navigation operator doesnt belong there, an explit "if attributes" is much more readbale.
Hyuk has joined #ruby
c0mrad3 has joined #ruby
Nahra` has quit [Read error: Connection reset by peer]
<apeiros> or .dig
A_Drone has quit [Remote host closed the connection]
<apeiros> oh, no, that doesn't work
Nahra` has joined #ruby
Hyuk has quit [Max SendQ exceeded]
<apeiros> another variant would be to transform the @networks
skade has joined #ruby
<dminuoso> apeiros: https://eval.in/617624
<apeiros> @categories = @networks.values.map(&:keys).inject(:|).map { |key| [key, []] } # and then fill it from @networks
<dminuoso> Yuck..
<dminuoso> :| ?
<apeiros> union
RegulationD has quit [Ping timeout: 240 seconds]
<apeiros> >> [:foo, :bar] | [:foo, :quuz]
<ruby[bot]> apeiros: # => [:foo, :bar, :quuz] (https://eval.in/617629)
<dminuoso> apeiros: By the time Evesy_ returns we will have transformed his 5 line snippet into an entire gem.
<apeiros> sure
<dminuoso> :o)
<apeiros> though not me. I'll be afk in a bit
<dminuoso> Same here, gotta do some productive things for a change.
A_Drone has joined #ruby
hanmac has quit [Ping timeout: 258 seconds]
zarubin has joined #ruby
braincrash has quit [Ping timeout: 240 seconds]
rikkipitt has joined #ruby
<apeiros> pro-what?
<apeiros> what-ductive?
<apeiros> whatwhat?
skade has quit [Quit: Computer has gone to sleep.]
vuoto has quit [Remote host closed the connection]
hk238 has joined #ruby
<dminuoso> apeiros: Before you run off though, I got my last variant!
<apeiros> shoot
<dminuoso> Its not working yet for some reason, but you get the idea.
<apeiros> I see :)
<apeiros> the private won't do anything btw.
<apeiros> it only affects instance methods
<dminuoso> Shh. Ive been coding C++ for months now.
<dminuoso> I don't want to hear this.
<dminuoso> :)
LoneHerm_ has joined #ruby
braincrash has joined #ruby
<dminuoso> Thanks for the pointer.
zarubin has quit [Ping timeout: 244 seconds]
KaliLinuxGR has joined #ruby
the_rhizo has joined #ruby
tubuliferous has quit [Ping timeout: 260 seconds]
jgt has quit [Ping timeout: 276 seconds]
armyriad has quit [Ping timeout: 250 seconds]
jrafanie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros> it doesn't work because you have an array of hashes
shum has joined #ruby
<apeiros> I think you want @networks = {} and @networks.merge
<apeiros> or @networks = [] and @networks << [ip, attrs]
sdothum has quit [Ping timeout: 252 seconds]
<dminuoso> Ahh.
A_Drone has quit [Remote host closed the connection]
hahuang61 has joined #ruby
<dminuoso> Yeah just found it too.
xall has joined #ruby
<dminuoso> apeiros: https://eval.in/617653
LoneHerm_ has quit [Ping timeout: 252 seconds]
<dminuoso> jhass: Are you still around? Id like your input on this: Have I been overdoing things?
<dminuoso> Or apeiros for that matter of course.
shum has quit [Client Quit]
ldnunes has joined #ruby
<jhass> mh
<jhass> yes.
<jhass> :P
<dminuoso> jhass: Honestly, what would be the point where you would have stopped tossing ruby fairy dust at it?
giz|work|2 has joined #ruby
sdothum has joined #ruby
<jhass> I'm not sure, your initial case variant perhaps
xall has quit [Ping timeout: 244 seconds]
hahuang61 has quit [Ping timeout: 250 seconds]
<jhass> btw the private's there seem to have no effect?
hanmac has joined #ruby
rikkipitt has quit [Remote host closed the connection]
<jhass> also opts probably should be keyword args
rikkipitt has joined #ruby
armyriad has joined #ruby
<dminuoso> jhass: That private/public was actually just an intuitive thing happening because recently I have been writing much C++ code.
armyriad has quit [Max SendQ exceeded]
<dminuoso> Ill have to read up how to control visibility properly in Ruby.
rodfersou has quit [Ping timeout: 244 seconds]
skade has joined #ruby
Madplatypus has quit [Quit: Connection closed for inactivity]
armyriad has joined #ruby
rikkipitt has quit [Ping timeout: 276 seconds]
johnmilton has joined #ruby
xall has joined #ruby
JeanCarloMachado has joined #ruby
rodfersou has joined #ruby
Gasher has quit [Quit: Leaving]
BaroMeter has joined #ruby
xall has quit [Ping timeout: 244 seconds]
cd-rum has joined #ruby
johnmilton has quit [Ping timeout: 244 seconds]
armyriad has quit [Ping timeout: 250 seconds]
Vingador has joined #ruby
Ishido has joined #ruby
solars has quit [Quit: WeeChat 0.4.2]
skade has quit [Quit: Computer has gone to sleep.]
vuoto has joined #ruby
vuoto has quit [Remote host closed the connection]
vuoto has joined #ruby
cd-rum has quit [Ping timeout: 260 seconds]
solars has joined #ruby
vuoto has quit [Remote host closed the connection]
vuoto has joined #ruby
cd-rum has joined #ruby
pokalyis has joined #ruby
Beams has joined #ruby
xall has joined #ruby
platzhirsch has joined #ruby
rikkipitt has joined #ruby
synthroid has joined #ruby
skade has joined #ruby
Pumukel has joined #ruby
xall has quit [Ping timeout: 250 seconds]
<Beams> Could I get some advice on putting comments in an array? http://hastebin.com/uwexanigob.coffee
vuoto has quit [Remote host closed the connection]
<matthewd> Beams: Stick with your "before"
Pupeno has quit [Remote host closed the connection]
<Beams> matthewd: thanks, will do
<matthewd> Beams: You *could* use %w() + %w(), but... :/
mim1k has quit [Ping timeout: 260 seconds]
<Beams> yeah i quite like that idea
johnmilton has joined #ruby
<Beams> this file will need to be edited by my team so would be nice to keep it as simple as possible (less commas and quotes)
Pupeno has joined #ruby
Pupeno has quit [Changing host]
Pupeno has joined #ruby
tyang has joined #ruby
A_Drone has joined #ruby
tvw has quit [Read error: Connection reset by peer]
armyriad has joined #ruby
bkxd has joined #ruby
anahtar has joined #ruby
<Beams> hmm that doesn't seem to work in what i'm doing anyway. I'll stick with the first way
JeanCarloMachado has quit [Quit: Lost terminal]
xall has joined #ruby
Mon_Ouie has joined #ruby
dennisvennink has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
bruce_lee has joined #ruby
xall has quit [Ping timeout: 258 seconds]
tubuliferous has joined #ruby
Vingador_ has joined #ruby
Beams has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
xall has joined #ruby
Vingador has quit [Ping timeout: 276 seconds]
tubuliferous has quit [Ping timeout: 244 seconds]
zarubin has joined #ruby
fergal has quit [Quit: fergal]
TheWhip has quit [Remote host closed the connection]
Vingador_ has quit [Ping timeout: 276 seconds]
skade has quit [Quit: Computer has gone to sleep.]
skade has joined #ruby
Mon_Ouie has quit [Ping timeout: 250 seconds]
xall has quit [Ping timeout: 244 seconds]
TheWhip has joined #ruby
rikkipitt has quit [Quit: Leaving...]
zarubin has quit [Ping timeout: 244 seconds]
blackgoat has quit [Quit: WeeChat 1.5]
LoneHermit has joined #ruby
bkxd has quit [Ping timeout: 260 seconds]
vdamewood has quit [Ping timeout: 244 seconds]
pawnbox has quit [Remote host closed the connection]
sp_ has quit [Ping timeout: 244 seconds]
pawnbox has joined #ruby
ur5us has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
airdisa has joined #ruby
hahuang61 has joined #ruby
pawnbox has quit [Remote host closed the connection]
LoneHermit has quit [Ping timeout: 252 seconds]
TheWhip has quit [Remote host closed the connection]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
nando293921 has joined #ruby
sdothum has joined #ruby
hahuang61 has quit [Ping timeout: 250 seconds]
binaryplease has joined #ruby
Pupeno has quit [Remote host closed the connection]
Mon_Ouie has joined #ruby
pokalyis has quit [Quit: Textual IRC Client: www.textualapp.com]
Billias has quit [Ping timeout: 244 seconds]
aryaching has joined #ruby
kent\n has quit [Read error: Connection reset by peer]
fergal has joined #ruby
kent\n has joined #ruby
kent\n has quit [Changing host]
kent\n has joined #ruby
tk__ has joined #ruby
swills_ has quit [Ping timeout: 250 seconds]
glcx has joined #ruby
glcx has quit [Changing host]
glcx has joined #ruby
pokalyis has joined #ruby
pawnbox has joined #ruby
jgt has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
xall has joined #ruby
malconis has joined #ruby
MarkBilk__ has quit [Ping timeout: 250 seconds]
Pupeno has joined #ruby
MarkBilk has joined #ruby
xall has quit [Ping timeout: 244 seconds]
mim1k has joined #ruby
Billias has joined #ruby
hutch34 has joined #ruby
cfec0b8d has quit [Quit: KVIrc 4.9.1 Aria http://www.kvirc.net/]
chipotle has joined #ruby
chipotle has quit [Max SendQ exceeded]
Snowy has joined #ruby
chipotle has joined #ruby
xlegoman has joined #ruby
chipotle has quit [Max SendQ exceeded]
s2013 has joined #ruby
chipotle has joined #ruby
matt4 has joined #ruby
Mon_Ouie has quit [Ping timeout: 260 seconds]
chipotle has quit [Max SendQ exceeded]
chipotle has joined #ruby
chipotle has quit [Max SendQ exceeded]
chipotle has joined #ruby
chipotle has quit [Max SendQ exceeded]
alfiemax has quit [Ping timeout: 258 seconds]
Pupeno_ has joined #ruby
chipotle has joined #ruby
raeoks has quit [Quit: Textual IRC Client: www.textualapp.com]
Pupeno_ has quit [Remote host closed the connection]
xall has joined #ruby
chipotle has quit [Max SendQ exceeded]
matt4 has quit [Ping timeout: 252 seconds]
chipotle has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
Pupeno has quit [Read error: Connection reset by peer]
Pupeno has joined #ruby
Pupeno has quit [Changing host]
Pupeno has joined #ruby
chipotle has quit [Max SendQ exceeded]
the_rhizo has quit [Ping timeout: 276 seconds]
dionysus69 has quit [Ping timeout: 252 seconds]
sp_ has joined #ruby
xall has quit [Ping timeout: 240 seconds]
dminuoso has quit [Ping timeout: 265 seconds]
the_rhizo has joined #ruby
pawnbox has quit [Remote host closed the connection]
fmcgeough has joined #ruby
jgt has quit [Ping timeout: 264 seconds]
Gasher has joined #ruby
Mon_Ouie has joined #ruby
kies has quit [Ping timeout: 258 seconds]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bluOxigen has joined #ruby
marloi has joined #ruby
Beams has joined #ruby
eljimmy has quit [Quit: This computer has gone to sleep]
pawnbox has joined #ruby
sharkman has quit [Ping timeout: 250 seconds]
xall has joined #ruby
s2013 has joined #ruby
Pupeno has quit [Ping timeout: 265 seconds]
ta_ has quit [Remote host closed the connection]
Pumukel has quit [Quit: ChatZilla 0.9.92 [Firefox 47.0/20160604131506]]
dminuoso has joined #ruby
<marloi> hello, I'm trying to uninstall the gem for heroku by doing "sudo gem uninstall -i /usr/share/gems heroku" but I'm getting a permission error: "ERROR: While executing gem ... (Gem::FilePermissionError)" Any idea how to fix this?
Pupeno has joined #ruby
Pupeno has quit [Changing host]
Pupeno has joined #ruby
Pupeno has quit [Remote host closed the connection]
davidklsn has joined #ruby
tvw has joined #ruby
<davidklsn> Hello, anyone have a tip to convert "David Andersson" to david.andersson@gmail.com?
<jhass> "#{name.downcase.gsub(" ", ".")}@gmail.com" ?
Pupeno has joined #ruby
Pupeno has quit [Changing host]
Pupeno has joined #ruby
<matthewd> davidklsn: Blindly assuming everyone's email address is first.last@gmail ? :/
<jhass> marloi: you probably need to run it as root since you installed it as root
Pupeno has quit [Remote host closed the connection]
xall has quit [Ping timeout: 244 seconds]
RegulationD has joined #ruby
<jhass> matthewd: let them, I don't want their spam anyhow :P
<davidklsn> matthewd just used it for the example :)
<davidklsn> jhass thanks!
<marloi> jhass, doesn't putting "sudo" before the uninstall command run it as root?
<jhass> marloi: it does
<marloi> but that's how I'm running it, and I still get that error
Pupeno has joined #ruby
<jhass> marloi: that seems rather unlikely, root bypasses most if not all permission checks
bigkevmcd has quit [Quit: Outta here...]
<jhass> maybe your sudo is a stub?
<jhass> which sudo; command -v sudo
RegulationD has quit [Ping timeout: 240 seconds]
<Evesy_> dminuoso: You still knocking around?
<marloi> both give /usr/bin/sudo
A_Drone has quit [Remote host closed the connection]
<jhass> what about gem?
<jhass> which gem; command -v gem
memorasus has joined #ruby
zarubin has joined #ruby
r_rios has quit [Ping timeout: 250 seconds]
tvw has quit [Remote host closed the connection]
kies has joined #ruby
<marloi> I get /usr/bin/gem for both
ramortegui has joined #ruby
<matthewd> marloi: Doesn't the error tell you exactly which file it's failing to access?
A_Drone has joined #ruby
tubuliferous has joined #ruby
<matthewd> marloi: You seem to have truncated the most useful part of the message :|
<dminuoso> Evesy_: Yes
tvw has joined #ruby
<marloi> "You don't have write permissions for the /usr/share/gems/bin directory."
dionysus69 has joined #ruby
bkxd has joined #ruby
<matthewd> How did you install this gem?
Pupeno has quit [Ping timeout: 258 seconds]
pawnbox has quit [Remote host closed the connection]
ChiefAlexander has joined #ruby
<marloi> I don't really remember, maybe "sudo gem install heroku"?
subby has joined #ruby
pawnbox has joined #ruby
zarubin has quit [Ping timeout: 258 seconds]
<matthewd> It's not an OS package?
<marloi> no, I'm on fedora
submitnine has quit [Ping timeout: 252 seconds]
subby is now known as submitnine
m1dnight1 is now known as m1dnight_
<matthewd> Given Fedora was my first guess of OS whose package it might be, I'm not sure that fact alone disproves the theory
byteflame has joined #ruby
A_Drone has quit [Remote host closed the connection]
xall has joined #ruby
griffindy has joined #ruby
<marloi> why would that screw up the permissions though?
aupadhye has quit [Quit: Leaving]
<Evesy_> Sorry dminuoso, thought I had another question. Settled for https://gist.github.com/Evesy/c0d056b2eafb8bdad81b05e3b8c7da2a in the end anyway and works well
jgt has joined #ruby
<dminuoso> Evesy_: You should at the very least use temporaries rather than duplicating the IPAddr blocks.
<matthewd> marloi: Dunno... selinux maybe?
<dminuoso> Evesy_: Otherwise it looks fine. If you looked at the examples after that, it was just me being bored and tossing common Ruby idioms at it.
<dminuoso> For no real reason other than "lets see what happens"
A_Drone has joined #ruby
A_Drone has quit [Remote host closed the connection]
<dminuoso> Anyway, gotta leave the train.
A_Drone has joined #ruby
A_Drone has quit [Remote host closed the connection]
dminuoso_ has joined #ruby
maucar has joined #ruby
matp has joined #ruby
dsea has joined #ruby
nando293921 has quit [Quit: Lost terminal]
dminuoso has quit [Remote host closed the connection]
xall has quit [Ping timeout: 260 seconds]
llaine has joined #ruby
nando293921 has joined #ruby
<llaine> Hi guys, i'm looking to do some benchmarks on some ruby function, which tools you recommend?
eljimmy has joined #ruby
thanoj has joined #ruby
jrafanie has joined #ruby
<workmad3> llaine: I tend to start with just using the stdlib benchmark features: http://ruby-doc.org/stdlib-1.9.3/libdoc/benchmark/rdoc/Benchmark.html
eprasad has quit [Quit: Leaving]
<apeiros> llaine: benchmark/ips
<marloi> my main problem is that I now have two versions of heroku installed, a ruby version which doesn't seem to be working, and a standalone which does. When I type "heroku whatever" the default seems to use the ruby version
<llaine> thank you guys for answer
<llaine> i'll try ips
bkxd has quit [Ping timeout: 250 seconds]
xall has joined #ruby
dminuoso has joined #ruby
Pupeno has joined #ruby
Pupeno has quit [Changing host]
Pupeno has joined #ruby
roflmyeggo has joined #ruby
dminuoso1 has joined #ruby
dminuoso has quit [Client Quit]
Toledo-gone is now known as croberts
xall has quit [Ping timeout: 240 seconds]
synthroid has quit []
TheWhip has joined #ruby
geekbri has joined #ruby
synthroid has joined #ruby
Torrone has quit [Quit: This computer has gone to sleep]
jgt1 has joined #ruby
bsmith has joined #ruby
bsmith has left #ruby [#ruby]
synthroi_ has joined #ruby
dminuoso has joined #ruby
Torrone has joined #ruby
jgt has quit [Ping timeout: 260 seconds]
sarbs has quit [Max SendQ exceeded]
sarbs has joined #ruby
Velizar has quit [Quit: Velizar]
dminuoso1 has quit [Ping timeout: 244 seconds]
synthroid has quit [Ping timeout: 244 seconds]
youch has joined #ruby
sarbs has quit [Max SendQ exceeded]
xlegoman has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sarbs has joined #ruby
roflmyeggo has quit [Ping timeout: 250 seconds]
freerobby has quit [Quit: Leaving.]
qguv has joined #ruby
the_drow_ has joined #ruby
last_staff has quit [Quit: last_staff]
matt4 has joined #ruby
lxsameer has quit [Quit: WeeChat 1.5]
the_drow has quit [Ping timeout: 240 seconds]
cZk is now known as czk
pawnbox has quit [Remote host closed the connection]
duckpuppy has joined #ruby
ChiefAlexander has quit [Remote host closed the connection]
xall has joined #ruby
ChiefAlexander has joined #ruby
kobain has joined #ruby
tyang has quit [Quit: Leaving]
grenierm has joined #ruby
alfiemax has joined #ruby
rodfersou has quit [Ping timeout: 250 seconds]
l4v2 has joined #ruby
rodfersou has joined #ruby
heheda has joined #ruby
matt4 has quit [Quit: WeeChat 1.5]
SteenJobs has joined #ruby
dminuoso has quit [Read error: Connection reset by peer]
xall has quit [Ping timeout: 250 seconds]
anisha has quit [Quit: This computer has gone to sleep]
plugine has joined #ruby
Spami has joined #ruby
<jhass> marloi: given fedora I second selinux or perhaps apparmor madness, time to ask #fedora
Eiam has quit [Ping timeout: 276 seconds]
tk__ has quit [Quit: ばいばい]
macsteps has joined #ruby
dsea has quit [Read error: Connection reset by peer]
jishankai has quit [Ping timeout: 252 seconds]
Billias has quit [Ping timeout: 244 seconds]
mikecmpbll has joined #ruby
qguv has quit [Ping timeout: 244 seconds]
mbreedlove has joined #ruby
craigp has quit [Ping timeout: 244 seconds]
Nahra` has quit [Remote host closed the connection]
Billias has joined #ruby
nettoweb has joined #ruby
spudowiar has joined #ruby
Nahra has joined #ruby
Pupeno has quit [Remote host closed the connection]
tyang has joined #ruby
zarubin has joined #ruby
matt3 has joined #ruby
mistermocha has joined #ruby
iLogic has joined #ruby
ramortegui has quit [Quit: Ex-Chat]
babblebre has joined #ruby
Axy has joined #ruby
lazyatom has quit [Quit: Connection closed for inactivity]
SteenJobs has quit [Quit: SteenJobs]
Billias has left #ruby [#ruby]
dsea has joined #ruby
qguv has joined #ruby
zarubin has quit [Ping timeout: 250 seconds]
mistermocha has quit [Ping timeout: 250 seconds]
Mia has quit [Ping timeout: 260 seconds]
giz|work|2 has quit [Ping timeout: 240 seconds]
snath has joined #ruby
giz|work|2 has joined #ruby
snath has quit [Read error: Connection reset by peer]
hahuang61 has joined #ruby
drefl has quit [Read error: Connection reset by peer]
drefl has joined #ruby
dhollinger has quit [Ping timeout: 264 seconds]
tvw has quit [Read error: Connection reset by peer]
tvw has joined #ruby
Evesy_ has quit [Ping timeout: 250 seconds]
hahuang61 has quit [Ping timeout: 250 seconds]
tyang has quit [Ping timeout: 260 seconds]
blandflakes has joined #ruby
dhollinger has joined #ruby
bkxd has joined #ruby
agent_white has joined #ruby
macsteps has quit [Remote host closed the connection]
platzhirsch has quit [Quit: WeeChat 1.4]
shinnya has joined #ruby
<agent_white> Mornin'
Torrone has quit [Quit: This computer has gone to sleep]
<spudowiar> Noonin'
jgt2 has joined #ruby
armyriad has quit [Ping timeout: 265 seconds]
jgt1 has quit [Ping timeout: 264 seconds]
c355e3b has quit [Quit: Connection closed for inactivity]
Torrone has joined #ruby
chouhoulis has quit [Remote host closed the connection]
cdg has joined #ruby
RegulationD has joined #ruby
Velizar has joined #ruby
SteenJobs has joined #ruby
tyang has joined #ruby
SteenJobs has quit [Client Quit]
armyriad has joined #ruby
RegulationD has quit [Ping timeout: 240 seconds]
giz|work|2 has quit [Ping timeout: 244 seconds]
aep-shoutlet has joined #ruby
banisterfiend has quit [Quit: Textual IRC Client: www.textualapp.com]
submitnine has quit []
c355e3b has joined #ruby
bkxd has quit [Ping timeout: 244 seconds]
davidklsn has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
johnny56 has quit [Ping timeout: 264 seconds]
cd-rum has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yardenbar has quit [Ping timeout: 250 seconds]
Pupeno has joined #ruby
nicoulaj has joined #ruby
Macaveli has quit [Quit: Textual IRC Client: www.textualapp.com]
mim1k has quit [Ping timeout: 244 seconds]
Gasher has quit [Quit: Leaving]
Pupeno has quit [Remote host closed the connection]
mim1k has joined #ruby
davidklsn has joined #ruby
anahtar has quit [Ping timeout: 260 seconds]
Silthias has quit [Ping timeout: 244 seconds]
freerobby has joined #ruby
Pupeno has joined #ruby
Pupeno has quit [Changing host]
Pupeno has joined #ruby
Pupeno has quit [Remote host closed the connection]
heheda has quit [Quit: Page closed]
Pupeno has joined #ruby
tvw has quit [Ping timeout: 244 seconds]
etetz has joined #ruby
Silthias has joined #ruby
AndrewIsHere has joined #ruby
tyang has quit [Ping timeout: 244 seconds]
axl_ has joined #ruby
aryaching has quit [Read error: Connection reset by peer]
synthroi_ has quit [Remote host closed the connection]
aryaching has joined #ruby
glcx_ has joined #ruby
davidklsn has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
plugine has quit [Remote host closed the connection]
AndrewIsHere has quit [Ping timeout: 250 seconds]
plugine has joined #ruby
jgt2 has quit [Ping timeout: 240 seconds]
vuoto has joined #ruby
MarkBilk has quit [Ping timeout: 250 seconds]
nicoulaj has quit [Quit: nicoulaj]
Devalo has joined #ruby
malconis has quit [Quit: Textual IRC Client: www.textualapp.com]
SteenJobs has joined #ruby
mtkd has quit [Ping timeout: 240 seconds]
plugine has quit [Ping timeout: 276 seconds]
pawnbox has joined #ruby
cdg has quit [Remote host closed the connection]
cdg has joined #ruby
mtkd has joined #ruby
davorb has left #ruby ["Using Circe, the loveliest of all IRC clients"]
polysics has joined #ruby
johnny56 has joined #ruby
aganov has quit [Remote host closed the connection]
zarubin has joined #ruby
rodfersou is now known as rodfersou|lunch
axsuul has joined #ruby
pawnbox has quit [Ping timeout: 252 seconds]
beilabs has joined #ruby
cdg has quit [Ping timeout: 244 seconds]
OTORelic4 has joined #ruby
jhack has joined #ruby
nettoweb has quit [Read error: Connection reset by peer]
teclator has quit [Ping timeout: 244 seconds]
grenierm has quit [Quit: grenierm]
zarubin has quit [Ping timeout: 265 seconds]
polysics_ has joined #ruby
LoneHermit has joined #ruby
polysics has quit [Ping timeout: 250 seconds]
ev__ has joined #ruby
vuoto has quit [Remote host closed the connection]
vuoto has joined #ruby
vuoto has quit [Remote host closed the connection]
vuoto has joined #ruby
vuoto has quit [Remote host closed the connection]
vuoto has joined #ruby
LoneHermit has quit [Ping timeout: 252 seconds]
frozengeek has quit [Ping timeout: 250 seconds]
threedee has joined #ruby
synthroid has joined #ruby
vuoto has quit [Remote host closed the connection]
vuoto has joined #ruby
Silthias1 has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
llaine has quit [Ping timeout: 250 seconds]
Silthias has quit [Ping timeout: 240 seconds]
teclator has joined #ruby
synthroid has quit [Ping timeout: 244 seconds]
RegulationD has joined #ruby
craigp has joined #ruby
solars has quit [Ping timeout: 265 seconds]
Spami has quit [Quit: This computer has gone to sleep]
SteenJobs has quit [Quit: SteenJobs]
vuoto has quit [Remote host closed the connection]
synthroid has joined #ruby
vuoto has joined #ruby
Snowy has quit [Quit: ragequit]
axsuul has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
soulisson has joined #ruby
jgt2 has joined #ruby
<soulisson> Hi, can blocks be seen as anonymous functions?
<apeiros> they're similar, yes
<apeiros> they additionally are closures
vuoto has quit [Remote host closed the connection]
cdg has joined #ruby
<soulisson> apeiros, thanks
TomyLobo has joined #ruby
vuoto has joined #ruby
pawnbox has joined #ruby
<apeiros> i.e., they'll keep all local variables from the scope where they've been defined, including the pseudo-local "self"
<soulisson> apeiros, nice
mark_66 has quit [Quit: Leaving.]
memorasus has quit [Ping timeout: 260 seconds]
<soulisson> I have issue with my code, I get the following error: `gets': No such file or directory - llp (Errno::ENOENT) with the "gets" method
<apeiros> Kernel#gets works on ARGF, not $stdin
<apeiros> so if you pass any arguments to your script, it'll try to read from files named like the passed arg.
jgt3 has joined #ruby
bkxd has joined #ruby
<soulisson> apeiros, oh, didn't know that
<apeiros> i.e. `ruby script.rb foo bar` with script.rb containing `while line = gets` will read the file ./foo, then ./bar, then stdin until EOF
<soulisson> apeiros, what's the proper way to read from stdin
<apeiros> $stdin.gets
jgt2 has quit [Ping timeout: 252 seconds]
<soulisson> $variables are global variables?
<apeiros> yes
SilverKey has joined #ruby
rikkipitt has joined #ruby
memorasus has joined #ruby
<soulisson> apeiros, if I define a local variable foo="cool" in a script "script_a.rb" and I load this script in "script_b.rb", will the foo variable be available in script_b.rb
dminuoso_ has quit [Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )]
<apeiros> no
plugine has joined #ruby
<apeiros> that "local" part in their name has its reason ;-)
<soulisson> apeiros, ok, than you very much, I'm really a noob :)
<apeiros> np
<soulisson> but I start to enjoy writing in Ruby
gdp has quit [Remote host closed the connection]
TPug has joined #ruby
<soulisson> Can you recomend a good ruby editor, one that provide maybe code completion?
<apeiros> I use sublime text
<soulisson> Ok, I'll try it
cschnei__ has joined #ruby
edwinvdgraaf has quit [Ping timeout: 258 seconds]
<thanoj> its a question of if you want a ide or text editor
nadir has joined #ruby
<apeiros> other well known editors are: emacs, vim, vi, rubymine (IDE)
amclain has joined #ruby
<apeiros> on osx, I also like bbedit. but last time I payed for it, it was rather expensive.
<soulisson> thanoj, I guess I meant IDE
<apeiros> you'll find that a majority of ruby coders actually prefer a good text editor over an IDE
marcoecc has joined #ruby
<soulisson> apeiros, what's the reason?
mrgrieves has quit [Ping timeout: 265 seconds]
<apeiros> can't speak for others. for me, IDEs tend not to offer any benefit I actually use, but the features they provide still demand a lot of resources, making the editor sluggish and/or the whole computer
craigp has quit [Ping timeout: 250 seconds]
plugine has quit [Remote host closed the connection]
ferr has quit [Quit: WeeChat 1.5]
<soulisson> ok
<thanoj> I'd say if you're new to ruby then maybe use an IDE as it might help debugging/learning easier because of the additional tools
<apeiros> I'm of the opposite opinion
<apeiros> you'll be distracted by trying to learn the IDEs feature instead of focusing on ruby
<apeiros> *features
<thanoj> yeah I guess, I was mostly saying from a debugging perspective
<thanoj> I think they have nice breakpoint/step through features in some of those ides
vuoto_ has joined #ruby
<thanoj> There are a lot of ruby tools/gems to debug as well, but I came from Java and I appreciated that aspect of the eclipse ide
<elomatreb> If you want breakpoints, byebug/pry is nice and usable without an IDE
<thanoj> when I was first learning programming
<Papierkorb> thanoj: Try IntelliJ
<Papierkorb> An actual debugger feature would be fun, but OTOH, pry suits ruby quite well. binding.pry is basically a breakpoint
centrx has joined #ruby
<thanoj> ya I agree, I use pry now and it can fit quite nicely into a vim workflow
<elomatreb> I don't have any experience with compiled languages that offer "true" breakpoints, what are the differences from those to a byebug breakpoint?
bkxd has quit [Ping timeout: 244 seconds]
rajdesai has joined #ruby
govg has quit [Ping timeout: 240 seconds]
bkxd has joined #ruby
<jobat> Hm. vim is for some reason significantly slower in ruby files for me with syntax highlighting on.
<jobat> to the point where it's noticably laggy when (and I know this is a bad thing) holding j/k to scroll between lines
cdg has quit [Ping timeout: 260 seconds]
<etetz> what plugins you using for it?
tw1sted has quit [Changing host]
tw1sted has joined #ruby
ev__ has quit [Read error: Connection reset by peer]
bkxd has quit [Ping timeout: 258 seconds]
<mikecmpbll> (offtopic) i posted to #rubyonrails earlier but if any uk ruby devs fancy a dev job working on a rails app in yorkshire, pm me :') (devops roles also)
tejasmanohar has joined #ruby
<mikecmpbll>
glcx has quit [Quit: Quitte]
glcx_ is now known as glcx
<ljarvis> and if you want one remote then pm me :D
<mikecmpbll> ljarvis : will bear in mind! :)
<ljarvis> :)
ev_ has joined #ruby
bkxd has joined #ruby
antgel has quit [Ping timeout: 258 seconds]
gizmore has joined #ruby
sp_ has quit [Ping timeout: 258 seconds]
mbreedlove has quit [Ping timeout: 265 seconds]
<EdwardIII> mikecmpbll: sky sports betting?
RegulationD has quit [Remote host closed the connection]
<jobat> etetz: none
<mikecmpbll> EdwardIII : heh, they're not the only people recruiting in leeds, believe it or not.
nando293921 has quit [Ping timeout: 260 seconds]
<EdwardIII> heh i choose to believe
<mikecmpbll> nah we're a kinda small outfit in skipton
<mikecmpbll> with a good product, and not enough devs :)
polyidus has joined #ruby
threedee has quit [Ping timeout: 240 seconds]
<zacts> the only IDE I use is tmux + vim, but I like Atom kind of too
<EdwardIII> i gotta run, all the best
zarubin has joined #ruby
threedee has joined #ruby
marloi has quit [Ping timeout: 244 seconds]
solars has joined #ruby
<mikecmpbll> cya :)
SCHAAP137 has joined #ruby
last_staff has joined #ruby
<etetz> @jobat Are you sure it's only ruby files then? That sounds.. pretty strange to me.
<etetz> Bah, sorry kind of new to IRC I'm not sure how to do that fancy name message like you did =P
SilverKey has quit [Quit: Halted.]
<jobat> etetz: I think it's just if your message starts with a username
vuoto_ has quit [Remote host closed the connection]
vuoto has quit [Quit: Lost terminal]
<etetz> Ah, you said youre just doing syntax highlighting and that's what's bogging it down?
zarubin has quit [Ping timeout: 240 seconds]
<matthewd> jobat: Does `:syn off` "fix" it?
<jobat> yeah, and if I open a java file that is a couple thousand lines long with syntax highlighting it doesn't have the issue
<jobat> matthewd: yep, that's the only reason I know it's the syntax highlighting that's causing it
<etetz> Hm I'm not sure vanilla vim tbh, I use vim-ruby plugin
ruby-lang467 has joined #ruby
<ruby-lang467> Hello, is this a general chat for ruby help as well?
Pupeno has quit [Quit: Leaving...]
<eam> ruby-lang467: sure is
<ruby-lang467> Have you possibly dealt with the twitter bot _ebooks before?
LoneHerm_ has joined #ruby
pawnbox has quit [Remote host closed the connection]
<matt3> jobat: try "set re=1" in your .vimrc
chouhoulis has joined #ruby
mikecmpbll has quit [Ping timeout: 258 seconds]
hahuang61 has joined #ruby
rajdesai has quit [Remote host closed the connection]
beilabs_ has joined #ruby
pawnbox has joined #ruby
mim1k has quit [Ping timeout: 258 seconds]
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
LoneHerm_ has quit [Ping timeout: 252 seconds]
<ruby-lang467> http://pastebin.com/WMuh4mkf this is the error i get, any help?
<ruby[bot]> ruby-lang467: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/4c2a08d70aa60e9dcbbc55997c43ef09
<ruby[bot]> ruby-lang467: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
howdoi has joined #ruby
<eam> ruby-lang467: the error appears to be in a file you haven't included in the gist (bots.rb)
Beams has quit [Quit: Textual IRC Client: www.textualapp.com]
ixti has joined #ruby
beilabs has quit [Ping timeout: 260 seconds]
<eam> it's saying that "configure" is being used, which might be a variable name or a method name, but there's nothing defined by that name
hahuang61 has quit [Ping timeout: 250 seconds]
<ruby-lang467> @eam it actually has to be in the bots file, because the error on the run file is literally this:
<eam> in ruby the syntax for referencing a variable or a method is ambiguous
<ruby-lang467> require_relative 'bots'
<jobat> matt3: no difference as far as I can see, thanks for trying though
johnny56 has quit [Ping timeout: 264 seconds]
<ruby-lang467> here is run
rodfersou|lunch is now known as rodfersou
<ruby-lang467> The other one was bots
Billias has joined #ruby
spongebonghemppa has joined #ruby
<jobat> matt3: actually, it is a little better, but still laggy. Weird.
<jobat> I'll probably just switch to using the vim-ruby plugin
<spongebonghemppa> how do you iterate through an entire array and split each item in the array?
johnny56 has joined #ruby
<spongebonghemppa> basically i want to iterate through the array and split each word into characters
<spongebonghemppa> but i'm getting an invalid conversion error
<elomatreb> Maybe gist your code?
<matthewd> spongebonghemppa: It doesn't sound like your problem is related to the iteration
<jobat> spongebob: have you tried array.map{|x| x.chars} ?
rikkipitt has quit [Quit: Leaving...]
Devalo has quit [Remote host closed the connection]
<spongebonghemppa> http://pastie.org/10929919
<jobat> *spongebonghemppa rather
pawnbox has quit [Remote host closed the connection]
Devalo has joined #ruby
<spongebonghemppa> jobat: no i haven't used map
<spongebonghemppa> so i can do a for in loop for every word and then map each word for their chars?
<spongebonghemppa> that's sweet
<elomatreb> In Ruby, we generally do not use the classical for loops to iterate. Array offers utility methods for that
<spongebonghemppa> and a more concise way to solve this problem
<jobat> yeah, you'd normally use array.each rather than a for loop. nicer to read!
<spongebonghemppa> i think you just helped me reduce a nice amount of lines in my code :)
<elomatreb> Also, in is_vowel, you can just do vowels.include?(letter)
<spongebonghemppa> i tried that
symm- has joined #ruby
<spongebonghemppa> or maybe i was close to it
<spongebonghemppa> but it didn't work somehow so i made a method for it
<spongebonghemppa> i wish i had a timeline of how i coded and each individual character i typed over the entire span of my script
rajdesai has joined #ruby
<spongebonghemppa> but something like that doesn't exist =(
<elomatreb> Yes, it does. It's called git, and it's really nice once you get used to it
rajdesai has quit [Remote host closed the connection]
<spongebonghemppa> no git tracks your commits
<spongebonghemppa> i'm talking about logging every keystroke
<Papierkorb> Undo?
<spongebonghemppa> then you have a slider that you can drag
<spongebonghemppa> and see what you typed and changed along the way ;)
<Papierkorb> Each individual keystrokes aren't that useful anyway
<elomatreb> Ah. Some editors offer a visual history, but that's generally not *too* useful
airdisa has quit []
pawnbox has joined #ruby
<spongebonghemppa> that way you can pinpoint what you were thinking at that particular moment in time
Devalo has quit [Ping timeout: 264 seconds]
<spongebonghemppa> sometimes you forget what you're trying to do? (maybe that's a problem with beginners) and that slider can help you stay focused
ev_ has quit [Quit: (null)]
shmuli has joined #ruby
<Papierkorb> more like staying nonfocused by messing around with yet another control element
ruby-lang467 has quit [Quit: Page closed]
<elomatreb> I found eliminating distractions more useful
Derperperd has joined #ruby
beilabs_ has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
beilabs has joined #ruby
polysics_ has quit [Ping timeout: 258 seconds]
matt3 has quit [Ping timeout: 240 seconds]
sara- has joined #ruby
<sara-> hello
<sara-> msfconsole
<sara-> Could not find rake-11.1.2 in any of the sources
<sara-> Run `bundle install` to install missing gems.
AndrewIsHere has joined #ruby
<jhass> seems pretty clear
<spongebonghemppa> sara-: type the last command bundle install
<spongebonghemppa> if you have problems check your gemfile
dionysus69 has quit [Ping timeout: 258 seconds]
<spongebonghemppa> but make sure you're in the same directory as the gemfile
pawnbox has joined #ruby
airdisa has joined #ruby
<spongebonghemppa> in javascript you have words[i]
<spongebonghemppa> what is the ruby equivalent?
beilabs has quit [Ping timeout: 264 seconds]
polysics has joined #ruby
<spongebonghemppa> because i am iterating through each word
<jhass> words.each do |word|
<spongebonghemppa> but i'm in a for in loop
freerobby has quit [Quit: Leaving.]
<jhass> don't be
jgt3 has quit [Read error: Connection reset by peer]
<jhass> for loops are discouraged, and internally call .each anyway
freerobby has joined #ruby
<spongebonghemppa> what's the point of having for loops then?
<jhass> legacy
Billias has quit [Ping timeout: 258 seconds]
freerobby has quit [Client Quit]
shmuli has quit [Remote host closed the connection]
djbkd has joined #ruby
tyang has joined #ruby
<spongebonghemppa> jhass: is this how it should be done?
<spongebonghemppa> http://pastie.org/10929931
banisterfiend has joined #ruby
MarkBilk has joined #ruby
<sara-> how do you install missing gems
edwinvdgraaf has joined #ruby
Vingador has joined #ruby
<jhass> spongebonghemppa: that's pretty good already, there's Enumerable#any? which encapsulates that pattern, but in this case have a look at Array#include?
<jhass> sara-: run bundle install
skade has joined #ruby
<jobat> jhass: personally I'd just do vowels.include?(letter)
<jobat> jhass: sorry I meant spongebonghemppa
<spongebonghemppa> jhass: he might be having a dependencies problem
<spongebonghemppa> jobat: i'll try that too
TPug has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<spongebonghemppa> there might be some dependencies not listed in that file
<spongebonghemppa> but that seems strange
<jobat> spongebonghemppa: also, ruby automatically returns whatever the result of the last statement run in the method is so if you use include you don't need the return statement
<jhass> jobat: well that was where I tried to lead to by mentioning Array#include? without down right taking it away ;)
<spongebonghemppa> when do you need the return statement
shmuli has joined #ruby
<jhass> in case you want to return early, so basically never outside a if
<jhass> or loop
devbug has quit [Quit: Lances at dawn!]
<jobat> jhass: doh didn't even notice. I am bad at teaching!
malconis has joined #ruby
jhack has quit [Quit: jhack]
<spongebonghemppa> jobat: i wish i remembered what i typed back then
<spongebonghemppa> because i was getting some sort of fixnum error
<spongebonghemppa> when i tried doing vowels.include?
ChiefAlexander has quit [Remote host closed the connection]
<spongebonghemppa> oh it's because i was doing string[0].include?(vowels)
<jhass> spongebonghemppa: another minor note, in Ruby we prefer to drop prefixes, get_foo -> foo, is_foo -> foo?, set_foo -> foo=
polyidus has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass> yeah that seems the wrong way around ;)
<spongebonghemppa> jhass: english please
<jhass> but getting an error about fixnum on that is still weird, what's your Ruby version?
<spongebonghemppa> it wasn't a fixnum error
<jhass> regarding my last note, I'm not sure how to phrase any better
<elomatreb> spongebonghemppa: Do you have experience in other programming languages? Ruby can be a bit weird to get used to if that is the case
<spongebonghemppa> implicit conversion into string
<spongebonghemppa> i know javascript
<jhass> ah yeah, that makes more sense
<lizard2010> some like this?
<spongebonghemppa> why not put it in a vowels array?
diegoviola has joined #ruby
polyidus has joined #ruby
<spongebonghemppa> i mean variable
<elomatreb> They are in an array, it's just not being assigned to a variable, as we only need it once
<spongebonghemppa> wouldn't a variable look like cleaner code?
<jobat> spongebonghemppa: why would you bother putting it in an array if you're only using it once?
<spongebonghemppa> readability?
sara- has quit [Quit: Leaving]
<elomatreb> Not in this case, because the contents of the array literal and the method name make the intentions perfectly clear
<jobat> personally I prefer a concise one liner like that when it's something so simple, and as elomatreb says, the method name makes it pretty clear
<jobat> don't fall into the java trap of thinking more code always means better code =D
ChiefAlexander has joined #ruby
<elomatreb> btw: You probably want to downcase the argument of that function, because it wouldn't detect uppercase letters this way
<jobat> not that the inverse is true either
<jhass> perhaps a percent literal to spice it up further, %w(a e i o u).include?(letter)
<jhass> or even just use String#include?
<jhass> "aeiou".include?(letter)
<lizard2010> elomatreb, +1
beilabs has joined #ruby
<jobat> jhass: nice.
<elomatreb> Also, this method is not safe for international languages. There are more vowels in other languages (In German there are also äöü)
SteenJobs has joined #ruby
<lizard2010> and +1 again (=
spider-mario has joined #ruby
andikr has quit [Remote host closed the connection]
<lizard2010> and in another langs it can be total another leters
<elomatreb> ot: Is there a safe method to check if a character is a vowel? Maybe some unicode property?
edwinvdgraaf has quit [Remote host closed the connection]
<jhass> if you can find a unicode category for it you can use it via /\p{Foo}/, yeah
Spami has joined #ruby
threedee has left #ruby ["Ex-Chat"]
kyleolivo has joined #ruby
<elomatreb> Doesn't seem that way. There's a vowel category, but it's only for the phonetic alphabet :/
<lizard2010> >> "àáâãäå".mb_chars.normalize(:kd).gsub(/[^\x00-\x7F]/n,'').downcase.to_s
<lizard2010> => "aaaaaa"
<lizard2010> (0
<lizard2010> but it is from rail, I think
yardenbar has joined #ruby
TPug has joined #ruby
RegulationD has joined #ruby
zarubin has joined #ruby
SteenJobs has quit [Ping timeout: 258 seconds]
kab has joined #ruby
dhollinger has quit [Ping timeout: 250 seconds]
bad_ip has joined #ruby
matt3 has joined #ruby
MarkBilk_ has joined #ruby
AndrewIsHere has quit [Remote host closed the connection]
Devalo has joined #ruby
Devalo has quit [Remote host closed the connection]
RegulationD has quit [Ping timeout: 240 seconds]
craigp has joined #ruby
dhollinger has joined #ruby
AndrewIsHere has joined #ruby
Devalo has joined #ruby
Devalo has quit [Remote host closed the connection]
zarubin has quit [Ping timeout: 252 seconds]
MarkBilk has quit [Ping timeout: 250 seconds]
tejasmanohar has quit [Quit: tejasmanohar]
aryaching has quit [Ping timeout: 258 seconds]
macsteps has joined #ruby
MarkBilk_ has quit [Ping timeout: 258 seconds]
jobat has quit [Quit: Page closed]
benhoi has quit [Ping timeout: 260 seconds]
ltd has quit [Ping timeout: 260 seconds]
matled has quit [Ping timeout: 260 seconds]
nando293921 has joined #ruby
Devalo has joined #ruby
Devalo has quit [Remote host closed the connection]
skade has quit [Read error: Connection reset by peer]
Devalo has joined #ruby
MarkBilk_ has joined #ruby
<strongcode> Hi all - I'm creating a Rakefile task to isntall my dotfiles. Part of this includes downloading nvm, `source ~/.bash_profile` and then using nvm directly after with `nvm install <version>`
ltd has joined #ruby
skade has joined #ruby
edwinvdgraaf has joined #ruby
<strongcode> however the shell can't seem to find nvm, despite the install completing. Is this because a ruby process cannot reload the shell itself?
benhoi has joined #ruby
<strongcode> I'm trying with `Shellwords.escape("source ~/.bash_profile")`
Helheim has quit [Ping timeout: 244 seconds]
matled has joined #ruby
ruby446 has joined #ruby
<ruby446> Hi, i would like some help.
tachikomas has quit [Remote host closed the connection]
nando293921 has quit [Ping timeout: 258 seconds]
<ruby446> I barely know anything about coding, but when I try to run something:
<ruby446> "uninitialized constant EM (NameError)"
<ruby446> http://pastie.org/10929977 the specific area in question
replay has joined #ruby
BaroMeter has quit [Quit: Leaving]
<ruby446> I guess EM wasnt initialized, but i dont know if i gotta do that. And if i do, i dunno how.
<strongcode> ruby446 EM is a module, and you need to `require` it in your file that is using it.
<strongcode> what is EM anyways? Do you know?
<ruby446> not at all. I'm using a thing called twitter_ebooks that makes a twitter bot.
AndrewIsHere has quit [Remote host closed the connection]
<strongcode> can you link the source?
<Mon_Ouie> I've seen EM as a shorthand for EventMachine
<strongcode> ah, that would make sense
<umdstu> I have a factor set up as an interceptor for checking if requests have a token. I’m trying to use $injector to get my UserServer factory, but I get a circular depdency error. Whats the approach to resolve this?
pawnbox has quit [Remote host closed the connection]
<ruby446> its in the file run.rb
<ruby446> it WOULD be in skeleton, but its not
AndrewIsHere has joined #ruby
<ruby446> do you want the whole file?
mostlybadfly has joined #ruby
lele has quit [Ping timeout: 260 seconds]
Helheim has joined #ruby
AndrewIsHere has quit [Remote host closed the connection]
macsteps has quit [Remote host closed the connection]
<strongcode> yes, please
soulisson has left #ruby ["Quitte"]
shmuli has quit [Remote host closed the connection]
polyidus has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rajdesai has joined #ruby
AndrewIsHere has joined #ruby
polyidus has joined #ruby
rajdesai has quit [Remote host closed the connection]
ruby446 has quit [Ping timeout: 250 seconds]
EMthing has joined #ruby
<EMthing> I disconnected, anything?
shmuli has joined #ruby
shmuli has quit [Remote host closed the connection]
lele has joined #ruby
hutch34 has quit [Ping timeout: 244 seconds]
shmuli has joined #ruby
polyidus has quit [Client Quit]
RegulationD has joined #ruby
<strongcode> no, just requested you share the whole file
<EMthing> any solution though?
mtkd has quit [Ping timeout: 265 seconds]
cdg has joined #ruby
pawnbox has joined #ruby
swills_ has joined #ruby
tyang has quit [Quit: Leaving]
mtkd has joined #ruby
soulisson has joined #ruby
<soulisson> Didn't know I could use {} for multiline blocks
polyidus has joined #ruby
beilabs has quit [Remote host closed the connection]
<baweaver> and you can use do end for single line blocks
beilabs has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
<soulisson> baweaver, indeed, why most people prefer the do end syntax for multiline blocks?
Axy has quit [Ping timeout: 240 seconds]
flashpoint9 has joined #ruby
killerkamel has quit [Ping timeout: 244 seconds]
bmn has quit [Quit: obai]
<jhass> dunno, I mostly follow weirich's rule
macsteps has joined #ruby
vuoto has joined #ruby
miqlas-H has joined #ruby
bad_ip has quit [Ping timeout: 258 seconds]
rajdesai has joined #ruby
beilabs has quit [Ping timeout: 240 seconds]
bmn has joined #ruby
shmuli has quit [Remote host closed the connection]
karapetyan has joined #ruby
mikecmpbll has joined #ruby
Synthead has quit [Ping timeout: 276 seconds]
shmuli has joined #ruby
firstdayonthejob has joined #ruby
grenierm has joined #ruby
thanoj has quit [Remote host closed the connection]
xaxisx has joined #ruby
vuoto has quit [Remote host closed the connection]
tubuliferous has quit [Ping timeout: 240 seconds]
vuoto has joined #ruby
grenierm has quit [Client Quit]
<EMthing> could anyone possibly solve my problem
vuoto has quit [Remote host closed the connection]
vuoto has joined #ruby
vuoto has quit [Remote host closed the connection]
vuoto has joined #ruby
<jhass> EMthing: does addding require "em" help?
macsteps has quit [Remote host closed the connection]
<EMthing> At the top?
<jhass> or require "eventmachine"?
<jhass> anywhere before referencing EM
rajdesai has quit [Read error: Connection reset by peer]
xaxisx has quit [Client Quit]
macsteps has joined #ruby
vuoto has quit [Remote host closed the connection]
vuoto has joined #ruby
Rodya_ has joined #ruby
kyleolivo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<EMthing> OH MY GOD
<EMthing> I LOVE YOU
ruby-lang732 has joined #ruby
<EMthing> REQUIRE EVENTMAHINE DID THE TRICK TYTYTYTY <3
grenierm has joined #ruby
Sucks has joined #ruby
vuoto has quit [Remote host closed the connection]
vuoto has joined #ruby
Torrone has quit [Quit: This computer has gone to sleep]
Velizar has quit [Quit: Velizar]
pawnbox has quit [Read error: Connection reset by peer]
xaxisx has joined #ruby
pawnbox has joined #ruby
Guest8 has joined #ruby
Guest8 has quit [Client Quit]
Kasky has joined #ruby
SnowboardTechie has joined #ruby
Kasky has quit [Remote host closed the connection]
skade has quit [Read error: Connection reset by peer]
skade has joined #ruby
Kasky has joined #ruby
EMthing has quit [Quit: Page closed]
shmuli has quit [Remote host closed the connection]
soulisson has quit [Ping timeout: 244 seconds]
vuoto has quit [Remote host closed the connection]
grenierm has quit [Quit: grenierm]
workmad3 has quit [Ping timeout: 252 seconds]
vuoto has joined #ruby
shmuli has joined #ruby
sp__ has joined #ruby
symm- has quit [Ping timeout: 252 seconds]
kyleolivo has joined #ruby
hk238 has quit [Quit: http://www.kvirc.net/ 4.9.1 Aria]
whiteline has quit [Quit: Leaving]
polishdub has joined #ruby
shmuli has quit [Remote host closed the connection]
whiteline has joined #ruby
elaptics is now known as elaptics`away
Mon_Ouie has quit [Quit: WeeChat 1.5]
PoweredByPrana has joined #ruby
bocaneri has quit [Remote host closed the connection]
zarubin has joined #ruby
nando293921 has joined #ruby
tejasmanohar has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
PoweredByPrana has quit [Client Quit]
fergal has quit [Quit: fergal]
PoweredByPrana has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
SnowboardTechie has quit [Quit: Textual IRC Client: www.textualapp.com]
PoweredByPrana has quit [Client Quit]
zarubin has quit [Ping timeout: 260 seconds]
SnowboardTechie has joined #ruby
SnowboardTechie has quit [Client Quit]
SnowboardTechie has joined #ruby
shmuli has joined #ruby
thanoj has joined #ruby
ruby-lang732 has quit [Ping timeout: 250 seconds]
jrafanie_ has joined #ruby
bad_ip has joined #ruby
LoneHerm_ has joined #ruby
xaxisx has quit [Quit: xaxisx]
hahuang61 has joined #ruby
jrafanie has quit [Ping timeout: 252 seconds]
AndyBotwin has joined #ruby
AndyBotwin has quit [Max SendQ exceeded]
Eiam has joined #ruby
Helheim has quit [Ping timeout: 244 seconds]
LoneHerm_ has quit [Ping timeout: 252 seconds]
karapetyan has quit [Remote host closed the connection]
spudowiar has quit [Quit: Leaving.]
hahuang61 has quit [Ping timeout: 250 seconds]
Dimik has joined #ruby
minimalism has joined #ruby
hutch34 has joined #ruby
Helheim has joined #ruby
gizmore has quit [Ping timeout: 252 seconds]
rajdesai has joined #ruby
gizmore has joined #ruby
[Butch] has joined #ruby
SnowboardTechie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
macsteps has quit [Remote host closed the connection]
akahn has joined #ruby
hutch34 has quit [Ping timeout: 244 seconds]
bluOxigen has quit [Ping timeout: 276 seconds]
Salve has joined #ruby
bluOxigen has joined #ruby
drefl has quit [Ping timeout: 240 seconds]
duncannz has joined #ruby
duncannz has quit [Max SendQ exceeded]
duncannz has joined #ruby
duncannz has quit [Max SendQ exceeded]
duncannz has joined #ruby
duncannz has quit [Max SendQ exceeded]
duncannz has joined #ruby
Nahra has quit [Remote host closed the connection]
karapetyan has joined #ruby
duncannz has quit [Remote host closed the connection]
bjh13 has joined #ruby
karapetyan has quit [Remote host closed the connection]
Torrone has joined #ruby
hutch34 has joined #ruby
sp__ has quit [Ping timeout: 244 seconds]
chipotle has joined #ruby
flashpoint9 has joined #ruby
chipotle has quit [Max SendQ exceeded]
chipotle has joined #ruby
TPug has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
SCHAAP137 has quit [Quit: Leaving]
chipotle has quit [Max SendQ exceeded]
xaxisx has joined #ruby
SCHAAP137 has joined #ruby
chipotle has joined #ruby
shinnya has quit [Ping timeout: 244 seconds]
zacts has quit [Ping timeout: 260 seconds]
chipotle has quit [Max SendQ exceeded]
p0p0pr37 has quit [Remote host closed the connection]
chipotle has joined #ruby
chipotle has quit [Max SendQ exceeded]
Pumukel has joined #ruby
xaxisx has quit [Client Quit]
chipotle has joined #ruby
Rodya_ has quit [Remote host closed the connection]
chipotle has quit [Max SendQ exceeded]
Rodya_ has joined #ruby
chipotle has joined #ruby
chipotle has quit [Max SendQ exceeded]
chipotle has joined #ruby
jeremyhall has joined #ruby
chipotle has quit [Max SendQ exceeded]
xaxisx has joined #ruby
p0p0pr37 has joined #ruby
<spongebonghemppa> what is the thing called when you are trying to get part of a word?
karapetyan has joined #ruby
axl_ has quit [Ping timeout: 260 seconds]
giz|work|2 has joined #ruby
Devalo has quit [Remote host closed the connection]
axl_ has joined #ruby
<Papierkorb> spongebonghemppa: "the thing"? Could you give an example of what you want to do?
<spongebonghemppa> def string(string, starting length, ending length)
Devalo has joined #ruby
<spongebonghemppa> "hello", 2, -1 >> llo
<Papierkorb> spongebonghemppa: #slice(), or just #[]
<spongebonghemppa> what if it's not an array
<Papierkorb> >> "hello"[2..-1]
<ruby[bot]> Papierkorb: # => "llo" (https://eval.in/618045)
ldnunes has quit [Quit: Leaving]
<Papierkorb> spongebonghemppa: #[] is not bound to arrays
<Papierkorb> also, see above please
<spongebonghemppa> pig_latin_array.push(word[chars.length, - 1] + consonants.join("") + "ay")
<spongebonghemppa> undefined method `+' for nil:NilClass
<spongebonghemppa> =(
<Papierkorb> spongebonghemppa: Please read more closely what I actually wrote.
freerobby has joined #ruby
TPug has joined #ruby
crdpink has joined #ruby
crdpink2 has quit [Ping timeout: 250 seconds]
Devalo has quit [Ping timeout: 250 seconds]
marxarelli has joined #ruby
pawnbox has quit [Ping timeout: 276 seconds]
<meatchicken> if a module has the same method as a class
<meatchicken> which implementation is used
Sucks has quit [Quit: Leaving]
pawnbox has joined #ruby
<Papierkorb> >> module A; def a; "module!"; end; end; class B; include A; def a; "class!"; end; end; A.new.a
rajdesai has quit [Remote host closed the connection]
<ruby[bot]> Papierkorb: # => undefined method `new' for A:Module (NoMethodError) ...check link for more (https://eval.in/618050)
<Papierkorb> >> module A; def a; "module!"; end; end; class B; include A; def a; "class!"; end; end; B.new.a
<ruby[bot]> Papierkorb: # => "class!" (https://eval.in/618051)
<Papierkorb> meatchicken: what comes last overrides whatever came before.
armyriad has quit [Ping timeout: 260 seconds]
xall has joined #ruby
Silthias1 has quit [Ping timeout: 250 seconds]
tejasmanohar has quit [Quit: tejasmanohar]
<spongebonghemppa> http://pastie.org/10930119
<spongebonghemppa> i feel like i am really close to a solution
giz|work|2 has quit [Ping timeout: 258 seconds]
<spongebonghemppa> how would i go to the next word if it begins with a vowel?
replay_ has joined #ruby
macsteps has joined #ruby
Cohedrin has joined #ruby
[xx] has joined #ruby
replay has quit [Ping timeout: 260 seconds]
<spongebonghemppa> i got it!
replay_ has quit [Ping timeout: 276 seconds]
macsteps has quit [Ping timeout: 260 seconds]
[xx] has quit [Remote host closed the connection]
[xx] has joined #ruby
karapetyan has quit [Remote host closed the connection]
zhando has joined #ruby
axl_ has quit [Read error: Connection reset by peer]
zhando has quit [Client Quit]
karapetyan has joined #ruby
karapetyan has quit [Remote host closed the connection]
Torrone has quit [Quit: This computer has gone to sleep]
nogic has joined #ruby
lxsameer has joined #ruby
LoneHermit has joined #ruby
ihre has joined #ruby
axl_ has joined #ruby
miqlas-H has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
kyleolivo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ChiefAlexander has quit [Remote host closed the connection]
leea has joined #ruby
armyriad has joined #ruby
miqlas-H has joined #ruby
benhoi has quit [Ping timeout: 244 seconds]
babblebre has quit [Quit: Connection closed for inactivity]
LoneHermit has quit [Ping timeout: 252 seconds]
mrgrieves has joined #ruby
benhoi has joined #ruby
pokalyis has quit [Read error: Connection reset by peer]
babblebre has joined #ruby
pokalyis has joined #ruby
Helheim has quit [Ping timeout: 244 seconds]
tejasmanohar has joined #ruby
skade has joined #ruby
byteflame has quit [Ping timeout: 244 seconds]
karapetyan has joined #ruby
<hanmac> >> module A; def a; "module!"; end; end; class B; prepend A; def a; "class!"; end; end; B.new.a
<ruby[bot]> hanmac: # => "module!" (https://eval.in/618067)
Derperperd has quit [Quit: Derperperd]
<hanmac> meatchicken: it depends if the module is included or prepended
TheWhip has quit [Ping timeout: 244 seconds]
geekbri has quit [Remote host closed the connection]
mozzarella has quit [Ping timeout: 265 seconds]
byteflame has joined #ruby
miqlas-H has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
ChiefAlexander has joined #ruby
lxsameer has quit [Ping timeout: 258 seconds]
SnowboardTechie has joined #ruby
Helheim has joined #ruby
mozzarella has joined #ruby
Mon_Ouie has joined #ruby
mozzarella has quit [Client Quit]
rajdesai has joined #ruby
miqlas-H has joined #ruby
<spongebonghemppa> may i get a code review?
<spongebonghemppa> http://pastie.org/10930153
mozzarella has joined #ruby
jgt3 has joined #ruby
<spongebonghemppa> jhass: that page looks hot
<spongebonghemppa> whoever did the layout needs an award :)
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rajdesai has quit [Remote host closed the connection]
<jhass> .join("") -> .join
<jhass> prefer "string #{interpolation}" over "string " + concatenation
pokalyis has quit [Read error: Connection reset by peer]
ebbflowgo has joined #ruby
Mon_Ouie has quit [Ping timeout: 244 seconds]
s2013 has joined #ruby
vuoto has quit [Remote host closed the connection]
pokalyis has joined #ruby
rajdesai has joined #ruby
vuoto has joined #ruby
AlexRussia has joined #ruby
blandflakes has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
<jhass> pig_latin = words.map {|word| ... } http://devdocs.io/ruby~2.3/array#method-i-map
mikecmpbll has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass> oh and avoid the type of things in variable names, describe what your data represents, not how it's structured
gizmore has quit [Remote host closed the connection]
PickAndMix has quit [Quit: WeeChat 1.4]
<jhass> and no trailing ; ;)
<spongebonghemppa> i didn't even notice that
killerkamel has joined #ruby
<spongebonghemppa> old habits are hard to break
<spongebonghemppa> thank you so much for your input jhass
mikecmpbll has joined #ruby
<Papierkorb> I'd suggest extracting the stuff in the .each into its own method
nofxx has joined #ruby
rajdesai has quit [Ping timeout: 252 seconds]
<Papierkorb> Also, restructure the code paths to minimize use of things like `next` and `break`
mrgrieves has quit [Ping timeout: 244 seconds]
armyriad has quit [Ping timeout: 252 seconds]
jhack has joined #ruby
nando293921 has quit [Ping timeout: 250 seconds]
<jhass> I think the inner each is a take_while
ecnalyr has joined #ruby
giz|work|2 has joined #ruby
nertzy has quit [Ping timeout: 265 seconds]
dennisvennink has joined #ruby
<Papierkorb> The `chars` and `consonants` variables can be moved into the else block, which again I'd suggest extracting into another method
SnowboardTechie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ecnalyr> Anyone know of a more readable way to do this? `response['something'][0..associated_objects.count-1]` Gist of the full method: https://gist.github.com/ecnalyr/fd4c6f3916ff93abd39af6131c8f363f
armyriad has joined #ruby
<jhass> spongebonghemppa: https://p.jhass.eu/4o.rb
<Papierkorb> ecnalyr: First thought: response['something'].first(associated_objects.count - 1)
Dimik-- has joined #ruby
max2 has joined #ruby
jackjackdripper has joined #ruby
rajdesai has joined #ruby
<ecnalyr> Papierkorb, yep, that's a nice first step :)
<jhass> actually sans the -1, no?
polyidus has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Vingador has quit [Ping timeout: 276 seconds]
<jhass> >> [0, 1, 2, 4].first(2) == [0, 1, 2, 4][0..1]
<ruby[bot]> jhass: # => true (https://eval.in/618071)
<Papierkorb> >> a = [5,6,7,8,9,0]; (a.first(3) == a[0..2])
<ruby[bot]> Papierkorb: # => true (https://eval.in/618072)
blandflakes has joined #ruby
rajdesai has quit [Remote host closed the connection]
Mon_Ouie has joined #ruby
SnowboardTechie has joined #ruby
blandflakes has quit [Client Quit]
polyidus has joined #ruby
<ecnalyr> jhass it's an index, that's fancy too though.
<ecnalyr> and yorus works.
<ecnalyr> yours*
<Papierkorb> jhass is right
kyleolivo has joined #ruby
miqlas-H has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
Silthias has joined #ruby
marloi has joined #ruby
<ecnalyr> Maybe this? `associated_objects.map.with_index{|associated_object, index| response['something'][index]}` - yikes.
maucar has quit [Quit: Leaving]
Dimik-- has quit [Ping timeout: 250 seconds]
<jhass> .first is fine
Coldblackice_ has joined #ruby
aep-shoutlet has quit [Quit: Connection closed for inactivity]
djbkd has quit [Quit: My people need me...]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
grenierm has joined #ruby
replay has joined #ruby
zarubin has joined #ruby
eljimmy has quit [Quit: This computer has gone to sleep]
macsteps has joined #ruby
leea has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
axsuul has joined #ruby
Jaxan has joined #ruby
QORRiE has joined #ruby
blackgoat has joined #ruby
replay has quit [Ping timeout: 240 seconds]
madsa has quit [Ping timeout: 250 seconds]
zarubin has quit [Ping timeout: 244 seconds]
madsa has joined #ruby
<Jaxan> Hi! I don't often use ruby. Now I wanted to update my website with jekyll. But bundler cannot find rake: https://vvt.nu/lye
macsteps has quit [Ping timeout: 250 seconds]
tomphp has joined #ruby
<Jaxan> so I installed rake (the specific 10.1.0 version), but then it complains about the next gem. Isn't it supposed to install all dependencies when I install jekyll?
AlexRussia has quit [Ping timeout: 258 seconds]
<adaedra> try `bundle install`
ruby-lang598 has joined #ruby
<Jaxan> is bundle something which replaces gem?
<spongebonghemppa> jhass: that's how it should be done right?
<spongebonghemppa> i mean that's how it should be done in ruby?
craigp has quit [Ping timeout: 258 seconds]
<jhass> at least it's how I would do it ;)
replay has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
pawnbox has quit [Ping timeout: 276 seconds]
<spongebonghemppa> i had to re read your code a few times to get it but it was worth it ;)
<adaedra> Jaxan: bundle manages gems on development environments usually.
phrozen77 has quit [Ping timeout: 260 seconds]
craigp has joined #ruby
<adaedra> Or on non-gem things.
mistermocha has joined #ruby
rajdesai has joined #ruby
ruby-lang598 has quit [Quit: Page closed]
armyriad has quit [Read error: Connection reset by peer]
<Jaxan> adaedra: was it always like this or is that something new?
armyriad has joined #ruby
<adaedra> bundle has been existing for a long time now
hahuang61 has joined #ruby
<Jaxan> hmm, never touched it before
<spongebonghemppa> the chars thing that you linked jhass was confusing to understand because it doesn't have a code example, but neither does the ruby docs website
<spongebonghemppa> it was confusing until i read your code :)
<spongebonghemppa> thanks a lot!
nando293921 has joined #ruby
<jhass> it's just a more efficient version of .split("") really ;)
<jhass> (and IMO more clear)
<spongebonghemppa> it reads better too
naos has joined #ruby
ebbflowgo has quit [Ping timeout: 260 seconds]
ebbflowgo has joined #ruby
maloik21 has joined #ruby
madsa_ has joined #ruby
Devalo has joined #ruby
madsa has quit [Ping timeout: 276 seconds]
hahuang61 has quit [Ping timeout: 250 seconds]
rajdesai has quit [Remote host closed the connection]
rajdesai has joined #ruby
matp_ has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
xall has quit [Ping timeout: 252 seconds]
Helheim has quit [Ping timeout: 265 seconds]
sp___ has joined #ruby
synthroid has quit []
skade has quit [Quit: Computer has gone to sleep.]
matp has quit [Ping timeout: 258 seconds]
sdothum has joined #ruby
Devalo has quit [Ping timeout: 264 seconds]
marcoecc has quit [Remote host closed the connection]
maloik has quit [Ping timeout: 250 seconds]
Helheim has joined #ruby
Guest38_ has joined #ruby
axsuul has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tenderlo_ has quit [Read error: Connection reset by peer]
bad_ip has quit [Quit: Some people just want to watch the world burn.]
tenderlove has joined #ruby
karapetyan has quit [Remote host closed the connection]
ur5us has joined #ruby
karapetyan has joined #ruby
bad_ip has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
umdstu has quit [Quit: umdstu]
yfeldblum has joined #ruby
jobat has joined #ruby
nando294021 has joined #ruby
nando293921 has quit [Read error: Connection reset by peer]
skade has joined #ruby
swills_ has quit [Ping timeout: 276 seconds]
nando294021 has quit [Remote host closed the connection]
solars has quit [Quit: WeeChat 0.4.2]
madsa_ has quit [Ping timeout: 244 seconds]
Madplatypus has joined #ruby
madsa has joined #ruby
nando293921 has joined #ruby
IanMalcolm has quit [Quit: ZNC 1.6.1 - http://znc.in]
max2 is now known as PickAndMix
skade has quit [Ping timeout: 244 seconds]
polysics has quit [Remote host closed the connection]
eljimmy has joined #ruby
Nahra has joined #ruby
solars has joined #ruby
_kfpratt has joined #ruby
djbkd has joined #ruby
IanMalcolm has joined #ruby
pokalyis has quit [Read error: Connection reset by peer]
madsa has quit [Ping timeout: 260 seconds]
madsa has joined #ruby
pokalyis has joined #ruby
tejasmanohar_ has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
kfpratt has quit [Ping timeout: 258 seconds]
tejasmanohar has quit [Ping timeout: 250 seconds]
tejasmanohar_ is now known as tejasmanohar
last_staff has quit [Remote host closed the connection]
shmuli has quit [Remote host closed the connection]
last_staff has joined #ruby
TPug has quit [Ping timeout: 276 seconds]
sdothum has joined #ruby
rajdesai has quit [Remote host closed the connection]
tubuliferous_ has joined #ruby
Pumukel has quit [Remote host closed the connection]
tejasmanohar has quit [Quit: tejasmanohar]
centrx has quit []
pandaant has quit [Remote host closed the connection]
symm- has joined #ruby
last_staff has quit [Quit: last_staff]
KaliLinuxGR has quit [Ping timeout: 250 seconds]
rajdesai has joined #ruby
rajdesai has quit [Remote host closed the connection]
jaequery has joined #ruby
macsteps has joined #ruby
yeticry has quit [Ping timeout: 276 seconds]
SnowboardTechie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yeticry has joined #ruby
polyidus has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
xall has joined #ruby
duckpuppy has quit [Ping timeout: 276 seconds]
ebbflowgo has quit [Quit: ebbflowgo]
polyidus has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
grenierm has quit [Quit: grenierm]
karapetyan has quit [Remote host closed the connection]
sp___ has quit [Ping timeout: 260 seconds]
karapetyan has joined #ruby
jenrzzz has joined #ruby
spudowiar has joined #ruby
frozengeek has joined #ruby
vuoto has quit [Remote host closed the connection]
Torrone has joined #ruby
<spongebonghemppa> how do you do optional arguments in ruby?
<spongebonghemppa> i see that it's a * before the parameter name but it's not working
sp__ has joined #ruby
[Butch] has quit [Ping timeout: 252 seconds]
<spongebonghemppa> http://pastie.org/10930250
Nahra has quit [Read error: Connection reset by peer]
[xx] has quit [Ping timeout: 276 seconds]
Nahra has joined #ruby
KaliLinuxGR has joined #ruby
<jhass> spongebonghemppa: in this variant repeats always will be an array, it allows you to call it like repeat("joe"), repeat("joe", 1), repeat("joe", 2)
<jhass> this is commonly referred to as splat argument
<spongebonghemppa> oh
<spongebonghemppa> so the splat turns it into an array
<jhass> what people usually mean with optional arguments is those having a default value
<jhass> def repeat(value, repeats=1)
<spongebonghemppa> i tried assigning a default value but that wasn't working
tejasmanohar has joined #ruby
<jhass> show what you tried in that version?
<spongebonghemppa> now it's working
<spongebonghemppa> i'm so confused
<spongebonghemppa> oh it's because i didn't return the string
<spongebonghemppa> whoops
<spongebonghemppa> i didn't have string on the bottom
<spongebonghemppa> http://pastie.org/10930251
dionysus69 has joined #ruby
<spongebonghemppa> i needed to have string on line 15
<spongebonghemppa> this is a lot of fun
<spongebonghemppa> i'm having a lot of fun solving coding problems
<jhass> it might defeat your exercise a bit but have a look at http://devdocs.io/ruby~2.3/string#method-i-2A
<spongebonghemppa> i want to be a proficient developer in ruby and javascript
<spongebonghemppa> i want to be the best self taught programmer i can be
<spongebonghemppa> that way i can make cool apps and stuff for people to enjoy :)
<spongebonghemppa> then i could work with others on cool projects around the world
<spongebonghemppa> and learn more about how computers work... this is fun!
dionysus69 has quit [Remote host closed the connection]
madsa has quit [Ping timeout: 265 seconds]
akahn has quit [Quit: Connection closed for inactivity]
grenierm has joined #ruby
byteflame has quit [Ping timeout: 240 seconds]
LoneHermit has joined #ruby
<zenspider> spongebonghemppa: what is the output from `repeat("bob", 1)` ?
<zenspider> spongebonghemppa: what is the output from `repeat("bob", 2)` ?
rajdesai has joined #ruby
cdg has quit [Remote host closed the connection]
Vingador has joined #ruby
karapetyan has quit [Remote host closed the connection]
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
LoneHermit has quit [Ping timeout: 258 seconds]
OTORelic4 has quit [Ping timeout: 260 seconds]
karapetyan has joined #ruby
the_drow_ has quit [Quit: This computer has gone to sleep]
skade has joined #ruby
hutch34 has quit [Ping timeout: 258 seconds]
<spongebonghemppa> zenspider: it should be the same output
<spongebonghemppa> i don't understand why i am getting wrong number of arguments on this challenge http://pastie.org/10930274
ur5us has quit [Remote host closed the connection]
Trynemjoel has quit [Ping timeout: 264 seconds]
<baweaver> zenspider: ohai, haven't seen you on in a while
mikecmpbll has quit [Quit: Textual IRC Client: www.textualapp.com]
bad_ip has quit [Ping timeout: 276 seconds]
babblebre has quit [Quit: Connection closed for inactivity]
grenierm has quit [Quit: grenierm]
bad_ip has joined #ruby
Trynemjoel has joined #ruby
zeroDi has joined #ruby
<spongebonghemppa> i don't understand why if word.index == 0 && little_words.include?(word)
<spongebonghemppa> is wrong :(
<jhass> well, what would word.index return if it would do what you think it does?
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jrafanie_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mistermocha has quit [Remote host closed the connection]
<spongebonghemppa> the index of the current iteration of the each method?
kab has quit [Quit: Leaving]
Torrone has quit [Quit: This computer has gone to sleep]
<jhass> but how would ruby know you mean that? it's just a regular String object and you call the String#index method on it
jenrzzz has quit [Ping timeout: 260 seconds]
swills_ has joined #ruby
axsuul has joined #ruby
cd-rum has joined #ruby
ur5us has joined #ruby
roflmyeggo has joined #ruby
youch has quit [Remote host closed the connection]
cd-rum_ has joined #ruby
sp__ has quit [Ping timeout: 276 seconds]
polyidus has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
cd-rum has quit [Ping timeout: 244 seconds]
jeremyhall has quit [Remote host closed the connection]
<zenspider> spongebonghemppa: does that even make sense? repeat("bob", 1) == repeat("bob", 2) ???
jenrzzz has joined #ruby
<zenspider> baweaver: hey!
<spongebonghemppa> not when i think about it
polyidus has joined #ruby
spudowiar has quit [Ping timeout: 252 seconds]
frozengeek has quit [Quit: frozengeek]
tejasmanohar has quit [Quit: tejasmanohar]
ecnalyr has quit []
<zenspider> >> def repeat(s, n) ([s] * n).join " "; end; puts repeat("bob", 1); puts repeat("bob", 2)
<ruby[bot]> zenspider: # => bob ...check link for more (https://eval.in/618096)
<zenspider> >> def repeat(s, n) ([s] * n).join " "; end; puts repeat("bob", 1)
<ruby[bot]> zenspider: # => bob ...check link for more (https://eval.in/618097)
<zenspider> >> def repeat(s, n) ([s] * n).join " "; end; puts repeat("bob", 2)
<ruby[bot]> zenspider: # => bob bob ...check link for more (https://eval.in/618098)
QORRiE has quit [Quit: Leaving]
tejasmanohar has joined #ruby
duckpuppy has joined #ruby
<spongebonghemppa> zenspider: yes i realized it doesn't makes senes
<spongebonghemppa> sense
eljimador has joined #ruby
<spongebonghemppa> at least it's passing the test cases lol
solars has quit [Ping timeout: 258 seconds]
spudowiar has joined #ruby
<baweaver> then the test is wrong
<spongebonghemppa> i'll refactor it once i finish this last challenge :)
<spongebonghemppa> the test is wrong because it only tests for one case
solars has joined #ruby
ericsupreme has quit [Remote host closed the connection]
axl_ has quit [Quit: axl_]
cdg has joined #ruby
rodfersou has quit [Quit: leaving]
<zenspider> spongebonghemppa: what is this for?
<spongebonghemppa> i'm just learning ruby that's all
<spongebonghemppa> personal enrichment i guess lol
workmad3 has joined #ruby
<spongebonghemppa> i'm not taking a class or anything
<spongebonghemppa> i'm just doing various coding exercises i found on the internet
SteenJobs has joined #ruby
dr0lan has joined #ruby
tejasmanohar has quit [Quit: tejasmanohar]
cdg has quit [Ping timeout: 265 seconds]
tejasmanohar has joined #ruby
kavanagh has joined #ruby
leea has joined #ruby
sp_____ has joined #ruby
wcarss has left #ruby [#ruby]
giz|work|2 has quit [Ping timeout: 265 seconds]
macsteps has quit [Read error: No route to host]
macsteps_ has joined #ruby
polyidus has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
sp_____ has quit [Ping timeout: 250 seconds]
zarubin has joined #ruby
rajdesai has quit [Remote host closed the connection]
kavanagh has quit [Ping timeout: 244 seconds]
nando293921 has quit [Ping timeout: 244 seconds]
tax has quit [Quit: Leaving]
tax has joined #ruby
sp__ has joined #ruby
kavanagh has joined #ruby
dr0lan has quit [Read error: Connection reset by peer]
zarubin has quit [Ping timeout: 260 seconds]
skade has quit [Quit: Computer has gone to sleep.]
shellie_ has quit [Ping timeout: 250 seconds]
polysics has joined #ruby
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
shellie_ has joined #ruby
firstdayonthejob has quit [Ping timeout: 264 seconds]
tejasmanohar_ has joined #ruby
shmuli has joined #ruby
tejasmanohar has quit [Read error: Connection reset by peer]
tejasmanohar_ is now known as tejasmanohar
matt3 has quit [Quit: WeeChat 1.5]
shmuli has quit [Remote host closed the connection]
rajdesai has joined #ruby
ebbflowgo has joined #ruby
rkazak has joined #ruby
MarkBilk_ has quit [Quit: Leaving]
MarkBilk_ has joined #ruby
LoneHerm_ has joined #ruby
matt2 has joined #ruby
matt2 has quit [Client Quit]
hahuang61 has joined #ruby
tejasmanohar has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 265 seconds]
MarkBilk_ has quit [Client Quit]
spudowiar has quit [Excess Flood]
MarkBilk_ has joined #ruby
MarkBilk_ has quit [Client Quit]
MarkBilk_ has joined #ruby
shmuli has joined #ruby
spudowiar has joined #ruby
duckpuppy has quit [Ping timeout: 260 seconds]
Ishido has quit [Quit: Roads? Where We're Going We Don't Need Roads.]
MarkBilk_ has quit [Client Quit]
shmuli has quit [Remote host closed the connection]
MarkBilk_ has joined #ruby
LoneHerm_ has quit [Ping timeout: 260 seconds]
Devalo has joined #ruby
hahuang61 has quit [Ping timeout: 250 seconds]
shmuli has joined #ruby
MarkBilk_ has quit [Client Quit]
MarkBilk_ has joined #ruby
davedev24 has joined #ruby
shmuli has quit [Remote host closed the connection]
Devalo has quit [Ping timeout: 250 seconds]
MarkBilk_ has quit [Client Quit]
rajdesai has quit [Remote host closed the connection]
MarkBilk_ has joined #ruby
SteenJobs has quit [Quit: SteenJobs]
ur5us has quit [Remote host closed the connection]
qguv has quit [Ping timeout: 258 seconds]
bluOxigen has quit [Ping timeout: 244 seconds]
Torrone has joined #ruby
SCHAAP137 has quit [Quit: Leaving]
spider-mario has quit [Remote host closed the connection]
<spongebonghemppa> well i have hit something that i can't understand and i hope one of you can help me out :)
<spongebonghemppa> http://pastie.org/10930323
Torrone has quit [Client Quit]
rajdesai has joined #ruby
polysics has quit [Ping timeout: 260 seconds]
sdothum has joined #ruby
r_rios has joined #ruby
freerobby has quit [Quit: Leaving.]
freerobby has joined #ruby
KaliLinuxGR has quit [Remote host closed the connection]
TomyLobo has quit [Ping timeout: 264 seconds]
chouhoul_ has joined #ruby
sdothum has quit [Client Quit]
davedev24 has quit [Ping timeout: 250 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
davedev24 has joined #ruby
chouhoulis has quit [Ping timeout: 244 seconds]
ur5us has joined #ruby
nogic has quit [Ping timeout: 250 seconds]
chouhoul_ has quit [Ping timeout: 265 seconds]
polishdub has quit [Quit: Leaving]
rkazak has quit [Quit: Sleep.....ing....]
zeroDi has quit [Quit: WeeChat 1.5]
ChiefAlexander has quit [Quit: Leaving...]
s2013 has joined #ruby
cschnei__ has quit [Remote host closed the connection]
Derperperd has joined #ruby
kavanagh has quit [Quit: That's all folks!]
sdothum has joined #ruby
<zenspider> spongebonghemppa: that's not a question
<spongebonghemppa> oh
<spongebonghemppa> umm
ebbflowgo has left #ruby [#ruby]
<spongebonghemppa> how can iterate over an array and
<spongebonghemppa> see what the current index of that item is?
<Radar> spongebonghemppa: each_with_index
<spongebonghemppa> umm....
<zenspider> aren't you already doing that with index?
<spongebonghemppa> basically what i want to do is go over each item and have the ability of being able to know what the index is
<Radar> tbh this looks like homework
<zenspider> words[index][0].upcase + words[index][1..-1] sure looks a lot like words[index].capitalize
<Radar> [09:12:12] <Radar>spongebonghemppa: each_with_index
<spongebonghemppa> sorry
<spongebonghemppa> tahnks Radar
<spongebonghemppa> thank you so much :)
<zenspider> spongebonghemppa: you're already maintaining a variable called index. you're still not asking a good question
jhack has quit [Quit: jhack]
Rickmasta has joined #ruby
<spongebonghemppa> zenspider: i'm learning ruby and it's confusing
<spongebonghemppa> it will be a while until i start asking good questions
<spongebonghemppa> thank you all for putting up with me :)
xlegoman has joined #ruby
rkazak has joined #ruby
polysics has joined #ruby
edwinvdgraaf has quit [Remote host closed the connection]
UserInNeed has quit [Ping timeout: 250 seconds]
ebbflowgo has joined #ruby
ebbflowgo has quit [Client Quit]
d0nn1e has quit [Ping timeout: 240 seconds]
TPug has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
nando293921 has joined #ruby
jobat has quit [Ping timeout: 250 seconds]
etetz has quit [Remote host closed the connection]
jgt3 has quit [Ping timeout: 264 seconds]
etetz has joined #ruby
d0nn1e has joined #ruby
zarubin has joined #ruby
acchan has left #ruby ["WeeChat 1.0.1"]
ddffg has quit [Quit: Leaving]
UserInNeed has joined #ruby
SteenJobs has joined #ruby
jgt3 has joined #ruby
threedee has joined #ruby
etetz has quit [Ping timeout: 244 seconds]
workmad3 has quit [Ping timeout: 258 seconds]
zarubin has quit [Ping timeout: 276 seconds]
SnowboardTechie has joined #ruby
threedee has quit [Ping timeout: 276 seconds]
polysics has quit [Ping timeout: 252 seconds]
Eiam_ has joined #ruby
rajdesai has quit [Remote host closed the connection]
rajdesai has joined #ruby
the_rhizo has quit [Ping timeout: 258 seconds]
AzureStigma has joined #ruby
SnowboardTechie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
duckpuppy has joined #ruby
hutch34 has joined #ruby
Torrone has joined #ruby
sdothum has joined #ruby
SnowboardTechie has joined #ruby
rajdesai has quit [Ping timeout: 276 seconds]
duckpuppy has quit [Ping timeout: 250 seconds]
bjh13 has quit [Quit: ERC (IRC client for Emacs 25.1.50.1)]
shmuli has joined #ruby
shmuli has quit [Read error: Connection reset by peer]
toretore has quit [Ping timeout: 244 seconds]
hutch34 has quit [Ping timeout: 264 seconds]
shmuli has joined #ruby
SnowboardTechie has quit [Client Quit]
shmuli has quit [Read error: Connection reset by peer]
naftilos76 has quit [Quit: Αποχώρησε]
memorasus has quit [Read error: Connection reset by peer]
shmuli has joined #ruby
shmuli has quit [Read error: Connection reset by peer]
rajdesai has joined #ruby
rajdesai has quit [Remote host closed the connection]
rajdesai has joined #ruby
shmuli has joined #ruby
shmuli has quit [Read error: Connection reset by peer]
phredus_ has joined #ruby
shmuli has joined #ruby
pawnbox has joined #ruby
shmuli has quit [Read error: Connection reset by peer]
Madplatypus has quit [Quit: Connection closed for inactivity]
ryan_notabot has joined #ruby
xall has quit [Ping timeout: 244 seconds]
byteflame has joined #ruby
govg has joined #ruby
roflmyeggo has quit [Ping timeout: 244 seconds]
etetz has joined #ruby
pawnbox has quit [Ping timeout: 252 seconds]
SilverKey has joined #ruby
shmuli has joined #ruby
shmuli has quit [Read error: Connection reset by peer]
shmuli has joined #ruby
the_rhizo has joined #ruby
rajdesai has quit [Remote host closed the connection]
etetz has quit [Ping timeout: 252 seconds]
Eiam_ has quit [Quit: ╯°□°)╯︵ǝpouǝǝɹɟ]
shmuli has quit [Read error: Connection reset by peer]
polysics has joined #ruby