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]
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 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]
<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
<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]
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
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_: 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?
<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>
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]
<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)] …`
<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
<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
<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.
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?
<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]
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
<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…]
<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
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>
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?
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
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