00:05
dionysus69 has quit [Ping timeout: 268 seconds]
00:20
eddof13 has joined #ruby
00:21
eddof13 has quit [Client Quit]
00:42
nirvdrum has joined #ruby
00:51
<
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
00:51
kaivai has quit [Ping timeout: 268 seconds]
00:56
adam12 has joined #ruby
01:00
jpn has quit [Ping timeout: 252 seconds]
01:08
RickHull has quit [Ping timeout: 244 seconds]
01:27
jpn has joined #ruby
01:37
jpn has quit [Ping timeout: 260 seconds]
01:51
jpn has joined #ruby
01:58
jpn has quit [Ping timeout: 268 seconds]
02:12
gcd has quit [Ping timeout: 252 seconds]
02:12
markong has quit [Ping timeout: 268 seconds]
02:13
gcd has joined #ruby
02:16
desnudopenguino has quit [Ping timeout: 244 seconds]
02:22
TomyLobo has quit [Quit: Leaving]
02:26
jpn has joined #ruby
02:27
desnudopenguino has joined #ruby
02:31
jpn has quit [Ping timeout: 244 seconds]
02:47
jetchisel has quit [Ping timeout: 265 seconds]
02:50
jetchisel has joined #ruby
03:01
jpn has joined #ruby
03:11
jpn has quit [Ping timeout: 244 seconds]
03:28
jpn has joined #ruby
03:33
jpn has quit [Ping timeout: 250 seconds]
03:46
sagax has quit [Ping timeout: 260 seconds]
04:03
John_Ivan has quit [Read error: Connection reset by peer]
04:03
John_Ivan has joined #ruby
04:05
sagax has joined #ruby
04:08
mitt3ns has joined #ruby
04:15
ur5us has quit [Ping timeout: 246 seconds]
04:23
jpn has joined #ruby
04:28
jpn has quit [Ping timeout: 268 seconds]
04:39
fef has joined #ruby
04:43
fef has quit [Ping timeout: 258 seconds]
04:44
swaggboi has quit [Ping timeout: 244 seconds]
04:44
swaggboi has joined #ruby
05:17
jpn has joined #ruby
05:22
jpn has quit [Ping timeout: 268 seconds]
05:24
ur5us has joined #ruby
05:24
Guimauve has joined #ruby
05:26
Guest84 has joined #ruby
05:26
<
Guest84 >
Is ruby 3 and good?
05:29
Guest84 has quit [Quit: Client closed]
05:31
Guest84 has joined #ruby
05:41
Guest84 has quit [K-Lined]
05:51
reset has joined #ruby
06:06
howdoi has quit [Quit: Connection closed for inactivity]
06:30
rvalue has quit [Read error: Connection reset by peer]
06:30
rvalue has joined #ruby
06:35
Zerock has quit [Ping timeout: 265 seconds]
06:39
ur5us has quit [Ping timeout: 250 seconds]
06:41
Zerock has joined #ruby
06:50
moldorcoder7 has joined #ruby
06:55
jpn has joined #ruby
07:01
jpn has quit [Ping timeout: 265 seconds]
07:02
rvalue has quit [Ping timeout: 246 seconds]
07:03
Rounin has joined #ruby
07:03
Rounin has quit [Changing host]
07:03
Rounin has joined #ruby
07:04
kristianpaul has quit [Ping timeout: 264 seconds]
07:08
kristianpaul has joined #ruby
07:25
CrazyEddy has joined #ruby
07:32
ur5us has joined #ruby
07:44
dionysus69 has joined #ruby
07:48
dionysus69 has quit [Read error: Connection reset by peer]
07:48
dionysus69 has joined #ruby
08:07
dionysus69 has quit [Quit: dionysus69]
08:08
dionysus69 has joined #ruby
08:12
dionysus69 has quit [Ping timeout: 246 seconds]
08:12
TomyWork has joined #ruby
08:13
dionysus69 has joined #ruby
08:27
dionysus69 has quit [Quit: dionysus69]
08:27
dionysus70 has joined #ruby
08:30
dionysus70 is now known as dionysus69
08:41
jvalleroy has joined #ruby
08:44
dionysus69 has quit [Quit: dionysus69]
08:44
dionysus69 has joined #ruby
08:47
dionysus69 has quit [Remote host closed the connection]
08:48
dionysus69 has joined #ruby
08:56
dionysus69 has quit [Remote host closed the connection]
08:56
dionysus69 has joined #ruby
09:00
rvalue has joined #ruby
09:16
dionysus69 has quit [Read error: Connection reset by peer]
09:16
jpn has joined #ruby
09:16
dionysus70 has joined #ruby
09:18
dionysus70 is now known as dionysus69
09:26
ur5us has quit [Ping timeout: 246 seconds]
09:53
Guimauve has quit [Quit: Client closed]
09:54
Guimauve has joined #ruby
10:02
dionysus69 has quit [Quit: dionysus69]
10:02
dionysus69 has joined #ruby
10:54
phenom_ has quit [Ping timeout: 255 seconds]
10:55
phenom has joined #ruby
11:14
fef has joined #ruby
11:16
dionysus69 has quit [Ping timeout: 264 seconds]
11:19
Guimauve has quit [Quit: Client closed]
11:40
markong has joined #ruby
12:00
nirvdrum has quit [Quit: nirvdrum]
12:04
markong has quit [Ping timeout: 250 seconds]
12:13
Sankalp has quit [Ping timeout: 260 seconds]
12:17
markong has joined #ruby
12:22
dionysus69 has joined #ruby
12:22
Sankalp has joined #ruby
12:31
RickHull has joined #ruby
12:36
Laplace has joined #ruby
12:58
RickHull has quit [Quit: Leaving]
12:59
John_Ivan has quit [Read error: Connection reset by peer]
12:59
John_Ivan has joined #ruby
13:42
dionysus69 has quit [Remote host closed the connection]
13:43
dionysus69 has joined #ruby
13:44
Vaevictus has joined #ruby
13:44
<
Vaevictus >
I just found a mistake in a rubydoc for string in 3.1.2 ... what's the best way to report that?
13:44
yxhuvud has quit [Read error: Connection reset by peer]
13:45
yxhuvud has joined #ruby
13:46
<
havenwood >
sam113101: It works on my machine in both IRB and Pry, FWIW. What versions of Ruby and Pry?
13:47
<
Vaevictus >
it's stupid minor
13:47
<
Vaevictus >
3rd line of the example's output is wrong
13:49
<
havenwood >
Vaevictus: So it is! Oops.
13:50
<
havenwood >
Not fixed on the main branch either, so a PR makes sense.
13:51
<
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
13:52
<
havenwood >
Good catch.
13:53
<
havenwood >
I mean indeed does modify the receiver*, when the example output current wrongly acts like it doesn't.
13:55
<
Vaevictus >
maybe that was a change meant for the previous section
13:59
John_Ivan has quit [Read error: Connection reset by peer]
14:00
John_Ivan has joined #ruby
14:05
John_Ivan has quit [Ping timeout: 265 seconds]
14:33
nirvdrum has joined #ruby
14:34
nirvdrum has quit [Client Quit]
14:42
joto has joined #ruby
14:45
<
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) }
14:45
<
joto >
is there such a function like "sum" ?
14:47
dionysus69 has quit [Ping timeout: 268 seconds]
15:17
<
adam12 >
joto: Ruby version?
15:18
<
adam12 >
joto: Technically your solution should work, but it depends on your Ruby version.
15:20
<
joto >
I'm going to try it out in that case. My Ruby version is the latest one: 3.1.2
15:22
<
joto >
["pointer1", "pointer2].sum { |pointer| lookup_number(pointer) } > 0 ? "Amount is bigger than zero" : "Amount is zero"
15:22
<
joto >
that's my full version
15:23
<
adam12 >
joto: Why are you `sum`'ing a String?
15:23
<
adam12 >
joto: What does `lookup_number(pointer)` do?
15:31
<
joto >
it returns an integer :)
15:32
<
joto >
I believe this is the most concinse way of doing it in Ruby right?
15:40
<
adam12 >
joto: Oh, I'm sorry.
15:41
<
adam12 >
joto: I see you close the block before the ternary. I missed it the first time.
15:49
John_Ivan has joined #ruby
16:26
Laplace has quit [Quit: Connection closed for inactivity]
16:28
<
joto >
adam12, no problem. I am glad you responded. I'm a noob :)
16:46
eddof13 has joined #ruby
16:50
eddof13 has quit [Client Quit]
16:51
eddof13 has joined #ruby
16:52
<
havenwood >
joto: I'd suggest `.positive?` instead of ` > 0` but I agree it looks fine.
16:53
<
havenwood >
joto: You can use positional block arguments if you want to be a bit more concise, but I like naming `|pointer|` just fine.
16:54
<
havenwood >
joto: [foo, bar].sum { lookup_number(_1) }.positive?
16:54
eddof13 has quit [Client Quit]
16:58
eddof13 has joined #ruby
17:04
eddof13 has quit [Ping timeout: 265 seconds]
17:04
jpn has quit [Ping timeout: 268 seconds]
17:12
ur5us has joined #ruby
17:14
eddof13 has joined #ruby
17:14
eddof13 has quit [Read error: Connection reset by peer]
17:19
sympt has joined #ruby
17:23
eddof13 has joined #ruby
17:24
eddof13 has quit [Client Quit]
17:35
<
Vaevictus >
havenwood: sorry, i couldn't find the code for that rubydoc to make a PR for it
17:44
joto has quit [Ping timeout: 252 seconds]
17:49
<
Vaevictus >
and there it is, thanks
17:53
fef has quit [Quit: Killer]
18:02
markong has quit [Ping timeout: 248 seconds]
18:14
ur5us has quit [Ping timeout: 244 seconds]
18:21
nirvdrum has joined #ruby
18:26
nirvdrum has quit [Ping timeout: 264 seconds]
18:35
_ht has joined #ruby
18:44
skuntee4 has joined #ruby
18:52
skuntee4 has quit [Ping timeout: 268 seconds]
18:56
TomyWork has quit [Remote host closed the connection]
19:20
Aminda has quit [Remote host closed the connection]
19:21
Aminda has joined #ruby
19:27
wra1th has joined #ruby
19:28
skuntee4 has joined #ruby
19:33
scuntee5 has joined #ruby
19:35
skuntee4 has quit [Ping timeout: 252 seconds]
19:35
scuntee5 has quit [Client Quit]
19:35
skuntee4 has joined #ruby
19:41
skuntee4 has quit [Ping timeout: 244 seconds]
19:53
polishdub has quit [Ping timeout: 264 seconds]
19:55
polishdub has joined #ruby
19:55
ur5us has joined #ruby
20:00
_ht has quit [Quit: _ht]
20:00
polishdub has quit [Remote host closed the connection]
20:24
eddof13 has joined #ruby
20:28
Al2O3 has joined #ruby
20:28
eddof13 has quit [Client Quit]
20:30
eddof13 has joined #ruby
20:35
nirvdrum has joined #ruby
20:42
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
20:45
Aminda has quit [Ping timeout: 258 seconds]
20:47
Aminda has joined #ruby
20:50
jpn has joined #ruby
20:51
eddof13 has joined #ruby
20:53
eddof13 has quit [Client Quit]
20:54
eddof13 has joined #ruby
20:56
markong has joined #ruby
20:59
mitt3ns has quit [Remote host closed the connection]
21:05
victori has joined #ruby
21:12
Al2O3 has quit [Ping timeout: 250 seconds]
21:21
Starfoxxes has quit [Ping timeout: 265 seconds]
21:22
Starfoxxes has joined #ruby
21:24
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
21:26
Aminda has quit [Ping timeout: 258 seconds]
21:27
Aminda has joined #ruby
21:34
ur5us has quit [Remote host closed the connection]
21:34
ur5us has joined #ruby
21:45
jpn has quit [Ping timeout: 268 seconds]
21:54
ur5us has quit [Remote host closed the connection]
21:55
ur5us has joined #ruby
22:07
reset has quit [Quit: reset]
22:12
jpn has joined #ruby
22:16
BSaboia has joined #ruby
22:19
jpn has quit [Ping timeout: 265 seconds]
22:34
jpn has joined #ruby
22:44
jpn has quit [Ping timeout: 265 seconds]
22:49
smp has joined #ruby
23:06
desnudopenguino has quit [Ping timeout: 244 seconds]
23:12
desnudopenguino has joined #ruby
23:16
jpn has joined #ruby
23:16
Aminda has quit [Ping timeout: 258 seconds]
23:18
Aminda has joined #ruby
23:21
jpn has quit [Ping timeout: 265 seconds]
23:44
Rounin has quit [Ping timeout: 252 seconds]
23:48
tsujp has quit [Read error: Connection reset by peer]
23:48
tsujp has joined #ruby
23:48
jpn has joined #ruby
23:49
kapil has joined #ruby
23:49
robotmay has quit [Quit: No Ping reply in 180 seconds.]
23:51
robotmay has joined #ruby
23:53
Al2O3 has joined #ruby
23:53
jpn has quit [Ping timeout: 246 seconds]
23:54
nirvdrum has quit [Quit: nirvdrum]