jhass[m] changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.1.2, 3.0.4, 2.7.6: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ
dionysus69 has quit [Ping timeout: 268 seconds]
eddof13 has joined #ruby
eddof13 has quit [Client Quit]
nirvdrum has joined #ruby
<sam113101> when I'm in pry and I type (0..10).up<tab> there's "upper_bound" in the list, but when I try it it says undefined method
kaivai has quit [Ping timeout: 268 seconds]
adam12 has quit [Quit: The Lounge - https://thelounge.chat]
adam12 has joined #ruby
jpn has quit [Ping timeout: 252 seconds]
RickHull has quit [Ping timeout: 244 seconds]
jpn has joined #ruby
jpn has quit [Ping timeout: 260 seconds]
jpn has joined #ruby
jpn has quit [Ping timeout: 268 seconds]
gcd has quit [Ping timeout: 252 seconds]
markong has quit [Ping timeout: 268 seconds]
gcd has joined #ruby
desnudopenguino has quit [Ping timeout: 244 seconds]
TomyLobo has quit [Quit: Leaving]
jpn has joined #ruby
desnudopenguino has joined #ruby
jpn has quit [Ping timeout: 244 seconds]
jetchisel has quit [Ping timeout: 265 seconds]
jetchisel has joined #ruby
jpn has joined #ruby
jpn has quit [Ping timeout: 244 seconds]
jpn has joined #ruby
jpn has quit [Ping timeout: 250 seconds]
sagax has quit [Ping timeout: 260 seconds]
John_Ivan has quit [Read error: Connection reset by peer]
John_Ivan has joined #ruby
sagax has joined #ruby
mitt3ns has joined #ruby
ur5us has quit [Ping timeout: 246 seconds]
jpn has joined #ruby
jpn has quit [Ping timeout: 268 seconds]
fef has joined #ruby
fef has quit [Ping timeout: 258 seconds]
swaggboi has quit [Ping timeout: 244 seconds]
swaggboi has joined #ruby
jpn has joined #ruby
jpn has quit [Ping timeout: 268 seconds]
ur5us has joined #ruby
Guimauve has joined #ruby
Guest84 has joined #ruby
<Guest84> Is ruby 3 and good?
Guest84 has quit [Quit: Client closed]
Guest84 has joined #ruby
Guest84 has quit [K-Lined]
reset has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
Zerock has quit [Ping timeout: 265 seconds]
ur5us has quit [Ping timeout: 250 seconds]
Zerock has joined #ruby
moldorcoder7 has joined #ruby
jpn has joined #ruby
jpn has quit [Ping timeout: 265 seconds]
rvalue has quit [Ping timeout: 246 seconds]
Rounin has joined #ruby
Rounin has quit [Changing host]
Rounin has joined #ruby
kristianpaul has quit [Ping timeout: 264 seconds]
kristianpaul has joined #ruby
CrazyEddy has joined #ruby
ur5us has joined #ruby
dionysus69 has joined #ruby
dionysus69 has quit [Read error: Connection reset by peer]
dionysus69 has joined #ruby
dionysus69 has quit [Quit: dionysus69]
dionysus69 has joined #ruby
dionysus69 has quit [Ping timeout: 246 seconds]
TomyWork has joined #ruby
dionysus69 has joined #ruby
dionysus69 has quit [Quit: dionysus69]
dionysus70 has joined #ruby
dionysus70 is now known as dionysus69
jvalleroy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
jvalleroy has joined #ruby
dionysus69 has quit [Quit: dionysus69]
dionysus69 has joined #ruby
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
rvalue has joined #ruby
dionysus69 has quit [Read error: Connection reset by peer]
jpn has joined #ruby
dionysus70 has joined #ruby
dionysus70 is now known as dionysus69
ur5us has quit [Ping timeout: 246 seconds]
Guimauve has quit [Quit: Client closed]
Guimauve has joined #ruby
dionysus69 has quit [Quit: dionysus69]
dionysus69 has joined #ruby
phenom_ has quit [Ping timeout: 255 seconds]
phenom has joined #ruby
fef has joined #ruby
dionysus69 has quit [Ping timeout: 264 seconds]
Guimauve has quit [Quit: Client closed]
markong has joined #ruby
nirvdrum has quit [Quit: nirvdrum]
markong has quit [Ping timeout: 250 seconds]
Sankalp has quit [Ping timeout: 260 seconds]
markong has joined #ruby
dionysus69 has joined #ruby
Sankalp has joined #ruby
RickHull has joined #ruby
Laplace has joined #ruby
RickHull has quit [Quit: Leaving]
John_Ivan has quit [Read error: Connection reset by peer]
John_Ivan has joined #ruby
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
Vaevictus has joined #ruby
<Vaevictus> I just found a mistake in a rubydoc for string in 3.1.2 ... what's the best way to report that?
yxhuvud has quit [Read error: Connection reset by peer]
yxhuvud has joined #ruby
<havenwood> sam113101: It works on my machine in both IRB and Pry, FWIW. What versions of Ruby and Pry?
<havenwood> Vaevictus: I think bugs.rubylang.org would be the best place to report or maybe a GitHub PR, depending on how minor: https://bugs.ruby-lang.org/projects/ruby/wiki/HowToReport
<Vaevictus> it's stupid minor
<Vaevictus> 3rd line of the example's output is wrong
<havenwood> Vaevictus: So it is! Oops.
<havenwood> Not fixed on the main branch either, so a PR makes sense.
<havenwood> Vaevictus: I'd suggest a PR with the correction and brief explanation that it's meant to show modifying the receiver and indeed does. https://github.com/ruby/ruby
<havenwood> Good catch.
<havenwood> I mean indeed does modify the receiver*, when the example output current wrongly acts like it doesn't.
<Vaevictus> maybe that was a change meant for the previous section
John_Ivan has quit [Read error: Connection reset by peer]
John_Ivan has joined #ruby
John_Ivan has quit [Ping timeout: 265 seconds]
nirvdrum has joined #ruby
nirvdrum has quit [Client Quit]
joto has joined #ruby
<joto> Hi guys. I have two objects that contain a number. I would like to make the sum of these numbers like so: ["pointer1", "pointer2].sum { |pointer| lookup_number(pointer) }
<joto> is there such a function like "sum" ?
dionysus69 has quit [Ping timeout: 268 seconds]
<adam12> joto: Ruby version?
<adam12> joto: Technically your solution should work, but it depends on your Ruby version.
<joto> ah cool
<joto> I'm going to try it out in that case. My Ruby version is the latest one: 3.1.2
<joto> ["pointer1", "pointer2].sum { |pointer| lookup_number(pointer) } > 0 ? "Amount is bigger than zero" : "Amount is zero"
<joto> that's my full version
<adam12> joto: Why are you `sum`'ing a String?
<adam12> joto: What does `lookup_number(pointer)` do?
<joto> it returns an integer :)
<joto> I believe this is the most concinse way of doing it in Ruby right?
<adam12> joto: Oh, I'm sorry.
<adam12> joto: I see you close the block before the ternary. I missed it the first time.
John_Ivan has joined #ruby
Laplace has quit [Quit: Connection closed for inactivity]
<joto> adam12, no problem. I am glad you responded. I'm a noob :)
eddof13 has joined #ruby
eddof13 has quit [Client Quit]
eddof13 has joined #ruby
<havenwood> joto: I'd suggest `.positive?` instead of ` > 0` but I agree it looks fine.
<havenwood> joto: You can use positional block arguments if you want to be a bit more concise, but I like naming `|pointer|` just fine.
<havenwood> joto: [foo, bar].sum { lookup_number(_1) }.positive?
eddof13 has quit [Client Quit]
eddof13 has joined #ruby
eddof13 has quit [Ping timeout: 265 seconds]
jpn has quit [Ping timeout: 268 seconds]
ur5us has joined #ruby
eddof13 has joined #ruby
eddof13 has quit [Read error: Connection reset by peer]
sympt has joined #ruby
eddof13 has joined #ruby
eddof13 has quit [Client Quit]
<Vaevictus> havenwood: sorry, i couldn't find the code for that rubydoc to make a PR for it
joto has quit [Ping timeout: 252 seconds]
<Vaevictus> and there it is, thanks
fef has quit [Quit: Killer]
markong has quit [Ping timeout: 248 seconds]
ur5us has quit [Ping timeout: 244 seconds]
nirvdrum has joined #ruby
nirvdrum has quit [Ping timeout: 264 seconds]
_ht has joined #ruby
skuntee4 has joined #ruby
skuntee4 has quit [Ping timeout: 268 seconds]
TomyWork has quit [Remote host closed the connection]
Aminda has quit [Remote host closed the connection]
Aminda has joined #ruby
wra1th has joined #ruby
skuntee4 has joined #ruby
scuntee5 has joined #ruby
skuntee4 has quit [Ping timeout: 252 seconds]
scuntee5 has quit [Client Quit]
skuntee4 has joined #ruby
skuntee4 has quit [Ping timeout: 244 seconds]
polishdub has quit [Ping timeout: 264 seconds]
polishdub has joined #ruby
ur5us has joined #ruby
_ht has quit [Quit: _ht]
polishdub has quit [Remote host closed the connection]
eddof13 has joined #ruby
Al2O3 has joined #ruby
eddof13 has quit [Client Quit]
eddof13 has joined #ruby
nirvdrum has joined #ruby
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Aminda has quit [Ping timeout: 258 seconds]
Aminda has joined #ruby
jpn has joined #ruby
eddof13 has joined #ruby
eddof13 has quit [Client Quit]
eddof13 has joined #ruby
markong has joined #ruby
mitt3ns has quit [Remote host closed the connection]
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
victori has quit [Quit: ZNC 1.8.2 - https://znc.in]
victori has joined #ruby
Al2O3 has quit [Ping timeout: 250 seconds]
Starfoxxes has quit [Ping timeout: 265 seconds]
Starfoxxes has joined #ruby
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Aminda has quit [Ping timeout: 258 seconds]
Aminda has joined #ruby
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
jpn has quit [Ping timeout: 268 seconds]
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
reset has quit [Quit: reset]
jpn has joined #ruby
BSaboia has quit [Quit: ZNC - https://znc.in]
BSaboia has joined #ruby
jpn has quit [Ping timeout: 265 seconds]
jpn has joined #ruby
jpn has quit [Ping timeout: 265 seconds]
smp has quit [Quit: ZNC 1.8.2 - https://znc.in]
smp has joined #ruby
desnudopenguino has quit [Ping timeout: 244 seconds]
desnudopenguino has joined #ruby
jpn has joined #ruby
Aminda has quit [Ping timeout: 258 seconds]
Aminda has joined #ruby
jpn has quit [Ping timeout: 265 seconds]
Rounin has quit [Ping timeout: 252 seconds]
tsujp has quit [Read error: Connection reset by peer]
tsujp has joined #ruby
jpn has joined #ruby
kapil_ has quit [Quit: ZNC 1.7.5+deb4 - https://znc.in]
kapil has joined #ruby
robotmay has quit [Quit: No Ping reply in 180 seconds.]
robotmay has joined #ruby
Al2O3 has joined #ruby
jpn has quit [Ping timeout: 246 seconds]
nirvdrum has quit [Quit: nirvdrum]