havenwood changed the topic of #ruby to: Ruby 3.3.3, 3.2.4, 3.4.0-preview1 https://www.ruby-lang.org | Logs https://libera.irclog.whitequark.org/ruby
wyclif has joined #ruby
wyclif has quit [Ping timeout: 256 seconds]
wyclif has joined #ruby
Linux_Kerio has quit [Ping timeout: 264 seconds]
Munto has quit [Quit: Leaving]
wyclif has quit [Ping timeout: 268 seconds]
cappy has quit [Quit: Leaving]
wyclif has joined #ruby
brokkoli_origin has quit [Ping timeout: 255 seconds]
brokkoli_origin has joined #ruby
donofrio has joined #ruby
donofrio has quit [Ping timeout: 256 seconds]
mkoncek has quit [Ping timeout: 268 seconds]
wyclif has quit [Ping timeout: 264 seconds]
wyclif has joined #ruby
Vonter has quit [Ping timeout: 246 seconds]
Linux_Kerio has joined #ruby
cappy has joined #ruby
Vonter has joined #ruby
grenierm has joined #ruby
mkoncek has joined #ruby
wyclif has quit [Ping timeout: 240 seconds]
wyclif_ has joined #ruby
cappy has quit [Quit: Leaving]
wyclif_ has quit [Ping timeout: 252 seconds]
mkoncek has quit [Ping timeout: 252 seconds]
wyclif has joined #ruby
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
wyclif has quit [Read error: Connection reset by peer]
mkoncek has joined #ruby
konsolebox has joined #ruby
wyclif has joined #ruby
konsolebox has quit [Ping timeout: 264 seconds]
Vonter has quit [Ping timeout: 264 seconds]
wyclif has quit [Ping timeout: 260 seconds]
wyclif has joined #ruby
cappy has joined #ruby
konsolebox has joined #ruby
mjacob has quit [Read error: Connection reset by peer]
wyclif has quit [Ping timeout: 264 seconds]
mjacob has joined #ruby
Linux_Kerio has quit [Ping timeout: 264 seconds]
mange has quit [Quit: Quittin' time!]
wyclif has joined #ruby
wyclif has quit [Ping timeout: 264 seconds]
wyclif has joined #ruby
Vonter has joined #ruby
wyclif has quit [Ping timeout: 264 seconds]
Rounin has quit [Ping timeout: 255 seconds]
wyclif has joined #ruby
Rounin has joined #ruby
cappy has quit [Quit: Leaving]
donofrio has joined #ruby
Vonter has quit [Ping timeout: 252 seconds]
jenrzzz has joined #ruby
grenierm has quit [Ping timeout: 250 seconds]
Vonter has joined #ruby
xdminsy has quit [Quit: Konversation terminated!]
Vonter has quit [Ping timeout: 264 seconds]
Vonter has joined #ruby
wyclif has quit [Ping timeout: 268 seconds]
Tempesta has quit [Excess Flood]
jmcgnh has quit [Excess Flood]
Linux_Kerio has joined #ruby
wyclif has joined #ruby
gaussianblue has joined #ruby
jmcgnh has joined #ruby
wyclif has quit [Ping timeout: 240 seconds]
graaff has quit [Ping timeout: 268 seconds]
wyclif has joined #ruby
wyclif has quit [Ping timeout: 264 seconds]
wyclif has joined #ruby
wyclif has quit [Ping timeout: 255 seconds]
Tempesta has joined #ruby
wyclif has joined #ruby
wyclif has quit [Ping timeout: 264 seconds]
mkoncek has quit [Ping timeout: 260 seconds]
wyclif has joined #ruby
wyclif has quit [Ping timeout: 264 seconds]
wyclif has joined #ruby
wyclif has quit [Ping timeout: 255 seconds]
<constxqt> just found out about catch/throw
<constxqt> that's crazy...
Munto has joined #ruby
wyclif has joined #ruby
wyclif has quit [Client Quit]
wyclif has joined #ruby
otisolsen70 has joined #ruby
gaussianblue has quit [Quit: leaving]
___nick___ has joined #ruby
<_0x1eef> IIRC that's how Pry exits the REPL. I've found it useful as well, usually when an error doesn't quite fit.
user71 has joined #ruby
Guest94 has joined #ruby
<konsolebox> If you have a general Exception handler in the main function, you mostly would want SystemExit and Interrupt to be excluded from it.
szkl has joined #ruby
<konsolebox> Also any code that lazily just catches Exception is a sign of bad code writing.
<konsolebox> Even worse are those that don't handle exceptions at all.
Vonter has quit [Ping timeout: 268 seconds]
<_0x1eef> yolo
osc4rpt has joined #ruby
<adam12> constxqt: catch/throw is used in Sinatra/Roda too, to exit nicely from a route block. Super handy.
<adam12> catch(:halt) { serve_request } essentially
___nick___ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
Guest94 has quit [Quit: Client closed]
___nick___ has joined #ruby
___nick___ has quit [Client Quit]
otisolsen70 has quit [Ping timeout: 268 seconds]
___nick___ has joined #ruby
graaff has joined #ruby
Exagone313 has joined #ruby
Exa has quit [Read error: Connection reset by peer]
Exagone313 is now known as Exa
desnudopenguino1 has joined #ruby
<_0x1eef> >> foo = catch(:abort) { throw(:abort, 123) }; foo
<ruby[bot]> _0x1eef: # => 123 (https://carc.in/#/r/gxdr)
<_0x1eef> Being able to pass something back can be handy too.
desnudopenguino has quit [Ping timeout: 268 seconds]
desnudopenguino1 is now known as desnudopenguino
<_0x1eef> >> catch(:abort) { }
<ruby[bot]> _0x1eef: # => nil (https://carc.in/#/r/gxds)
<_0x1eef> >> catch(:abort) { 123 }
<ruby[bot]> _0x1eef: # => 123 (https://carc.in/#/r/gxdt)
<_0x1eef> Seemingly the default is whatever the block returns
<_0x1eef> This returns a lot of hits in bundled gems: find ~/git/github.com/0x1eef/ -name *.rb -exec fgrep -rn throw {} \; ... minitest, activemodel, active record. It's way more used than I ever realized.
<_0x1eef> Sequel, too
desnudopenguino has quit [Ping timeout: 246 seconds]
jenrzzz has quit [Ping timeout: 264 seconds]
<adam12> Sometimes I use it in a deep iterator if I'm lazy.
<adam12> It'll yield an arg too which is handy. catch { |found| one.each { two.each { three.each { throw found, value if value == something } } }
desnudopenguino has joined #ruby
<konsolebox> Took me a bit to realize you guys weren't talking about exceptions. It's been a while since I used throw/catch. I used the pair once to imitate bash's continue 2 or break 2. It's unfortunate Ruby doesn't have that feature.
<konsolebox> Writing loop blocks as methods instead doesn't make the code simpler as you'll be forced to use a flag variable either way.
<adam12> konsolebox: These are lighter than exceptions. afaik, no stack trace is generated.
osc4rpt has quit [Quit: leaving]
jenrzzz has joined #ruby
Linux_Kerio has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 268 seconds]
szkl has quit [Quit: Connection closed for inactivity]
cappy has joined #ruby
donofrio has quit [Read error: Connection reset by peer]
donofrio has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
wyclif has quit [Quit: leaving]
ih8u has quit [Remote host closed the connection]
entropy has joined #ruby
entropie has quit [Ping timeout: 264 seconds]
entropy is now known as entropie
rvalue has quit [Remote host closed the connection]
rvalue has joined #ruby
jenrzzz has joined #ruby
eoli3n has quit [Read error: Connection reset by peer]
donofrio has quit [Ping timeout: 256 seconds]
jenrzzz has quit [Ping timeout: 255 seconds]
eoli3n has joined #ruby
donofrio has joined #ruby
___nick___ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
c10l has quit [Quit: Ping timeout (120 seconds)]
c10l has joined #ruby
user71 has quit [Quit: Leaving]
infernix has quit [Ping timeout: 272 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
infernix has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Client Quit]
infernix has quit [Quit: ZNC - http://znc.sourceforge.net]
donofrio has quit [Remote host closed the connection]
infernix has joined #ruby
weaksauce has quit [Quit: Textual IRC Client: www.textualapp.com]
rvalue- has joined #ruby
rvalue has quit [Ping timeout: 268 seconds]
weaksauce has joined #ruby
rvalue- is now known as rvalue
cappy has quit [Quit: Leaving]
TomyWork has quit [Remote host closed the connection]
TomyLobo has joined #ruby
konsolebox has quit [Ping timeout: 246 seconds]
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
brw has quit [Quit: The Lounge - https://thelounge.chat]
brw has joined #ruby
inline_ has quit [Remote host closed the connection]
inline_ has joined #ruby