00:49
wyclif has joined #ruby
01:15
wyclif has quit [Ping timeout: 256 seconds]
01:16
wyclif has joined #ruby
01:27
Linux_Kerio has quit [Ping timeout: 264 seconds]
01:29
Munto has quit [Quit: Leaving]
01:41
wyclif has quit [Ping timeout: 268 seconds]
01:47
cappy has quit [Quit: Leaving]
01:52
wyclif has joined #ruby
02:16
brokkoli_origin has quit [Ping timeout: 255 seconds]
02:16
brokkoli_origin has joined #ruby
02:50
donofrio has joined #ruby
02:55
donofrio has quit [Ping timeout: 256 seconds]
03:48
mkoncek has quit [Ping timeout: 268 seconds]
03:52
wyclif has quit [Ping timeout: 264 seconds]
03:52
wyclif has joined #ruby
04:43
Vonter has quit [Ping timeout: 246 seconds]
04:53
Linux_Kerio has joined #ruby
04:55
cappy has joined #ruby
04:57
Vonter has joined #ruby
04:57
grenierm has joined #ruby
05:17
mkoncek has joined #ruby
05:19
wyclif has quit [Ping timeout: 240 seconds]
05:19
wyclif_ has joined #ruby
05:20
cappy has quit [Quit: Leaving]
05:28
wyclif_ has quit [Ping timeout: 252 seconds]
05:42
mkoncek has quit [Ping timeout: 252 seconds]
05:52
wyclif has joined #ruby
05:58
rvalue has quit [Read error: Connection reset by peer]
05:58
rvalue has joined #ruby
06:05
wyclif has quit [Read error: Connection reset by peer]
06:08
mkoncek has joined #ruby
06:09
konsolebox has joined #ruby
06:11
wyclif has joined #ruby
06:14
konsolebox has quit [Ping timeout: 264 seconds]
06:17
Vonter has quit [Ping timeout: 264 seconds]
06:35
wyclif has quit [Ping timeout: 260 seconds]
06:39
wyclif has joined #ruby
07:02
cappy has joined #ruby
07:11
konsolebox has joined #ruby
07:17
mjacob has quit [Read error: Connection reset by peer]
07:21
wyclif has quit [Ping timeout: 264 seconds]
07:22
mjacob has joined #ruby
07:35
Linux_Kerio has quit [Ping timeout: 264 seconds]
07:41
mange has quit [Quit: Quittin' time!]
07:49
wyclif has joined #ruby
07:56
wyclif has quit [Ping timeout: 264 seconds]
08:24
wyclif has joined #ruby
08:30
Vonter has joined #ruby
08:31
wyclif has quit [Ping timeout: 264 seconds]
08:57
Rounin has quit [Ping timeout: 255 seconds]
09:00
wyclif has joined #ruby
09:11
Rounin has joined #ruby
09:27
cappy has quit [Quit: Leaving]
09:32
donofrio has joined #ruby
09:45
Vonter has quit [Ping timeout: 252 seconds]
09:48
jenrzzz has joined #ruby
10:02
grenierm has quit [Ping timeout: 250 seconds]
10:06
Vonter has joined #ruby
10:18
xdminsy has quit [Quit: Konversation terminated!]
10:29
Vonter has quit [Ping timeout: 264 seconds]
10:33
Vonter has joined #ruby
11:05
wyclif has quit [Ping timeout: 268 seconds]
11:08
Tempesta has quit [Excess Flood]
11:14
jmcgnh has quit [Excess Flood]
11:17
Linux_Kerio has joined #ruby
11:20
wyclif has joined #ruby
11:21
gaussianblue has joined #ruby
11:25
jmcgnh has joined #ruby
11:50
wyclif has quit [Ping timeout: 240 seconds]
12:13
graaff has quit [Ping timeout: 268 seconds]
12:35
wyclif has joined #ruby
12:49
wyclif has quit [Ping timeout: 264 seconds]
13:00
wyclif has joined #ruby
13:06
wyclif has quit [Ping timeout: 255 seconds]
13:44
Tempesta has joined #ruby
13:53
wyclif has joined #ruby
14:00
wyclif has quit [Ping timeout: 264 seconds]
14:04
mkoncek has quit [Ping timeout: 260 seconds]
14:19
wyclif has joined #ruby
14:28
wyclif has quit [Ping timeout: 264 seconds]
14:42
wyclif has joined #ruby
14:50
wyclif has quit [Ping timeout: 255 seconds]
15:16
<
constxqt >
just found out about catch/throw
15:16
<
constxqt >
that's crazy...
15:20
Munto has joined #ruby
15:20
wyclif has joined #ruby
15:23
wyclif has quit [Client Quit]
15:23
wyclif has joined #ruby
15:26
otisolsen70 has joined #ruby
15:34
gaussianblue has quit [Quit: leaving]
15:40
___nick___ has joined #ruby
15:44
<
_0x1eef >
IIRC that's how Pry exits the REPL. I've found it useful as well, usually when an error doesn't quite fit.
15:48
user71 has joined #ruby
15:53
Guest94 has joined #ruby
16:01
<
konsolebox >
If you have a general Exception handler in the main function, you mostly would want SystemExit and Interrupt to be excluded from it.
16:02
szkl has joined #ruby
16:02
<
konsolebox >
Also any code that lazily just catches Exception is a sign of bad code writing.
16:04
<
konsolebox >
Even worse are those that don't handle exceptions at all.
16:12
Vonter has quit [Ping timeout: 268 seconds]
16:17
osc4rpt has joined #ruby
16:20
<
adam12 >
constxqt: catch/throw is used in Sinatra/Roda too, to exit nicely from a route block. Super handy.
16:20
<
adam12 >
catch(:halt) { serve_request } essentially
16:32
Guest94 has quit [Quit: Client closed]
16:33
___nick___ has joined #ruby
16:36
___nick___ has quit [Client Quit]
16:37
otisolsen70 has quit [Ping timeout: 268 seconds]
16:38
___nick___ has joined #ruby
16:51
graaff has joined #ruby
16:53
Exagone313 has joined #ruby
16:53
Exa has quit [Read error: Connection reset by peer]
16:55
Exagone313 is now known as Exa
16:57
desnudopenguino1 has joined #ruby
16:58
<
_0x1eef >
>> foo = catch(:abort) { throw(:abort, 123) }; foo
16:58
<
_0x1eef >
Being able to pass something back can be handy too.
16:58
desnudopenguino has quit [Ping timeout: 268 seconds]
16:58
desnudopenguino1 is now known as desnudopenguino
17:00
<
_0x1eef >
>> catch(:abort) { }
17:00
<
_0x1eef >
>> catch(:abort) { 123 }
17:00
<
_0x1eef >
Seemingly the default is whatever the block returns
17:06
<
_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.
17:07
<
_0x1eef >
Sequel, too
17:11
desnudopenguino has quit [Ping timeout: 246 seconds]
17:14
jenrzzz has quit [Ping timeout: 264 seconds]
17:14
<
adam12 >
Sometimes I use it in a deep iterator if I'm lazy.
17:15
<
adam12 >
It'll yield an arg too which is handy. catch { |found| one.each { two.each { three.each { throw found, value if value == something } } }
17:16
desnudopenguino has joined #ruby
17:16
<
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.
17:18
<
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.
17:21
<
adam12 >
konsolebox: These are lighter than exceptions. afaik, no stack trace is generated.
17:27
osc4rpt has quit [Quit: leaving]
18:00
jenrzzz has joined #ruby
18:00
Linux_Kerio has quit [Ping timeout: 240 seconds]
18:05
jenrzzz has quit [Ping timeout: 268 seconds]
18:12
szkl has quit [Quit: Connection closed for inactivity]
18:13
cappy has joined #ruby
18:14
donofrio has quit [Read error: Connection reset by peer]
18:16
donofrio has joined #ruby
18:27
jenrzzz has joined #ruby
18:32
jenrzzz has quit [Ping timeout: 268 seconds]
18:34
wyclif has quit [Quit: leaving]
18:41
ih8u has quit [Remote host closed the connection]
18:43
entropy has joined #ruby
18:43
entropie has quit [Ping timeout: 264 seconds]
18:43
entropy is now known as entropie
18:48
rvalue has quit [Remote host closed the connection]
18:49
rvalue has joined #ruby
18:52
jenrzzz has joined #ruby
18:55
eoli3n has quit [Read error: Connection reset by peer]
18:56
donofrio has quit [Ping timeout: 256 seconds]
18:58
jenrzzz has quit [Ping timeout: 255 seconds]
18:58
eoli3n has joined #ruby
19:02
donofrio has joined #ruby
19:10
jenrzzz has joined #ruby
19:14
jenrzzz has quit [Ping timeout: 240 seconds]
19:24
c10l has quit [Quit: Ping timeout (120 seconds)]
19:24
c10l has joined #ruby
19:46
user71 has quit [Quit: Leaving]
19:49
infernix has quit [Ping timeout: 272 seconds]
20:02
jenrzzz has joined #ruby
20:08
jenrzzz has quit [Ping timeout: 256 seconds]
20:19
infernix has joined #ruby
20:26
jenrzzz has joined #ruby
20:27
jenrzzz has quit [Client Quit]
20:55
donofrio has quit [Remote host closed the connection]
21:10
infernix has joined #ruby
21:21
rvalue- has joined #ruby
21:22
rvalue has quit [Ping timeout: 268 seconds]
21:24
weaksauce has joined #ruby
21:25
rvalue- is now known as rvalue
21:26
cappy has quit [Quit: Leaving]
21:41
TomyWork has quit [Remote host closed the connection]
21:42
TomyLobo has joined #ruby
21:53
konsolebox has quit [Ping timeout: 246 seconds]
22:00
ruby[bot] has quit [Remote host closed the connection]
22:00
ruby[bot] has joined #ruby
23:39
brw has joined #ruby
23:49
inline_ has quit [Remote host closed the connection]
23:49
inline_ has joined #ruby