havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.6.0, 2.5.3, 2.4.5: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
<baweaver> al2o3-cr: 40 minutes, I lied.
<phaul> only 3 to go :)
laaron has joined #ruby
laaron- has quit [Remote host closed the connection]
<al2o3-cr> haha cool that was quick, one little snitch it's Enumerable#chain and Enumerator#+
<al2o3-cr> ^ baweaver
elphe has quit [Ping timeout: 244 seconds]
<al2o3-cr> but other that that it looks good to me ;)
yqrashawn has joined #ruby
yqrashaw_ has quit [Ping timeout: 244 seconds]
elphe has joined #ruby
<baweaver> 2 left.
<al2o3-cr> damn, your on a roll now ;)
<baweaver> Mostly finishing half-written articles I was too lazy to publish before
sarink has joined #ruby
<al2o3-cr> that 30 is certainly in sight now :D
ellcs has joined #ruby
<phaul> baweaver: if you do all of them now, what are you going to do tomorrow :)
<baweaver> Go for 35
<al2o3-cr> eat more turkey ;)
<baweaver> Write more of my book probably
ellcs has quit [Ping timeout: 250 seconds]
<al2o3-cr> baweaver: going to use that pry paste, i'll have to use xclip though.
<al2o3-cr> nice indeed.
<baweaver> Most of it is functionally the same.
<baweaver> Still danged annoying though because of the way TMUX binds things
<al2o3-cr> is screen just as bad?
Xiti` has quit [Quit: Xiti`]
* baweaver shrugs
<baweaver> Never used it
<al2o3-cr> no worries.
mikecmpbll has quit [Quit: inabit. zz.]
<phaul> I most of the time use https://github.com/t9md/vim-ruby-xmpfilter to play with the code. it's old but still works fine.
<phaul> with vim
ixti has joined #ruby
uplime has quit [Ping timeout: 250 seconds]
<al2o3-cr> phaul: i don't think i'm ever out of pry lol ;)
yqrashaw_ has joined #ruby
kapil____ has quit [Quit: Connection closed for inactivity]
yqrashawn has quit [Ping timeout: 240 seconds]
SeepingN has joined #ruby
tdy has joined #ruby
laaron has quit [Remote host closed the connection]
yqrashawn has joined #ruby
laaron has joined #ruby
davidw has quit [Ping timeout: 268 seconds]
elphe has quit [Ping timeout: 244 seconds]
yqrashaw_ has quit [Ping timeout: 240 seconds]
laaron- has joined #ruby
laaron has quit [Remote host closed the connection]
laaron- has quit [Client Quit]
laaron has joined #ruby
elphe has joined #ruby
cruzo66342 has quit []
sonofentropy has quit [Quit: sonofentropy]
quintasan has quit [Remote host closed the connection]
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lxsameer has quit [Ping timeout: 245 seconds]
AJA4350 has quit [Quit: AJA4350]
sonofentropy has joined #ruby
sarink has quit [Remote host closed the connection]
sarink has joined #ruby
sarink has quit [Remote host closed the connection]
Menteb has joined #ruby
\void has quit [Quit: So long, and thanks for all the fish.]
yqrashaw_ has joined #ruby
Menteb has quit [Remote host closed the connection]
ellcs has joined #ruby
yqrashawn has quit [Ping timeout: 245 seconds]
hutch has joined #ruby
RougeR has joined #ruby
gix has quit [Ping timeout: 246 seconds]
elphe has quit [Ping timeout: 250 seconds]
tdy has quit [Ping timeout: 245 seconds]
yqrashaw_ has quit [Quit: yqrashaw_]
laaron has quit [Remote host closed the connection]
laaron has joined #ruby
ellcs has quit [Ping timeout: 250 seconds]
ellcs has joined #ruby
rem_ has joined #ruby
cschneid has joined #ruby
elphe has joined #ruby
<agent_white> I put pry in my coffee in the mornin'.
<Lewis> happy new year!!
donofrio has joined #ruby
<Lewis> anyone work at basecamp here?
tdy has joined #ruby
cschneid has quit [Remote host closed the connection]
sarink has joined #ruby
sarink has quit [Ping timeout: 250 seconds]
ellcs has quit [Ping timeout: 250 seconds]
Xiti has joined #ruby
donofrio has quit [Read error: Connection reset by peer]
donofrio has joined #ruby
hutch has quit [Ping timeout: 246 seconds]
RougeR has quit [Ping timeout: 240 seconds]
shakes has joined #ruby
donofrio has quit [Ping timeout: 240 seconds]
divergence has quit [Quit: b]
rem_ has left #ruby [#ruby]
aupadhye has joined #ruby
hutch has joined #ruby
davidw has joined #ruby
elphe has quit [Ping timeout: 245 seconds]
shakes has quit [Remote host closed the connection]
laaron- has joined #ruby
quipa has joined #ruby
ixti has quit [Quit: WeeChat 2.3]
laaron has quit [Remote host closed the connection]
donofrio has joined #ruby
JoeA2552 has joined #ruby
masterasia has joined #ruby
Kn|t3 has joined #ruby
JoeA2552 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Tempesta has quit [Ping timeout: 245 seconds]
JoeA2552 has joined #ruby
<baweaver> al2o3-cr / phaul / havenwood: Wanna see something awful?
elphe has joined #ruby
JoeA2552 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<baweaver> Looks like operator precedence screws with method_missing hackery
darkhanb has joined #ruby
<baweaver> _Might_ be able to get away with it by defining common operators precluding method_missing, not sure.
Ohga has joined #ruby
<Ohga> test
<baweaver> pong
<Ohga> *thumbsup*
hutch has quit [Ping timeout: 250 seconds]
nowhere_man has quit [Remote host closed the connection]
JoeA2552 has joined #ruby
Ohga has left #ruby [#ruby]
nowhere_man has joined #ruby
hutch has joined #ruby
donofrio has quit [Ping timeout: 246 seconds]
quipa has quit [Read error: Connection reset by peer]
hutch has quit [Ping timeout: 250 seconds]
kapil____ has joined #ruby
hutch has joined #ruby
JoeA2552 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
esrse has joined #ruby
elphe has quit [Ping timeout: 250 seconds]
elphe has joined #ruby
davidw has quit [Ping timeout: 246 seconds]
laaron- has quit [Remote host closed the connection]
<baweaver> AHA!
<baweaver> The numbers were grouping instead of applying to eachother.
<baweaver> derp
braincrash has quit [Quit: bye bye]
tdy has quit [Ping timeout: 246 seconds]
sgen has joined #ruby
braincrash has joined #ruby
Azure has joined #ruby
cschneid has joined #ruby
_whitelogger has joined #ruby
laaron has joined #ruby
hutch has quit [Ping timeout: 240 seconds]
uplime has joined #ruby
sgen has quit [Ping timeout: 250 seconds]
cschneid has quit [Remote host closed the connection]
cschneid has joined #ruby
sauvin has joined #ruby
donofrio has joined #ruby
elphe has quit [Ping timeout: 246 seconds]
elphe has joined #ruby
nowhereman has joined #ruby
nowhere_man has quit [Ping timeout: 252 seconds]
nowhereman is now known as Guest44017
laaron has quit [Remote host closed the connection]
laaron has joined #ruby
hutch has joined #ruby
masterasia has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sarink has joined #ruby
ur5us has joined #ruby
<baweaver> al2o3-cr: 29
ur5us has quit [Ping timeout: 250 seconds]
tdy has joined #ruby
ogres has joined #ruby
rippa has joined #ruby
Kn|t3 has left #ruby ["Leaving"]
sarink has quit [Remote host closed the connection]
hutch has quit [Ping timeout: 250 seconds]
hutch has joined #ruby
paranoicsan has joined #ruby
dada1 has joined #ruby
<dada1> Hello
<dada1> can I store something like NS::MyClass into klass
<dada1> or should I always store NS::MyClass.new into klass
<dada1> What should I name "klass" if it's not initialized?
Renich has joined #ruby
laaron has quit [Remote host closed the connection]
sgen has joined #ruby
dada1 has quit [Quit: Page closed]
tdy has quit [Ping timeout: 246 seconds]
tdy1 has joined #ruby
cschneid has quit [Remote host closed the connection]
elphe has quit [Ping timeout: 244 seconds]
elphe has joined #ruby
hutch has quit [Ping timeout: 250 seconds]
_whitelogger has joined #ruby
armyriad has quit [Ping timeout: 240 seconds]
dellavg_ has joined #ruby
paranoicsan is now known as paranoicsan[Away
paranoicsan[Away has quit [Quit: paranoicsan[Away]
reber has joined #ruby
paranoicsan has joined #ruby
johnny56 has joined #ruby
Renich has quit [Read error: Connection reset by peer]
cschneid has joined #ruby
laaron has joined #ruby
sgen has quit [Ping timeout: 250 seconds]
gix has joined #ruby
johnny56 has quit [Ping timeout: 272 seconds]
paranoicsan has quit [Quit: paranoicsan]
JoeA2552 has joined #ruby
tdy2 has quit [Ping timeout: 268 seconds]
mclee has joined #ruby
JoeA2552 has quit [Client Quit]
KeyJoo has joined #ruby
mclee has quit [Client Quit]
mclee has joined #ruby
elphe has quit [Ping timeout: 246 seconds]
JoeA2552 has joined #ruby
mclee has quit [Client Quit]
mclee has joined #ruby
cschneid has quit [Ping timeout: 268 seconds]
KeyJoo has quit [Quit: KeyJoo]
mclee has quit [Quit: WeeChat 1.4]
mclee has joined #ruby
mclee has quit [Client Quit]
mclee has joined #ruby
tdy3 has joined #ruby
mclee has quit [Client Quit]
mclee has joined #ruby
prestorium has joined #ruby
tdy3 has quit [Ping timeout: 268 seconds]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
JoeA2552 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
esrse has quit [Quit: Leaving]
laaron has quit [Remote host closed the connection]
laaron- has joined #ruby
neuraload has joined #ruby
Tempesta has joined #ruby
neuraload has quit [Client Quit]
johnny56 has joined #ruby
sonofentropy has quit [Quit: sonofentropy]
cthu| has joined #ruby
JoeA2552 has joined #ruby
masterasia has joined #ruby
cthulchu_ has quit [Ping timeout: 268 seconds]
sarink has joined #ruby
sarink has quit [Remote host closed the connection]
sarink has joined #ruby
cschneid has joined #ruby
sarink has quit [Remote host closed the connection]
sarink has joined #ruby
agent_white has quit [Quit: night]
ogres has quit [Quit: Connection closed for inactivity]
johnny56 has quit [Ping timeout: 272 seconds]
sonofentropy has joined #ruby
dellavg_ has quit [Ping timeout: 250 seconds]
sarink has quit [Remote host closed the connection]
laaron- has quit [Remote host closed the connection]
gix has quit [Ping timeout: 250 seconds]
laaron has joined #ruby
cschneid has quit [Ping timeout: 246 seconds]
johnny56 has joined #ruby
code_zombie has quit [Quit: Leaving]
sagax has quit [Ping timeout: 246 seconds]
prestorium has quit [Quit: prestorium]
cthulchu_ has joined #ruby
Guest49234 has joined #ruby
cthu| has quit [Ping timeout: 252 seconds]
cthu| has joined #ruby
cthulchu_ has quit [Ping timeout: 260 seconds]
conta has joined #ruby
vonfry has joined #ruby
<al2o3-cr> baweaver: nice, i had to read that few times to even understand what it was you were doing :D
laaron has quit [Remote host closed the connection]
laaron has joined #ruby
aupadhye has quit [Ping timeout: 250 seconds]
cthulchu_ has joined #ruby
cthu| has quit [Ping timeout: 268 seconds]
cschneid has joined #ruby
cthulchu has joined #ruby
cthu| has joined #ruby
cthulchu_ has quit [Ping timeout: 268 seconds]
uplime has quit [Ping timeout: 240 seconds]
cthulchu has quit [Ping timeout: 268 seconds]
cthu| has quit [Ping timeout: 268 seconds]
esrse has joined #ruby
sonofentropy has quit [Quit: sonofentropy]
mikecmpbll has joined #ruby
JoeA2552 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
venmx has joined #ruby
canton7 has quit [Quit: ZNC - http://znc.in]
canton7 has joined #ruby
cschneid has quit [Ping timeout: 250 seconds]
tiff has joined #ruby
sonofentropy has joined #ruby
uplime has joined #ruby
laaron has quit [Remote host closed the connection]
mikecmpbll has quit [Quit: inabit. zz.]
laaron has joined #ruby
venmx has quit [Ping timeout: 272 seconds]
clemens3 has joined #ruby
tdy3 has joined #ruby
tdy3 has quit [Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac]
elphe has joined #ruby
uplime has quit [Ping timeout: 272 seconds]
szulak_ has joined #ruby
al2o3-cr has quit [Ping timeout: 246 seconds]
venmx has joined #ruby
al2o3-cr has joined #ruby
marz_d`ghostman has quit [Quit: Page closed]
al2o3-cr has quit [Ping timeout: 246 seconds]
al2o3-cr has joined #ruby
cd has quit [Quit: cd]
venmx has quit [Ping timeout: 250 seconds]
dellavg_ has joined #ruby
laaron has quit [Remote host closed the connection]
laaron has joined #ruby
esrse has quit [Ping timeout: 245 seconds]
Inline has quit [Quit: Leaving]
sonofentropy has quit [Quit: sonofentropy]
al2o3-cr has quit [Read error: Connection reset by peer]
AJA4350 has joined #ruby
al2o3-cr has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
conta has quit [Remote host closed the connection]
Nicmavr has joined #ruby
kapil____ has quit [Quit: Connection closed for inactivity]
elphe has quit [Ping timeout: 250 seconds]
kapil____ has joined #ruby
_whitelogger has joined #ruby
donofrio has quit [Remote host closed the connection]
lightstalker has quit [Ping timeout: 246 seconds]
elphe has joined #ruby
Inline has joined #ruby
laaron has quit [Remote host closed the connection]
laaron- has joined #ruby
uplime has joined #ruby
vonfry has quit [Quit: WeeChat 2.3]
uplime has quit [Ping timeout: 272 seconds]
m0w has joined #ruby
tiff has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
venmx has joined #ruby
cschneid has joined #ruby
sonofentropy has joined #ruby
uplime has joined #ruby
uplime has quit [Ping timeout: 246 seconds]
mostlybadfly has joined #ruby
tdy3 has joined #ruby
tdy3 has quit [Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac]
cschneid has quit [Ping timeout: 240 seconds]
laaron- has quit [Remote host closed the connection]
laaron has joined #ruby
ellcs has joined #ruby
ellcs has quit [Ping timeout: 252 seconds]
Guest44017 has quit [Ping timeout: 252 seconds]
uplime has joined #ruby
troulouliou_div2 has joined #ruby
varesa has quit [Ping timeout: 272 seconds]
ellcs has joined #ruby
venmx has quit [Ping timeout: 268 seconds]
varesa has joined #ruby
Mike11 has joined #ruby
bmurt has joined #ruby
masterasia has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmurt has quit [Client Quit]
masterasia has joined #ruby
kapil____ has quit [Quit: Connection closed for inactivity]
masterasia has quit [Client Quit]
szulak_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
polishdub has joined #ruby
cschneid has joined #ruby
sonofentropy has quit [Quit: sonofentropy]
sonofentropy has joined #ruby
eldritch has quit [Ping timeout: 245 seconds]
r3dc0d3r has quit [Ping timeout: 245 seconds]
leonthemisfit has quit [Ping timeout: 245 seconds]
neuraload has joined #ruby
r3dc0d3r has joined #ruby
donofrio has joined #ruby
szulak_ has joined #ruby
laaron has quit [Remote host closed the connection]
eldritch has joined #ruby
eldritch has quit [Max SendQ exceeded]
leonthemisfit has joined #ruby
gix has joined #ruby
eldritch has joined #ruby
eldritch has quit [Max SendQ exceeded]
laaron has joined #ruby
ellcs has quit [Ping timeout: 268 seconds]
donofrio has quit [Ping timeout: 268 seconds]
eldritch has joined #ruby
donofrio has joined #ruby
masterasia has joined #ruby
cschneid has quit [Ping timeout: 244 seconds]
donofrio has quit [Ping timeout: 245 seconds]
szulak_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Rapture has joined #ruby
ellcs has joined #ruby
donofrio has joined #ruby
szulak_ has joined #ruby
donofrio has quit [Ping timeout: 246 seconds]
supergeek has joined #ruby
ellcs has quit [Ping timeout: 268 seconds]
<mspo> so I asked this already but didn't understand the answer. Is there a way to explicitly a method without arguments? like foo() but with foo(nil) or similar
<phaul> you mean explicitly call a method? yes parens force the parser to take it as a method name even if a local var exist with the same name
<phaul> foo(nil) is different though, that pases 1 argument with value nil
cschneid has joined #ruby
<phaul> &>> x = 7; def x; -7; end; x()
<rubydoc> # => -7 (https://carc.in/#/r/5v4f)
<phaul> &>> x = 7; def x; -7; end; x
<rubydoc> # => 7 (https://carc.in/#/r/5v4g)
<mspo> phaul: I am probably way off base but I wanted to do something like this: P.new( foo.empty? : nil ? foo )
<mspo> phaul: which is probably just a bad idea because I'm just learning but I was trying to find a good way to test for the argument
cschneid has quit [Ping timeout: 240 seconds]
Cthulu201 has quit [Quit: Nowhere special. I always wanted to go there.]
szulak_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cschneid has joined #ruby
Cthulu201 has joined #ruby
<mspo> havenwood: thanks I think I get it
<mspo> havenwood: *[] expands the (empty) array into nothing?
<havenwood> mspo: Yes, or if there were multiple items in the Array it would pass them as multiple arguments.
laaron has quit [Remote host closed the connection]
laaron has joined #ruby
<mspo> havenwood: okay cool. ruby still doesn't like my bad idea but I appreciate the lesson in the *[] syntax :)
<mspo> nbd I just skipped having a default value for the paramter and put better testing in the initialize
<havenwood> mspo: If you can show us your code we might have better suggestions.
supergeek has quit [Quit: Goodbye cruel world...]
<mspo> which got me to use a begin/rescue
<mspo> havenwood: I'm kind of live hacking as I learn
elphe has quit [Ping timeout: 246 seconds]
elphe has joined #ruby
tiff has joined #ruby
laaron has quit [Remote host closed the connection]
Guest49234 has quit [Quit: WeeChat 2.3]
lxsameer has joined #ruby
davidw has joined #ruby
elphe has quit [Ping timeout: 250 seconds]
quipa has joined #ruby
jottr has joined #ruby
elphe has joined #ruby
elphe has quit [Ping timeout: 245 seconds]
noodle has quit [Quit: /quit]
sgen has joined #ruby
\void has joined #ruby
elphe has joined #ruby
cschneid has quit [Ping timeout: 245 seconds]
hutch has joined #ruby
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
elphe has quit [Ping timeout: 246 seconds]
noodle has joined #ruby
jottr has quit [Ping timeout: 244 seconds]
neuraload has quit [Quit: This computer has gone to sleep]
sameerynho has joined #ruby
sgen_ has joined #ruby
lxsameer has quit [Ping timeout: 250 seconds]
sgen has quit [Ping timeout: 250 seconds]
sonofentropy has quit [Quit: sonofentropy]
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
szulak_ has joined #ruby
szulak_ has quit [Client Quit]
KeyJoo has joined #ruby
darkhanb has joined #ruby
ellcs has joined #ruby
cthulchu_ has joined #ruby
za1b1tsu has joined #ruby
clemens3 has quit [Ping timeout: 268 seconds]
clemens3_ has joined #ruby
clemens3 has joined #ruby
clemens3_ has quit [Ping timeout: 244 seconds]
BH23 has joined #ruby
clemens3_ has joined #ruby
clemens3 has quit [Ping timeout: 244 seconds]
solocshaw has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
ellcs has quit [Ping timeout: 268 seconds]
DTZUZO has joined #ruby
evdubs_ has joined #ruby
evdubs has quit [Ping timeout: 250 seconds]
clemens3_ has quit [Ping timeout: 250 seconds]
clemens3_ has joined #ruby
agent_white has joined #ruby
cthu| has joined #ruby
cthu| has quit [Max SendQ exceeded]
clemens3_ has quit [Ping timeout: 250 seconds]
cthu| has joined #ruby
cthulchu_ has quit [Ping timeout: 252 seconds]
marz_d`ghostman has joined #ruby
<marz_d`ghostman> I have my gems installed via bundle install --path .bundle on my project root directory. How do I run ruby so that it sees the gems?
<phaul> bundle exec
solocshaw has quit [Quit: solocshaw]
<phaul> $ bundle exec ruby some.rb, $ bundle exec some_executable etc.
<phaul> $ is the prompt ...
clemens3 has joined #ruby
sgen_ has quit [Ping timeout: 268 seconds]
<marz_d`ghostman> phaul: Ah, thanks. Also, how do I access instance methods inside at_exit blocks? I placed an at_exit block that I would like to email me if $ERROR_INFO
<baweaver> ohai phaul
mostlybadfly has joined #ruby
<phaul> ohai, looking
<baweaver> marz_d`ghostman: What's the full code?
hutch has quit [Ping timeout: 250 seconds]
troulouliou_div2 has quit [Remote host closed the connection]
ellcs has joined #ruby
<phaul> baweaver: oh yeah I saw this in the morning. I read the issue you had with operator precedence, I haven't really understood it yet though
<baweaver> I figured it our
<baweaver> Sf + 5 * 10 -> Sf + (5 * 10)
Mike11 has quit [Ping timeout: 250 seconds]
clemens3_ has joined #ruby
clemens3 has quit [Ping timeout: 250 seconds]
<phaul> baweaver: oh you mean if one wants left associative parens then they should explicitly do that. That makes sense, i was confused I thought you added some more trickery to force order.
<baweaver> Nope, not without hacking the everloving heck out of the parser :P
ellcs has quit [Ping timeout: 252 seconds]
<baweaver> I feel like at_exit should not be used in a module, but as a supervisor
armyriad has joined #ruby
<baweaver> I doubt it works as an instance method even if included.
ellcs has joined #ruby
<marz_d`ghostman> baweaver: What do you mean as a supervisor?
<phaul> &>> def f; x=3; exit; end; at_exit { puts x }
<rubydoc> # => #<Proc:0x000055b4545ad0a8@-e:2> (https://carc.in/#/r/5v53)
sauvin has quit [Remote host closed the connection]
<phaul> &>> def f; @x=3; exit; end; at_exit { puts @x }
<rubydoc> # => #<Proc:0x00005612ec70e090@-e:2> ...check link for more (https://carc.in/#/r/5v54)
<phaul> I'm not sure what I've done :)
<phaul> ah, nm I'm tired Im not even calling f..
venmx has joined #ruby
<phaul> marz_d`ghostman: send_mail is an instance method of notification. you I think use it as a class method, but I'm not sure what self is in at_exit. Does it work if you extend instead of include?
sarink has joined #ruby
<phaul> &>> at_exit { puts self }
<rubydoc> # => #<Proc:0x000055fac510cc80@-e:2> ...check link for more (https://carc.in/#/r/5v55)
<phaul> &>> at_exit { puts self }; class X; exit; end
<rubydoc> # => exit (SystemExit) ...check link for more (https://carc.in/#/r/5v56)
elphe has joined #ruby
<phaul> so it seems, that self is what self was at the definition of the block. Doesn't matter where it exits. So just try extend.
donofrio has joined #ruby
elphe has quit [Ping timeout: 246 seconds]
za1b1tsu_ has joined #ruby
tdy3 has joined #ruby
hutch has joined #ruby
<marz_d`ghostman> phaul: It gets triggered via Manager.new.run though hence I'm inlcuding it to make it available as an intance method rather than a class metho
<marz_d`ghostman> phaul: thanks for the recommendation, I'll double check.
za1b1tsu has quit [Ping timeout: 268 seconds]
sgen_ has joined #ruby
<phaul> &>> class X; at_exit { puts self }; end; 'is it main, or is it X?'
<rubydoc> # => "is it main, or is it X?" ...check link for more (https://carc.in/#/r/5v57)
<phaul> yeah, that's how it works
cschneid has joined #ruby
donofrio has quit [Ping timeout: 268 seconds]
kapil____ has joined #ruby
masterasia has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ellcs has quit [Ping timeout: 252 seconds]
ellcs has joined #ruby
cschneid has quit [Ping timeout: 240 seconds]
<mspo> I have another newb question. Why are methods documented (talked about) as Class#stuff but that # is not used as syntax?
<phaul> convention
<phaul> . means a method that's a method of something, something that can receive it
<phaul> for instance methods you need an instance object to receive it.
<phaul> it could be X.new.method , but it's just documentation, so X#method
y0u has joined #ruby
<phaul> but there are methods that the class receives and those are denoted with . in the documentation
lucasb has joined #ruby
elphe has joined #ruby
cschneid has joined #ruby
donofrio has joined #ruby
elphe has quit [Ping timeout: 244 seconds]
tdy3 has quit [Ping timeout: 246 seconds]
masterasia has joined #ruby
clemens3 has joined #ruby
clemens3_ has quit [Ping timeout: 246 seconds]
elphe has joined #ruby
Renich has joined #ruby
clemens3 has quit [Ping timeout: 250 seconds]
elphe has quit [Ping timeout: 250 seconds]
cschneid has quit [Ping timeout: 245 seconds]
Renich has quit [Quit: Renich]
donofrio has quit [Ping timeout: 250 seconds]
clemens3 has joined #ruby
elphe has joined #ruby
m0w has quit [Read error: Connection reset by peer]
elphe has quit [Ping timeout: 240 seconds]
masterasia has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
donofrio has joined #ruby
cuthbert has joined #ruby
ellcs has quit [Ping timeout: 268 seconds]
<havenwood> marz_d`ghostman: Matz borrowed the convention from Smalltalk.
<havenwood> #message
jottr has joined #ruby
VladGh has quit [Ping timeout: 250 seconds]
<phaul> havenwood: it was mspo asking that
<havenwood> phaul: oops!
<mspo> oh okay
hutch has quit [Ping timeout: 250 seconds]
elphe has joined #ruby
donofrio has quit [Ping timeout: 244 seconds]
elphe has quit [Ping timeout: 244 seconds]
tdy3 has joined #ruby
VladGh has joined #ruby
elphe has joined #ruby
za1b1tsu_ has quit [Read error: Connection reset by peer]
za1b1tsu has joined #ruby
tdy3 is now known as tdy
Aqo has joined #ruby
elphe has quit [Ping timeout: 245 seconds]
hutch has joined #ruby
ellcs has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
code_zombie has joined #ruby
Xiti has quit [Read error: Connection reset by peer]
cschneid has joined #ruby
Inline is now known as oleo
elphe has joined #ruby
oleo is now known as Inline
_whitelogger has joined #ruby
elphe has quit [Ping timeout: 268 seconds]
tdy has quit [Ping timeout: 240 seconds]
elphe has joined #ruby
vutral1 has joined #ruby
elphe has quit [Ping timeout: 250 seconds]
hutch has quit [Ping timeout: 250 seconds]
cd has joined #ruby
hutch has joined #ruby
elphe has joined #ruby
KeyJoo has quit [Ping timeout: 250 seconds]
elphe has quit [Ping timeout: 244 seconds]
Xiti has joined #ruby
cschneid has quit [Ping timeout: 240 seconds]
elphe has joined #ruby
teej has quit []
clemens3 has quit [Ping timeout: 240 seconds]
elphe has quit [Ping timeout: 250 seconds]
tdy has joined #ruby
envex has joined #ruby
hutch has quit [Ping timeout: 245 seconds]
teej has joined #ruby
hiroaki has joined #ruby
sgen_ has quit [Ping timeout: 272 seconds]
dellavg_ has quit [Ping timeout: 250 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
jcalla has quit [Ping timeout: 250 seconds]
jcalla has joined #ruby
<cthu|> regex in .include?
jcalla has quit [Ping timeout: 240 seconds]
donofrio has joined #ruby
<cthu|> oh, okay, it doesn't
<cthu|> but I can replace it with .index
<cthu|> index is smart enough to be friends with regex
sgen_ has joined #ruby
sarink has quit [Remote host closed the connection]
tag has joined #ruby
<phaul> match? is the most idiomatic if you just want yes or no
<phaul> it doesn't set the matchdata stuff, so it's faster
sarink has joined #ruby
quipa_ has joined #ruby
quipa has quit [Ping timeout: 250 seconds]
tiff has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sarink has quit [Ping timeout: 245 seconds]
<cthu|> phaul, many thanks, I will replace it with match
<cthu|> anyone seen a construction like unless in our langs?
<phaul> cthu|: ok, but note the ? mark at the end. there is also a String#match which is different
<cthu|> my rubocop says I should use =~ instead of match if the data match returns won't be used
<cthu|> I only use it in if
<phaul> well, I just answered that :)
<phaul> it's String#match vs String#match?
<cthu|> ah
<cthu|> errr
<cthu|> I always thought ? means it returns a bool
<cthu|> how does ? work?
<phaul> well, it usually does. but it's just a naming convention.
<phaul> in this case it does, and that's what you need in an if
<phaul> &>> 'string'.match?(/i/)
<rubydoc> # => true (https://carc.in/#/r/5v76)
jcalla has joined #ruby
<al2o3-cr> String#=~ is roughly 1.5x slower than String#match? on my machine.
<cthu|> &>> "qwe1" =~ /.*\d/i
<rubydoc> # => 0 (https://carc.in/#/r/5v77)
<cthu|> &>> "qwe1" =~ /.*/
<rubydoc> # => 0 (https://carc.in/#/r/5v78)
<cthu|> wow
<cthu|> eubocop claims =~ is faster
<cthu|> now I want to turn it off
<cthu|> ok, match it is
venmx has quit [Ping timeout: 250 seconds]
kapil____ has quit [Quit: Connection closed for inactivity]
mikecmpbll has joined #ruby
cschneid has joined #ruby
SeepingN has joined #ruby
za1b1tsu has quit [Remote host closed the connection]
<cthu|> how do I properly check if a["b"]["c"] exists?
cschneid has quit [Ping timeout: 272 seconds]
<cthu|> oh, we can do if "b" in a
<cthu|> even better, hash.key?(some_key)
orbyt_ has joined #ruby
ellcs has quit [Ping timeout: 260 seconds]
comet23 has joined #ruby
cuthbert has quit [Ping timeout: 246 seconds]
polishdub has quit [Quit: leaving]
donofrio has quit [Ping timeout: 245 seconds]
Mike11 has joined #ruby
<bathtub_shark> cthu|: a[:b].nil? will also work
tdy has quit [Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac]
tdy has joined #ruby
<phaul> bathtub_shark: careful. :b is a symbol. cthu| used string keys. Also one can store nil? in a hash, which then fails to make a distinction between it's there but nil or it's not there at all
<bathtub_shark> phaul: the latter is a fair point
<bathtub_shark> i mean, the former is too, but the latter is something i forgot to consider
moei has quit [Quit: Leaving...]
* bathtub_shark maybe has some minor refactoring to do.
tiff has joined #ruby
hiroaki has quit [Ping timeout: 246 seconds]
quipa_ has quit [Remote host closed the connection]
quipa_ has joined #ruby
GodFather has quit [Ping timeout: 250 seconds]
jottr has quit [Ping timeout: 244 seconds]
quipa_ has quit [Max SendQ exceeded]
quipa_ has joined #ruby
<cthu|> thanks
<cthu|> another question
<cthu|> I know that overriding existing functions in existing classes is bad
<cthu|> what about adding new functions to existing classes?
<cthu|> like self.color(string, color) in String
<cthu|> so that I could do something like puts("This test has failed".color("red"))
<phaul> inheritance in itself in most cases is bad. But we can include, refine, prepend
<phaul> Also inheritance is only bad because it enforces that what you create is obeying every contract that the thing obeyed you inherited from. If that's fine then inheritance is fine. But 99.9% of cases ppl yust break contracts. and that's why its mostly bad
<cthu|> what do you mean by contracts?
<phaul> contracts here means the external interface (public methods) to something plus their promise on their behaviour.
<phaul> I give you an example.
<phaul> (JimW's example) Rake::FileList used to inherit Array. That means that a filelist is in every respect an Array. Yes, from one angle it can be indexed, FileLists concatenated etc. But is it really an Array? Can it do #transpose ? Can it store arbitrary types? etc.
<cthu|> oh so there's no match?
<cthu|> if it extends array, it must obey
<cthu|> I don't even know how you can extend a class in a way that doesn't imply implementation of all public methods of the superclass
<cthu|> unless you override them
<cthu|> can you?
<phaul> by extending you mean inheritance?
<cthu|> yes
<cthu|> I mean I haven't tried extending of anything in Ruby yet, but I did a lot of it in Java
<cthu|> but Java has a lot more strict OOP structure.
<phaul> If you don't do anything the subclass inherits methods from the super class. the method lookup just walks up the inheritance chain until it finds a class that implements it
<phaul> even ruby core at the very inner core breaks contracts sometimes...
<phaul> Module is a superclass of Class. yet try to include a class somewhere ..
<phaul> (including is somehting that works for Modules but not for Classes)
m0w has joined #ruby
<phaul> &>> class X; end; class Y; include X; end;
<rubydoc> # => wrong argument type Class (expected Module) (TypeError) (https://carc.in/#/r/5v7n)
<phaul> so that's a breakage of Liskov substitution in a way
reber has quit [Remote host closed the connection]
elphe has joined #ruby
cschneid has joined #ruby
Mike11 has quit [Quit: Leaving.]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sarink has joined #ruby
orbyt_ has joined #ruby
segy has quit [Quit: ZNC - http://znc.in]
sarink has quit [Ping timeout: 250 seconds]
cschneid has quit [Ping timeout: 240 seconds]
orbyt_ has quit [Client Quit]
Aqo has quit [Quit: ChatZilla 0.9.92-rdmsoft [XULRunner 35.0.1/20150122214805]]
segy has joined #ruby
masterasia has joined #ruby
donofrio has joined #ruby
ByronJohnson has quit [Ping timeout: 272 seconds]
tdy has quit [Ping timeout: 246 seconds]
elphe has quit [Ping timeout: 246 seconds]
lucasb has quit [Quit: Connection closed for inactivity]
m0w has quit [Read error: Connection reset by peer]
cschneid has joined #ruby
lightstalker has joined #ruby