havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com || Ruby 2.4.1, 2.3.4 & 2.2.7: https://www.ruby-lang.org || Paste >3 lines of text to: https://gist.github.com || Rails questions? Ask in: #RubyOnRails || Logs: https://irclog.whitequark.org/ruby || Books: https://goo.gl/wpGhoQ
xrlk has quit [Quit: HEIL HITLER]
quobo has quit [Quit: Connection closed for inactivity]
marius has quit [Quit: xy]
marius has joined #ruby
KeyJoo has quit [Ping timeout: 260 seconds]
marius has quit [Client Quit]
learningRuby has joined #ruby
jak_ has quit [Remote host closed the connection]
jak_ has joined #ruby
darix has quit [Quit: may the packets be with you...]
Cohedrin_ has quit [Ping timeout: 260 seconds]
cseder has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Cohedrin_ has joined #ruby
cyphase_eviltwin is now known as cyphase
petruff has quit [Quit: WeeChat 1.8]
darix has joined #ruby
VladGh has quit [Remote host closed the connection]
VladGh has joined #ruby
learningRuby has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
marr has quit [Ping timeout: 240 seconds]
Cohedrin_ has quit [Ping timeout: 260 seconds]
solocshaw has quit [Ping timeout: 276 seconds]
milardovich has quit [Remote host closed the connection]
milardovich has joined #ruby
nadir has joined #ruby
Cohedrin_ has joined #ruby
_sfiguser has quit [Ping timeout: 240 seconds]
milardovich has quit [Ping timeout: 260 seconds]
cam27 has joined #ruby
__Yiota has joined #ruby
petruff has joined #ruby
gothicsouth has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
P1ro has quit [Remote host closed the connection]
__Yiota has joined #ruby
charliesome has joined #ruby
mrconfused has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
learningRuby has joined #ruby
petruff has quit [Quit: WeeChat 1.9]
P1ro has joined #ruby
fugue has joined #ruby
ioquatix has quit [Quit: Lost terminal]
fugue has quit [Client Quit]
weaksauce has quit [Ping timeout: 240 seconds]
amperry has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
Cohedrin_ has quit [Ping timeout: 276 seconds]
dviola has quit [Ping timeout: 240 seconds]
AnoHito_ has joined #ruby
AnoHito has quit [Ping timeout: 248 seconds]
N0ATN is now known as Ka
Cohedrin_ has joined #ruby
arescorpio has joined #ruby
<adam12> Jeez, first time in a while I've had issues getting an app to start.
nofxxxx has quit [Ping timeout: 240 seconds]
enterprisey has joined #ruby
milardovich has joined #ruby
milardovich has quit [Ping timeout: 260 seconds]
d^sh has quit [Ping timeout: 248 seconds]
jak_ has quit [Remote host closed the connection]
jak_ has joined #ruby
d^sh has joined #ruby
Cohedrin_ has quit [Ping timeout: 240 seconds]
gizmore has joined #ruby
Cohedri__ has joined #ruby
gizmore|2 has quit [Ping timeout: 276 seconds]
rubylegend2092 has quit [Quit: Going offline, see ya! (www.adiirc.com)]
kobain has joined #ruby
CustosLimen has quit [Ping timeout: 255 seconds]
nofxx has joined #ruby
perniciouscaffei has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
umaaji has joined #ruby
Cohedri__ has quit [Ping timeout: 246 seconds]
arescorpio has quit [Ping timeout: 248 seconds]
Mia has quit [Ping timeout: 248 seconds]
dcunit3d has quit [Ping timeout: 260 seconds]
CustosLimen has joined #ruby
im0nde has quit [Ping timeout: 276 seconds]
Cohedrin_ has joined #ruby
brent__ has joined #ruby
brent__ has quit [Ping timeout: 268 seconds]
Cohedrin_ has quit [Ping timeout: 246 seconds]
Cohedri__ has joined #ruby
dcunit3d has joined #ruby
HoierM_ has quit [Ping timeout: 268 seconds]
milardovich has joined #ruby
jameser has joined #ruby
uZiel has joined #ruby
bweston92 has quit [Quit: Connection closed for inactivity]
uZiel has quit [Remote host closed the connection]
milardovich has quit [Ping timeout: 255 seconds]
Cohedri__ has quit [Read error: Connection reset by peer]
Cohedrin_ has joined #ruby
arescorpio has joined #ruby
zacts has quit [Quit: WeeChat 1.9]
uZiel has joined #ruby
shakes has quit [Quit: Leaving]
cadillac_ has quit [Ping timeout: 240 seconds]
cadillac_ has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
__Yiota has joined #ruby
TheBloke has quit [Ping timeout: 240 seconds]
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
moei has joined #ruby
arescorpio has quit [Ping timeout: 260 seconds]
jak_ has quit [Remote host closed the connection]
jak_ has joined #ruby
knight33 has joined #ruby
meshsmith has quit [Remote host closed the connection]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
learningRuby has left #ruby [#ruby]
charliesome has joined #ruby
perniciouscaffei has joined #ruby
nobodyzxc has joined #ruby
nobodyzxc has quit [Client Quit]
herbmillerjr has quit [Quit: Konversation terminated!]
jak__ has joined #ruby
jak_ has quit [Read error: Connection reset by peer]
herbmillerjr has joined #ruby
sneakerhax has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gix has quit [Ping timeout: 248 seconds]
Cohedrin_ has quit [Ping timeout: 260 seconds]
monzie has joined #ruby
gix has joined #ruby
monzie has quit [Ping timeout: 240 seconds]
kies has joined #ruby
Cohedrin_ has joined #ruby
mrconfused has quit [Ping timeout: 246 seconds]
kies has quit [Ping timeout: 276 seconds]
Cohedrin_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jak_ has joined #ruby
jak__ has quit [Read error: Connection reset by peer]
arescorpio has joined #ruby
kies has joined #ruby
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Cohedrin_ has joined #ruby
kobain has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
aglorei has quit [Remote host closed the connection]
oleo has quit [Quit: irc client terminated!]
jak_ has quit [Read error: Connection reset by peer]
jak_ has joined #ruby
_whitelogger has joined #ruby
ayonkhan has joined #ruby
perniciouscaffei has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
latemus has joined #ruby
PaulCape_ has quit [Ping timeout: 248 seconds]
nofxx has quit [Ping timeout: 248 seconds]
PaulCapestany has joined #ruby
nofxx has joined #ruby
gothicsouth has joined #ruby
jak_ has quit [Ping timeout: 255 seconds]
jak has joined #ruby
solocshaw has joined #ruby
arescorpio has quit [Quit: Leaving.]
KeyJoo has joined #ruby
anisha has joined #ruby
lizard2010 has joined #ruby
aupadhye has joined #ruby
conta has joined #ruby
lizard2010 has quit [Quit: Leaving]
cschneid_ has quit [Read error: Connection reset by peer]
cschneid_ has joined #ruby
patrontechnosoft has joined #ruby
ur5us has quit [Remote host closed the connection]
muelleme_ has joined #ruby
muelleme_ has quit [Ping timeout: 260 seconds]
jak has quit [Read error: Connection reset by peer]
grymmjack has quit [Ping timeout: 260 seconds]
gj_ has joined #ruby
jak has joined #ruby
gj_ is now known as grymmjack
cam27 has quit [Quit: cam27]
uZiel has joined #ruby
uZiel has quit [Remote host closed the connection]
uZiel has joined #ruby
ta_ has quit [Remote host closed the connection]
umaaji has quit [Quit: Leaving...]
umaaji has joined #ruby
sniffer has joined #ruby
brent__ has joined #ruby
choke_ has joined #ruby
CrazyEddy has quit [Remote host closed the connection]
choke has quit [Ping timeout: 268 seconds]
brent__ has quit [Ping timeout: 246 seconds]
choke_ has quit [Ping timeout: 260 seconds]
alex`` has joined #ruby
enterprisey has quit [Remote host closed the connection]
enterprisey has joined #ruby
patrontechnosoft has quit [Remote host closed the connection]
ledestin has joined #ruby
jaruga________ has joined #ruby
Silthias has joined #ruby
Cohedrin_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
patrontechnosoft has joined #ruby
jaruga________ has quit [Quit: jaruga________]
tvw has joined #ruby
monzie has joined #ruby
monzie has quit [Client Quit]
fugue has joined #ruby
fugue has quit [Client Quit]
sneakerhax has quit [Ping timeout: 240 seconds]
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aufi has joined #ruby
patronte_ has joined #ruby
patrontechnosoft has quit [Read error: Connection reset by peer]
ledestin has joined #ruby
biberu has joined #ruby
jak has quit [Remote host closed the connection]
jak has joined #ruby
patronte_ has quit [Remote host closed the connection]
patrontechnosoft has joined #ruby
patrontechnosoft has quit [Ping timeout: 255 seconds]
al2o3-cr has quit [Ping timeout: 276 seconds]
antgel has joined #ruby
mark_66 has joined #ruby
bigkevmcd has joined #ruby
ta_ has joined #ruby
patrontechnosoft has joined #ruby
patrontechnosoft has left #ruby [#ruby]
andikr has joined #ruby
DoubleMalt has joined #ruby
xall has joined #ruby
DoubleMalt has quit [Remote host closed the connection]
dcunit3d has quit [Ping timeout: 260 seconds]
patrontechnosoft has joined #ruby
patronte_ has joined #ruby
patrontechnosoft has quit [Read error: Connection reset by peer]
patronte_ has quit [Remote host closed the connection]
patrontechnosoft has joined #ruby
DoubleMalt has joined #ruby
jaruga________ has joined #ruby
mathys has joined #ruby
xall has quit [Quit: xall]
patrontechnosoft has quit [Read error: No route to host]
patrontechnosoft has joined #ruby
Dimik has quit [Ping timeout: 260 seconds]
patronte_ has joined #ruby
patrontechnosoft has quit [Remote host closed the connection]
dionysus69 has joined #ruby
patrontechnosoft has joined #ruby
Mortomes|Work has joined #ruby
patrontechnosoft has quit [Remote host closed the connection]
patrontechnosoft has joined #ruby
patrontechnosoft has quit [Remote host closed the connection]
patrontechnosoft has joined #ruby
patrontechnosoft has quit [Remote host closed the connection]
patrontechnosoft has joined #ruby
patrontechnosoft has quit [Remote host closed the connection]
patrontechnosoft has joined #ruby
patrontechnosoft has quit [Remote host closed the connection]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
alex`` has quit [Quit: WeeChat 1.8]
alex`` has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
solocshaw has quit [Ping timeout: 276 seconds]
dfsdfssdfsfd has joined #ruby
<dfsdfssdfsfd> under the heading "How do you get good defaults and flexibility?" of http://www.justinweiss.com/articles/3-ways-to-configure-your-ruby-api-wrappers/ im confused what show_special is there
PaulCape_ has joined #ruby
ur5us has joined #ruby
PaulCapestany has quit [Ping timeout: 248 seconds]
jak_ has joined #ruby
jak has quit [Read error: Connection reset by peer]
mikecmpbll has joined #ruby
Tempesta has quit [Quit: See ya!]
ascarter has joined #ruby
Qchmqs__ has joined #ruby
Beams has joined #ruby
tvw has quit [Remote host closed the connection]
Pumukel has joined #ruby
Qchmqs__ is now known as Qchmqs
ascarter has quit [Ping timeout: 260 seconds]
vondruch has joined #ruby
jak_ has quit [Read error: Connection reset by peer]
jak_ has joined #ruby
A124 has quit [Read error: Connection reset by peer]
enterprisey has quit [Remote host closed the connection]
A124 has joined #ruby
<dminuoso> dfsdfssdfsfd: ?rails
<dminuoso> dfsdfssdfsfd: also it's just a random action they forgot to either talk about or remove.
quobo has joined #ruby
vondruch has quit [Quit: vondruch]
ferr has joined #ruby
lxsameer has joined #ruby
vondruch has joined #ruby
Tempesta has joined #ruby
vondruch has quit [Client Quit]
vondruch has joined #ruby
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
lxsameer has quit [Quit: WeeChat 1.7]
mim1k has joined #ruby
lxsameer has joined #ruby
mark_66 has quit [Remote host closed the connection]
mark_66 has joined #ruby
marr has joined #ruby
djbkd has joined #ruby
psychicist__ has joined #ruby
jak_ has quit [Ping timeout: 240 seconds]
jak has joined #ruby
Pumukel has quit [Remote host closed the connection]
Pumukel has joined #ruby
Pumukel has quit [Remote host closed the connection]
brent__ has joined #ruby
patrontechnosoft has joined #ruby
brent__ has quit [Ping timeout: 260 seconds]
cseder has joined #ruby
Mon_Ouie has joined #ruby
jak has quit [Remote host closed the connection]
jak has joined #ruby
djbkd has quit [Remote host closed the connection]
ayonkhan has quit [Read error: Connection reset by peer]
pandaant has joined #ruby
ayonkhan has joined #ruby
jak has quit [Read error: Connection reset by peer]
jak has joined #ruby
aglorei has joined #ruby
TvL2386_ is now known as TvL2386
DoubleMalt has quit [Ping timeout: 255 seconds]
<Bish> hey guys, i have a method that gets 4 arrays are parameters, that contain database ids
<Bish> the method is pretty slow.. so i wanna cache it
<Bish> so i want to have every output to every possible input, how would u permute the inputs, say i have p1=[1,2,3],p2=[3,6,9],p3=[1,2,3],p4=[4,9,3]
lel has quit [Ping timeout: 260 seconds]
<Bish> and i want to have the permutations to to length of 2
<dminuoso> Bish: What kind of permutations are you looking for?
<Bish> im just giving examples, because i am unable to mathematicially describe it
lel has joined #ruby
<Bish> ([1],[],[],[]),([1,3],[],[],[]),([1],[3],[],[])
<Bish> so first 2 parameters have to be atleast 1 entry, 3,4 are optional(can be empty)
<dminuoso> Bish: Does the order matter?
<Bish> yes
NeutronStarr has quit [Quit: WeeChat 1.4]
<Bish> its a method, normal parameters
patronte_ has quit [Remote host closed the connection]
<dminuoso> Bish: [[1,2,3], [3,6,9], [1,2,3], [4,9,3]].reduce(&:product)
patrontechnosoft has quit [Remote host closed the connection]
<dminuoso> Bish: add nil if you want to allow for the empty case.
<dminuoso> Note that combinatorically this drastically explodes if you increase the array sizes here.
<dminuoso> Because n!
<Bish> yeah thats why i want to limit each array to 2
<Bish> but that doesnt really help in Big-O i guess
<universa1> why don't you cache those, that are actually requested?
<Bish> because the first request will timeout already
<universa1> 1st request slow, following ones will be fast.
<Bish> slow as in, gateway timeout
NeutronStarr has joined #ruby
<Bish> which will disrupt the process the user is in, and each user has its own ids there so i cant cache them for al
<dminuoso> ?xy
<ruby[bot]> it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
<Bish> i dont know how to explain my problem better, ive given all information i can
ayonkhan_ has joined #ruby
ayonkhan has quit [Ping timeout: 260 seconds]
<Bish> actually its one huge database query these ids will get inserted to
<Bish> that one is slow
<Bish> af
<universa1> Bish: well, guessing here: you could move the "slow task" into a background job. if there is database query, it is probably the case, one could optimize either the query or the db to make it faster.
jaruga________ has quit [Quit: jaruga________]
<Bish> i tried to optimize it , pretty hopeless
<Bish> background job doesnt help.. because its a really user interactive thing
<Bish> i would rather remove the feature
<Bish> u can have a shot at the database query if u want :D
<universa1> but with only seeing the arguments, it is basically impossible to actually help you.
<universa1> and i'm not saying that i can actually can, but you are making it hard for others...
aruns_ has joined #ruby
<Bish> well, so what u demand me to do?
<Bish> u can have the database select, which is basicially the whole method
<Bish> there is not much more
<Bish> (the method just executes the query)
ur5us has quit [Remote host closed the connection]
<Bish> and i already spent some time optimizing it.. which wasn't fun
<aruns_> Hi, quick question, running Mac OS X 10.11.6 (El Capitan) on office MacBook, using FISH 2.4.0 as my shell, running RVM 1.29.1 and RVM does not seem to be overriding the default Ruby I have installed.
<universa1> aruns_: rvm use 2.4.1 ?
<universa1> aruns_: set default ruby in rvm?
<aruns_> universa1: Yeah, I have 2.4.1 set as default Ruby under RVM
<aruns_> I have rvm use default in my shell config
<aruns_> I have sourced shell config, exited the shell and spawned a new shell instance
<aruns_> Even restarted
<universa1> aruns_: does rvm actually work? so rvm use 2.4.1 doesn't print some warning?
<aruns_> universa1: It does not, no.
<aruns_> I'm following pretty much the same steps that I do on my Ubuntu and Arch laptops at home
<aruns_> So I'm guessing maybe it's an issue with the RVM installer for Mac
<universa1> aruns_: so after you've run rvm use 2.4.1
<universa1> aruns_: it is actually using the rvm 2.4.1 ruby? so which ruby points to rvm?
<aruns_> Well actually I have 2.4.0 at the moment
<aruns_> I am installing 2.4.1 now
<universa1> aruns_: doesn't amtter
<aruns_> But it has Using /Users/*nameofuser*/.rvm/gems/ruby-2.4.0
<aruns_> Just doesn't override the default Ruby
<universa1> aruns_: so just the default stuff isn't working... what is the output of rvm list ?
<aruns_> I don't recall if I even got it working under Bash
<aruns_> Testing that now
<aruns_> But it worked fine on FISH on Ubuntu and Arch
<universa1> aruns_: this is on a fresh terminal session?
<aruns_> Yes.
<universa1> aruns_: so: new terminal; rvm list; which ruby <-- this points to system ruby?
<universa1> aruns_: just trying to understand the problem ;) not having any idea why or what might be botched
<aruns_> Exactly.
<aruns_> I'm also running RVM 1.29.1
<aruns_> I recall reading that I migh thave to downgrade
<aruns_> But want to eliminate other possible causes first
nanoz has joined #ruby
ur5us has joined #ruby
<aruns_> As still waiting for RVM to install 2.4.1 :P
<aruns_> OK so it works under Bash
<aruns_> That's good to know at least.
Drakevr has quit [Changing host]
Drakevr has joined #ruby
PaulCape_ has quit [Ping timeout: 240 seconds]
milardovich has joined #ruby
sekmo has joined #ruby
PaulCapestany has joined #ruby
DoubleMalt has joined #ruby
milardovich has quit [Ping timeout: 258 seconds]
kryptoz has joined #ruby
arup_r has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<zenspider> more fish complaints about rvm...?
ddddddd has joined #ruby
<zenspider> aruns_: eliminate rvm. that's the variable in common
<aruns_> Wait something I haven't tried.
<aruns_> Think I know what the issue is.
<zenspider> using rvm
<aruns_> No I use it at home and works fine.
<arup_r> I am setting up an end to end test outside of my rails projects folder. I have couple of shell scripts to start rails and my frontend application. When in my shell I run `./bin/setup` manually no error. All good. When I am calling the same from my Rspec hook like %x[ ./bin/setup ] .. It is telling `rails not found`. Can anyone help me to fix this shell issue? Here I asked the same question with more description https://www.reddit.com/r/rails/comme
<arup_r> nts/6ktlun/loaderror_cannot_load_such_file_rails/
<arup_r> it is not rails question, ruby and shell I am not able to handle :)
<elomatreb> aruns_: You probably have to install a wrapper for RVM with fish, it's a collection of bash scripts after all
<aruns_> elomatreb: No I did that
ascarter has joined #ruby
<aruns_> The same steps I've followed on my Ubuntu and Arch laptops I've followed here
<aruns_> Works on those two
<aruns_> Just not on here
<aruns_> Except under Bash
<aruns_> And I've got FISH on both
<zenspider> which still means you have a problem with rvm... one you wouldn't have if you used a much simpler ruby version mgr
Pumukel has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
<zenspider> but whatever flips your skirt up...
ascarter has quit [Ping timeout: 240 seconds]
milardovich has joined #ruby
<zenspider> certainly safer and easier
KeyJoo has quit [Ping timeout: 260 seconds]
<zenspider> I don't like them because they're not +u clean... but they're certainly a valid alternative
* zenspider goes to bed
chmurifree is now known as chmuri
mim1k has quit [Read error: Connection reset by peer]
psychicist__ has quit [Read error: Connection reset by peer]
pandaant has quit [Quit: Lost terminal]
psychicist__ has joined #ruby
cseder has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sepp2k has joined #ruby
_aeris_ has quit [Ping timeout: 268 seconds]
dasher00 has quit [Ping timeout: 260 seconds]
mim1k has joined #ruby
milardovich has quit [Remote host closed the connection]
anisha has quit [Ping timeout: 248 seconds]
kryptoz has quit [Read error: Connection reset by peer]
dasher00 has joined #ruby
aglorei has quit [Ping timeout: 248 seconds]
milardovich has joined #ruby
im0nde has joined #ruby
_aeris_ has joined #ruby
anisha has joined #ruby
_aeris_ has quit [Ping timeout: 240 seconds]
vuoto has joined #ruby
DoubleMalt has quit [Ping timeout: 268 seconds]
_aeris_ has joined #ruby
cseder has joined #ruby
milardovich has quit [Remote host closed the connection]
loechel has joined #ruby
loechel has quit [Remote host closed the connection]
aglorei has joined #ruby
WebDawg has quit [Ping timeout: 240 seconds]
jak has quit [Remote host closed the connection]
ur5us has quit [Remote host closed the connection]
Pumukel has quit [Ping timeout: 240 seconds]
ur5us has joined #ruby
TheBloke has joined #ruby
jak has joined #ruby
Prira_ has quit [Read error: Connection reset by peer]
blaisebool has quit [Ping timeout: 240 seconds]
Sp4rKy has quit [Ping timeout: 240 seconds]
Sp4rKy has joined #ruby
Sp4rKy is now known as Guest1397
WebDawg has joined #ruby
sekmo has quit [Quit: Textual IRC Client: www.textualapp.com]
Prira has joined #ruby
_whitelogger has joined #ruby
jaruga________ has joined #ruby
chichou has joined #ruby
umaaji has quit [Ping timeout: 260 seconds]
mim1k has quit [Ping timeout: 276 seconds]
hkdsun has quit [Quit: ZNC 1.6.5 - http://znc.in]
hkdsun has joined #ruby
milardovich has joined #ruby
mim1k has joined #ruby
Mortomes|Work has quit [Ping timeout: 260 seconds]
ldnunes has joined #ruby
cseder has quit [Quit: Textual IRC Client: www.textualapp.com]
mim1k has quit [Ping timeout: 260 seconds]
GinoMan has quit [Ping timeout: 240 seconds]
ur5us has quit [Remote host closed the connection]
ltem has joined #ruby
dcunit3d has joined #ruby
hightower2 has joined #ruby
ur5us has joined #ruby
vuoto has quit [Remote host closed the connection]
DoubleMalt has quit [Ping timeout: 276 seconds]
GinoMan has joined #ruby
lxsameer has quit [Quit: WeeChat 1.7]
charliesome has joined #ruby
ayonkhan has joined #ruby
jak has quit [Remote host closed the connection]
jak has joined #ruby
swills has joined #ruby
ayonkhan_ has quit [Ping timeout: 255 seconds]
ascarter has joined #ruby
milardovich has quit []
ur5us has quit [Remote host closed the connection]
Danny has joined #ruby
Danny is now known as Guest33141
aruns_ has quit [Ping timeout: 240 seconds]
ascarter has quit [Ping timeout: 260 seconds]
GinoMan2440 has joined #ruby
Guest33141 has quit [Remote host closed the connection]
GinoMan2440 has quit [Client Quit]
GinoMan2440 has joined #ruby
GinoMan has quit [Ping timeout: 276 seconds]
tvw has joined #ruby
tvw has quit [Client Quit]
tvw has joined #ruby
blaisebool has joined #ruby
blaisebool is now known as Guest46113
mim1k has joined #ruby
DoubleMalt has joined #ruby
jaruga________ is now known as jaruga
arup_r has quit [Remote host closed the connection]
xMopxShell has quit [Ping timeout: 240 seconds]
jak_ has joined #ruby
jak has quit [Read error: Connection reset by peer]
chichou has quit [Quit: WeeChat 1.9]
splitshot has joined #ruby
aruns has joined #ruby
_moep_ has joined #ruby
<_moep_> hi
ayonkhan has quit [Quit: Textual IRC Client: www.textualapp.com]
hkdsun_ has joined #ruby
jphase has quit [Remote host closed the connection]
hkdsun has quit [Ping timeout: 260 seconds]
jphase has joined #ruby
jphase has quit [Ping timeout: 240 seconds]
aruns has quit [Ping timeout: 248 seconds]
anjen has joined #ruby
aruns has joined #ruby
iomotoko has quit [Quit: leaving]
mim1k has quit [Ping timeout: 260 seconds]
meshsmith has joined #ruby
meshsmith has joined #ruby
meshsmith has quit [Changing host]
mark_66 has quit [Quit: Leaving.]
GodFather has joined #ruby
tau has joined #ruby
pandaant has joined #ruby
mim1k has joined #ruby
knight33 has joined #ruby
pandaant has quit [Remote host closed the connection]
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
agent_white has quit [Quit: bai]
ascarter has joined #ruby
ledestin has joined #ruby
BSAlb has joined #ruby
GodFather has quit [Quit: Ex-Chat]
GodFather has joined #ruby
GodFather has quit [Remote host closed the connection]
GodFather_ has joined #ruby
ascarter has quit [Ping timeout: 248 seconds]
ledestin has quit [Ping timeout: 248 seconds]
BSaboia has quit [Ping timeout: 268 seconds]
Danny has joined #ruby
Danny has quit [Remote host closed the connection]
antgel has quit [Ping timeout: 268 seconds]
antgel has joined #ruby
anisha has quit [Read error: Connection reset by peer]
jak_ has quit [Remote host closed the connection]
jak_ has joined #ruby
anisha has joined #ruby
uZiel has joined #ruby
nanoz has quit [Ping timeout: 268 seconds]
meshsmith has quit [Ping timeout: 276 seconds]
Hess has joined #ruby
xMopxShell has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
AckZ has joined #ruby
patarr has joined #ruby
anjen has quit [Quit: anjen]
uZiel has quit [Ping timeout: 248 seconds]
meshsmith has joined #ruby
meshsmith has joined #ruby
meshsmith has quit [Changing host]
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
xrlk has joined #ruby
mark_66 has joined #ruby
oleo has joined #ruby
<manveru> anyone know how to tell rubocop not to complain about /(?<var>)/ =~ "something" ... it wants to replace it with Regexp#match? which won't assign the variable :(
<manveru> ah, guess https://github.com/bbatsov/rubocop/pull/4531 fixes that
Rodya_ has joined #ruby
jphase has joined #ruby
<darix> manveru: hmm would match_object = /someregexp/.match(text_variable) do the job?
kobain has joined #ruby
<darix> i really prefer that over =~ and $\d variables nowadays
<darix> especially with named match groups
<manveru> sure... but then i have to write `var = match_object[:var]`
<manveru> `next unless /^BEETLE_(?<config_key>.*)/ =~ key`
<manveru> i'm using it like this
<manveru> so after this line the config_key variable has what i need already
<darix> uhm
<darix> ugly :p
<manveru> it works with .match() as well, just not with .match?() :)
<darix> manveru: sure but .match should return nil if it doesnt match no?
<manveru> sure, but then one line becomes 3
<darix> hm
<darix> why?
<darix> next unless mo = /^BEETLE_(?<config_key>.*)/.match(key)
<darix> mo[:config_key]
<darix> to access it
<darix> or
<herwin> which results in another rubocop warning
<darix> mo = /^BEETLE_(?<config_key>.*)/.match(key)
<manveru> assign in conditional
<herwin> assignment in if-statement, or whatever the exact name they use is
<darix> next if mo.nil?
<manveru> either way, it's a bug in rubocop
<manveru> that check is meant for better performance, not to change the semantics
<manveru> there's just no new release yet... so i'll ignore it until then
gts7 has joined #ruby
cam27 has joined #ruby
Ishido has joined #ruby
shinnya has joined #ruby
aupadhye has quit [Ping timeout: 248 seconds]
KeyJoo has joined #ruby
zacts has joined #ruby
knight33 has joined #ruby
polishdub has joined #ruby
petruff has joined #ruby
cpruitt has joined #ruby
mim1k has quit [Ping timeout: 248 seconds]
mim1k has joined #ruby
ta_ has quit [Remote host closed the connection]
DLSteve has joined #ruby
cschneid_ has quit [Remote host closed the connection]
mim1k has quit [Ping timeout: 260 seconds]
hutch34 has joined #ruby
ferr has quit [Quit: WeeChat 1.8]
uZiel has joined #ruby
dionysus69 has quit [Ping timeout: 248 seconds]
alex`` has quit [Quit: WeeChat 1.8]
aufi has quit [Ping timeout: 248 seconds]
truenito has joined #ruby
GodFather_ has quit [Ping timeout: 260 seconds]
lxsameer has joined #ruby
GodFather_ has joined #ruby
tau has quit [Read error: Connection reset by peer]
tau has joined #ruby
jphase_ has joined #ruby
anisha has quit [Quit: This computer has gone to sleep]
cdg has joined #ruby
hightower2 has quit [Ping timeout: 276 seconds]
cadillac__ has joined #ruby
jphase has quit [Ping timeout: 276 seconds]
cadillac_ has quit [Read error: Connection reset by peer]
cadillac__ is now known as cadillac_
KeyJoo has quit [Ping timeout: 248 seconds]
nofxx has quit [Ping timeout: 240 seconds]
isBEKaml has joined #ruby
nofxx has joined #ruby
ketan has joined #ruby
skweek has joined #ruby
patarr_ has joined #ruby
vuoto has joined #ruby
conta has quit [Ping timeout: 276 seconds]
mathys has quit [Quit: Leaving]
skweek has quit [Ping timeout: 240 seconds]
patarr has quit [Ping timeout: 240 seconds]
Miah_ has joined #ruby
cschneid_ has joined #ruby
<Bish> is there a reduce function that always calls the block with the same reference?
<Bish> it feels stupid always to write .reduce {|a,b| ...;a}
mim1k has joined #ruby
<Bish> it feels stupid always to write .reduce() {|a,b| ...;a}
<matthewd> Bish: each_with_object
<Bish> each_with_object.reduce or just each with object?
<ljarvis> just the latter as matthewd suggested
<ljarvis> .reduce { .. ;x } is a code smell
<ljarvis> and it's exactly what each_with_object is for
<Bish> ah okay
<ljarvis> you can also chain it with just .with_object
<ljarvis> e.g. .each.with_object
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
knight33 has joined #ruby
ResidentBiscuit has joined #ruby
patarr_ has quit [Ping timeout: 260 seconds]
patarr has joined #ruby
vuoto has quit [Remote host closed the connection]
vuoto has joined #ruby
Hess has quit [Ping timeout: 255 seconds]
zanshin has joined #ruby
noob has joined #ruby
doublemalt_ has joined #ruby
<zanshin> I inherited some Ruby code that I'm trying to figure out. The code reads a JSON file and at one point has an if statement that reads `if i['ssl']` where `i` is the iterator and `ssl` is an attribute in the JSON file. ssl has a text value, it is _not_ a boolean. How does this if statement work? Does Ruby have some syntax sugar that treats the presence of a value as true?
noob has left #ruby [#ruby]
<apeiros> zanshin: in ruby, everything except nil and false are true-ish
<apeiros> i.e. if i['ssl'] is basically "if there's a value around for this key"
<ljarvis> false is a value *troll*
<apeiros> (would need a change if nil or false was a valid value for that key)
<apeiros> and yes, that *troll* is not really a troll IMO
<apeiros> true, false, nil are all objects in ruby. it's something to be aware of.
<zanshin> apeiros: Lovely. Thanks. That's a new concept for me. I can go home now, I learned something new. :)
<ljarvis> but yeah, if you want to check if "ssl" exists as a key, no matter what value it has, use .key?("ssl")
DoubleMalt has quit [Ping timeout: 255 seconds]
<apeiros> I love has_ free syntax in ruby, but for this I actually prefer has_key? over key?
<zanshin> has_key would be a lot clearer for the next guy who has to read and understand this.
<ljarvis> tbh i just prefer key? because it's shorter, i do agree has_key? reads significantly better
hutch34 has quit [Ping timeout: 240 seconds]
GodFather_ has quit [Ping timeout: 260 seconds]
cdg has quit [Remote host closed the connection]
[Butch] has joined #ruby
<isBEKaml> I think key? is better over the has_key? noise. To my eyes, key? just means asking 'is it a key?'
<ljarvis> but has_key? is asking "has it got this key?" which is clearer :D
andikr has quit [Remote host closed the connection]
Qchmqs has quit [Remote host closed the connection]
<ljarvis> we could also use: member? include?
<ljarvis> lolruby
<isBEKaml> well, you're using the hash. So that's implicit (or explicit): hash.key? 'foo' just asks 'is foo a key in this hash?'
<apeiros> isBEKaml: foo.key? asks whether foo is a key IMO. it's why I don't like it.
gizmore has quit [Quit: KVIrc 4.9.2 Aria http://www.kvirc.net/]
<ljarvis> yeah I get that too
<isBEKaml> apeiros: ha ha haha
<isBEKaml> Isn't that what we wanted?
<apeiros> no
<ljarvis> no, you dont want to consider foo being a key
<apeiros> he wants to know whether foo *has* a key given as a parameter
<ljarvis> it's obviously a hash
patarr has quit [Ping timeout: 255 seconds]
<apeiros> anyway, tbh, I'd even be fine with key? if in turn ruby got rid of all unnecessary aliases (there are some necessary ones)
<isBEKaml> apeiros: Nope, that's not what I meant. I think you got it backwards to what I meant.
cdg has joined #ruby
<isBEKaml> I meant something like: puts "foo is a key in some_hash" if some_hash.key? 'foo'
brent__ has joined #ruby
<apeiros> yes, I got that
<apeiros> maybe you reread the scrollback ;-)
<isBEKaml> apeiros: I went with what you said: foo.key? is not what I meant at all
texasmynsted has quit [Ping timeout: 260 seconds]
<apeiros> k
brent___ has joined #ruby
brent__ has quit [Read error: Connection reset by peer]
patarr has joined #ruby
texasmynsted has joined #ruby
Rodya_ has quit [Remote host closed the connection]
enterprisey has joined #ruby
uZiel_ has joined #ruby
ar1a has joined #ruby
<isBEKaml> Oh, I now see where I got sidetracked. Sorry for the noise.
jak_ has quit [Remote host closed the connection]
<apeiros> np
gizmore has joined #ruby
uZiel_ has quit [Client Quit]
<ar1a> can someone link me some info on passing functions as parameters? in some libraries i see yknow "foo { |bar| puts bar }" or whatever, i was wondering if there was any info for implementing that into my own code
jak_ has joined #ruby
<ar1a> so i can write functions that take functions as a parameter :D
<apeiros> ar1a: they're called "blocks"
<ar1a> thanks
<apeiros> and basically you do `yield(arg1, …)` to invoke a block passed to your method
<apeiros> and block_given? to test whether one was passed
<ar1a> not arg1()
<ar1a> thanks, block is the buzzword i needed
<apeiros> no, yield() calls the block
<ar1a> ill go look stuff up :)
<apeiros> yield(arg1, arg2) calls the block passing 2 arguments to it
sekmo has joined #ruby
<apeiros> > def foo; yield(1, 2); end; foo { |a,b| … }
<apeiros> a=1 and b=2 in that block.
brent___ has quit [Ping timeout: 248 seconds]
aruns has quit [Quit: leaving]
mrconfused has joined #ruby
texasmynsted has quit [Ping timeout: 260 seconds]
mostlybadfly has joined #ruby
texasmynsted has joined #ruby
cadillac_ has quit [Read error: Connection reset by peer]
dionysus69 has joined #ruby
tvw has quit [Read error: Connection reset by peer]
amclain has joined #ruby
texasmynsted has quit [Ping timeout: 240 seconds]
Rodya_ has joined #ruby
aufi has joined #ruby
graingert is now known as jreback
jreback is now known as graingert
sekmo has quit [Quit: Textual IRC Client: www.textualapp.com]
texasmynsted has joined #ruby
sekmo has joined #ruby
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
troys has joined #ruby
gts7 has quit [Ping timeout: 258 seconds]
tgragnato has joined #ruby
haylon has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
gts7 has joined #ruby
ascarter has joined #ruby
aidalgol has quit [Ping timeout: 240 seconds]
mark_66 has quit [Remote host closed the connection]
velu_aon[m] has quit [Ping timeout: 246 seconds]
kp666[m] has quit [Ping timeout: 255 seconds]
dman[m] has quit [Ping timeout: 240 seconds]
Tagami[m] has quit [Ping timeout: 240 seconds]
M107262[m] has quit [Ping timeout: 240 seconds]
solocshaw has joined #ruby
aviraldg has quit [Ping timeout: 255 seconds]
heftig has quit [Read error: Connection reset by peer]
intermo[m] has quit [Read error: Connection reset by peer]
johnson[m] has quit [Read error: Connection reset by peer]
turt2live1 has quit [Read error: Connection reset by peer]
el_ocho[m] has quit [Read error: Connection reset by peer]
jonjits[m] has quit [Read error: Connection reset by peer]
torarne has quit [Read error: Connection reset by peer]
Giphy[m] has quit [Read error: Connection reset by peer]
KevinMGranger has quit [Ping timeout: 246 seconds]
testnick[m] has quit [Ping timeout: 246 seconds]
voltai[m] has quit [Read error: Connection reset by peer]
antgel has quit [Ping timeout: 248 seconds]
doublemalt_ has quit [Ping timeout: 240 seconds]
vuoto has quit [Remote host closed the connection]
axsuul has quit [Ping timeout: 259 seconds]
mikeiniowa has quit [Ping timeout: 259 seconds]
ascarter has quit [Ping timeout: 248 seconds]
cats has quit [Ping timeout: 260 seconds]
axsuul has joined #ruby
cats has joined #ruby
aufi has quit [Quit: Leaving]
Giphy[m] has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
cdg has quit [Remote host closed the connection]
learner123 has joined #ruby
hutch34 has joined #ruby
xrlk has quit [Remote host closed the connection]
<learner123> Hi, being a Ruby newbie, let me ask some question... might be too basic.
<learner123> I'm very confused with error I'm getting when using <object>.<method>.
<learner123> Looks like, I need to use correct .<method> for the type of <object> whether it's a string, array, or hash.
choke has joined #ruby
<learner123> Should I remember which method to use with a string, array, or hash? Or, what's the best way to pass this learning curve?
<elomatreb> Well, what are the methods you want to use?
enterprisey has quit [Ping timeout: 260 seconds]
<elomatreb> Because Hash, Array, and String are entirely different things
<learner123> Maybe looking up some webpage where various methods are listed for each of string, array, and hash?
alex`` has joined #ruby
<elomatreb> Depending on how you installed Ruby you installed documentation for the ruby core with it, try `ri SomeClass` on the command line
<elomatreb> Alternatively, there are web-based renders of the same docs, e.g. https://ruby-doc.org/core-2.4.1/Array.html
<learner123> elomatreb: Yeah, I know that... so, I already need to know the usage of a method to use for the type, right?
choke has quit [Ping timeout: 255 seconds]
<elomatreb> Yes, since methods can do different things on different types. Typically the standard library is designed to avoid confusion (e.g. length *usually* does what you want on all applicable classes), but it's not guaranteed and third-party code doesn't make any guarantees
<learner123> For example, I should already know that .upper is used for <string>.upper... not with <array>.upper or <hash>.upper.
<elomatreb> Yes, since there obviously is no uppercase version of an Array ;)
johnson[m] has joined #ruby
Tagami[m] has joined #ruby
aidalgol has joined #ruby
heftig has joined #ruby
turt2live has joined #ruby
torarne has joined #ruby
intermo[m] has joined #ruby
dman[m] has joined #ruby
M107262[m] has joined #ruby
jonjits[m] has joined #ruby
voltai[m] has joined #ruby
kp666[m] has joined #ruby
KevinMGranger has joined #ruby
aviraldg has joined #ruby
testnick[m] has joined #ruby
el_ocho[m] has joined #ruby
velu_aon[m] has joined #ruby
sekmo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
conta3 has joined #ruby
gts7 has quit [Read error: Connection reset by peer]
frustrum has joined #ruby
<learner123> Is it similar in other languages like Python?
frustrum has quit [Client Quit]
<learner123> as much confusing or no?
cschneid_ has quit [Remote host closed the connection]
hutch34 has quit [Ping timeout: 255 seconds]
mim1k has quit [Ping timeout: 260 seconds]
govg has quit [Quit: leaving]
kangu0 has joined #ruby
<kangu0> Pointer exists in Ruby?
<kangu0> Why Pointer is required
svara has quit [Remote host closed the connection]
duderonomy has joined #ruby
svara has joined #ruby
<elomatreb> learner123: This is probably the same in all languages
Beams has quit [Quit: .]
<learner123> ok, thanks.
Ishido has quit [Ping timeout: 240 seconds]
troys is now known as troys_
BSAlb has quit [Quit: Leaving]
BSaboia has joined #ruby
truenito has quit [Ping timeout: 276 seconds]
tgragnato has quit [Quit: Sto andando via]
<splitshot> kangu0, yes. Everything is a reference.
<kangu0> How or why pointer or reference are useful
<kangu0> splitshot
abhi56rai has joined #ruby
jak_ has quit [Remote host closed the connection]
jak_ has joined #ruby
Miah_ has quit [Quit: Connection closed for inactivity]
d^sh_ has joined #ruby
quobo has quit [Quit: Connection closed for inactivity]
<splitshot> Not really sure what you mean by how is it useful... It lets you share a reference to data without copying it. So there are benefits to that, but you also need to be aware that's what happening.
d^sh has quit [Ping timeout: 260 seconds]
cdg has joined #ruby
<dminuoso> <splitshot> kangu0, yes. Everything is a reference.
<dminuoso> That part is completely hidden from you though.
cdg has quit [Remote host closed the connection]
<splitshot> When you, for example, pass an object (reference) to a method, that method has access to *that object*, not a copy of it.
<dminuoso> Ruby is pure pass-by-value.
<dminuoso> But what you pass are pointers under the hood.
cdg has joined #ruby
ketan has quit [Remote host closed the connection]
ketan has joined #ruby
kies has quit [Ping timeout: 276 seconds]
texasmynsted has quit [Quit: ZNC - http://znc.in]
texasmynsted has joined #ruby
<apeiros> kangu0: they are not pointers in the sense as that you can't do pointer arithmetics or point to random space in memory
<apeiros> kangu0: for that matter, reference is a much better term
<dminuoso> apeiros, watch me!
* dminuoso fiddles around
* apeiros raises Shields
<apeiros> red alert, all hands to stations!
<apeiros> that was a reference, btw. :D
* apeiros really wanted to point this out
* dminuoso instantiates a Fiddle::Pointer to apeiros' shield object and forcibly casts it to the RClass WoolBlanket
ddddddd has quit [Ping timeout: 248 seconds]
<dminuoso> Haha.
<dminuoso> Has baweaver been teaching you?
Mon_Ouie has quit [Ping timeout: 240 seconds]
whippythellama has joined #ruby
<dminuoso> apeiros, by the way.. something sad has happened...
<dminuoso> Do you recall that actual Fiddle hack to cast objects?
<dminuoso> I finally refactored it by just sprinkling a teeny bit of reflection..
<apeiros> not the code, but the idea, yes
Ishido has joined #ruby
<dminuoso> No more fiddling in production code :<
* dminuoso sad panda
<apeiros> :)
zenguy_pc has quit [Ping timeout: 240 seconds]
kang90 has joined #ruby
<dminuoso> apeiros, oh! I gotta run something by you
<apeiros> bad timing, but do try
kangu0 has quit [Ping timeout: 240 seconds]
abhi56rai has quit [Quit: WeeChat 1.9]
abhi56rai has joined #ruby
zenguy_pc has joined #ruby
lxsameer has quit [Quit: WeeChat 1.7]
gusrub has joined #ruby
jaruga has quit [Quit: jaruga]
ddddddd has joined #ruby
texasmynsted has left #ruby [#ruby]
Rodya_ has quit [Remote host closed the connection]
Ishido has quit [Ping timeout: 240 seconds]
zenguy_pc has quit [Ping timeout: 255 seconds]
mim1k has joined #ruby
Ishido has joined #ruby
Rodya_ has joined #ruby
kies has joined #ruby
<ar1a> so in this code im reading, instead of running yield it runs instance_eval &block
<ar1a> what's the difference?
Rodya_ has quit [Remote host closed the connection]
Rodya_ has joined #ruby
mim1k has quit [Ping timeout: 248 seconds]
<splitshot> arla, it executes the block in the context of the module.
eckhardt has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
<ar1a> does yield not do that?
<ar1a> its a one btw, not an l :p
eckhardt has quit [Client Quit]
jphase has joined #ruby
abhi56rai has quit [Quit: WeeChat 1.9]
abhi56rai has joined #ruby
Rodya_ has quit [Remote host closed the connection]
<splitshot> In the example code, the block is sending the parameter message which is defined in the module. Yield would not allow you to do that, no.
abhi56rai has quit [Client Quit]
<elomatreb> ar1a: Demo: https://eval.in/826713
abhi56rai has joined #ruby
jak has joined #ruby
jak_ has quit [Ping timeout: 255 seconds]
Cohedrin_ has joined #ruby
abhi56rai has quit [Client Quit]
jphase_ has quit [Ping timeout: 268 seconds]
abhi56rai has joined #ruby
mim1k has joined #ruby
whippythellama has quit [Ping timeout: 255 seconds]
<ar1a> oh, oki
<dminuoso> ar1a: yield executes the block passed to the current method execution takes place in.
<dminuoso> (That may sound a bit convoluted but I couldn't phrase it any nicer)
<dminuoso> I personally prefer explicit procyfying and then invoking callable.call() most of the time for clarities sake.
darix has quit [Ping timeout: 258 seconds]
<ar1a> sounds complex
<dminuoso> ar1a: The issue is if I phrase it dirrectly, it will not cover special cases..
<elomatreb> It's not as complicated as it sounds for the most part
perniciouscaffei has joined #ruby
<dminuoso> It was not even correct..
<dminuoso> ar1a: It executes the block passed to the current execution context.
<dminuoso> Now that sounds confusing!
<ar1a> oki
mim1k has quit [Ping timeout: 248 seconds]
<ar1a> is there a way to have an async REPL? i'm running a chat bot, and i'd like to be able to send messages from it
<dminuoso> ar1a: ruby[bot] uses http://eval.in
<dminuoso> For better or worse..
<ar1a> no i meant
<ar1a> inside of my script thingy
<ar1a> im confused...
<ar1a> not necessarily a REPL
<ar1a> just a prompt
uZiel has joined #ruby
<dminuoso> O_o
<dminuoso> You mean like.. you want stdin?
<ar1a> i suppose
<ar1a> but asynchronously
<dminuoso> What?
<elomatreb> Ruby isn't big with asynchronous inputs, unless you build something with threads yourself there is nothing like that in the standard libray
<ar1a> no, a gem is fine :)
<ar1a> like um... readline? i think
<ar1a> ugh, idk
<ar1a> it's not important, nvm
<dminuoso> Oh you meant non-blocking reading from stdin?
<ar1a> yeah!
<dminuoso> Uhhh....
<ar1a> sorry, does asynchronous != non-blocking?
<elomatreb> Usually yes
<elomatreb> Uh, other way around
<elomatreb> <- fail
<dminuoso> Just never heard "async" being used in the context of IO
<dminuoso> :P
<ar1a> my bad
<elomatreb> Node uses it like that I think?
<dminuoso> So yeah. readline
<dminuoso> curses/ncurses.
<dminuoso> Those kinds of bastarized and completely unusable libraries
<splitshot> async i/o is a big deal
<dminuoso> splitshot: i/o yes. but non-blocking stdin? not so much.
* splitshot shrugs
<elomatreb> But stdout yes, as demonstrated by old NPM
<dminuoso> But I guess you could also do it the hardway and use #select ...
<dminuoso> Not that it's something you likely want..
<ar1a> can you guys code review this short module please
dionysus70 has joined #ruby
dionysus69 has quit [Ping timeout: 248 seconds]
dionysus70 is now known as dionysus69
<dminuoso> >> callable = proc{ yield }; callable.call { puts "1" }
<ruby[bot]> dminuoso: # => no block given (yield) (LocalJumpError) ...check link for more (https://eval.in/826732)
gusrub has quit [Remote host closed the connection]
<dminuoso> asm>> { yield }
<ruby[bot]> dminuoso: I have disassembled your code, the result is at https://eval.in/826734
muelleme_ has joined #ruby
<dminuoso> asm>> foo = proc{ yield }
<ruby[bot]> dminuoso: I have disassembled your code, the result is at https://eval.in/826736
roshanavand has joined #ruby
<dminuoso> asm>> foo = proc{ yield }; def meth(callable); callable.call; end; meth(foo) { puts "hi" }
<ruby[bot]> dminuoso: I have disassembled your code, the result is at https://eval.in/826737
<dminuoso> >> foo = proc{ yield }; def meth(callable); callable.call; end; meth(foo) { puts "hi" }
<ruby[bot]> dminuoso: # => no block given (yield) (LocalJumpError) ...check link for more (https://eval.in/826738)
* dminuoso gives upo
<elomatreb> ar1a: Chained array access like in line 11 can be nasty to debug when one of the intermediate values is nil, since you just get a undefined method for nil and the line
<dminuoso> ^-
<dminuoso> Denormalize your data.
<dminuoso> And then normalize it!
<dminuoso> For good measure.
<ar1a> elomatreb: i had found that
<ar1a> dminuoso: what does that mean?
<elomatreb> If you *really* need to do deep access into an array like that Array#dig is really nice
<dminuoso> ar1a: It's something Rubyists dont know about. And neither do API vendors.
gusrub has joined #ruby
<ar1a> elomatreb: well its burried that deep
<dminuoso> ar1a: Ever heard of BCNF?
<dminuoso> Or 2NF/3NF?
<ar1a> no
<dminuoso> ar1a: Yeah. Normalize the data you get from the API.
<ar1a> how?
<dminuoso> A quick glance suggests this could be cool: https://github.com/chrokh/normalizr
<ar1a> that seems like a lot of work for something this simple... Array#dig looks cool
<dminuoso> Let's see if I'll trigger anyone with this.
<elomatreb> You need to use machine learning, blockchains, and mongodb big data to normalize your data, obviously
<ar1a> the answer ive been wanting!
ketan has quit [Ping timeout: 255 seconds]
<dminuoso> elomatreb: fuck mongodb
conta3 has quit [Quit: conta3]
<dminuoso> elomatreb: the other things I agree with though.
<dminuoso> Sorry for my language, but that word always triggers ne,.
montanonic has joined #ruby
mim1k has joined #ruby
<elomatreb> You can substitute for any other hip database to taste
__Yiota has joined #ruby
<dminuoso> It makes MySQL look professional in comparison.
<ar1a> dminuoso: its web scale!
<ar1a> dminuoso: has set +b on !ar1a@*
<ar1a> is that how irc hostnames work, i forget
conta2 has joined #ruby
__Yiota has quit [Client Quit]
mim1k has quit [Ping timeout: 255 seconds]
whippythellama has joined #ruby
anisha has joined #ruby
DTZUZU has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
ascarter has joined #ruby
cdg has quit [Remote host closed the connection]
<ar1a> is it true ruby isnt truly multi-threaded
abhi56rai has quit [Quit: WeeChat 1.9]
PaulCapestany has quit [Quit: .]
<ar1a> uses GIL or something
ltem has quit [Quit: Leaving]
abhi56rai has joined #ruby
cschneid_ has joined #ruby
<dminuoso> ar1a: *GVL
<dminuoso> ar1a: And it depends. It is multi-threaded.
<ar1a> Global interpreter lock
<ar1a> whats GVL?
<dminuoso> Global VM lock.
<dminuoso> Ruby hasn't been using an interpreter since 1.9.
<ar1a> so its like java now?
<dminuoso> ar1a: Not as sophisticated. But yeah.
<ar1a> how is it different to an interpreter in ruby's case
ascarter has quit [Ping timeout: 240 seconds]
__Yiota has joined #ruby
<dminuoso> ar1a: By compiling to bytecode first there's certain optimizations that can be made during compilation, that offset the slight overhead.
abhi56rai has quit [Client Quit]
<dminuoso> ar1a: Ruby 3.0 will take that to new proportions (where you can pre-compile ruby code before shipping easily)
abhi56rai has joined #ruby
<ar1a> ruby 3.0
<ar1a> haven't they been promising that for years! :p
whippythellama has quit [Ping timeout: 255 seconds]
uZiel has quit [Ping timeout: 248 seconds]
cschneid_ has quit [Ping timeout: 258 seconds]
abhi56rai has quit [Client Quit]
__Yiota has quit [Ping timeout: 240 seconds]
Cohedrin_ has quit [Ping timeout: 246 seconds]
<dminuoso> ar1a: But anyway. To answer your original questions, it's just the Ruby code (basically the entire C code) that is protected by the GVL.
zenguy_pc has joined #ruby
mim1k has joined #ruby
<dminuoso> ar1a: I/O interaction with the kernel typically releases the GVL. Which means you always have concurrency, but with I/O (and a very select few other things) you also have parallelism.
<dminuoso> So if you're doing CPU intensive stuff that does things in the Ruby GVL you will only get concurrency.
Cohedrin_ has joined #ruby
ddd12 has quit [Quit: Leaving]
mim1k has quit [Ping timeout: 268 seconds]
johnny56_ has quit [Ping timeout: 264 seconds]
muelleme_ has quit [Ping timeout: 260 seconds]
alex`` has quit [Quit: WeeChat 1.8]
dfsdfssdfsfd has quit [Ping timeout: 260 seconds]
abhi56rai has joined #ruby
shinnya has quit [Ping timeout: 240 seconds]
Dimik has joined #ruby
clemens3 has joined #ruby
drcode has quit [Quit: ZNC 1.6.5 - http://znc.in]
darix has joined #ruby
mim1k has joined #ruby
Cohedrin_ has quit [Ping timeout: 258 seconds]
<ar1a> debian 8 still on ruby 2.1.5
<ar1a> i think, at least
Cohedrin_ has joined #ruby
troys_ is now known as troys
muelleme_ has joined #ruby
whippythellama has joined #ruby
abhi56rai has quit [Quit: WeeChat 1.9]
abhi56rai has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
abhi56rai has quit [Client Quit]
nofxx has quit [Ping timeout: 240 seconds]
quobo has joined #ruby
drcode has joined #ruby
PaulCapestany has joined #ruby
GinoMan1423 has joined #ruby
abhi56rai has joined #ruby
jphase has quit [Remote host closed the connection]
GinoMan2440 has quit [Ping timeout: 260 seconds]
jphase has joined #ruby
GinoMan1423 has quit [Remote host closed the connection]
jphase has quit [Ping timeout: 255 seconds]
whippythellama has quit [Ping timeout: 240 seconds]
jak has quit [Remote host closed the connection]
blackwind_123 has joined #ruby
mim1k has joined #ruby
andrzejku has joined #ruby
ta_ has joined #ruby
<ar1a> yep
nofxx has joined #ruby
jak has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
petruff has quit [Ping timeout: 240 seconds]
psychicist__ has quit [Quit: Lost terminal]
ledestin has joined #ruby
yokel has quit [Ping timeout: 240 seconds]
raspado has joined #ruby
yokel has joined #ruby
dcunit3d has quit [Ping timeout: 240 seconds]
tomaw has quit [Read error: Connection reset by peer]
Ishido has quit [Ping timeout: 255 seconds]
psychicist__ has joined #ruby
montanonic has quit [Ping timeout: 248 seconds]
Ishido has joined #ruby
yokel has quit [Ping timeout: 255 seconds]
postmodern has joined #ruby
yokel has joined #ruby
mim1k has joined #ruby
anisha has quit [Quit: This computer has gone to sleep]
solocshaw has quit [Remote host closed the connection]
abrahampolishchu has joined #ruby
SeepingN has joined #ruby
whippythellama has joined #ruby
mim1k has quit [Ping timeout: 248 seconds]
Cohedrin_ has quit [Read error: Connection reset by peer]
Cohedrin_ has joined #ruby
oleo has quit [Read error: Connection reset by peer]
nhhc has joined #ruby
montanonic has joined #ruby
johnny56_ has joined #ruby
knight33 has joined #ruby
tomaw has joined #ruby
<_moep_> hey, is this room the correct one, for questions about rbenv?
<ar1a> i don't see why not
<havenwood> _moep_: There isn't an #rbenv channel like #chruby or #rvm, so this is the closest.
<_moep_> ok
mim1k has joined #ruby
<_moep_> ok, I installed it in ~app like the doc at github
<havenwood> ?rbenv
<ruby[bot]> Missing command under rbenv? Did you try `rbenv rehash`?
solocshaw has joined #ruby
<_moep_> now I want to run my configurationmanagment tool and it should trigger rbenv (rbenv install …)
troys is now known as troys_
<_moep_> and I get at user root the error "no such command install"
<havenwood> _moep_: Show us the line that results in that?
<_moep_> /home/app/.rbenv/bin/rbenv install 2.3.4
sekmo has joined #ruby
<havenwood> _moep_: Is ruby-build installed?
<_moep_> I also exported the path before export PATH="/home/app/.rbenv/bin:$PATH"
<_moep_> yes
solocshaw has quit [Remote host closed the connection]
<havenwood> _moep_: Maybe avoid the entangled command and use ruby-build directly: ruby-build 2.3.4 ~/local/ruby-2.3.4
brent__ has joined #ruby
<_moep_> its working localy its just not working with my script
<_moep_> (when i try it as user root)
mim1k has quit [Ping timeout: 240 seconds]
<havenwood> _moep_: If you continue to have ruby-build issues, you can always use ruby-install to install for rbenv: ruby-install --latest --install-dir ~/.rbenv/versions/2.3.4 ruby 2.3.4
<havenwood> _moep_: I'd not be surprised if rbenv scripts don't work as root. Is it only with root you're having trouble?
oleo has joined #ruby
<_moep_> yes, with the app user I dont a the problem
<havenwood> _moep_: So I'd suggest using ruby-build directly, hardcoding the path to install to, or use ruby-install for the same.
brent___ has joined #ruby
brent__ has quit [Read error: Connection reset by peer]
<_moep_> thx I will try it
sekmo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
brent___ has quit [Read error: Connection reset by peer]
conta2 has quit [Ping timeout: 255 seconds]
<dminuoso> _moep_: Is this for docker?
<_moep_> no
<_moep_> cdist
<dminuoso> Whatever that is :S
<clemens3> join #macosx
<_moep_> something like ansible
<dminuoso> ansible in bash, eh?
<_moep_> ack
<dminuoso> My condolences.
DeeJayh has joined #ruby
whippythellama has quit [Ping timeout: 240 seconds]
solocshaw has joined #ruby
tomaw has quit [Quit: Quitting]
tomaw has joined #ruby
ketan has joined #ruby
tomaw has quit [Quit: Quitting]
tomaw has joined #ruby
solocshaw has quit [Remote host closed the connection]
solocshaw has joined #ruby
ketan has quit [Ping timeout: 248 seconds]
mim1k has joined #ruby
Cohedrin_ has quit [Ping timeout: 255 seconds]
solocshaw has quit [Remote host closed the connection]
solocshaw has joined #ruby
ResidentBiscuit has quit [Quit: Critical Miss]
muelleme_ has quit [Ping timeout: 255 seconds]
mim1k has quit [Ping timeout: 255 seconds]
ur5us has joined #ruby
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
pie3 has joined #ruby
Cohedrin_ has joined #ruby
ur5us has quit [Ping timeout: 255 seconds]
kang90 has quit [Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )]
pie3 has quit [Quit: Leaving]
polishdub has quit [Quit: Leaving]
PatrikasZvaigzde is now known as naprimer
[Butch] has quit [Quit: I'm out . . .]
shortdudey123 has quit [Ping timeout: 246 seconds]
shortdudey123 has joined #ruby
Rodya_ has joined #ruby
sneakerhax has joined #ruby
whippythellama has joined #ruby
andrzejku has quit [Quit: Textual IRC Client: www.textualapp.com]
gothicsouth has joined #ruby
jak has quit [Remote host closed the connection]
jak has joined #ruby
mim1k has joined #ruby
bauruine has quit [Quit: ZNC - http://znc.in]
bauruine has joined #ruby
sekmo has joined #ruby
solocshaw has quit [Read error: Connection reset by peer]
solocshaw has joined #ruby
mim1k has quit [Ping timeout: 255 seconds]
xMopxShell has quit [Ping timeout: 240 seconds]
sekmo has quit [Read error: Connection reset by peer]
PaulCapestany has quit [Ping timeout: 240 seconds]
spheric has joined #ruby
lxsameer has joined #ruby
DeeJayh has quit [Read error: Connection reset by peer]
nhhc has quit [Remote host closed the connection]
jordanm has quit [Quit: Konversation terminated!]
Cohedrin_ has quit [Ping timeout: 246 seconds]
shinnya has joined #ruby
mim1k has joined #ruby
PaulCapestany has joined #ruby
biberu has quit []
jordanm has joined #ruby
dionysus69 has quit [Ping timeout: 248 seconds]
xMopxShell has joined #ruby
abhi56rai has quit [Ping timeout: 240 seconds]
Rodya_ has quit [Remote host closed the connection]
Cohedri__ has joined #ruby
quobo has quit [Quit: Connection closed for inactivity]
mim1k has quit [Ping timeout: 248 seconds]
Asher has quit [Quit: Leaving.]
Rodya_ has joined #ruby
Asher has joined #ruby
PaulCapestany has quit [Ping timeout: 240 seconds]
dcunit3d has joined #ruby
whippythellama has quit [Ping timeout: 240 seconds]
ddddddd has quit [Ping timeout: 260 seconds]
PaulCapestany has joined #ruby
splitshot has quit [Remote host closed the connection]
ur5us has joined #ruby
mim1k has joined #ruby
ldnunes has quit [Quit: Leaving]
dcluna has quit [Ping timeout: 268 seconds]
dcluna has joined #ruby
mim1k has quit [Ping timeout: 255 seconds]
PaulCapestany has quit [Ping timeout: 248 seconds]
al2o3-cr has joined #ruby
tau has quit [Read error: Connection reset by peer]
whathappen has joined #ruby
<whathappen> is it okay to indent with spaces
<ljarvis> yes
<zenspider> whathappen: not just okay... expected. :P
<whathappen> programmers who indent with spaces seem to make more money
<ljarvis> dont take that article seriously whathappen
shinnya has quit [Ping timeout: 260 seconds]
Mia has quit [Ping timeout: 248 seconds]
naprimer2 has joined #ruby
devster31 has joined #ruby
jphase has joined #ruby
dcunit3d has quit [Ping timeout: 248 seconds]
devster31 has quit [K-Lined]
naprimer has quit [Ping timeout: 240 seconds]
<whathappen> Will the next version of ruby require semi colons after each line of code
<havenwood> whathappen: Please don't troll.
PaulCapestany has joined #ruby
whathappen has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
whippythellama has joined #ruby
eckhardt has joined #ruby
HoierM_ has joined #ruby
cam27 has quit [Quit: cam27]
al2o3-cr has quit [Quit: WeeChat 1.9]
whippythellama has quit [Ping timeout: 240 seconds]
cpruitt has quit [Quit: cpruitt]
troys_ is now known as troys
patarr has quit [Ping timeout: 248 seconds]
solocshaw has quit [Ping timeout: 255 seconds]
Fysicus has joined #ruby
jphase has quit [Remote host closed the connection]
jphase has joined #ruby
mostlybadfly has joined #ruby
mim1k has joined #ruby
jphase has quit [Ping timeout: 246 seconds]
quobo has joined #ruby
<learner123> If I pass parameters to methods, is it possible get the name of those parameters? For example, myvar = 12345 and calling mymethod (myvar) will print "myvar" instead of 12345.
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mim1k has quit [Ping timeout: 255 seconds]
al2o3-cr has joined #ruby
blackwind_123 has quit [Ping timeout: 246 seconds]
<Papierkorb> learner123: No
ketan has joined #ruby
blackwind_123 has joined #ruby
cam27 has joined #ruby
Cohedri__ has quit [Ping timeout: 260 seconds]
ketan has quit [Ping timeout: 248 seconds]
enterprisey has joined #ruby
<learner123> it's not possible, Papierkorb?
<learner123> Hard to believe!
haylon has quit [Remote host closed the connection]
jak has quit [Remote host closed the connection]
<clemens3> u can look at caller and parse the file find the line that invoked you method etc., big hack, but could get something
<Papierkorb> learner123: No it's not. Variables only have names so you, the programmer, can access them in your code. The computer, after reading the source, couldn't call less.
<Papierkorb> *couldn't care
jak has joined #ruby
<clemens3> __FILE__
whippythellama has joined #ruby
<clemens3> there is local_variables, but you want the external one from the caller
johnzorn has quit [Ping timeout: 240 seconds]
<Papierkorb> Well of course, you can try hacking your way through. But those are: Hacks. Nothing that's "usually" possible, and in this case, not easy to do right.
<learner123> OK, thanks.
Cohedrin_ has joined #ruby
<clemens3> yes, what for do you need that?
SeepingN has joined #ruby
<learner123> Are you asking me, clements3?
whippythellama has quit [Ping timeout: 260 seconds]
<clemens3> yes, but not important, i guess was just some curiousity of yours
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
<learner123> OK.
<learner123> myvar = 123 then somehow calling and making "mymethod myvar" print "myvar" = 123.
<learner123> mymethod() would have some way to print the parameter name and parameter value in it.
ascarter has joined #ruby
<learner123> a=1, b=2, c=3, d=4..... then printalpha(a, b, c, d) --> then printalpha method would print: a=1, b=2, c=3, d=4
<clemens3> i understand what you want, but why do you want that?
<learner123> Oh...
<clemens3> the idea is for the printalpha method to hide that information
<clemens3> of what happened outside
<clemens3> if you have def printalpha( a, b, c, d ) then you are closer already
<learner123> In reality for my task, each of those parameters is an array with a lot of values.
<learner123> So, I want the method to print the parameter name first and then a bunch of its values.
Cohedrin_ has quit [Read error: Connection reset by peer]
<clemens3> if you have def printalpha(p, q, r, s)
<clemens3> u want to print abcd or pqrs?
<learner123> Of course, I have a few actual processing steps to do before printing those things.
<learner123> (inside a method)
<learner123> abcd
<clemens3> because what is the value? you could give an additional parameter with the abcd names if you cared for printout
<clemens3> then why not add another parameter with those names
<learner123> That's what I was trying to do with no success.
ascarter has quit [Ping timeout: 260 seconds]
Cohedrin_ has joined #ruby
<clemens3> but what is the service in printing out the variable names?
<learner123> [ "a", "b", "c", "d" ].each { |param| printalpha param, "#{param}" } didn't work.
<clemens3> you can do printalpha( [ "a", a, "b", b, "c", c, "d", d ] )
SeepingN has quit [Ping timeout: 248 seconds]
<clemens3> and you have all the information inside the method
roshanavand has quit [Ping timeout: 255 seconds]
roshanavand has joined #ruby
<learner123> service = I want to create files with the parameter names that are part of the filenames.... and each file would include values of each parameter.
<learner123> ah... let me try. Thanks, clements3!
<clemens3> mom
<learner123> actually, I'm using an myarray.each { |myparam| printalpha myparam }.
<learner123> Hard to do.
mim1k has joined #ruby
SeepingN has joined #ruby
<al2o3-cr> >> def foo(x, y, z) local_variables.map { |lv| "#{lv} = #{binding.local_variable_get(lv)}" } end; foo(1,2,3)
<ruby[bot]> al2o3-cr: # => ["x = 1", "y = 2", "z = 3"] (https://eval.in/826855)
meshsmith has quit [Remote host closed the connection]
<learner123> where myarray = [ array1, array2, array3, array4 ]
<learner123> and I'm using the v2.0.0 on Mac.
<learner123> bash-3.2$ ruby --version ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]
<clemens3> al2o3-cr: i understood you wanted: a=1; foo(a); and output "a=1" and not "x=1"?
mim1k has quit [Ping timeout: 246 seconds]
<clemens3> you=learner
<learner123> I'm getting an error:
<learner123> ./test.rb:4:in `block in foo': undefined method `local_variable_get' for #<Binding:0x007fac6c87f8c8> (NoMethodError) from ./test.rb:4:in `map' from ./test.rb:4:in `foo' from ./test.rb:8:in `<main>'
TomyLobo has quit [Ping timeout: 255 seconds]
<learner123> It's to al2o3-cr.
phreakocious_ is now known as phreakocious
<learner123> clements3: Yep, that's what I'm trying to do.
<learner123> Although my parameter is an array of arrays.
<clemens3> but i dont understand the use case yet
<clemens3> this files and parameters business
<clemens3> because when you invoke the method, you have already the variable names there
<clemens3> then what is the problem
<clemens3> and what is it for
<clemens3> maybe u can solve main problem differently
<clemens3> learner, you can use al2o3's appraoch before invoking the sub method
<al2o3-cr> i'm tired and probably didn't read the backlog enough :(
<learner123> array1 = [ 1232, 2552, 23234, 34565634 ]; array2 = [ 12313, 235345, 346545, 456746 ]; array3 = [ 56656, 234324, 567676, 678785678 ]; myarray = [ array1, array2, array3, array4 ]; myarray.each { |myparam| mymethod myparam }
<clemens3> so then use mymethod( myparam, "myparam" )
<clemens3> and feed it with another myarraynames = [ "array1", "array2", array3..
<learner123> the 2nd parameter "myparam" as it is will be passed then not each of "array1", "array2", etc.
<clemens3> u can do it dynamicly with local_variables each like al2o3-cr did above
<clemens3> in you case use "array1"
<clemens3> you=your
<clemens3> and feed it with another myarraynames = [ "array1", "array2", "array3", "array4" ]
<clemens3> and use same index to pass one value from myarray and one from myarraynames to the method
<clemens3> with 2 parameters
<learner123> You're recommending me to use a hash instead?
<zenspider> learner123: what? why are you trying to do that?
<zenspider> did nobody even think to ask instead of just sending them down a rabbithole?
whippythellama has joined #ruby
<clemens3> was my question above first or second
<clemens3> i still dont know either
<zenspider> I must have missed it in the shitstorm
<clemens3> stoermchen
<zenspider> there it is. yeah. no answer...
<clemens3> something with files and parameters
<clemens3> maybe he wants to serialize something and could use yaml
<zenspider> learner123: whatever you're doing is a bad idea... what's going on?
<clemens3> myarray = [ [ array1, "array1" ], ...
<clemens3> and in the method you have myparam[ 0 ] with the variable value und myparam[ 1 ] with the name of the variable
<clemens3> instead of just myparam
<clemens3> but as zenspider said, we don
<clemens3> t know why
roshanavand has quit [Ping timeout: 246 seconds]
<learner123> #!/usr/bin/ruby def mymethod my_passed_parameter # how can I print: # array1 = [ 1, 2, 3, 4 ] # array2 = [ 5, 6, 7, 8 ] # array3 = [ 9, 10, 11, 12 ] end array1 = [ 1, 2, 3, 4 ] array2 = [ 5, 6, 7, 8 ] array3 = [ 9, 10, 11, 12 ] myarraynames = [ array1, array2, array3 ] myarraynames.each { |myparam| mymethod myparam }
whippythellama has quit [Ping timeout: 240 seconds]
<zenspider> learner123: don't do that
<learner123> I thought this would be very simple.
<learner123> why not?
<clemens3> i guess it is some exercise from some class
<learner123> No.
<zenspider> don't paste a blob of crap in here. use a paste service. because it is polite
<learner123> Let me modify it to make it closer to what I'm trying to do.
<zenspider> and yes, you probably thought thit would be simple. it isn't. and it isn't a good idea for a number of reasons... but you should answer our questions first
<learner123> What's the paste service?
<zenspider> use a gist
<learner123> OK, thanks. Let me check gist.
<clemens3> learner123: you think you tell us what you do, but actually you are thinking how to do something.
pitoucc has joined #ruby
aglorei has quit [Remote host closed the connection]
aglorei has joined #ruby
eckhardt has quit [Quit: Textual IRC Client: www.textualapp.com]
<learner123> Sorry for the cumbersome newbie code.
pitoucc has quit [Quit: Leaving]
<learner123> But the above creates filenames "[1, 2, 3, 4]", "[5, 6, 7, 8]", etc.
PaulCapestany has quit [Read error: Connection reset by peer]
<learner123> instead of filenames /tmp/array1, /tmp/array2, /tmp/array3.
hkdsun has joined #ruby
hkdsun_ has quit [Ping timeout: 258 seconds]
dcunit3d has joined #ruby
johnny56_ has quit [Ping timeout: 264 seconds]
<clemens3> so the file name should be "array1" and the content of the file should be "[ 1, 2, 3, 4 ]"?
<clemens3> etc for 2, 3, 4 as well
<learner123> clements3: Yep, exactly.
PaulCapestany has joined #ruby
<learner123> Right now, what I get is /tmp/[1, 2, 3, 4] as the filename instead of /tmp/array1.
johnny56_ has joined #ruby
<clemens3> def write( filename, content )
<learner123> I've googled various stack overflow sites, etc. and seen the use of .binding(), local_variable_get(), eval(), inspect(), etc. but with my ruby v2.0, some are not available and others just don't work for me.
mim1k has joined #ruby
ablackack has quit [Quit: ZNC 1.6.3+deb1+xenial0 - http://znc.in]
<learner123> clements3: Hmm.... sorry but could you please show me a modified code using gist, if possible?
<clemens3> File.write( "tmp/array1", array1 )
ablackack has joined #ruby
<learner123> For one parameter, I could do that... how would I be able to do it when I had 10 parameters to pass.
<learner123> Tricky to me with myarraynames.each { |myparam| mymethod myparam }
<clemens3> [ [ "tmp/array1", array1 ], ["tmp/array2", array2 ] ]
<learner123> That is, to use hash, right?
<clemens3> and you iterate over the first array and use index 0 and 1 as parameters each
mim1k has quit [Ping timeout: 268 seconds]
<learner123> an array of hash.
singer22 has joined #ruby
nmupwjl has joined #ruby
<nmupwjl> HAPPY NIGGERS DAY!! quicktalkeh676te.onion/6697: galeido michael_mbp ytti raatiniemi al2o3-cr gix nickjj zack6849 Travis-42 FifthWall Bish WhatsGoi` nadir jaredrhine Fenhl bauruine seitensei bw\_ guardian typeVoid chrisarcand ta_ x0f Morrolan dmnd zeroDivisible ryotarai Tempesta jak soahccc octomancer justache [dmp] Junaos coffeejunk Fysicus scottschecter lancetw adambeynon bier pwillard TheBrayn linduxed kiltzman Diabolik diegok herbmillerjr xzhao nikivi
<nmupwjl> HAPPY NIGGERS DAY!! quicktalkeh676te.onion/6697: Meow-J eputnam ovaltine konsolebox claw ckrailo avir nuck eregon sniffer russt psychicist__ digitalfiz unreal larissa xzhao tatey dmnd slima deimos Danielss89 yorickpeterse maxmanders alveric2 foxxx0 abrahampolishchu bjmllr apeiros gregf_ chmuri DTZUZU MrBloo Archrover bazzy flips gnarf michael_mbp Jello_Raptor D9 klaas kent\n Morrolan bougyman bier mr_rich101 Hobbyboy pwillard blackwind_123 ste gusrub
<nmupwjl> HAPPY NIGGERS DAY!! quicktalkeh676te.onion/6697: tfitts BackEndCoder dyjakan nishiki dminuoso petems rcs oblique Psy-Q swistak35_ ltp JustTheDoctor is_null veloutin jimeh_ bove `derpy nuck sonne TvL2386 hayden___ bayed jwheare [diecast] gf3 mostlybadfly Brak____________ diegok wkoszek_ Danielss89 tessi_zz savoir-faire silverdust joes jasondotstar bougyman sysanthrope cttttt genpaku Junaos sunya7a_ hkdsun vdl MissionCritical webhat mahlon dhollinger octoman
<nmupwjl> HAPPY NIGGERS DAY!! quicktalkeh676te.onion/6697: Hobbyboy jolamb potatoe linduxed jwheare Fraeon nopacienc3 herwin wkoszek_ JoshL redondos graft jinie zeroDivisible SeepingN zzxc pizzaops DTZUZU chmuri VladGh vircung tolvstaa friday vqrs clemens3 Rush_ ckrailo SegFaultAX qmr duracrisis johnny56_ joast [dmp] FastJack ACE1503 dfoolz Ka baweaver _mak epochwolf mattp_ szulak infernix Scient kspencer staticfox mbr colstrom bier yokel
<clemens3> [ [ "tmp/array1", array1 ], ["tmp/array2", array2 ] ].each { |myparam| File.write( myparam[ 0 ], myparam[ 1 ] ) } # sorry folks for pasting
<nmupwjl> HAPPY NIGGERS DAY!! quicktalkeh676te.onion/6697: freeze_ syndikate raspado nofxx jzigmund SpComb ste lxsameer WhatsGoi` Fire-Dragon-DoL webhat g3funk vqrs matthewd Yxhuvud MasterNayru_ dcunit3d Alina-malina MrBloo amitchellbullard jokke justinmrkva spectra statelesscode AKPWD jwheare jtperreault nickjj Rabbit_ jericon benjen watersoul LyndsySimon JStoker pskosinski ltd_ bayed iNs solidsnack inukshuk HoierM_ bove Tralin darthThorik mach_kernel blackwind_123
<nmupwjl> HAPPY NIGGERS DAY!! quicktalkeh676te.onion/6697: P1ro graft blackwind_123 mjuhl qmr Diabolik Fenhl _2easy Cohedrin_ TheBrayn ahuman hplar radic ckrailo boshhead Jello_Raptor aglorei wbnns diegok patteh fumk pizzaops KramerC armyriad joast reinh1 sysanthrope Raboo jsrn nathani linduxed gusrub kaspergrubbe klaas clamstar vifino amitchellbullard Meow-J darthThorik chrisarcand uxp_ chamunks cam27 konsolebox jzigmund sebd vircung bayed dminuoso zenspider
<nmupwjl> HAPPY NIGGERS DAY!! quicktalkeh676te.onion/6697: sorah___ jimeh_ latemus gremax chaos95 Kilo`byte havenwood boshhead gothicsouth hsiktas nebiros headius aredridel zzak klaas cydrobolt avelldiroll bier spectra drcode LBRapid mostlybadfly Subfusc scottschecter blackwind_123 ghoti Raboo bw\_ voxxit jericon brixen bazzy funnel Yxhuvud hinbody omninonsens Bish webhat darix raatiniemi jwheare TinkerTyper_ is_null stryek_ jpterry gregf_ heyimwill cout jrm guardia
<nmupwjl> HAPPY NIGGERS DAY!! quicktalkeh676te.onion/6697: bhaak gil_ Dreamer3 tessi_zz BTRE unsymbol infernix nOwz ec\ DTZUZU cibs rt nowhere_man heinrich5991 duderonomy shaman42 velu_aon[m] sneakerhax aloy ionte_ spider-mario bjmllr jhass midacts jordanm Bish \13k A124 scrooloose chrisarcand pavelz brixen omninonsens ltd_ esObe ruby[bot] eputnam EvilJStoker jzigmund cevett DarthGandalf freeze_ jak jrmhurs102 RazorX andersh justinmrkva j0bk dyyylan SpComb
lxsameer has quit [Quit: WeeChat 1.8]
<Nilium> In dire need of a k-line here.
<nmupwjl> HAPPY NIGGERS DAY!! quicktalkeh676te.onion/6697: bathtub_shark avir pavelz spheric eregon manveru my123 konsolebox spider-mario FastJack klaas Nicmavr gremax d^sh_ chrisarcand TinkerTyper_ funnel Bish bove Hien cyphase dikaio_ csk bodie_ tw1sted V1s1ble adambeynon Kilo`byte graft tsul avelldiroll adaedra zachary12 Rush_ brixen Rutix coffeejunk dlitvak segy Psy-Q Dreamer3 jcast SCHAPiE potatoe dyyylan Guest60457 minimalism cschneid raspado ste
<nmupwjl> HAPPY NIGGERS DAY!! quicktalkeh676te.onion/6697: valkyr2e __main__ mjuhl zipkid zenguy_pc darix sonne agrecascino ur5us jrmhurs102 justache chamunks inukshuk balo elarson Emmanuel_Chanel Diabolik drcode Cohedrin_ Rush_ Travis-42 devyn jericon cardoni Nicmavr g3funk ACE1503 rikai SCHAPiE cjohnson sinduck minimalism Iacobus Hien z64 grymmjack Seenox clamstar oz rrichardsr3 greister voxxit kent\n ineb Rodya_ zapata pecan birdyondrugs dminuoso perry
<nmupwjl> HAPPY NIGGERS DAY!! quicktalkeh676te.onion/6697: Evesy michael_mbp blackwind_123 jinie devyn jpterry bw\_ ericnw marlinc _mak Fenhl yosafbridge ineb flips marens BSaboia yitsushi ltd_ ElderFain Iacobus dlitvak sonne vayan patteh jzigmund RazorX Ishido Yonk digitalfiz ytti moei vedu __main__ uxp_ JustTheDoctor voxxit CustosLimen Guest54664 D9 ghormoon ggherdov Nilium abrahampolishchu benjen drcode knowtheory latemus cgfbee pabs jordanm
<nmupwjl> HAPPY NIGGERS DAY!! quicktalkeh676te.onion/6697: sami Soulcutter jzigmund _br__ xMopxShell midacts SpComb _2easy z3uS mtkd VladGh bhaak spider-mario duderonomy mvensky Phanes hinbody inukshuk nikivi spectra ericnw leonthemisfit Iacobus rcs DarkBushido naprimer2 eputnam Rodya_ podman SirCmpwn Mekkis_ andersh foxxx0 joast JStoker cyphase Lloyd raatiniemi stan roger_rabbit TheMoonMaster jasondotstar shortdudey123 gigetoo Radar Junaos jtperreault unreal A124 J
<nmupwjl> HAPPY NIGGERS DAY!! quicktalkeh676te.onion/6697: priodev daemonwrangler tsunamie aloy veloutin nOwz Hien Hobbyboy brixen SCHAPiE FifthWall discopatrick brainslug konsolebox cardoni rikai julian kent\n oblique kt2 kies colstrom dcluna foxxx0 rcs jrgifford iooner Emmanuel_Chanel SuperLag Fysicus vdl alem0lars BTRE sent-hil kapowaz p0p0pr37 jasondotstar ChewCraft llua Ishido gsingh93 BackEndCoder bier dcunit3d mclee singer22 duderonomy Jello_Raptor artmann_ b
<nmupwjl> HAPPY NIGGERS DAY!! quicktalkeh676te.onion/6697: davic birdyondrugs alveric2 perry __main__ gsingh93 freedrull infernix kloeri Rabbit_ jtdowney jolamb HoierM_ oleo sniffer cydrobolt montanonic swgillespie soahccc aloy spectra fumk zapata nickjj lele kspencer iamayam dcunit3d Jamo sjums P1ro jxf cyphase Xiti shortdudey123 ec\ p0p0pr37 _mak daemonwrangler kapowaz EvilJStoker PaulCapestany sami Hien Ka gusrub wbnns rapha graft AnoHito_
im0nde has quit [Ping timeout: 240 seconds]
<nmupwjl> HAPPY NIGGERS DAY!! quicktalkeh676te.onion/6697: bougyman vifino elomatreb nadir jhill nicolai86 baweaver _br__ eputnam jasondotstar balo gusrub EvilJStoker aglorei dcunit3d gimmic j0bk elliottcable bodie_ saneax FifthWall gnarf cjk101010 diegok BSaboia freeze_ jrgifford tessi_zz HoierM_ reinh1 jcast Fire-Dragon-DoL dhollinger Klumben sneakerhax alveric2 marens ikopico Rabbit_ G tekacs dunk sebd arahael cam27 devyn connor_goodwolf headius clamstar psychici
<nmupwjl> HAPPY NIGGERS DAY!! quicktalkeh676te.onion/6697: gremax aarongodin nOwz Rabbit_ Dreamer3 boshhead Ishido WhatsGoi` TvL2386 artmann_ cydrobolt Scient coffeejunk Subfusc spider-mario Jamo deimos sami Tempesta havenwood Hien j416 jimeh_ zachary12 zipkid jrmhurs102 discopatrick aspiers klaas veloutin el_ocho[m] rileyy Danielss89 darthThorik al2o3-cr drcode segy ltp CVTJNII freeze_ sspreitz Gnubie__ hayden___ genpaku nopacienc3 octomancer michael_mbp AKPWD pfg
<p0p0pr37> fku
kline has joined #ruby
<nmupwjl> HAPPY NIGGERS DAY!! quicktalkeh676te.onion/6697: vifino hkdsun mesamoo vayan Meow-J yosafbridge csk Seenox ericmath1son twe4ked manveru webnanners j416 Lyubo1 diegok Koshian hayden___ RealMarc aurelien alveric2 gregf_ omninonsens varesa jhass ryotarai KramerC Cohedrin_ AlHafoudh kies tfitts Iacobus BackEndCoder jrgifford solidsnack aarongodin pecan hsiktas Junaos majuscule nug Scient ACE1503 sinduck JStoker kapowaz drcode sneakerhax perry abrahampolishchu
<nmupwjl> HAPPY NIGGERS DAY!! quicktalkeh676te.onion/6697: cydrobolt [diecast] pecan Seenox Caius CVTJNII TheBrayn MarkBilk mjuhl sorah___ Diabolik s1kx jak diegok alveric2 scrooloose sysanthrope Brak____________ pelegreno_____ flips typeVoid bayed darix go|dfish gse_ aspiers ruby[bot] SeepingN pragmatism arahael majuscule mtkd cardoni cam27 HoierM_ CustosLimen crayfishx watersoul Ticky reinh1 adaedra gremax reaVer stryek_ krasnus armyriad veloutin jrmhurs102 elomat
patarr has joined #ruby
<dlitvak> can we ban this dude?
<nmupwjl> HAPPY NIGGERS DAY!! quicktalkeh676te.onion/6697: infernix bigkevmcd jak fumk Meow-J ltd_ Psy-Q greister qmr mr_rich101 majuscule gimmic pragmatism brixen hplar Evesy avelldiroll hkdsun benjen moei Nicmavr zipkid typeVoid krasnus psychicist__ gix zzak nathani darthThorik freedrull `derpy shaman42 vdl sorah___ nchambers spheric tfitts ChewCraft Ticky jimeh_ AnoHito_ FifthWall crayfishx ruby[bot] p0p0pr37 TinkerTyper_ Hien iooner avir am55
<nmupwjl> HAPPY NIGGERS DAY!! quicktalkeh676te.onion/6697: clemens3 jolamb nfsnobody- CustosLimen gimmic julian nchambers Mekkis_ Meow-J jasondotstar nirix vqrs D9 herbmillerjr jxf bathtub_shark dcunit3d Tralin stan s1kx BSaboia postmodern shaman42 syndikate gil_ Ka potatoe freedrull pizzaops xsdg nebben DaveTaboola arahael headius jinie arvindsa- kt2 Caius arthu nekomune petems BTRE FastJack balo sspreitz Morrolan testnick[m] AnoHito_ RazorX yeticry_
<Nilium> Thanks, kline.
nmupwjl has quit [Remote host closed the connection]
<dlitvak> danke
PaulCapestany has quit [Read error: Connection reset by peer]
<Rodya_> they were just doing the same i ##networking
<Rodya_> in*
<Nilium> Yeah, they're hitting the populated channels
<leonthemisfit> what a chode
<Nilium> Anyway, back to ruby
<Nilium> Or watching, anyway
PaulCapestany has joined #ruby
* Nilium hadn't written any production ruby in about a year and a half until recently
im0nde has joined #ruby
<zenspider> shit. sorry I missed that
whippythellama has joined #ruby
patarr has quit [Ping timeout: 268 seconds]
cyphase has quit [Ping timeout: 260 seconds]
raspado has quit [Quit: Leaving...]
<clemens3> learner123: yes, looks good:)
alveric3 has joined #ruby
kline has left #ruby ["*.banana *.split"]
cadillac_ has joined #ruby
sepp2k has quit [Ping timeout: 260 seconds]
cyphase has joined #ruby
alveric2 has quit [Ping timeout: 260 seconds]
learner123 has quit [Ping timeout: 260 seconds]
whippythellama has quit [Ping timeout: 240 seconds]
NeutronStarr has quit [Ping timeout: 255 seconds]
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
NeutronStarr has joined #ruby
xMopxShell has quit [Ping timeout: 255 seconds]
br0d1n has joined #ruby
im0nde has quit [Ping timeout: 255 seconds]
troys is now known as troys_
mim1k has joined #ruby
johnny56_ has quit [Quit: johnny56_]
hutch34 has joined #ruby
psychicist__ has quit [Quit: Lost terminal]
troys_ is now known as troys
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Cohedrin_ has quit [Read error: Connection reset by peer]
johnny56 has joined #ruby
Cohedrin_ has joined #ruby
cschneid_ has joined #ruby
enterprisey has quit [Remote host closed the connection]
mim1k has quit [Ping timeout: 260 seconds]
cschneid_ has quit [Ping timeout: 258 seconds]
whippythellama has joined #ruby
hutch34 has quit [Ping timeout: 255 seconds]
micalexander has joined #ruby