Emmanuel_Chanel has quit [Ping timeout: 265 seconds]
ChmEarl has quit [Quit: Leaving]
cd has quit [Quit: cd]
openstruct has quit [Ping timeout: 256 seconds]
baojg has joined #ruby
burgestrand has joined #ruby
burgestrand has quit [Client Quit]
Emmanuel_Chanel has joined #ruby
JohnB has quit [Quit: Leaving]
adu has quit [Quit: adu]
donofrio has quit [Remote host closed the connection]
Swyper has joined #ruby
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
brendan- has quit [Ping timeout: 260 seconds]
cloud69 has joined #ruby
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
axe has quit [Ping timeout: 258 seconds]
paul0 has joined #ruby
_paul0 has quit [Ping timeout: 256 seconds]
Mutsuhito has left #ruby [#ruby]
Swyper has quit [Remote host closed the connection]
factormystic2 has joined #ruby
factormystic has quit [Ping timeout: 240 seconds]
factormystic2 is now known as factormystic
vondruch has joined #ruby
burgestrand has joined #ruby
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
Glumetu has joined #ruby
ur5us has joined #ruby
imode has quit [Ping timeout: 256 seconds]
imode has joined #ruby
meinside has joined #ruby
braincrash has joined #ruby
apoc has quit [Ping timeout: 264 seconds]
mozzarella has quit [Ping timeout: 256 seconds]
apoc has joined #ruby
mozzarella has joined #ruby
burgestrand has quit [Quit: burgestrand]
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
burgestrand has joined #ruby
imode has quit [Ping timeout: 260 seconds]
cloud69 has quit [Quit: Connection closed for inactivity]
DarthGandalf has quit [Ping timeout: 272 seconds]
Axy has joined #ruby
Mia has quit [Ping timeout: 246 seconds]
eydaimon has quit [Ping timeout: 264 seconds]
eydaimon has joined #ruby
ur5us has quit [Ping timeout: 264 seconds]
cloud69 has joined #ruby
olspookishmagus has quit [Ping timeout: 260 seconds]
Rudd0 has quit [Ping timeout: 256 seconds]
olspookishmagus has joined #ruby
Rudd0 has joined #ruby
olspookishmagus is now known as Guest52276
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
siaw23 has joined #ruby
openstruct has joined #ruby
openstruct has joined #ruby
openstruct has quit [Ping timeout: 256 seconds]
Rudd0^ has joined #ruby
vondruch has quit [Quit: vondruch]
bamdad has quit [Ping timeout: 240 seconds]
Rudd0 has quit [Ping timeout: 260 seconds]
impermanence has quit [Ping timeout: 256 seconds]
impermanence has joined #ruby
Sina has joined #ruby
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
bamdad has joined #ruby
TCZ has joined #ruby
greengriminal has joined #ruby
Guest52276 has quit [Quit: All for nothing]
olspookishmagus has joined #ruby
braincrash has quit [Ping timeout: 260 seconds]
boc_tothefuture has joined #ruby
bamdad has quit [Ping timeout: 240 seconds]
<boc_tothefuture>
Hi! I am playing around with some meta programming. I have a script that runs and has no classes so it is just running in Object class (I think that is correct). I have a module I am including. When I include that module I want to set an instance variable. So in my included method I call base.instance_variable_set(:@log, 'foo'). But then after
<boc_tothefuture>
the include @log is still nil. I am not sure why.
dionysus69 has joined #ruby
dionysus69 has quit [Client Quit]
bamdad has joined #ruby
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
Retropikzel has joined #ruby
troulouliou_div2 has joined #ruby
bmurt has joined #ruby
_whitelogger has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Technodrome has joined #ruby
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
axe has joined #ruby
Swyper has joined #ruby
apoc has quit [Ping timeout: 256 seconds]
apoc has joined #ruby
<adam12>
boc_tothefuture: That might be working, but there's a good chance it's setting a class instance variable, tho I didn't check.
<adam12>
boc_tothefuture: When you `include SomeModule`, there's no instance. At least, not without maybe calling include on another object.
<adam12>
boc_tothefuture: For this demonstration, if you use extend and `def self.extended(base)` as the method hook, it will probably work.
<jhass>
toplevel is a bit special as it has distinct definition and evaluation scopes. So when it comes to method and constant definitions you can picture it as being inside class Object ... end, but when it comes to locals, ivar access etc it's an instance method of an anonymous subclass and instance of Object called "main"
<jhass>
so base.instance_variable_set is not setting the ivar on an instance of Object, it's setting it on the Class instance called Object itself
ruurd has quit [Remote host closed the connection]
apoc has quit [Ping timeout: 256 seconds]
chouhoulis has joined #ruby
Swyper has quit [Remote host closed the connection]
burgestrand has quit [Quit: burgestrand]
<boc_tothefuture>
ok, so is extend the only way?
<boc_tothefuture>
or the correct way?
<boc_tothefuture>
let me try that
chouhoulis has quit [Ping timeout: 256 seconds]
Swyper has joined #ruby
<jhass>
or just step away from doing at the top-level. class MyApp; def run(args); ....; end; end MyApp.new.run(ARGV) ain't so bad, instant testability too
<boc_tothefuture>
I was going down the instance_exec route..
<boc_tothefuture>
So, this is running as a JSR223 item and I am trying to add a DSL to it.
burgestrand has joined #ruby
<boc_tothefuture>
extend does work.
bmurt has joined #ruby
apoc has joined #ruby
vondruch has joined #ruby
angelds has joined #ruby
charrit69 has joined #ruby
angelds has quit [Ping timeout: 260 seconds]
silverdust has joined #ruby
boc_tothefuture has quit [Remote host closed the connection]
cd has joined #ruby
TCZ has quit [Quit: Leaving]
openstruct has joined #ruby
openstruct has quit [Changing host]
openstruct has joined #ruby
FrankyCyborg has quit [Quit: The Sleep Monster got me!]
baojg has quit [Remote host closed the connection]
burgestrand has quit [Quit: burgestrand]
baojg has joined #ruby
cloud69 has quit [Quit: Connection closed for inactivity]
chouhoulis has joined #ruby
vondruch has quit [Read error: Connection reset by peer]
vondruch_ has joined #ruby
vondruch_ has left #ruby [#ruby]
vondruch_ has joined #ruby
vondruch_ has quit [Client Quit]
vondruch_ has joined #ruby
vondruch has joined #ruby
vondruch_ has quit [Ping timeout: 256 seconds]
moldorcoder7_ has joined #ruby
Glumetu has quit [Quit: Glumetu]
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
elcontrastador has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rippa has joined #ruby
moldorcoder7_ has quit [Quit: %bye mirc%]
orbyt_ has joined #ruby
moldorcoder7 has joined #ruby
moldorcoder7 has quit [Excess Flood]
moldorcoder7 has joined #ruby
imode has joined #ruby
DaRock has quit [Ping timeout: 260 seconds]
tpanarch1st_ has joined #ruby
tpanarch1st has quit [Ping timeout: 260 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DarthGandalf has joined #ruby
moldorcoder7 has quit [Remote host closed the connection]
moldorcoder7 has joined #ruby
chouhoulis has quit [Remote host closed the connection]
moldorcoder7 has quit [Remote host closed the connection]
moldorcoder7 has joined #ruby
moldorcoder7 has quit [Remote host closed the connection]
moldorcoder7 has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
braincrash has joined #ruby
Axy has quit [Ping timeout: 256 seconds]
charrit69 has quit [Quit: Konversation terminated!]
Swyper has quit []
moldorcoder7 has quit [Excess Flood]
moldorcoder7 has joined #ruby
Technodrome has joined #ruby
elcontrastador has joined #ruby
TCZ has joined #ruby
cthulchu_ has joined #ruby
braincrash has quit [Ping timeout: 272 seconds]
ChmEarl has joined #ruby
howdoi has joined #ruby
moldorcoder7 has quit [Remote host closed the connection]
Axy has joined #ruby
Axy has joined #ruby
Axy has quit [Changing host]
Mia has quit [Ping timeout: 246 seconds]
troulouliou_div2 has quit [Remote host closed the connection]
troulouliou_div2 has quit [Remote host closed the connection]
Axy has quit [Read error: Connection reset by peer]
braincrash has joined #ruby
zacts has joined #ruby
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Read error: Connection reset by peer]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TCZ has quit [Quit: Leaving]
<silverdust>
I want to check if x == "go" || x == "come" . Is there a better way to write this in ruby? Like x.include?("go", "come") ?
<silverdust>
nvm. Found it
<apotheon>
I'd generally use "or" instead of "||".
<bougyman>
%w{go come}.include? x
<bougyman>
is what I would use there. using 'or' in ruby is full of weirdness.
<bougyman>
Unless you know exactly why you want to use 'or' (not for readability, it's not equivalent to ||), you should not be using it.
troulouliou_div2 has joined #ruby
gix has joined #ruby
<apotheon>
bougyman: It's lower precedence and fits fine here.
troulouliou_div2 has quit [Read error: Connection reset by peer]
<apotheon>
. . . but yeah, #include? is good here.
troulouliou_div2 has joined #ruby
<silverdust>
Yeah bougyman that's what I went with
fippy has joined #ruby
<isene>
fippy: Got it to work - but without enclosing the image file name in " 'image' " - that stopped the command. But - with file names that contain spaces, I would need to enclose it in '' - any tips to fix that? (This message has been postponed on 2020-11-05 21:57:21.)
troulouliou_div2 has quit [Read error: Connection reset by peer]
orbyt_ has joined #ruby
tpanarch1st_ has quit [Ping timeout: 272 seconds]
troulouliou_div2 has joined #ruby
<apotheon>
I never really got why people are afraid of "or". It just has very low precedence.
troulouliou_div2 has quit [Read error: Connection reset by peer]
troulouliou_div2 has joined #ruby
DTZUZU has joined #ruby
bocaneri has quit [Remote host closed the connection]
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
cloaked1 has joined #ruby
cloaked1 has joined #ruby
davispuh has joined #ruby
TCZ has joined #ruby
ur5us has joined #ruby
Mia has joined #ruby
Mia has joined #ruby
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
bamdad has quit [Ping timeout: 240 seconds]
troulouliou_div2 has quit [Remote host closed the connection]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ruby-lang566 has joined #ruby
ruby-lang566 has quit [Client Quit]
bamdad has joined #ruby
cer0 has joined #ruby
silverdust has quit [Ping timeout: 258 seconds]
silverdust has joined #ruby
impermanence has quit [Ping timeout: 265 seconds]
bamdad has quit [Ping timeout: 240 seconds]
silverdust has quit [Ping timeout: 240 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
cer0 has quit [Ping timeout: 256 seconds]
KindOne has quit [Ping timeout: 272 seconds]
KindOne has joined #ruby
orbyt_ has joined #ruby
davispuh has quit [Ping timeout: 265 seconds]
Retropikzel has quit [Quit: Vision[0.10.3]: i've been blurred!]
KindOne has quit [Read error: Connection reset by peer]
KindOne has joined #ruby
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
davispuh has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]