havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.5.1, 2.4.4, 2.3.7, 2.6.0-preview2: https://www.ruby-lang.org | Paste 4+ lines of text to https://gist.github.com | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby
jaequery has quit [Client Quit]
lxsameer has quit [Ping timeout: 264 seconds]
jamesaxl has quit [Quit: WeeChat 2.1]
cagomez has joined #ruby
karapetyan has joined #ruby
chouhoulis has quit [Remote host closed the connection]
nowhere_man has quit [Ping timeout: 256 seconds]
karapetyan has quit [Ping timeout: 240 seconds]
jaequery has joined #ruby
za1b1tsu has joined #ruby
nowhere_man has joined #ruby
jaequery has quit [Client Quit]
wilbert has joined #ruby
chouhoulis has joined #ruby
gheegh has quit [Quit: Textual IRC Client: www.textualapp.com]
cschneid has joined #ruby
<RougeR> hello
taylorzr has quit [Ping timeout: 256 seconds]
za1b1tsu has quit [Ping timeout: 240 seconds]
cagomez has quit [Read error: Connection reset by peer]
lxsameer has joined #ruby
cschneid has quit [Ping timeout: 256 seconds]
et09 has joined #ruby
<et09> editing someone else's code - he defined a class getter 'payer_cost' and also defines that as a variable in a method
<et09> in that same method, the local one takes precedence, right?
chouhoulis has quit [Ping timeout: 256 seconds]
<et09> looks like that's a yes
et09 has quit [Quit: leaving]
chouhoulis has joined #ruby
lxsameer has quit [Ping timeout: 248 seconds]
roamingdog has quit [Remote host closed the connection]
jaequery has joined #ruby
BloopMonster has joined #ruby
graphene has quit [Remote host closed the connection]
za1b1tsu has joined #ruby
graphene has joined #ruby
cadillac_ has quit [Ping timeout: 245 seconds]
za1b1tsu has quit [Ping timeout: 260 seconds]
jaequery has quit [Quit: Textual IRC Client: www.textualapp.com]
tdy has joined #ruby
redlegion has quit [Remote host closed the connection]
redlegion has joined #ruby
cadillac_ has joined #ruby
gizmore has joined #ruby
bjpenn has joined #ruby
quobo has quit [Quit: Connection closed for inactivity]
gizmore|2 has quit [Ping timeout: 240 seconds]
mupt has joined #ruby
lxsameer has joined #ruby
Lyubo1 has quit [Ping timeout: 245 seconds]
Lyubo1 has joined #ruby
lxsameer has quit [Ping timeout: 268 seconds]
chouhoulis has quit [Remote host closed the connection]
<Radar> depends on the variable
nicht has joined #ruby
taylorzr has joined #ruby
Azure has quit [Read error: Connection reset by peer]
Azure has joined #ruby
dreamthese has quit [Remote host closed the connection]
dreamthese has joined #ruby
roamingdog has joined #ruby
za1b1tsu has joined #ruby
lxsameer has joined #ruby
za1b1tsu has quit [Ping timeout: 240 seconds]
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
lxsameer has quit [Ping timeout: 264 seconds]
lxsameer has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
meinside has joined #ruby
lxsameer has quit [Ping timeout: 248 seconds]
biox has quit [Quit: probably server crash]
jordanm has quit [Remote host closed the connection]
BloopMonster has quit [Ping timeout: 256 seconds]
wilbert has quit [Quit: wilbert]
lxsameer has joined #ruby
jordanm has joined #ruby
Dimik has quit [Ping timeout: 248 seconds]
lxsameer has quit [Ping timeout: 256 seconds]
graphene has quit [Remote host closed the connection]
lxsameer has joined #ruby
graphene has joined #ruby
lxsameer has quit [Ping timeout: 240 seconds]
wilbert has joined #ruby
lxsameer has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
lxsameer has quit [Ping timeout: 268 seconds]
mupt has quit [Ping timeout: 240 seconds]
lxsameer has joined #ruby
za1b1tsu has joined #ruby
lxsameer has quit [Ping timeout: 260 seconds]
za1b1tsu has quit [Ping timeout: 256 seconds]
kapil___ has joined #ruby
lxsameer has joined #ruby
cadillac_ has quit [Quit: I quit]
cadillac_ has joined #ruby
bjpenn has quit [Ping timeout: 264 seconds]
lxsameer has quit [Ping timeout: 264 seconds]
braincrash has quit [Quit: bye bye]
lxsameer has joined #ruby
braincrash has joined #ruby
lxsameer has quit [Ping timeout: 256 seconds]
lxsameer has joined #ruby
<RougeR> anyone fancy giving me a hand with a tech interview
<RougeR> im really fekin close
<RougeR> im just tierd and been at work all day
wontruef_ has quit [Ping timeout: 265 seconds]
lxsameer has quit [Ping timeout: 276 seconds]
wontruefree has joined #ruby
nowhere_man has quit [Remote host closed the connection]
nowhere_man has joined #ruby
lxsameer has joined #ruby
Kestrel-029 has quit [Read error: Connection reset by peer]
lxsameer has quit [Ping timeout: 268 seconds]
Nicmavr has joined #ruby
Nicmavr is now known as Guest41035
ogres has quit [Quit: Connection closed for inactivity]
SeepingN has joined #ruby
nowhere_man has quit [Read error: Connection reset by peer]
lxsameer has joined #ruby
lxsameer has quit [Ping timeout: 240 seconds]
nowhere_man has joined #ruby
gix- has joined #ruby
gix has quit [Disconnected by services]
lxsameer has joined #ruby
lxsameer has quit [Ping timeout: 256 seconds]
lxsameer has joined #ruby
<havenwood> RougeR: Congrats on slogging through it!
<RougeR> havenwood: ty
<RougeR> ugh its 5am
<RougeR> getting there
wizkid238 has joined #ruby
<havenwood> RougeR: Whenever you see an if statement with true/false, it's likely you can just use the truthiness of the statement and discard the logic: https://gist.github.com/CodePint/238bbc4603b15f45e78517936e44d538#file-poker-rb-L245-L249
<havenwood> RougeR: This already returns `true` or `false`: (number_only_cards & low_straight) == low_straight
<RougeR> yeah ytou are aright havenwood
<RougeR> i musta missed that one, i did it for all the others
<RougeR> im stuck on another bit
<havenwood> RougeR: nice
<RougeR> the kickers
<RougeR> given two arrays
<RougeR> array1 = [7, 12, 9, 6]
<RougeR> array2= [12, 10, 7, 6]
lxsameer has quit [Ping timeout: 245 seconds]
<RougeR> youll have to find which wins
<RougeR> single highest number = winner
<RougeR> wait ugh
<RougeR> ill fix it
<RougeR> i can find the highest then pop it out if they match
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
izaac has quit [Ping timeout: 256 seconds]
lxsameer has joined #ruby
lxsameer has quit [Ping timeout: 248 seconds]
wizkid238 has quit [Quit: leaving]
BloopMonster has joined #ruby
cschneid has joined #ruby
lxsameer has joined #ruby
lxsameer has quit [Ping timeout: 256 seconds]
lxsameer has joined #ruby
dinfuehr has quit [Ping timeout: 264 seconds]
dinfuehr has joined #ruby
conta has joined #ruby
za1b1tsu has joined #ruby
nicht has quit [Ping timeout: 256 seconds]
lxsameer has quit [Ping timeout: 276 seconds]
za1b1tsu has quit [Ping timeout: 264 seconds]
dinfuehr has quit [Ping timeout: 264 seconds]
dinfuehr has joined #ruby
lxsameer has joined #ruby
taylorzr has quit [Ping timeout: 240 seconds]
taylorzr has joined #ruby
orbyt_ has joined #ruby
caleBOT has joined #ruby
lxsameer has quit [Ping timeout: 240 seconds]
ogres has joined #ruby
orbyt_ has quit [Client Quit]
d^sh has quit [Ping timeout: 245 seconds]
TinkerT has quit [Read error: Connection reset by peer]
TinkerT has joined #ruby
lxsameer has joined #ruby
d^sh has joined #ruby
lxsameer has quit [Ping timeout: 268 seconds]
lxsameer has joined #ruby
__goodnight__ has joined #ruby
__goodnight__ has quit [Client Quit]
caleBOT has quit [Remote host closed the connection]
kapil___ has quit [Quit: Connection closed for inactivity]
lxsameer has quit [Ping timeout: 248 seconds]
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lxsameer has joined #ruby
SeepingN has joined #ruby
wontruefree has quit [Quit: bye]
BloopMonster has quit [Ping timeout: 256 seconds]
lxsameer has quit [Ping timeout: 276 seconds]
lxsameer has joined #ruby
cschneid has quit [Remote host closed the connection]
nowhere_man has quit [Ping timeout: 255 seconds]
lxsameer has quit [Ping timeout: 240 seconds]
gizmore has quit [Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
anisha has joined #ruby
<RougeR> havenwood: finished it
punnie has quit [Quit: Connection closed for inactivity]
cschneid has joined #ruby
lxsameer has joined #ruby
lxsameer has quit [Ping timeout: 256 seconds]
wontruefree has joined #ruby
lxsameer has joined #ruby
cschneid has quit [Remote host closed the connection]
cschneid has joined #ruby
cschneid has quit [Remote host closed the connection]
lxsameer has quit [Ping timeout: 255 seconds]
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
lxsameer has joined #ruby
roamingdog has joined #ruby
ellcs1 has quit [Ping timeout: 260 seconds]
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
ellcs has joined #ruby
apeiros has quit [Remote host closed the connection]
lxsameer has quit [Ping timeout: 255 seconds]
za1b1tsu has joined #ruby
aupadhye has joined #ruby
lxsameer has joined #ruby
amar has joined #ruby
Inline has quit [Quit: Leaving]
lxsameer has quit [Ping timeout: 260 seconds]
wontruefree has quit [Quit: bye]
amar has quit [Ping timeout: 265 seconds]
amar has joined #ruby
lxsameer has joined #ruby
apeiros has joined #ruby
amar has quit [Ping timeout: 265 seconds]
amar has joined #ruby
lxsameer has quit [Ping timeout: 276 seconds]
Venomen has joined #ruby
Venomen has quit [Changing host]
Venomen has joined #ruby
lxsameer has joined #ruby
apeiros has quit [Remote host closed the connection]
lxsameer has quit [Ping timeout: 256 seconds]
lxsameer has joined #ruby
taylorzr has quit [Ping timeout: 265 seconds]
lxsameer has quit [Ping timeout: 256 seconds]
schleppel has joined #ruby
lxsameer has joined #ruby
lxsameer has quit [Ping timeout: 260 seconds]
andikr has joined #ruby
lxsameer has joined #ruby
yohji has joined #ruby
lxsameer has quit [Ping timeout: 255 seconds]
wilbert_ has joined #ruby
Caerus has quit [Quit: Leaving]
wilbert has quit [Ping timeout: 245 seconds]
vondruch has quit [Quit: vondruch]
aufi has joined #ruby
aufi_ has joined #ruby
lxsameer has joined #ruby
aufi has quit [Ping timeout: 268 seconds]
lxsameer has quit [Ping timeout: 268 seconds]
tvw has joined #ruby
claudiuinberlin has joined #ruby
\void has quit [Quit: So long, and thanks for all the fish.]
lxsameer has joined #ruby
BloopMonster has joined #ruby
TomyWork has joined #ruby
RougeR has quit [Ping timeout: 240 seconds]
n13z has joined #ruby
lxsameer has quit [Ping timeout: 256 seconds]
sysvalve has joined #ruby
lxsameer has joined #ruby
ogres has quit [Quit: Connection closed for inactivity]
amar has quit [Remote host closed the connection]
amar has joined #ruby
lxsameer has quit [Ping timeout: 240 seconds]
vondruch has joined #ruby
megamos has joined #ruby
amar has quit [Ping timeout: 248 seconds]
wilbert_ has quit [Ping timeout: 268 seconds]
RougeR has joined #ruby
RougeR has quit [Changing host]
RougeR has joined #ruby
lxsameer has joined #ruby
Burgestrand has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
lxsameer has quit [Ping timeout: 240 seconds]
RougeR has quit [Ping timeout: 276 seconds]
__nightw0lf has joined #ruby
lxsameer has joined #ruby
CrazyEddy has quit [Ping timeout: 256 seconds]
_nightw0lf has quit [Ping timeout: 245 seconds]
megamos has quit [Ping timeout: 256 seconds]
lxsameer has quit [Ping timeout: 256 seconds]
Burgestrand has quit [Quit: Closing time!]
lxsameer has joined #ruby
__nightw0lf has quit [Quit: Leaving]
Mike11 has joined #ruby
bjpenn has joined #ruby
Burgestrand has joined #ruby
Beams has joined #ruby
conta has quit [Ping timeout: 260 seconds]
amar has joined #ruby
megamos has joined #ruby
Puffball has quit [Quit: Puffball]
conta has joined #ruby
clemens3 has joined #ruby
nowhere_man has joined #ruby
guille-moe has joined #ruby
konos5__ has joined #ruby
BloopMonster has quit [Ping timeout: 240 seconds]
CrazyEddy has joined #ruby
Crackville has joined #ruby
<konos5__> Hi, everyone! Quick question: The ruby eigenclass diagram suggests that `BasicObject.singleton_class.singleton_class.superclass` is `Class` (Please see the link: https://www.dropbox.com/s/rmcdzjgb9c4ljsw/ruby-eigenclass-diagram-edit.png?dl=0) . However it using a ruby interpreter I found out that it's #Class and not Class. Which one is true?
<konos5__> \q
konos5__ has quit []
konos5__ has joined #ruby
Crackville has quit []
dhollin3 has joined #ruby
dhollinger has quit [Ping timeout: 264 seconds]
Guest41035 has quit [Changing host]
Guest41035 has joined #ruby
Guest41035 is now known as Kestrel-029
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
karapetyan has joined #ruby
bjpenn has quit [Ping timeout: 240 seconds]
karapetyan has quit [Ping timeout: 264 seconds]
Es0teric has joined #ruby
reber has joined #ruby
inukshuk_ has joined #ruby
postmodern has quit [Quit: Leaving]
sonOfRa has quit [Remote host closed the connection]
quobo has joined #ruby
amar has quit [Ping timeout: 265 seconds]
sonOfRa has joined #ruby
<konos5__> anyone?
<konsolebox> > BasicObject.singleton_class.singleton_class.singleton_class.class
<konsolebox> >> BasicObject.singleton_class.singleton_class.singleton_class.class
<ruby[bot]> konsolebox: # => Class (https://eval.in/1030340)
nowhere_man has quit [Ping timeout: 276 seconds]
<konsolebox> konos5__: that "#Class" is probably just output of "inspect"
inukshuk_ has quit [Quit: leaving]
naftilos76 has joined #ruby
<konos5__> You just run `BasicObject.singleton_class.singleton_class.singleton_class.class` instead of `BasicObject.singleton_class.singleton_class.singleton_class.superclass`
<konos5__> ooops my apologies.
<konsolebox> oh
<konos5__> should just be `BasicObject.singleton_class.singleton_class.superclass`
<konsolebox> you're it should be literally Class
<konsolebox> *you're saying
<konos5__> that should return `#<Class:Class>`
karapetyan has joined #ruby
<konos5__> which it does, but the diagram suggests otherwise
<konos5__> I'm saying that the diagram suggests that it should literally be `Class` but the interpreter says `#<Class:Class>`
vondruch_ has joined #ruby
<konsolebox> yes i get what you mean
<konos5__> it can't be both true. ...and the interpreter usually doesn't make mistakes... so... why is the diagram "wrong"?
<konos5__> maybe it refers to a previous version of Ruby..?
<konsolebox> perhaps Ruby have some forms of specialization when it comes to singleton classes
<konos5__> ...carry on
<konsolebox> konos5__: i no other thoughts more than that
<konsolebox> *i have
vondruch has quit [Ping timeout: 264 seconds]
vondruch_ is now known as vondruch
amar has joined #ruby
<konos5__> Thanks anyway, I'll try again later on today...
biberu has joined #ruby
apeiros has joined #ruby
shinnya has quit [Ping timeout: 240 seconds]
Burgestrand has quit [Quit: Closing time!]
karapetyan has quit [Remote host closed the connection]
mjolnird has quit [Remote host closed the connection]
megamos has quit [Quit: Leaving]
DeepIO has joined #ruby
apeiros has quit [Remote host closed the connection]
roamingdog has joined #ruby
apeiros has joined #ruby
BloopMonster has joined #ruby
Burgestrand has joined #ruby
<konsolebox> konos5__: as i observed, singleton classes of normal objects inherit differently from those of classes. e.g `Object.new.singleton_class.superclass == Object`, but `Object.singleton_class.superclass == BasicObject.singleton_class`. One thing to note is that the superclass of BasicObject's singleton_class is Class, and singleton class of Class is #<Class:Class>, that is why it is what you get with BasicObject.singleton_class.singleton_class.superclass
feelx- has joined #ruby
feelx has quit [Ping timeout: 256 seconds]
<konsolebox> >> BasicObject.singleton_class.superclass == Class && BasicObject.singleton_class.singleton_class.superclass == Class.singleton_class
<ruby[bot]> konsolebox: # => true (https://eval.in/1030370)
karapetyan has joined #ruby
Burgestrand has quit [Quit: Closing time!]
<konos5__> Thanks I get that and I see what's going on. However the diagram disagrees with you and has been quoted here multiple times.
<konos5__> I mean the output of irb makes perfect sense and is -in my eyes- totally justified. The diagram isn't
graphene has quit [Remote host closed the connection]
lxsameer has quit [Ping timeout: 256 seconds]
graphene has joined #ruby
graphene has quit [Read error: Connection reset by peer]
<konsolebox> konos5__: i agree
lxsameer has joined #ruby
graphene has joined #ruby
drale2k_ has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Mike11 has quit [Ping timeout: 265 seconds]
yokel has quit [Ping timeout: 245 seconds]
yokel has joined #ruby
<konsolebox> konos5__: where did you get the diagram though?
<konos5__> can't really remember the user...
<konos5__> could be @apeiros
<konos5__> but can't really remember...it's been 5 to 6 months ago...
KaffeeJunky123 has joined #ruby
InfinityFye has joined #ruby
punnie has joined #ruby
conta has quit [Quit: conta]
KaffeeJunky123 has left #ruby [#ruby]
KaffeeJunky123 has joined #ruby
<KaffeeJunky123> I can't seem to use the ruby standard library in irb, it doesn't find any of the standard library modules when I try to either write its fullname or use include, I've ruby 2.3.3 installed here.
<KaffeeJunky123> Any ideas what might be wrong?
<tbuehlmann> KaffeeJunky123: you need to require first. did you do that?
<KaffeeJunky123> tbuehlmann: yes it does not find any of the standard library modules, the core ones work
<KaffeeJunky123> eg Math works but Matrix does not
<KaffeeJunky123> Which should be present in this version of ruby
<KaffeeJunky123> I'm on Debian and installed ruby-full, if that helps
<konsolebox> KaffeeJunky123: `require 'matrix'` doesn't work?
BTRE has quit [Remote host closed the connection]
<KaffeeJunky123> konsolebox: Thank you so much, I made the mistake of capitalizing matrix
BTRE has joined #ruby
<konsolebox> i see
<KaffeeJunky123> but now I wonder if storing the state of a game of tic tac toe in a matrix is really a good idea
mjolnird has joined #ruby
ldnunes has joined #ruby
nowhere_man has joined #ruby
gigetoo has joined #ruby
samosaphile has joined #ruby
Burgestrand has joined #ruby
mjolnird has quit [Read error: Connection reset by peer]
mjolnird has joined #ruby
kb_ has joined #ruby
conta has joined #ruby
kb_ has quit [Client Quit]
samosaphile has left #ruby [#ruby]
Burgestrand has quit [Quit: Closing time!]
Burgestrand has joined #ruby
drale2k_ has joined #ruby
AJA4350 has joined #ruby
minimal_life has joined #ruby
conta has quit [Quit: conta]
yokel has quit [Ping timeout: 255 seconds]
<konsolebox> KaffeeJunky123: i think it's a good start
yokel has joined #ruby
synthroid has joined #ruby
shinnya has joined #ruby
fmcgeough has joined #ruby
fmcgeough has quit [Client Quit]
mjolnird has quit [Remote host closed the connection]
mjolnird has joined #ruby
rprimus has joined #ruby
rprimus has quit [Changing host]
maufart__ has joined #ruby
minimal_life has quit [Quit: Konversation terminated!]
aufi_ has quit [Ping timeout: 268 seconds]
clemens3 has quit [Remote host closed the connection]
FrankyCyborg has joined #ruby
vondruch has quit [Ping timeout: 240 seconds]
mjolnird has quit [Remote host closed the connection]
mjolnird has joined #ruby
vondruch has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
nowhere_man has quit [Ping timeout: 256 seconds]
fmcgeough has joined #ruby
reber has quit [Remote host closed the connection]
reber has joined #ruby
karapetyan has quit [Remote host closed the connection]
ciscam has joined #ruby
clemens3 has joined #ruby
cadillac_ has quit [Ping timeout: 248 seconds]
yqt has joined #ruby
jcalla has joined #ruby
drale2k_ has quit [Ping timeout: 265 seconds]
BloopMonster has quit [Ping timeout: 260 seconds]
crankharder has quit [Remote host closed the connection]
Furai has quit [Quit: WeeChat 2.1]
cadillac_ has joined #ruby
aufi_ has joined #ruby
Furai has joined #ruby
maufart__ has quit [Ping timeout: 240 seconds]
mupt has joined #ruby
Alina-malina has quit [Max SendQ exceeded]
maufart__ has joined #ruby
reber has quit [Remote host closed the connection]
aufi_ has quit [Ping timeout: 268 seconds]
reber has joined #ruby
caleBOT_ has joined #ruby
Alina-malina has joined #ruby
punnie has quit [Quit: Connection closed for inactivity]
aufi_ has joined #ruby
tty has quit [Quit: tty]
quobo has quit [Quit: Connection closed for inactivity]
maufart__ has quit [Ping timeout: 268 seconds]
nowhere_man has joined #ruby
rafadc has joined #ruby
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
bruce_lee has joined #ruby
guille-moe has quit [Ping timeout: 245 seconds]
guille-moe has joined #ruby
nicht has joined #ruby
synthroi_ has joined #ruby
kapil___ has joined #ruby
ogres has joined #ruby
karapetyan has joined #ruby
za1b1tsu has quit [Ping timeout: 240 seconds]
synthroid has quit [Ping timeout: 245 seconds]
dionysus69 has joined #ruby
gnufied has joined #ruby
karapetyan has quit [Ping timeout: 256 seconds]
Inline has joined #ruby
vondruch has quit [Quit: vondruch]
aupadhye has quit [Ping timeout: 264 seconds]
Kestrel-029 has quit [Read error: Connection reset by peer]
synthroid has joined #ruby
vondruch has joined #ruby
Nicmavr has joined #ruby
Nicmavr is now known as Guest26572
synthroi_ has quit [Ping timeout: 260 seconds]
agent_white has quit [Remote host closed the connection]
conta1 has joined #ruby
Rapture has joined #ruby
conta1 has quit [Client Quit]
caleBO___ has joined #ruby
sylario has joined #ruby
caleBOT_ has quit [Read error: Connection reset by peer]
caleBOT_ has joined #ruby
cale_____ has joined #ruby
ca_______ has joined #ruby
caleBO___ has quit [Ping timeout: 256 seconds]
caleBO___ has joined #ruby
caleBOT_ has quit [Ping timeout: 276 seconds]
gnufied has quit [Quit: Leaving]
gnufied has joined #ruby
cale_____ has quit [Ping timeout: 265 seconds]
rshetty has joined #ruby
ca_______ has quit [Ping timeout: 264 seconds]
caleBOT_ has joined #ruby
alex`` has joined #ruby
shinnya has quit [Ping timeout: 255 seconds]
za1b1tsu has joined #ruby
caleBO___ has quit [Ping timeout: 264 seconds]
cow[home] has joined #ruby
Venomen has quit [Quit: Leaving...]
SeepingN has joined #ruby
za1b1tsu has quit [Ping timeout: 276 seconds]
cschneid has joined #ruby
dionysus69 has quit [Ping timeout: 264 seconds]
rshetty has quit [Remote host closed the connection]
za1b1tsu has joined #ruby
cschnei__ has joined #ruby
pauliesaint has joined #ruby
anisha has quit [Read error: Connection reset by peer]
codymj has joined #ruby
cschneid has quit [Ping timeout: 260 seconds]
<croberts> hi, im trying to figure out where to put the end in this, i have tried inside and outside the {} but rubocop is not happy eitherway https://paste.fedoraproject.org/paste/4PAfiLPGwzN~t0bxo0m4lQ
agent_white has joined #ruby
agent_white has left #ruby [#ruby]
<apeiros> croberts: why do you have an "if" there in the first place? ternary doesn't use one.
anisha has joined #ruby
yokel has quit [Ping timeout: 245 seconds]
guille-moe has quit [Ping timeout: 240 seconds]
bradleyp_ has joined #ruby
<croberts> apeiros: had this orginally and the person in sugggested it that way, https://paste.fedoraproject.org/paste/tvVf2~KVT2CcVkpbtA11fw
<croberts> in the foreman-dev group
mupt has quit [Ping timeout: 248 seconds]
<SeepingN> = needs to be ==
<apeiros> that makes even less sense
<SeepingN> but also, what in the world
<apeiros> what SeepingN said, and `volumes.index(volume) +=`
<apeiros> and the if outside the loop…
<SeepingN> += itself?
sriehl_ has quit [Quit: ZNC 1.6.6 - http://znc.in]
<croberts> yeah in vmware if index is 7 that is reserverd for a internal device id so it has to skip that one
<apeiros> anyway, "I had X before" is not really an explanation for why you now have a ternary + if. but from that code I'd assume you're still a rookie learning the syntax?
anisha has quit [Read error: Connection reset by peer]
<croberts> for the disk
<croberts> yeah
<croberts> still a noob
ellcs1 has joined #ruby
bradleyprice has quit [Ping timeout: 265 seconds]
amar has quit [Remote host closed the connection]
<apeiros> well, `a = condition ? if_truthy_this : if_falsy_that` is how ternary goes. no if. e.g. `a = true ? 1 : 2` will assign 1 to a.
yokel has joined #ruby
BloopMonster has joined #ruby
<croberts> ah ok
r29v has quit [Quit: r29v]
<apeiros> and don't use map if you want the side-effect. map is if you want the return value of map.
<croberts> sorry for the awful code, like i said still trying to learn
<apeiros> e.g. `array.each do |item| puts item end` instead of `array.map do |item| puts item end`
alex`` has quit [Ping timeout: 265 seconds]
<croberts> ok ty again
graphene has quit [Remote host closed the connection]
Liothen has quit [Quit: The Dogmatic Law of Shadowsong]
Liothen has joined #ruby
Liothen has quit [Changing host]
Liothen has joined #ruby
psychicist__ has joined #ruby
anisha has joined #ruby
synthroid has quit [Remote host closed the connection]
chouhoulis has joined #ruby
gizmore has joined #ruby
AlHafoudh has quit [Ping timeout: 245 seconds]
guille-moe has joined #ruby
synthroid has joined #ruby
foxxx0 has quit [Ping timeout: 256 seconds]
Mike11 has joined #ruby
yokel has quit [Ping timeout: 245 seconds]
Burgestrand has quit [Quit: Closing time!]
gix- has quit [Quit: Client exiting]
yokel has joined #ruby
AlHafoudh has joined #ruby
foxxx0 has joined #ruby
gix has joined #ruby
clemens3 has quit [Ping timeout: 256 seconds]
nicht has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
caleBOT_ has quit [Remote host closed the connection]
yqt has quit [Ping timeout: 265 seconds]
r29v has joined #ruby
sriehl has joined #ruby
sriehl has quit [Changing host]
sriehl has joined #ruby
shinnya has joined #ruby
apeiros has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 276 seconds]
cagomez has joined #ruby
p0s1x has joined #ruby
p0s1x has quit [Client Quit]
nowhere_man has quit [Ping timeout: 245 seconds]
mmattice has quit [Ping timeout: 260 seconds]
andikr has quit [Remote host closed the connection]
ropeney has joined #ruby
mmattice has joined #ruby
FernandoBasso has joined #ruby
<KaffeeJunky123> convention wise, how should I name an instance method that modifies the objects state and returns a boolean? Is this even a good idea? It's a method on my tic tac toe games board class, I called it move for now, but I'm somehow unhappy with the name.
bradleyp_ has quit [Remote host closed the connection]
<gizmore> add ?
<gizmore> like foo.bar?
<gizmore> KaffeeJunky123: modifieng and returning eh?
amar_ has joined #ruby
<gizmore> KaffeeJunky123: in my project i chose _foo for getters and foo(foo); self; for setters (chain)
caleBOT has joined #ruby
rafadc has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<KaffeeJunky123> gizmore: I don't think it makes sense to chain on this method, it takes the indice of the field as argument and marks it for the current player or returns false if it's an illegal turn
<gizmore> i did a major design pattern on my project
amar_ has quit [Ping timeout: 260 seconds]
<gizmore> _foo (getters)
<gizmore> foo(foo) setters
mupt has joined #ruby
<gizmore> _foo (being public getters)
<Zarthus> why not just use attr_accessor
Beams has quit [Quit: .]
ciscam has quit [Ping timeout: 256 seconds]
ciscam has joined #ruby
Mrgoose2 has joined #ruby
karapetyan has joined #ruby
ellcs1 has quit [Ping timeout: 264 seconds]
dhollin3 is now known as dhollinger
foxxx0 has quit [Ping timeout: 256 seconds]
<gizmore> Zarthus: good question
<gizmore> i dont like this decorator
<Zarthus> i'd imagine ruby allows you to override the decorator (or at least include your own)
Es0teric has quit [Quit: Computer has gone to sleep.]
mroutis has joined #ruby
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<gizmore> why deal with those internals of attr_* when you can just define your own to be sure
Sina has joined #ruby
karapetyan has quit [Ping timeout: 256 seconds]
aufi_ has quit [Quit: Leaving]
<Zarthus> because they're convienient
<Zarthus> and t's waht everyone expects you'll be using
<Zarthus> why write in ruby when you could be writing in c
mupt has quit [Ping timeout: 240 seconds]
Puffball has joined #ruby
herbmillerjr has joined #ruby
<konsolebox> KaffeeJunky123: an action method returning boolean is pretty ok to me
loincloth has joined #ruby
[Butch] has joined #ruby
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
karapetyan has joined #ruby
contradictioned has joined #ruby
<KaffeeJunky123> now I'm trying to think of a fancy way to create this array [[0,0,1], [0,1,0], [1,0,0]]
<Zarthus> KaffeeJunky123: keep cloning [0,0,1] and shuffle until desired result 😁
<KaffeeJunky123> lol
llua has quit [Quit: <Rudolph> shell code is what greycat reads to kids when he tucks them in]
konos5__ has quit [Quit: Connection closed for inactivity]
bradleyprice has joined #ruby
mupt has joined #ruby
amar_ has joined #ruby
llua has joined #ruby
amar_ has quit [Read error: Connection reset by peer]
amar_ has joined #ruby
TomyWork has quit [Ping timeout: 240 seconds]
synthroi_ has joined #ruby
yohji has quit [Remote host closed the connection]
synthroid has quit [Ping timeout: 264 seconds]
wontruefree has joined #ruby
synthroid has joined #ruby
amar_ has quit [Ping timeout: 240 seconds]
ellcs has quit [Remote host closed the connection]
sysvalve has quit [Quit: Leaving]
<konsolebox> >> require 'matrix'; Matrix.diagonal(1, 1, 1).to_a.reverse # KaffeeJunky123
<ruby[bot]> konsolebox: # => [[0, 0, 1], [0, 1, 0], [1, 0, 0]] (https://eval.in/1030530)
guille-moe has quit [Ping timeout: 265 seconds]
<KaffeeJunky123> konsolebox: and back to matrix
<KaffeeJunky123> konsolebox: This is a permutation matrix i need
synthro__ has joined #ruby
<KaffeeJunky123> in theory this matrix should swap row 1 and 3 of 3x3 matrix, unless my math is wrong
synthroi_ has quit [Ping timeout: 265 seconds]
foxxx0 has joined #ruby
darkhanb has joined #ruby
chmurifree has quit [Excess Flood]
<KaffeeJunky123> konsolebox: at that point it's shorter to just spell it out completely
<konsolebox> ok
chmurifree has joined #ruby
<KaffeeJunky123> Matrix[Matrix.diagonal(1,1,1).to_a.reverse] vs Matrix[ [0, 0, 1], [0, 1, 0] [1, 0, 0] ]
wontruefree has left #ruby ["this is not the client you are looking for"]
rshetty has joined #ruby
<KaffeeJunky123> konsolebox: actually I can just write identity(3) instead of diagonal(1,1,1) to shorten it down
synthroid has quit [Ping timeout: 265 seconds]
<konsolebox> i see
naftilos76 has quit [Quit: Leaving]
roamingdog has quit [Ping timeout: 245 seconds]
synthroid has joined #ruby
roamingdog has joined #ruby
synthroi_ has joined #ruby
synthro__ has quit [Ping timeout: 260 seconds]
caleBOT has quit [Remote host closed the connection]
caleBOT has joined #ruby
rafadc has joined #ruby
synthroid has quit [Ping timeout: 256 seconds]
jrich523 has joined #ruby
catbusters has joined #ruby
bradleyprice has quit [Remote host closed the connection]
bradleyprice has joined #ruby
<jrich523> hey guys, any suggestions on how to expose rules to a user via a file config? that would allow basic logic
<jrich523> its for resource rules
<jrich523> host.totalcpu > host.usedcpu - 2 or something simple like that
eckhardt_ has joined #ruby
akaiiro has joined #ruby
InfinityFye has quit [Quit: Leaving]
AJA4350 has quit [Quit: AJA4350]
kapil___ has quit [Quit: Connection closed for inactivity]
nowhere_man has joined #ruby
FernandoBasso has quit [Quit: Page closed]
dbugger_ has joined #ruby
claudiuinberlin has joined #ruby
mupt has quit [Ping timeout: 240 seconds]
dviola has joined #ruby
Mike11 has quit [Ping timeout: 264 seconds]
shinnya has quit [Ping timeout: 248 seconds]
AlHafoudh has quit [Ping timeout: 256 seconds]
karapetyan has quit [Remote host closed the connection]
foxxx0 has quit [Ping timeout: 255 seconds]
mupt has joined #ruby
ohcibi has quit [Ping timeout: 260 seconds]
bjpenn has joined #ruby
rshetty has quit [Remote host closed the connection]
fluxAeon_ has joined #ruby
ohcibi has joined #ruby
karapetyan has joined #ruby
foxxx0 has joined #ruby
alex`` has joined #ruby
AlHafoudh has joined #ruby
mupt has quit [Ping timeout: 240 seconds]
tvw has quit [Remote host closed the connection]
ogres has quit [Quit: Connection closed for inactivity]
qwebirc70579 has joined #ruby
sameerynho has joined #ruby
deadnull has joined #ruby
mupt has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
deadnull has quit [Client Quit]
RougeR has joined #ruby
RougeR has quit [Changing host]
RougeR has joined #ruby
qwebirc70579 has quit [Ping timeout: 260 seconds]
caleBOT has quit [Remote host closed the connection]
claudiuinberlin has joined #ruby
karapetyan has quit [Remote host closed the connection]
nima_m has joined #ruby
megamos has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
caleBOT_ has joined #ruby
pauliesaint_ has joined #ruby
ramfjord has joined #ruby
<KaffeeJunky123> wow, I spent hours on this silly matrix stuff and yet my code looks like this https://ideone.com/iZW8C1
needhelp has joined #ruby
\void has joined #ruby
<needhelp> Hi channel. I need to do a join (many-to-many relationship) togheter with or where. What is the best way to do it? Raw sql or ActiveRecords built in functions?
<KaffeeJunky123> this acutally means I want people to look at my code and state their opinion
caleBOT_ has quit [Ping timeout: 256 seconds]
pauliesaint has quit [Ping timeout: 260 seconds]
pauliesaint_ is now known as pauliesaint
<KaffeeJunky123> needhelp: try the built in function and look at the SQL it produces
kapil___ has joined #ruby
<needhelp> well ofc i can write my own raw sql. I was wondering, is there any built in?
CrazyEddy has quit [Remote host closed the connection]
<havenwood> KaffeeJunky123: This line doesn't do anything (it just returns `#=> false`): @pc_turn != @pc_turn
<KaffeeJunky123> needhelp: Oh sorry, I missunderstood your question then, I thought you already had an ORM
depesz has joined #ruby
<depesz> how can I quickly/sensibly get owner of current stdin? basically what "who -m" does to show user logged on terminal.
<KaffeeJunky123> havenwood: tyvm
graphene has joined #ruby
<needhelp> well I am using built in functions but it will be bugs when using pagination
<depesz> I'm doing now File.stat('/proc/self/fd/0').uid, but it doesn't look nice.
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
<KaffeeJunky123> needhelp: your github link is a 404 by the way
roamingdog has quit [Ping timeout: 256 seconds]
conta1 has joined #ruby
needhelp has quit [Quit: Page closed]
bradleyprice has quit [Remote host closed the connection]
agent_white has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
bradleyprice has joined #ruby
agent_white has quit [Client Quit]
starseed0000 has joined #ruby
agent_white has joined #ruby
caleBOT_ has joined #ruby
sauvin has quit [Read error: Connection reset by peer]
konsolebox has quit [Ping timeout: 240 seconds]
crankharder has joined #ruby
mupt has quit [Ping timeout: 240 seconds]
TinkerT has quit [Read error: Connection reset by peer]
cschnei__ has quit [Remote host closed the connection]
TinkerT has joined #ruby
caleBOT_ has quit [Ping timeout: 248 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
cschnei__ has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
quobo has joined #ruby
cschnei__ has quit [Ping timeout: 268 seconds]
zachk has joined #ruby
zachk has quit [Changing host]
zachk has joined #ruby
jamesaxl has joined #ruby
karapetyan has joined #ruby
wilbert_ has joined #ruby
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
mupt has joined #ruby
KaffeeJunky123 has left #ruby [#ruby]
konsolebox has joined #ruby
karapetyan has quit [Ping timeout: 255 seconds]
ramfjord_ has joined #ruby
codymj has quit [Ping timeout: 260 seconds]
ramfjord has quit [Ping timeout: 256 seconds]
apeiros has joined #ruby
mupt has quit [Ping timeout: 256 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roamingdog has joined #ruby
ramfjord_ has quit [Ping timeout: 268 seconds]
dbugger_ has quit [Quit: Leaving]
dionysus69 has joined #ruby
ramfjord has joined #ruby
mroutis has quit [Remote host closed the connection]
megamos has quit [Ping timeout: 260 seconds]
conta1 has quit [Quit: conta1]
ramfjord has quit [Ping timeout: 276 seconds]
hanmac has left #ruby [#ruby]
ramfjord has joined #ruby
amar has joined #ruby
codymj has joined #ruby
amar_ has joined #ruby
ramfjord has quit [Ping timeout: 264 seconds]
amar has quit [Ping timeout: 256 seconds]
ramfjord has joined #ruby
anisha has quit [Quit: This computer has gone to sleep]
amar_ has quit [Ping timeout: 256 seconds]
fmcgeough has quit [Quit: fmcgeough]
ramfjord has quit [Ping timeout: 256 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
catbusters has quit [Quit: Connection closed for inactivity]
<baweaver> ooo, matrix, that'd be a lot of fun.
<baweaver> I should do a writeup on that later.
mcritchlow has joined #ruby
amar has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
pnkl has joined #ruby
ramfjord has joined #ruby
DTZUZU has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
nowhere_man has quit [Ping timeout: 256 seconds]
duderonomy has quit [Ping timeout: 268 seconds]
fluxAeon_ has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
ciscam has quit [Ping timeout: 256 seconds]
ciscam has joined #ruby
harmaahylje has quit [Ping timeout: 256 seconds]
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
mupt has joined #ruby
claudiuinberlin has joined #ruby
amar_ has joined #ruby
Mike11 has joined #ruby
amar has quit [Ping timeout: 248 seconds]
nima_m has quit [Quit: nima_m]
mcritchlow has quit [Remote host closed the connection]
SeepingN has joined #ruby
graphene has quit [Remote host closed the connection]
David_H__ has quit [Ping timeout: 264 seconds]
rshetty has joined #ruby
<havenwood> baweaver: i love that the matrix fibonacci one-liners even works properly for negatives: https://gist.github.com/havenwood/02cf291b809327d96a3f
mattp__ has quit [Ping timeout: 268 seconds]
graphene has joined #ruby
<havenwood> (Matrix[[0, 1], [1, 1]] ** n.pred)[1, 1].to_i
mattp__ has joined #ruby
fluxAeon_ has joined #ruby
rshetty has quit [Ping timeout: 268 seconds]
<havenwood> baweaver: or a stochastic matrix opens the door to markov puns
pnkl has quit [Quit: The Lounge - https://thelounge.github.io]
<havenwood> #ruby channel logs for "markov" show: "markov my words" "markov twain" "markoved for death" "markey markov" "markov the beast" "markov zuckerberg" "markov polo" "markov get set go"
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
MagePsycho has joined #ruby
rafadc has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
harmaahylje has joined #ruby
<MagePsycho> run "find #{release_path}/var #{release_path}/vendor #{release_path}/pub/static #{shared_path}/pub/media #{release_path}/app/etc -type f -exec chmod g+w {} \;"
Matthew1 has joined #ruby
<MagePsycho> is valid in ruby?
cmhobbs has joined #ruby
<cmhobbs> is there a less gross way to define one line predicate methods than this? def foo?; !!@foo end
<havenwood> MagePsycho: The `run "..."` part is valid Ruby. The shell script you're running isn't Ruby at all.
<havenwood> cmhobbs: That doesn't seem gross to me. Seems fine.
<cmhobbs> hm
<cmhobbs> just doesn't really flow
<havenwood> cmhobbs: Alternatively: def foo?; @foo end
<MagePsycho> inside run “” we can run shell commands right
<cmhobbs> s'ok, it's functional
<MagePsycho> @havenwood
<cmhobbs> havenwood: that won't force true or false, though. what if foo is nil or "bar"
<havenwood> cmhobbs: Not all predicate methods return `true` or `false`, just something truthy and `nil` or `false`.
<havenwood> >> 42.nonzero?
<ruby[bot]> havenwood: # => 42 (https://eval.in/1030603)
<havenwood> >> 0.nonzero?
<ruby[bot]> havenwood: # => nil (https://eval.in/1030604)
<havenwood> cmhobbs: has ^
<cmhobbs> interesting. i just assumed it was the expected behaviour of a predicate method
jenrzzz has quit [Ping timeout: 240 seconds]
<MagePsycho> execute :chmod, "+x #{release_path}/bin/magento" -> what about this?
<Zarthus> MagePsycho: Why can't you try it and see?
<havenwood> MagePsycho: The Ruby parts aren't the interesting parts of these. You could always turn your shell scripts into pure Ruby.
<MagePsycho> just wanted to check the best practices
<MagePsycho> run vs execute
<Zarthus> the best practice would probably be to just use bash, there's nothing in here that requires ruby ;P
<MagePsycho> I am using capistrano which is ruby based
<Zarthus> fair enough
<havenwood> MagePsycho: So you want to know whether to use Cap's #execute or Rake's #run? That's what you're asking?
<MagePsycho> Yeah
David_H_Smith has joined #ruby
fmcgeough has joined #ruby
karapetyan has joined #ruby
cmhobbs has left #ruby ["WeeChat 1.6"]
<havenwood> MagePsycho: I'd vote: execute :chmod, '+x', File.join(release_path, 'bin', 'magento')
<MagePsycho> File.join(#{release_path}, 'bin', 'magento')
<MagePsycho> release_path is a variable
<havenwood> MagePsycho: Yes: File.join(release_path, 'bin', 'magento')
<MagePsycho> whats the , in ruby? concatenation?
<MagePsycho> sorry I am new to ruby so
<havenwood> >> release_path = "/x/y/z"; File.join(release_path, 'MagePSycho')
<ruby[bot]> havenwood: # => "/x/y/z/MagePSycho" (https://eval.in/1030609)
<havenwood> MagePsycho: In shelling out, it's often better to provide the individual arguments. That way your programming language can run the command directly, without shelling out to get shellword splitting.
<havenwood> MagePsycho: So: system 'ls', '-la'
<havenwood> MagePsycho: Instead of: systme 'ls -la'
<MagePsycho> @havenwood Thanks
<havenwood> MagePsycho: Compare `system 'echo *'` and `system 'echo', '*'`.
karapetyan has quit [Ping timeout: 276 seconds]
synthroi_ has quit []
bradleyprice has quit [Remote host closed the connection]
MagePsycho has quit [Quit: MagePsycho]
cschneid has joined #ruby
duderonomy has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
MagePsycho has joined #ruby
MagePsycho has quit [Client Quit]
MagePsycho has joined #ruby
MagePsycho has quit [Client Quit]
<starseed0000> If I have a user model with a profile, and that profile belongs to a color - if I were writing an api would it make any sense to put an update to /profile/color or would it just be an update to /profile?
<starseed0000> I feel like updating to color implies I am updating the color itself, not the relationship.
AKPWD has quit [Quit: じゃね。]
AKPWD has joined #ruby
<starseed0000> But from an api standpoint it isn't clear to update color you would request /profile
<starseed0000> Would it make more sense to PUT to a color_relationship path or something?
<starseed0000> What is best practice there?
jenrzzz has quit [Ping timeout: 276 seconds]
bruce_lee has quit [Remote host closed the connection]
mupt has quit [Ping timeout: 240 seconds]
shinnya has joined #ruby
schleppel has quit [Quit: Konversation terminated!]
vindvaki has joined #ruby
dkmueller has joined #ruby
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
biberu has quit []
GodFather has joined #ruby
sameerynho has quit [Ping timeout: 264 seconds]
caleBOT has joined #ruby
johnny56 has quit [Ping timeout: 276 seconds]
<havenwood> ?rails starseed0000
<ruby[bot]> starseed0000: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
<havenwood> starseed0000: I'd assume a PATCH to /profile
ldnunes has quit [Quit: Leaving]
sauvin has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
Omnilord has quit [Read error: Connection reset by peer]
psychicist__ has quit [Ping timeout: 256 seconds]
fmcgeough has quit [Read error: Connection reset by peer]
fmcgeough has joined #ruby
karapetyan has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
nythalcrow has quit [Quit: Leaving]
eckhardt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sameerynho has joined #ruby
eckhardt_ has joined #ruby
nowhere_man has joined #ruby
shinnya has quit [Ping timeout: 260 seconds]
vindvaki has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has quit [Ping timeout: 240 seconds]
amar_ has quit [Remote host closed the connection]
dkmueller has quit [Quit: Konversation terminated!]
[Butch] has quit [Quit: Textual IRC Client: www.textualapp.com]
FernandoBasso has joined #ruby
tty has joined #ruby
zautomata2 has quit [Quit: WeeChat 1.9.1]
drale2k_ has joined #ruby
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
Mike11 has quit [Quit: Leaving.]
eckhardt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eckhardt_ has joined #ruby
eckhardt_ has quit [Client Quit]
bradleyprice has joined #ruby
bradleyprice has quit [Remote host closed the connection]
darkhanb has quit [Ping timeout: 255 seconds]
<baweaver> Hrm, matrixes are immutable it seems. Interesting.
<baweaver> I will say the varying ways of iteration are nice though
rafadc has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
<baweaver> >> require 'matrix'; Matrix[%w(x o x), %w(x o -), %(x - o)].each(:upper).to_a
<ruby[bot]> baweaver: # => can't convert String into an Array (undefined method `to_ary' for "x - o":String ...check link for more (https://eval.in/1030630)
<jrich523> hey guys, need to store 'rules' for VM provisioning, and was wondering what the best way would be to save those as a configuration
<baweaver> Heh, whoops.
<baweaver> >> require 'matrix'; Matrix[%w(x o x), %w(x o -), %w(x - o)].each(:upper).to_a
<ruby[bot]> baweaver: # => ["x", "o", "x", "o", "-", "o"] (https://eval.in/1030631)
<baweaver> Likely YAML or JSON.
<jrich523> the most complex rule that comes to mind is Host.usedCPU < Host.TotalCPU - 2
<jrich523> i considered yaml, since there are 3 areas for rules (objects) KVM (host), Cabinet, Pod
<jrich523> but its more so the rule processinging, and not the storage
<jrich523> cuz if i did yaml, i could make it look something like kvm: \n - usedcpu < total - 2
<Zarthus> would it? that sounds illogical.
<jrich523> yeah i dont like it, thats why im here :)
<jrich523> i looked for some rule type gems, saw a couple, mostly really old, and many of which are specific to rails (ActiveRecords)
<Zarthus> it sounds like you're just writing literal strings as a rule rather than applying some sort of scheme to it
<jrich523> im not sure i follow, i want them in a config file so that some ops guy could change it if he had to
<jrich523> so yeah, strings
bradleyprice has joined #ruby
jhack has joined #ruby
<jrich523> well thats too simple
<jrich523> my "simple" rule was actually a complex one :)
<Zarthus> ¯\_(ツ)_/¯ you can define multiple restrictions
<jrich523> they want to make sure that the number of vcpu is 2 less than total
<jrich523> systems vary so i cant use a simple 98 of 100, since some are 100 some are 240
<jrich523> etc etc
<jrich523> so the rub here is that it needs to support math
<Zarthus> it doesn't sound like you're using yaml if you're really just putting a bunch of strings in it
<jrich523> im not using anything yet :)
<jrich523> was trying to work backwards
<jrich523> figure out how i'd process it first
<jrich523> and then deal with storage
<Zarthus> how about letting them write ruby instead?
<Zarthus> a programming language already supports maths by default.
<jrich523> well, i guess how do i do that?
<jrich523> so if lets say, i want to have it as its own file rules.rb
<Zarthus> not much different from a yaml file, instead of YAML.loads you just call require
<jrich523> hmm
<Zarthus> you can define a common interface for a class and let them have at it.
<jrich523> let me think on that a moment before i ask stupid follow up questions :)
<Zarthus> (it's just a suggestion, there's drawbacks to the ruby solution, most notably that they need to have ruby installed.)
jenrzzz has quit [Ping timeout: 245 seconds]
<jrich523> oh well this is just a deployment script
<jrich523> its big and stupid, and im charged with making it worse :)
<Zarthus> ruby expertise, in a well defined environment, isn't really necessary (i.e. Vagrant does fine)
<jrich523> so its ruby all around
<jrich523> and as it stands today, they run the script via bundler
<jrich523> but to the guys using it, its just a cli
<jrich523> they could probably figure out VERY basic ruby
<Zarthus> just for reference, a random vagrant file: https://github.com/adlawson/vagrantfiles/blob/master/ruby/Vagrantfile
<jrich523> but these are ops/support guys
<Zarthus> it doesn't really require knowledge of ruby, just decent documentation
<jrich523> i guess i should add that they run it from a server
<jrich523> so setup etc isnt too big of a deal
<jrich523> right now the process is they ssh to a box, run a script provision -application jrich -env dev -guestcount 5
<Zarthus> anyway, this is all just a suggestion, but rather than implementing a whole system to handle parsing of rules, you might as well rely on ruby *shrug*
<jrich523> well the reason im looking at this is the rules the company wants changes often
<jrich523> right now that means telling me, i do an update/PR and push a deployment
<jrich523> sorta horrible to change rules
<jrich523> so i wanted to expose that so they can do it as they need it
<Zarthus> are you writing something like saltstack?
karapetyan has quit [Remote host closed the connection]
<jrich523> oh god no
codymj has quit [Quit: Leaving]
<jrich523> this actually directly talks to Foreman
<jrich523> foreman/puppet handle all the config etc
<jrich523> they dont like the foreman gui (it doesnt have all they need)
sameerynho has quit [Ping timeout: 260 seconds]
<Zarthus> fair enough
<jrich523> thats my next task actually, to decomission this script in favor of a gui plugin (lets see how many ages that takes)
ohcibi has quit [Quit: No Ping reply in 180 seconds.]
<jrich523> so, on the foreman side, its react, i can create a rule page and process it howeveer i want
AlHafoudh has quit [Ping timeout: 255 seconds]
<jrich523> or rather, i can easier control the input with a react page, where as with this, its harder to control
<jrich523> and i've been trying to nicely say, the idiots run this
<jrich523> so it has to be super simple
<jrich523> so having them edit a class of ruby, probably not a good idea :)
reber has quit [Read error: Connection reset by peer]
foxxx0 has quit [Ping timeout: 255 seconds]
<Zarthus> i would expect even a junior sysadmin to manage a small ruby config :)
<jrich523> i would too :-/
<jrich523> my expectations, and reality have clashed
<jrich523> lol
ohcibi has joined #ruby
rafadc has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Zarthus> i guess that's why they hired you to do it rather than let them do it themselves huh
<jrich523> yeah
<Zarthus> Smells like job security.
<jrich523> ugh
<jrich523> this place is so banged up its the opposite
<jrich523> people leaving left and right cuz they are fed up
<Zarthus> smells like even more job security.
<jrich523> lol sorta i guess
<jrich523> i typically do like 1-2 month contracts
<jrich523> i think im up to 14 months now
<zenspider> "needs to support maths" => write an interpreter
<zenspider> or yeah, give them full access to ruby or whatever.
<jrich523> well, thats the thing, i was hoping there was something sort of ready to go :)
<Zarthus> I couldn't think of anything simpler than ruby for this, tbh
<zenspider> jrich523: something ready to go, for your particular and peculiar needs?
<jrich523> well can i do a rule.rb thats like one function def rules(kvm,cabinet,pod)
<jrich523> no, a general parser that i could feed stuff to
* Zarthus shrugs, and would recommend the Vagrantfile config style over a dedicated function
<zenspider> there's always eval. and now you have 2 problems and a disfunctional server
<jrich523> yeah i think im leaning towards that method too
<zenspider> that's really dumb... you've been warned.
<jrich523> wait, isnt for regex? :)
<Zarthus> if you have enough disfunctional servers the number of problems start to reduce
<Zarthus> they grow in size but not in quantity
<jrich523> lol
foxxx0 has joined #ruby
<zenspider> if you want something slighly more secure, you could use ruby_parser + sexp_processor to write a simple interpreter for a subset of ruby and limit the expressions you allow
<jrich523> right now im thinking more like the vagrant config
jhack has quit [Quit: jhack]
<jrich523> the rules i'll have to put in there should make it easy for anyone to tweak later on
mmattice has quit [Ping timeout: 260 seconds]
<Zarthus> whatever you end up going with, good luck
<Zarthus> i'm off to bed.
<jrich523> thanks
<jrich523> have a good one!
AlHafoudh has joined #ruby
jhack has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
AJA4350 has joined #ruby
pauliesaint has quit [Quit: pauliesaint]
jenrzzz has quit [Ping timeout: 256 seconds]
lordtolstoi has quit [Remote host closed the connection]
pauliesaint has joined #ruby
caleBOT has quit [Remote host closed the connection]
jhack has quit [Quit: jhack]
mmattice has joined #ruby
pauliesaint has quit [Client Quit]
pauliesaint has joined #ruby
cschneid has quit [Remote host closed the connection]
jhack has joined #ruby
jhack has quit [Client Quit]
ellcs has joined #ruby
caleBOT has joined #ruby
feelx has joined #ruby
feelx- has quit [Ping timeout: 248 seconds]
AlHafoudh has quit [Ping timeout: 255 seconds]
cseder has joined #ruby
cseder has left #ruby [#ruby]
foxxx0 has quit [Ping timeout: 264 seconds]
AlHafoudh has joined #ruby
foxxx0 has joined #ruby
graphene has quit [Read error: Connection reset by peer]
graphene has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
ellcs has quit [Ping timeout: 245 seconds]
karapetyan has joined #ruby
mmattice has quit [Ping timeout: 256 seconds]
lavamind has joined #ruby
mmattice has joined #ruby
<lavamind> hello, ruby newbie here, I'm trying my hand at beaker-rspec but am having trouble with it running vagrant. it's installed on my Debian 9 system through the package manager but it says "can't find executable" when doing "bundle exec vagrant"
karapetyan has quit [Ping timeout: 265 seconds]
<lavamind> however when I do "bundle exec which vagrant" it says "/usr/bin/vagrant" which is correct
<lavamind> really don't know what's going on here, see full error message http://paste.debian.net/1031778/
taylorzr has joined #ruby
Matthew1 has quit [Remote host closed the connection]
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
drale2k_ has joined #ruby
mynameisdebian has joined #ruby
mozzarella has quit [Ping timeout: 240 seconds]
r29v has quit [Quit: r29v]
duderonomy has quit [Ping timeout: 268 seconds]
<havenwood> lavamind: Does it still happen with the latest RubyGems and Bundler versions?
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> lavamind: gem update --system && gem update bundler && bundle exec vagrant
<lavamind> havenwood: I'm under ruby-bundler 1.16 from my package manager
<lavamind> and rubygems-intergrations, also from the package manager, v 1.11
jamesaxl has quit [Quit: WeeChat 2.1]
taylorzr has quit [Ping timeout: 255 seconds]
<havenwood> lavamind: Latest versions are RubyGems 2.7.7 and Bundler 1.16.1.
<havenwood> lavamind: So it seems like your Bundler is near the most recent version.
taylorzr has joined #ruby
apparition47 has joined #ruby
<havenwood> lavamind: maybe related to?: https://github.com/bundler/bundler/issues/4602
eckhardt_ has joined #ruby
ElFerna has joined #ruby
<lavamind> havenwood: that bug report seems quite complex, and afaict I'm not running in any nested fashion
mmattice has quit [Ping timeout: 265 seconds]
<havenwood> lavamind: Just curious, but what's the result if you: RUBYGEMS_GEMDEPS=- vagrant
<lavamind> havenwood: I ran sudo gem update --system, which install RubyGems 2.7.7, and that didn't change anything
<havenwood> lavamind: Does running `vagrant` by itself work?
<havenwood> lavamind: Does running `RUBYGEMS_GEMDEPS=- vagrant` work?
<lavamind> (as an aside, after doing sudo gem uninstall rubygems-update, it leaves the executable /usr/bin/bundle2.3 around)
<lavamind> havenwood: yes vagrant is working, I use it in other non-ruby projects
<havenwood> lavamind: So you mean the command only fails with `bundle exec` prefixed on this project? Does it work with RUBYGEMS_EXEC instead?
<lavamind> RUBYGEMS_GEMDEPS=- vagrant output the same error message
<lavamind> but just "vagrant" works...
<havenwood> roger that
<havenwood> lavamind: I'm curious, what's: head -n1 "$(command -v vagrant)"
<mynameisdebian> I have this code: https://gist.github.com/rrdein/e680003c7938836fd0e3495ba8ecde45 . On line 37 it prints some variables. A section of the output looks like this: https://gist.github.com/rrdein/a0b67129fae044c6d7ab52b81a986142 . You can see that when i goes from 0 to 1 that cidrs[0][1] (the fourth column) continues to change in the output, even though the value of i should never again be 0 to change
<mynameisdebian> cidrs[0][1] on line 34. I have commented line 34 and confirmed that it is the only line accessing cidrs[0][1]. Can anyone see how “cidrs[0][1]” can keep changing from the line “cidrs[i][1] += 1” when I no longer equals 1?
coderphive has joined #ruby
<havenwood> lavamind: head -n1 /usr/bin/vagrant
<lavamind> havenwood: #!/usr/bin/ruby
<havenwood> lavamind: mm
<havenwood> lavamind: Is that as expected? Matches?: command -v ruby
<lavamind> dpkg -S /usr/bin/ruby -> ruby: /usr/bin/ruby
<lavamind> ruby package version 1:2.3.3
<havenwood> lavamind: hrmmm
<havenwood> lavamind: I've not seen this one before.
<havenwood> mynameisdebian: You don't need to `require 'rubygems'` these days.
<lavamind> havenwood: just to make sure, I shouldnt need to have "vagrant" in my Gemfile correct?
r29v has joined #ruby
<mynameisdebian> havenwood thx
ElFerna has quit [Quit: ElFerna]
<havenwood> lavamind: Yes, you should have it in your gemfile if you want to prefix `bundle exec` or `RUBYGEMS_GEMDEPS=-`.
<havenwood> lavamind: Both of those limit gem choices to those found in the Gemfile.lock
<havenwood> mynameisdebian: Seems like no reason to set ARGV.first to a thing - just directly: File.open('test.plist')
<mynameisdebian> havenwood: it's for testing
<havenwood> mynameisdebian: We really don't use `for` in Ruby.
<darix> JFYI: we already have an opensuse package for 2.6 testing
<mynameisdebian> since when
<havenwood> mynameisdebian: Forever. Are you familiar with #each?
<havenwood> darix: nice
<darix> mynameisdebian: most people will probably use yourenumrable.each {|e| ... }
<lavamind> havenwood: I see no sign of this in the beaker-rspec documentation tough, and I noticed it pulls in beaker-vagrant which is supposed to handle interfacing with vagrant
<mynameisdebian> yes but i need an iterating variable as well so I use the built-in for command designed for that purpose
mozzarella has joined #ruby
<lavamind> maybe it's just a coincidence that running the beaker testsuite outputs the same error as "bundle exec vagrant" ?
<havenwood> mynameisdebian: There is *always* a better way.
<mynameisdebian> havenwood: do you have any comment on my original question?
<havenwood> mynameisdebian: I've never seen `for` legitimately used in Ruby.
<darix> mynameisdebian: #each is also builtin :P
eckhardt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> mynameisdebian: cidr_list_length.times do |i|
mmattice has joined #ruby
za1b1tsu has quit [Ping timeout: 256 seconds]
caleBOT has quit [Remote host closed the connection]
r29v has quit [Quit: r29v]