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!
dasher00 has quit [Ping timeout: 240 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
teardown has joined #ruby
teardown has quit [Read error: Connection reset by peer]
Scriptonaut has quit [Changing host]
Scriptonaut has joined #ruby
cd has joined #ruby
teardown has joined #ruby
teardown has quit [Read error: Connection reset by peer]
dfucci has joined #ruby
teardown has joined #ruby
teardown has quit [Read error: Connection reset by peer]
dfucci has quit [Ping timeout: 256 seconds]
<havenwood> istrasci: #nan? isn't the *only* way but it's the straightforward way
yokel has joined #ruby
<istrasci> havenwood: OK, thank you for your help and examples.
zacts has joined #ruby
teardown has joined #ruby
teardown has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
drincruz has joined #ruby
teardown has joined #ruby
teardown has quit [Read error: Connection reset by peer]
johndotpub_ has joined #ruby
darris_ has joined #ruby
johndotpub has quit [Quit: /dev/zero]
darris has quit [Quit: Bye bye!]
ropeney has quit [Quit: ZNC 1.7.4 - https://znc.in]
endorama has quit [Remote host closed the connection]
ropeney_ has joined #ruby
darris_ is now known as darris
teardown has joined #ruby
teardown has quit [Read error: Connection reset by peer]
endorama has joined #ruby
jud has quit [Quit: Leaving]
yokel has quit [Ping timeout: 258 seconds]
cd has quit [Quit: cd]
bmurt has joined #ruby
gueorgui_ has joined #ruby
Secret-Fire has quit [Remote host closed the connection]
gueorgui has quit [Ping timeout: 246 seconds]
istrasci has quit [Remote host closed the connection]
meinside has joined #ruby
drincruz has quit [Ping timeout: 246 seconds]
teardown has joined #ruby
teardown has quit [Read error: Connection reset by peer]
zacts has quit [Ping timeout: 240 seconds]
Secret-Fire has joined #ruby
yokel has joined #ruby
Secret-Fire has quit [Remote host closed the connection]
Secret-Fire has joined #ruby
Rudd0 has quit [Remote host closed the connection]
<nakilon> it is just because NaN by definition means that the value can't be determined so you can't say if it's equal to anything or not
teardown has joined #ruby
<nakilon> not sure why INFINITY == INFINITY though
teardown has quit [Read error: Connection reset by peer]
<nakilon> if they were equal then subtracting one from another had to be zero
yokel has quit [Ping timeout: 258 seconds]
teardown has joined #ruby
teardown has quit [Read error: Connection reset by peer]
yokel has joined #ruby
teardown has joined #ruby
teardown has quit [Read error: Connection reset by peer]
teardown has joined #ruby
teardown has quit [Read error: Connection reset by peer]
bruce_lee has quit [Ping timeout: 244 seconds]
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
bruce_lee has joined #ruby
yokel has quit [Ping timeout: 260 seconds]
teardown has joined #ruby
teardown has quit [Read error: Connection reset by peer]
teardown has joined #ruby
TCZ has quit [Quit: Leaving]
teardown has quit [Read error: Connection reset by peer]
alexherbo2 has quit [Ping timeout: 244 seconds]
bkuhlmann has joined #ruby
teardown has joined #ruby
teardown has quit [Read error: Connection reset by peer]
yokel has joined #ruby
iamse7en has joined #ruby
<havenwood> nakilon: In the IEEE spec, positive infinity is represented by the 7f800000 hex bit pattern. So one infinity is the same as another, for a Float at least.
<havenwood> nakilon: Quiet NaNs are hex bit patterns between 7FC00000 and 7FFFFFFF.
akem_ has joined #ruby
<havenwood> Oh, wait, Ruby uses Float doubles.
<havenwood> So infinity is 7FF0000000000000 and NaN is between 7FF8000000000000 and 7FFFFFFFFFFFFFFF.
akem has quit [Ping timeout: 256 seconds]
<havenwood> Anyway, Floats are strange.
<havenwood> I prefer not to use them since I typically don't do anything involving floating point operations.
<havenwood> nakilon: The spec also says positive infinity plus negative infinity is NaN.
<iamse7en> Can someone please help me with nokogiri? any doc.xpath searching yields nothing. what am I doing wrong? doc = Nokogiri::XML(open("https://api.linesfeed.info/v1/pregames/lines/pu?sport=Basketball"))
teardown has joined #ruby
teardown has quit [Read error: Connection reset by peer]
justache has quit [Remote host closed the connection]
justache has joined #ruby
<go|dfish> iamse7en: looks like this api is "smart"
<go|dfish> it seems to be sending back different formats depending on User-Agent (or some other header)
<iamse7en> go|dfish: interesting, suggestions on how I can parse it then search with xpath?
<go|dfish> try just: open("https://api.linesfeed.info/v1/pregames/lines/pu?sport=Basketball") and you'll get JSON data back
dan64- has joined #ruby
<havenwood> go|dfish: Nokogiri is for XML.
teardown has joined #ruby
teardown has quit [Read error: Connection reset by peer]
<go|dfish> yes indeed
<havenwood> go|dfish: require 'json'; require 'open-uri'; JSON.parse URI.open 'https://api.linesfeed.in
<havenwood> fo/v1/pregames/lines/pu?sport=Basketball', &:read
<go|dfish> iamse7en: looks like you need to force the Accept header to get xml back, Accept: application/xml
<havenwood> go|dfish: Oops
<havenwood> go|dfish: I got confused on nicks.
<havenwood> iamse7en: require 'json'; require 'open-uri'; JSON.parse URI.open 'https://api.linesfeed.info/v1/pregames/lines/pu?sport=Basketball';, &:read
dan64- has quit [Client Quit]
<havenwood> iamse7en: Since it's JSON, just use JSON from the stdlib and leave Nokogiri out of it.
dan64 has quit [Ping timeout: 240 seconds]
<iamse7en> I already have a bunch of existing code that uses .xpath to iterate throughout the document. If I use JSON, can I still use existing code or must I re-write it all
dan64- has joined #ruby
dan64- has quit [Remote host closed the connection]
<iamse7en> They updated the API recently
<havenwood> iamse7en: Then as go|dfish suggests, set Accept to application/xml.
<havenwood> require 'nokogiri'; require 'open-uri'; doc = Nokogiri::XML URI.open 'https://api.linesfeed.info/v1/pregames/lines/pu?sport=Basketball';, 'Accept' => 'application/xml', &:read
<havenwood> iamse7en: ^
<iamse7en> ahh beautiful. thank you havenwood go|dfish !
yokel has quit [Ping timeout: 260 seconds]
Tempesta_ has joined #ruby
sh7d has quit [Quit: meh]
Tempesta has quit [Ping timeout: 244 seconds]
cthu| has quit [Ping timeout: 258 seconds]
Tempesta_ has quit [Ping timeout: 240 seconds]
sh7d has joined #ruby
yokel has joined #ruby
gix has quit [Ping timeout: 264 seconds]
kinduff4 has joined #ruby
drincruz has joined #ruby
kinduff has quit [Ping timeout: 265 seconds]
kinduff4 is now known as kinduff
wallace_mu has quit [Remote host closed the connection]
elxbarbosa has joined #ruby
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
iamse7en has quit [Quit: I'm out like a black kid in a spelling bee.]
<elxbarbosa> hey, why proc lambdas assigned to var cant read instances variables?
ramfjord has quit [Ping timeout: 264 seconds]
wallace_mu has joined #ruby
<elxbarbosa> I get that lambda has its own scope, but it seems there is no instance closure, is it?
yokel has quit [Ping timeout: 244 seconds]
wallace_mu has quit [Ping timeout: 260 seconds]
justache has quit [Remote host closed the connection]
justache has joined #ruby
bkuhlmann has quit []
yokel has joined #ruby
roshanavand_ has joined #ruby
roshanavand has quit [Ping timeout: 244 seconds]
roshanavand_ is now known as roshanavand
jwt has joined #ruby
zacts has joined #ruby
yokel has quit [Ping timeout: 258 seconds]
elxbarbo` has joined #ruby
elxbarbo` has quit [Remote host closed the connection]
yokel has joined #ruby
elxbarbosa has quit [Ping timeout: 240 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yokel has quit [Ping timeout: 244 seconds]
jwt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sgen has joined #ruby
adu has joined #ruby
Tempesta has joined #ruby
adu has quit [Ping timeout: 240 seconds]
jwt has joined #ruby
ramfjord has joined #ruby
FrankyCyborg has joined #ruby
<apotheon> I'm not sure exactly what elxbarbosa meant, but I see the ability to access instance variables just fine: http://sprunge.us/a7K6to
justache has quit [Remote host closed the connection]
Rudd0 has joined #ruby
yokel has joined #ruby
justache has joined #ruby
kinduff has quit [Ping timeout: 240 seconds]
kinduff9 has joined #ruby
yokel has quit [Ping timeout: 244 seconds]
FrankyCyborg has quit [Ping timeout: 244 seconds]
FankyCyborg2 has joined #ruby
cadeskywalker has quit [Ping timeout: 244 seconds]
cadeskywalker has joined #ruby
roshanavand_ has joined #ruby
ropeney_ has quit [Ping timeout: 265 seconds]
roshanavand has quit [Read error: Connection reset by peer]
roshanavand_ is now known as roshanavand
ropeney has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
justache has quit [Remote host closed the connection]
justache has joined #ruby
teardown has joined #ruby
ropeney has quit [Ping timeout: 258 seconds]
ropeney has joined #ruby
jwt has quit [Remote host closed the connection]
jwt has joined #ruby
sgen has quit [Ping timeout: 244 seconds]
ropeney_ has joined #ruby
ropeney has quit [Ping timeout: 260 seconds]
wallace_mu has joined #ruby
yokel has joined #ruby
ChmEarl has quit [Quit: Leaving]
wallace_mu has quit [Ping timeout: 258 seconds]
jwt has quit [Quit: Textual IRC Client: www.textualapp.com]
yokel has quit [Ping timeout: 244 seconds]
<leftylink> the one time in my life I wish I could use &.-= ... as in, `remaining &.-= 1`. instead, i have to go with `remaining -= 1 if remaining`
jwt has joined #ruby
ur5us has quit [Ping timeout: 244 seconds]
<leftylink> nah, I'll have remaining be a reasonable value so that I just do `remaining -= 1` unconditionally
<havenwood> leftylink: Yeah, that sounds like a nice thing to do—ensuring `remaining` is an Integer.
<FankyCyborg2> or... propose a change to Ruby, regarding their syntax
<havenwood> *almost* everything is an object :)
<leftylink> you know what else we can't do... we can't use the result of a ternary as an lvalue
<leftylink> so I can't do `([true, false].sample ? var1 : var2) = 5` to randomly assign 5 to either var1 or var2. what a shame.
<leftylink> or ([true, false].sample ? var1 : var2) += 5 to randomly increment one of the two
<leftylink> it's okay, I've only ever wanted to do that once in my life
<FankyCyborg2> sometimes I think about what would happen, when we merge Perl, Python, PHP and Ruby ... will it become C++ ? or better/worse?
nofxx has quit [Remote host closed the connection]
BSaboia has joined #ruby
roadt_ has joined #ruby
nofxx has joined #ruby
<havenwood> leftylink: vars = {var1: 42, var2: 0}; vars[vars.keys.sample] += 5
roadt has quit [Ping timeout: 258 seconds]
<havenwood> leftylink: While we wait on macros... you can:
<havenwood> %i[var1 var2].sample.then { |var| binding.local_variable_set var, binding.local_variable_get(var) + 5 }
nofxx has quit [Remote host closed the connection]
nofxx has joined #ruby
yokel has joined #ruby
smtlassezfaire has joined #ruby
bocaneri has joined #ruby
elxbarbosa has joined #ruby
jwt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yokel has quit [Ping timeout: 244 seconds]
jwt has joined #ruby
jwt has quit [Client Quit]
Secret-Fire has quit [Remote host closed the connection]
dfucci has joined #ruby
yokel has joined #ruby
chalkmonster has joined #ruby
xco has joined #ruby
BSaboia has quit [Quit: This computer has gone to sleep]
Secret-Fire has joined #ruby
Mikaela has quit [Ping timeout: 240 seconds]
yokel has quit [Ping timeout: 256 seconds]
dan64 has joined #ruby
drincruz has quit [Ping timeout: 240 seconds]
yokel has joined #ruby
kent\n has quit [Ping timeout: 260 seconds]
kent\n has joined #ruby
vondruch has quit [Quit: vondruch]
yokel has quit [Ping timeout: 240 seconds]
vondruch has joined #ruby
Rudd0 has quit [Ping timeout: 256 seconds]
yasumi2136 has joined #ruby
BSaboia has joined #ruby
wallace_mu has joined #ruby
akem_ is now known as akem
cliluw has quit [Ping timeout: 244 seconds]
cliluw has joined #ruby
wallace_mu has quit [Ping timeout: 244 seconds]
schne1der has joined #ruby
yasumi2136 has quit [Remote host closed the connection]
smtlassezfaire has quit [Quit: smtlassezfaire]
dasher00 has joined #ruby
yokel has joined #ruby
elxbarbosa has quit [Ping timeout: 244 seconds]
roadt_ has quit [Quit: 离开]
roadt has joined #ruby
jud has joined #ruby
yokel has quit [Ping timeout: 244 seconds]
donofrio_ has quit [Remote host closed the connection]
yokel has joined #ruby
ujjain2 has joined #ruby
yokel has quit [Ping timeout: 256 seconds]
yokel has joined #ruby
akem_ has joined #ruby
akem has quit [Ping timeout: 240 seconds]
ur5us has joined #ruby
yokel has quit [Ping timeout: 244 seconds]
yokel has joined #ruby
mikecmpbll has joined #ruby
yokel has quit [Ping timeout: 244 seconds]
mcspud is now known as mookdups
ujjain2 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
supercoven has joined #ruby
ujjain2 has joined #ruby
supercoven has quit [Read error: Connection reset by peer]
akem_ has quit [Ping timeout: 265 seconds]
supercoven has joined #ruby
Xiti has quit [Quit: Leaving]
akem has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
teclator has joined #ruby
wallace_mu has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
yokel has joined #ruby
wallace_mu has quit [Ping timeout: 260 seconds]
schne1der has quit [Ping timeout: 244 seconds]
dionysus69 has joined #ruby
yokel has quit [Ping timeout: 265 seconds]
yokel has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
_aeris_ has quit [Remote host closed the connection]
_aeris_ has joined #ruby
vqrs has quit [Ping timeout: 260 seconds]
vqrs has joined #ruby
TCZ has joined #ruby
yokel has quit [Ping timeout: 244 seconds]
alexherbo2 has joined #ruby
yokel has joined #ruby
zapata has joined #ruby
Rudd0 has joined #ruby
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
yokel has quit [Ping timeout: 256 seconds]
yokel has joined #ruby
mikecmpbll has quit [Ping timeout: 264 seconds]
sarna has joined #ruby
BSaboia has quit [Quit: Leaving]
BSaboia has joined #ruby
skyline199476 has joined #ruby
akem has quit [Ping timeout: 256 seconds]
yokel has quit [Ping timeout: 244 seconds]
mikecmpbll has joined #ruby
Mikaela has joined #ruby
skyline199476 has quit [Ping timeout: 256 seconds]
dfucci has quit [Ping timeout: 264 seconds]
mikecmpbll has quit [Remote host closed the connection]
dfucci has joined #ruby
braincrash has joined #ruby
wallace_mu has joined #ruby
ujjain2 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
schne1der has joined #ruby
akem has joined #ruby
wallace_mu has quit [Ping timeout: 265 seconds]
vondruch_ has joined #ruby
jordanm has quit [Remote host closed the connection]
jordanm has joined #ruby
yokel has joined #ruby
vondruch has quit [Ping timeout: 256 seconds]
vondruch_ is now known as vondruch
yokel has quit [Ping timeout: 256 seconds]
imode has quit [Ping timeout: 260 seconds]
braincrash has quit [Ping timeout: 244 seconds]
BlakSAM has joined #ruby
yokel has joined #ruby
sh7d has quit [Ping timeout: 240 seconds]
sh7d has joined #ruby
ellcs has joined #ruby
ujjain2 has joined #ruby
jordanm has quit [Read error: Connection reset by peer]
jordanm has joined #ruby
_aeris_ has quit [Remote host closed the connection]
_aeris_ has joined #ruby
ellcs has quit [Ping timeout: 244 seconds]
yokel has quit [Ping timeout: 246 seconds]
Ediz has joined #ruby
fcserr has quit [Read error: Connection reset by peer]
dualfade has quit [Ping timeout: 240 seconds]
dualfade has joined #ruby
yokel has joined #ruby
ujjain2 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
elcuervo has quit [Read error: Connection reset by peer]
elcuervo has joined #ruby
ujjain2 has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
yokel has quit [Ping timeout: 260 seconds]
braincrash has joined #ruby
meinside has quit [Quit: Connection closed for inactivity]
wallace_mu has joined #ruby
TCZ has quit [Quit: Leaving]
ujjain2 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yokel has joined #ruby
silviu has quit [Remote host closed the connection]
silviu has joined #ruby
sgen has joined #ruby
yokel has quit [Ping timeout: 260 seconds]
ujjain2 has joined #ruby
johndotpub_ has quit [Quit: /dev/zero]
johndotpub has joined #ruby
ujjain2 has quit [Read error: Connection reset by peer]
drincruz has joined #ruby
TCZ has joined #ruby
yokel has joined #ruby
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
yokel has quit [Ping timeout: 246 seconds]
jhass has quit [Quit: Bye]
jhass has joined #ruby
donofrio has joined #ruby
yokel has joined #ruby
pjdavis has joined #ruby
yokel has quit [Ping timeout: 240 seconds]
inerthia has joined #ruby
yokel has joined #ruby
BlakSAM has quit [Ping timeout: 256 seconds]
BlakSAM has joined #ruby
sgen has quit [Ping timeout: 260 seconds]
rafadc has quit [Quit: ZNC - https://znc.in]
schne1der has quit [Ping timeout: 244 seconds]
yokel has quit [Ping timeout: 244 seconds]
ruurd has quit [Quit: bye folks]
akem has quit [Ping timeout: 244 seconds]
rafadc has joined #ruby
wildtrees has joined #ruby
ChmEarl has joined #ruby
alexherbo26 has joined #ruby
alexherbo2 has quit [Ping timeout: 244 seconds]
cadeskywalker has quit [Ping timeout: 244 seconds]
alexherbo26 is now known as alexherbo2
Mikaela has quit [Ping timeout: 240 seconds]
Lyubo1 has quit [Ping timeout: 244 seconds]
Mikaela has joined #ruby
Lyubo1 has joined #ruby
bmurt has joined #ruby
sarna has quit [Quit: Connection closed]
siasmj_ has joined #ruby
rhe has joined #ruby
zapata_ has joined #ruby
strmpnk_ has joined #ruby
jetpack_joe_ has joined #ruby
jerme__ has joined #ruby
alnk_ has joined #ruby
ghormoon_ has joined #ruby
ReinH__ has joined #ruby
Chew_ has joined #ruby
nyuszika7h has joined #ruby
jnoon_ has joined #ruby
coffeejunk_ has joined #ruby
podman_ has joined #ruby
Spitfire_ has joined #ruby
Spitfire_ has joined #ruby
Spitfire_ has quit [Changing host]
graphicsv_ has joined #ruby
Querens_ has joined #ruby
Rush_ has joined #ruby
Rush__ has joined #ruby
EvilJStoker has quit [Ping timeout: 272 seconds]
noodle has quit [Ping timeout: 272 seconds]
marahin has quit [Ping timeout: 272 seconds]
Spitfire has quit [Ping timeout: 272 seconds]
graphicsv has quit [Ping timeout: 272 seconds]
siasmj has quit [Ping timeout: 272 seconds]
strmpnk has quit [Ping timeout: 272 seconds]
GGMethos has quit [Ping timeout: 272 seconds]
ReinH_ has quit [Ping timeout: 272 seconds]
rhe_ has quit [Ping timeout: 272 seconds]
jerme_ has quit [Ping timeout: 272 seconds]
Chew has quit [Ping timeout: 272 seconds]
jnoon has quit [Ping timeout: 272 seconds]
jetpack_joe has quit [Ping timeout: 272 seconds]
podman has quit [Ping timeout: 272 seconds]
zapata has quit [Ping timeout: 272 seconds]
kashike has quit [Ping timeout: 272 seconds]
Hien has quit [Ping timeout: 272 seconds]
leah2 has quit [Ping timeout: 272 seconds]
coffeejunk has quit [Ping timeout: 272 seconds]
arekushi has quit [Ping timeout: 272 seconds]
Querens has quit [Ping timeout: 272 seconds]
alnk has quit [Ping timeout: 272 seconds]
RushPL has quit [Ping timeout: 272 seconds]
ghormoon has quit [Ping timeout: 272 seconds]
timmow_ has quit [Ping timeout: 272 seconds]
foolish has quit [Ping timeout: 272 seconds]
Rush has quit [Ping timeout: 272 seconds]
siasmj_ is now known as siasmj
Hien_ has joined #ruby
strmpnk_ is now known as strmpnk
jerme__ is now known as jerme_
podman_ is now known as podman
Chew_ is now known as Chew
coffeejunk_ is now known as coffeejunk
graphicsv_ is now known as graphicsv
jetpack_joe_ is now known as jetpack_joe
jnoon_ is now known as jnoon
alnk_ is now known as alnk
timmow has joined #ruby
wildtrees has quit [Remote host closed the connection]
noodle has joined #ruby
wildtrees has joined #ruby
GGMethos has joined #ruby
inerthia has quit [Quit: Textual IRC Client: www.textualapp.com]
cadeskywalker has joined #ruby
marahin has joined #ruby
wildtrees has quit [Max SendQ exceeded]
marahin has quit [Changing host]
marahin has joined #ruby
wildtrees has joined #ruby
EvilJStoker has joined #ruby
kashike has joined #ruby
leah2 has joined #ruby
TCZ has quit [Quit: Leaving]
howdoi has joined #ruby
ellcs has joined #ruby
pjdavis has quit []
BH23 has quit [Read error: Connection reset by peer]
Ediz has quit [Remote host closed the connection]
Ediz has joined #ruby
Ediz is now known as Guest16698
leitz has joined #ruby
Guest16698 has quit [Remote host closed the connection]
Guest16698 has joined #ruby
BlakSAM has quit [Ping timeout: 256 seconds]
BlakSAM has joined #ruby
lucasb has joined #ruby
<leitz> Newbie question, getting a syntax error on ",". How do i do the insert with multiple value sets? It works with a single value pair. insert into countries (country_code, country_name) values (('gb', 'Great Britan'), ('de', 'Germany'));
<leitz> Err...I should check the channel....
TCZ has joined #ruby
Guest16698 has quit [Remote host closed the connection]
Guest16698 has joined #ruby
yasumi2136 has joined #ruby
alexherbo2 has quit [Ping timeout: 256 seconds]
dionysus69 has quit [Ping timeout: 246 seconds]
akem has joined #ruby
yasumi2136 has quit [Client Quit]
cd has joined #ruby
yokel has joined #ruby
yasumi2136 has joined #ruby
yokel has quit [Ping timeout: 258 seconds]
ellcs has quit [Remote host closed the connection]
wildtrees has quit [Remote host closed the connection]
wildtrees has joined #ruby
yasumi2136 has quit [Remote host closed the connection]
yasumi2136 has joined #ruby
yokel has joined #ruby
ujjain2 has joined #ruby
ellcs has joined #ruby
yokel has quit [Ping timeout: 260 seconds]
kerframil has joined #ruby
yasumi2136 has quit [Remote host closed the connection]
yasumi2136 has joined #ruby
yokel has joined #ruby
dfucci has quit [Read error: Connection reset by peer]
dfucci has joined #ruby
ruurd has joined #ruby
ellcs has quit [Ping timeout: 244 seconds]
yokel has quit [Ping timeout: 256 seconds]
yasumi2136 has quit [Remote host closed the connection]
BlakSAM has quit [Quit: leaving]
BTRE has quit [Remote host closed the connection]
BTRE has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zapata_ is now known as zapata
cthu| has joined #ruby
schne1der has joined #ruby
TCZ has quit [Quit: Leaving]
yokel has joined #ruby
andremedeiros has quit [Quit: ZNC 1.8.2 - https://znc.in]
andremedeiros has joined #ruby
gix has joined #ruby
alexherbo2 has joined #ruby
yokel has quit [Ping timeout: 272 seconds]
chalkmonster has quit [Quit: WeeChat 2.9]
chalkmonster has joined #ruby
chalkmonster has quit [Client Quit]
chalkmonster has joined #ruby
chalkmonster has quit [Client Quit]
ramfjord has joined #ruby
zacts has quit [Quit: leaving]
yokel has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yokel has quit [Ping timeout: 260 seconds]
imode has joined #ruby
Spitfire_ is now known as Spitfire
yokel has joined #ruby
MrCrackPot has quit [Remote host closed the connection]
ujjain2 has quit [Quit: Textual IRC Client: www.textualapp.com]
wildtrees has quit [Remote host closed the connection]
bmurt has joined #ruby
<jrhorn424> Suppose I want to rescue multiple error. Will ruby rescue the most specific error, least specific error, or will it try to rescue in order? Example: `rescue NoMethodError, NameError, StandardError => e`. If the block throws other `StandardError`s, are they caught? If it throws `NameError`, will it be caught as `NameError` or `StandardError`?
wildtrees has joined #ruby
impermanence has joined #ruby
schne1der has quit [Ping timeout: 272 seconds]
yokel has quit [Ping timeout: 256 seconds]
jenrzzz has quit [Ping timeout: 244 seconds]
MrCrackPot has joined #ruby
MrCrackPot has quit [Client Quit]
yokel has joined #ruby
ediz_ has joined #ruby
Guest16698 has quit [Ping timeout: 256 seconds]
zacts has joined #ruby
Technodrome has joined #ruby
rippa has joined #ruby
sepp2k has joined #ruby
yokel has quit [Ping timeout: 256 seconds]
yokel has joined #ruby
ediz_ has quit [Read error: Connection reset by peer]
Ediz has joined #ruby
Ediz is now known as Guest12856
<adam12> jrhorn424: AFAIK, they are tried in order without specificity. It would be up to you to set the specificity.
<adam12> jrhorn424: I can't seem to find where `rescue` is defined, but looking at the instruction sequence generated by something like `begin; rescue NameError, Standarderror => e; end`, it just loops through the list of classes.
yokel has quit [Ping timeout: 240 seconds]
<adam12> jrhorn424: In your example, I believe NoMethodError and NameError both inherit from StandardError, so you could in theory just `rescue => e` then `case e` if you had to do anything with a specific type of exception.
justache has quit [Read error: Connection reset by peer]
justache has joined #ruby
wildtrees has quit [Quit: Leaving]
bocaneri has quit [Read error: Connection reset by peer]
zacts has quit [Quit: leaving]
dfucci has quit [Ping timeout: 240 seconds]
go|dfish has quit [Ping timeout: 260 seconds]
cd has quit [Quit: cd]
go|dfish has joined #ruby
yokel has joined #ruby
jenrzzz has joined #ruby
wimpog has joined #ruby
<wimpog> what's the difference between `rescue => e` and `rescue Exception => e`?
<jhass> wimpog: rescue => e is equivalent to rescue StandardError => e
<wimpog> jhass: so it captures more errors than `rescue Exception => e` ?
<jhass> no, less, StandardError is below Exception in the hierarchy
<jhass> https://rubyapi.org/2.7/o/exception check "Built-In"
yokel has quit [Ping timeout: 256 seconds]
<wimpog> jhass: I see. So it is better to use `rescue Exception => e` if I want to capture more errors?
<jhass> it's generally a smell, because there's quite some exceptions you generally don't want to catch and can make stopping your program difficult. Again reference above list for details
vondruch has quit [Ping timeout: 256 seconds]
<jhass> I like being as specific as sensible, as it nicely documents which error cases I expect
<wimpog> Thank you, jhass! I don't know yet what more specific should be, so I want to capture all and see how to make it more precise
yokel has joined #ruby
<jhass> for developing/testing fine, for deployment I would highly recommend you to invest a) into a supervisor that can restart your program on crashes, if it's long running (say a webserver) b) into an error monitoring solution (sentry, honeybadger etc)
<jhass> and then just deploy with the most specific error cases you know and know how to handle and just let it crash and report for the stuff you didn't expect yet
impermanence56 has joined #ruby
skape has joined #ruby
impermanence44 has joined #ruby
impermanence56 has quit [Client Quit]
impermanence44 has quit [Client Quit]
impermanence40 has joined #ruby
<wimpog> thanks, jhass
akem has quit [Quit: Leaving]
dionysus69 has joined #ruby
impermanence has quit [Ping timeout: 244 seconds]
Guest12856 has quit [Read error: Connection reset by peer]
Ediz has joined #ruby
Ediz is now known as Guest40325
yokel has quit [Ping timeout: 272 seconds]
yokel has joined #ruby
wimpog has quit [Quit: wimpog]
zacts has joined #ruby
justache has quit [Remote host closed the connection]
yokel has quit [Ping timeout: 272 seconds]
kerframil has quit [Ping timeout: 272 seconds]
justache has joined #ruby
<jrhorn424> Thank you adam12! Good point about `case`. Cheers
TCZ has joined #ruby
kaleido has quit [Remote host closed the connection]
wildtrees has joined #ruby
dionysus69 has quit [Remote host closed the connection]
kaleido has joined #ruby
kaleido has quit [Changing host]
kaleido has joined #ruby
yokel has joined #ruby
supercoven has quit [Ping timeout: 256 seconds]
yokel has quit [Ping timeout: 256 seconds]
cnsvc has joined #ruby
yokel has joined #ruby
yokel has quit [Ping timeout: 246 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
Guest40325 has quit [Read error: Connection reset by peer]
Guest40325 has joined #ruby
kerframil has joined #ruby
schne1der has joined #ruby
imode has quit [Ping timeout: 246 seconds]
yokel has joined #ruby
jenrzzz has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
roshanavand has quit [Ping timeout: 256 seconds]
yokel has quit [Ping timeout: 265 seconds]
akem has joined #ruby
DTZUZU_ has quit [Read error: Connection reset by peer]
zacts has quit [Ping timeout: 246 seconds]
DTZUZU has joined #ruby
yokel has joined #ruby
dfucci has joined #ruby
yokel has quit [Ping timeout: 256 seconds]
zacts has joined #ruby
Nerium has joined #ruby
dfucci has quit [Ping timeout: 246 seconds]
ellcs has joined #ruby
elcuervo has quit [Ping timeout: 258 seconds]
Nerium has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zacts has quit [Quit: leaving]
zacts has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wildtrees has quit [Quit: Leaving]
bmurt has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cow[moo] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ule has quit [Ping timeout: 256 seconds]
ule has joined #ruby
yokel has joined #ruby
Guest40325 has quit [Read error: Connection reset by peer]
Ediz has joined #ruby
Ediz is now known as Guest35032
sgen has joined #ruby
ur5us has joined #ruby
leitz has quit [Quit: Leaving]
yokel has quit [Ping timeout: 265 seconds]
TCZ has quit [Quit: Leaving]
yokel has joined #ruby
alexherbo2 has quit [Ping timeout: 256 seconds]
yokel has quit [Ping timeout: 240 seconds]
TCZ has joined #ruby
roshanavand has joined #ruby
roshanavand_ has joined #ruby
roshanavand has quit [Ping timeout: 244 seconds]
roshanavand_ is now known as roshanavand
impermanence has joined #ruby
schne1der has quit [Ping timeout: 272 seconds]
gix has quit [Ping timeout: 256 seconds]
gix has joined #ruby
impermanence40 has quit [Ping timeout: 260 seconds]
alexherbo2 has joined #ruby
yokel has joined #ruby
yokel has quit [Ping timeout: 240 seconds]
dfucci has joined #ruby
yokel has joined #ruby
zacts has quit [Quit: leaving]
dfucci has quit [Ping timeout: 264 seconds]
zacts has joined #ruby
alexherbo20 has joined #ruby
yokel has quit [Ping timeout: 260 seconds]
alexherbo2 has quit [Ping timeout: 264 seconds]
alexherbo20 is now known as alexherbo2
ellcs has quit [Ping timeout: 244 seconds]
yokel has joined #ruby
hiroaki has quit [Ping timeout: 240 seconds]
sgen has quit [Ping timeout: 260 seconds]
akem_ has joined #ruby
akem has quit [Ping timeout: 256 seconds]
zacts has quit [Quit: leaving]
zacts has joined #ruby
dviola has quit [Quit: WeeChat 2.9]
akem_ has quit [Ping timeout: 272 seconds]
zacts has quit [Quit: leaving]
zacts has joined #ruby
roshanavand has quit [Remote host closed the connection]
sh7d has quit [Ping timeout: 240 seconds]
yokel has quit [Ping timeout: 258 seconds]
alexherbo2 has quit [Ping timeout: 258 seconds]
alexherbo2 has joined #ruby
yokel has joined #ruby
cow[moo] has joined #ruby
ramfjord has quit [Ping timeout: 264 seconds]
alexherbo2 has quit [Quit: Ping timeout (120 seconds)]
braincrash has quit [Ping timeout: 240 seconds]
alexherbo2 has joined #ruby
yokel has quit [Ping timeout: 240 seconds]
Guest35032 has quit [Ping timeout: 260 seconds]
yokel has joined #ruby
alexherbo2 has quit [Read error: Connection reset by peer]
alexherbo2 has joined #ruby
BSaboia has quit [Quit: This computer has gone to sleep]
ramfjord has joined #ruby
cow[moo] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yokel has quit [Ping timeout: 272 seconds]
alexherbo2 has quit [Quit: Ping timeout (120 seconds)]
yokel has joined #ruby
imode has joined #ruby
zacts has quit [Ping timeout: 272 seconds]
yokel has quit [Ping timeout: 272 seconds]
cow[moo] has joined #ruby