havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.7.1, 2.6.6, 2.5.8: 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!
ctOS has joined #ruby
roadie has joined #ruby
imode has joined #ruby
seaef has joined #ruby
roadie has quit [Ping timeout: 260 seconds]
d3bug has joined #ruby
FastJack has quit [Ping timeout: 260 seconds]
reyfi9e has quit [Quit: Konversation term]
FastJack has joined #ruby
drincruz has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
Technodrome has joined #ruby
wildtrees has quit [Quit: Leaving]
davispuh has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
oncall-pokemon has quit [Quit: Connection closed for inactivity]
seaef has quit [Quit: ZZZzzz…]
akem has quit [Ping timeout: 256 seconds]
seaef has joined #ruby
ChmEarl has quit [Quit: Leaving]
drincruz has quit [Ping timeout: 260 seconds]
Mawile has quit [Read error: Connection reset by peer]
renich has quit [Ping timeout: 256 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
akem has joined #ruby
Tempesta has quit [Quit: See ya!]
Tempesta has joined #ruby
cnsvc_ has joined #ruby
drincruz has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
drincruz has quit [Ping timeout: 258 seconds]
kinduff has joined #ruby
SanguineAnomaly has quit [Ping timeout: 258 seconds]
SanguineAnomaly has joined #ruby
cnsvc_ has quit [Ping timeout: 240 seconds]
seaef has quit [Quit: I am functioning within established parameters.]
johnflux_ has joined #ruby
drincruz has joined #ruby
drincruz has quit [Ping timeout: 264 seconds]
electrostat has quit [Read error: Connection reset by peer]
cnsvc_ has joined #ruby
Eloc has joined #ruby
Eloc has quit [Remote host closed the connection]
cnsvc_ has quit [Ping timeout: 240 seconds]
gix has quit [Disconnected by services]
drincruz has joined #ruby
drincruz has quit [Ping timeout: 256 seconds]
darkstardevx has quit [Quit: Leaving]
roadie has joined #ruby
d3bug has quit [Quit: Connection closed for inactivity]
electrostat has joined #ruby
<johnflux_> In an rspec file, the code does: _(foo).must be what is _ ?
electrostat has quit [Client Quit]
sauvin has joined #ruby
electrostat has joined #ruby
roadie has quit [Ping timeout: 260 seconds]
<havenwood> johnflux_: In that context, check: defined?(_)
<havenwood> johnflux_: For example: defined?(_) #=> "local-variable"
<havenwood> johnflux_: In IRB, it's the return value of the last statement.
cd has quit [Quit: cd]
<johnflux_> ah thanks
<johnflux_> havenwood: hmm, no, i don't get it. so what would _(foo) mean?
roadie has joined #ruby
<havenwood> johnflux_: For example:
<havenwood> &>> def _; 42 end; _()
<rubydoc> # => 42 (https://carc.in/#/r/94im)
<johnflux_> havenwood: okay, but.. are you suggesting that I insert something like: puts defined?(_) in my code to find out?
<havenwood> johnflux_: Or put a `binding.irb` by where it's used.
_aeris_ has quit [Remote host closed the connection]
<havenwood> johnflux_: Check what it is, and go from there.
<johnflux_> oh wow, that's cool
<havenwood> &>> def _; 42 end; [defined?(_), method(:_).owner]
<rubydoc> # => ["method", Object] (https://carc.in/#/r/94in)
<havenwood> ?irb
<ruby[bot]> irb is "interactive ruby", it is part of ruby. You can run ruby code and see results immediately. it's useful for testing code. Also see ?pry, a gem which is a popular alternative to irb.
<havenwood> ?pry
<ruby[bot]> Pry, the better IRB, provides easy object inspection `ls`, `history`, viewing docs `?`, viewing source `$`, syntax highlighting and other features (see `help` for more). Put `binding.pry` in your source code for easy debugging. Install Pry (https://pryrepl.org/): gem install pry pry-doc
<johnflux_> havenwood: I think in this particular case the binding.irb isn't useful because I think irb is overriding it?
<johnflux_> havenwood: I did a puts defined?(_) and it has just printed out 'method'
<havenwood> johnflux_: In IRB that'd be: "local-variable"
<johnflux_> ah, I need the .owner
<havenwood> johnflux_: So it's a method.
<johnflux_> yeah the irb local-variable is overriding it
<havenwood> johnflux_: You can also check: method(:_).source_location
<johnflux_> rspec/expectations/syntax.rb like 72
<johnflux_> nice
<johnflux_> and.... I have no idea what this code means haha
<johnflux_> creates an ExpectationTarget for it
<johnflux_> okay it's a shorthand for "expect" I think
<johnflux_> havenwood: thank you so much!
<havenwood> johnflux_: any time!
wymillerlinux has quit [Ping timeout: 256 seconds]
electrostat has quit [Quit: uwotm8]
electrostat has joined #ruby
drincruz has joined #ruby
electrostat has quit [Client Quit]
drincruz has quit [Ping timeout: 258 seconds]
alexherbo2 has joined #ruby
donofrio has quit [Remote host closed the connection]
nofxx has joined #ruby
nofxx has quit [Client Quit]
electrostat has joined #ruby
cliluw has quit [Ping timeout: 265 seconds]
jetchisel has joined #ruby
roadie has quit [Ping timeout: 272 seconds]
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
roadie has joined #ruby
roadie has quit [Ping timeout: 260 seconds]
DTZUZO_ has quit [Ping timeout: 240 seconds]
DTZUZO_ has joined #ruby
Vashy has quit [Ping timeout: 252 seconds]
DTZUZO_ has quit [Quit: WeeChat 2.6]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
drincruz has joined #ruby
drincruz has quit [Ping timeout: 265 seconds]
Vashy has joined #ruby
mibr has joined #ruby
roadie has joined #ruby
jetchisel has quit [Quit: Unfortunately time is always against us -- [Morpheus]]
conta has joined #ruby
roadie has quit [Ping timeout: 272 seconds]
cnsvc_ has joined #ruby
cnsvc_ has quit [Ping timeout: 240 seconds]
Vashy has quit [Ping timeout: 252 seconds]
hiroaki_ has quit [Ping timeout: 265 seconds]
gato has joined #ruby
NODE has quit [Ping timeout: 240 seconds]
Benett has quit [Ping timeout: 240 seconds]
Benett has joined #ruby
NODE has joined #ruby
darkstardevx has joined #ruby
conta has quit [Remote host closed the connection]
roadie has joined #ruby
_aeris_ has joined #ruby
vondruch has joined #ruby
kristian_on_linu has joined #ruby
drincruz has joined #ruby
hiroaki has joined #ruby
roadie has quit [Ping timeout: 244 seconds]
drincruz has quit [Ping timeout: 264 seconds]
yxhuvud has quit [Remote host closed the connection]
gato has quit [Ping timeout: 260 seconds]
TCZ has joined #ruby
roadie has joined #ruby
darkstardevx has quit [Ping timeout: 260 seconds]
roadie has quit [Ping timeout: 260 seconds]
darkstardevx has joined #ruby
cnsvc_ has joined #ruby
cnsvc_ has quit [Ping timeout: 240 seconds]
jennis has joined #ruby
roadie has joined #ruby
cnsvc_ has joined #ruby
ur5us has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
chalkmonster has joined #ruby
imode has quit [Ping timeout: 265 seconds]
Technodrome has joined #ruby
TCZ has quit [Quit: Leaving]
wogi has joined #ruby
Vashy has joined #ruby
cliluw has joined #ruby
johnflux_ has quit [Ping timeout: 256 seconds]
gato has joined #ruby
Vashy has quit [Ping timeout: 252 seconds]
TCZ has joined #ruby
wogi has quit [Read error: Connection reset by peer]
cnsvc_ has quit [Ping timeout: 240 seconds]
cliluw has quit [Ping timeout: 260 seconds]
akem has quit [Quit: Leaving]
ur5us has quit [Quit: Leaving]
ur5us has joined #ruby
darkstardevx has quit [Remote host closed the connection]
ur5us has quit [Ping timeout: 260 seconds]
sorah has joined #ruby
TCZ has quit [Quit: Leaving]
jinmiaoluo has joined #ruby
Vashy has joined #ruby
yxhuvud has joined #ruby
alexherbo29 has joined #ruby
alexherbo2 has quit [Ping timeout: 260 seconds]
alexherbo29 is now known as alexherbo2
banisterfiend has joined #ruby
kristian_on_linu has quit [Remote host closed the connection]
bvdw has quit [Quit: The Lounge - https://thelounge.chat]
akem has joined #ruby
robotmay has quit [Quit: Be excellent to each other]
bvdw has joined #ruby
robotmay has joined #ruby
<ta> &>> "hello".gsub(/(e)/, "_\\1_")
<rubydoc> # => "h_e_llo" (https://carc.in/#/r/94l1)
<ta> &>> "hello".gsub(/(e)/) { "_\\1_" }
<rubydoc> # => "h_\\1_llo" (https://carc.in/#/r/94l2)
<ta> How to reference a group in a block?
<jhass> &>> "hello".gsub(/(e)/) { "_#{$1}_" } # ta
<rubydoc> # => "h_e_llo" (https://carc.in/#/r/94l3)
<akem> So $1 is global variable right?
<akem> Cause '$something' is global, but $1 $2 etc is maybe a special case?
wymillerlinux has joined #ruby
<akem> What if i start a thread from the block and wanna use $1 inside?
<akem> I guess i should try, it will be faster :P
<jhass> yeah, $1, $2 are not really globals
<akem> Nah it doesn't work from a thread, so $1 is restricted to the block, that's a bit weird to use the '$' sign.
<jhass> iirc they're thread local
<akem> Ok, yeah.
bkuhlmann has joined #ruby
<ta> akem: thank you :)
<ta> jhass: thanks to you also! ;)
roadie has quit [Ping timeout: 246 seconds]
jeromelanteri has joined #ruby
wymillerlinux has quit [Quit: wymillerlinux]
wymillerlinux has joined #ruby
conta has joined #ruby
banisterfiend has quit [Quit: banisterfiend]
banisterfiend has joined #ruby
jinmiaoluo has quit [Ping timeout: 246 seconds]
qual has quit [Quit: qual]
davispuh has joined #ruby
grimgnr has quit [Quit: WeeChat 2.3]
kaleido has quit [Quit: peas]
gato has quit [Quit: Connection closed]
al2o3-cr has quit [Ping timeout: 256 seconds]
al2o3-cr has joined #ruby
<havenwood> Great to have Dir.home *just work* without further hoops :) https://github.com/ruby/ruby/commit/c15cddd1d515c5bd8dfe8fb2725e3f723aec63b8
TCZ has joined #ruby
TCZ has quit [Client Quit]
conta has quit [Quit: conta]
jinmiaoluo has joined #ruby
ChmEarl has joined #ruby
kaleido has joined #ruby
jinmiaoluo has quit [Ping timeout: 260 seconds]
jinmiaoluo has joined #ruby
Tempesta has quit [Quit: See ya!]
imode has joined #ruby
Tempesta has joined #ruby
cliluw has joined #ruby
zapata has joined #ruby
TCZ has joined #ruby
TCZ has quit [Client Quit]
fmcs has joined #ruby
dviola has joined #ruby
cow[moo] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
apurkrt has joined #ruby
cow[moo] has joined #ruby
vondruch has quit [Ping timeout: 265 seconds]
xco has quit [Read error: Connection reset by peer]
wymillerlinux has quit [Ping timeout: 256 seconds]
chalkmonster has quit [Quit: WeeChat 2.8]
howdoi has joined #ruby
TCZ has joined #ruby
cliluw has quit [Quit: Leaving]
kristian_on_linu has joined #ruby
chalkmonster has joined #ruby
TCZ has quit [Quit: Leaving]
cd has joined #ruby
cow[moo] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wymillerlinux has joined #ruby
Xiti has quit [Quit: Leaving]
cnsvc_ has joined #ruby
lucasb has joined #ruby
bkuhlman_ has joined #ruby
bkuhlmann has quit [Ping timeout: 246 seconds]
cnsvc_ has quit [Ping timeout: 240 seconds]
bkuhlmann has joined #ruby
bkuhlmann has quit [Client Quit]
hiroaki has quit [Ping timeout: 272 seconds]
bkuhlman_ has quit [Ping timeout: 240 seconds]
camilasan has quit [Read error: Connection reset by peer]
camilasan has joined #ruby
orbyt_ has joined #ruby
camilasan_ has joined #ruby
camilasan has quit [Read error: Connection reset by peer]
Xiti has joined #ruby
camilasan has joined #ruby
camilasan_ has quit [Ping timeout: 246 seconds]
kinduff has quit [Read error: Connection reset by peer]
camilasan has quit [Read error: Connection reset by peer]
camilasan has joined #ruby
kinduff has joined #ruby
hiroaki has joined #ruby
dputtick has joined #ruby
camilasan has quit [Read error: Connection reset by peer]
camilasan has joined #ruby
apurkrt has left #ruby ["Leaving"]
Esa__ has joined #ruby
fmcs has quit [Changing host]
fmcs has joined #ruby
gix has joined #ruby
mikecmpbll has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
TCZ has joined #ruby
akem has quit [Ping timeout: 246 seconds]
seaef has joined #ruby
akem has joined #ruby
goepsilongo has joined #ruby
banisterfiend has quit [Quit: banisterfiend]
TCZ has quit [Quit: Leaving]
goepsilongo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
goepsilongo has joined #ruby
mibr has quit [Ping timeout: 272 seconds]
kristian_on_linu has quit [Remote host closed the connection]
kristian_on_linu has joined #ruby
kristian_on_linu has quit [Remote host closed the connection]
goepsilongo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bitwinery has joined #ruby
bitwinery has quit [Remote host closed the connection]
bitwinery has joined #ruby
bitwinery has quit [Remote host closed the connection]
lomex has joined #ruby
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
goepsilongo has joined #ruby
Xiti has quit [Quit: Leaving]
tau has joined #ruby
davispuh has quit [Ping timeout: 256 seconds]
tau has quit [Ping timeout: 265 seconds]
venmx has joined #ruby
imode has quit [Ping timeout: 256 seconds]
davispuh has joined #ruby
goepsilongo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
LtHummus has quit [Quit: ZNC 1.8.0 - https://znc.in]
stdedos has joined #ruby
LtHummus has joined #ruby
Technodrome has joined #ruby
goepsilongo has joined #ruby
Xiti has joined #ruby
lomex has quit [Ping timeout: 272 seconds]
seaef has quit [Quit: ZZZzzz…]
howdoi has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby