00:00
FullMetalStacker has quit [Remote host closed the connection]
00:01
ignorand_ has joined #ruby
00:02
Ignorand has quit [Remote host closed the connection]
00:09
xalynn has joined #ruby
00:12
xalynn has left #ruby [Leaving]
00:15
Ignorand has joined #ruby
00:17
ignorand_ has quit [Ping timeout: 250 seconds]
00:21
mretka has quit [Quit: WeeChat 2.8]
00:25
miriam has joined #ruby
00:25
miriam is now known as mretka
00:26
mretka has quit [Changing host]
00:26
mretka has joined #ruby
00:36
CrazyEddy has quit [Ping timeout: 248 seconds]
00:39
mretka has quit [Quit: WeeChat 2.8]
00:41
ignorand_ has joined #ruby
00:41
mretka has joined #ruby
00:43
Ignorand has quit [Ping timeout: 255 seconds]
00:52
CrazyEddy has joined #ruby
00:58
unblig61 has joined #ruby
01:01
Julida87 has joined #ruby
01:02
nannan16 has joined #ruby
01:02
victori has quit [Remote host closed the connection]
01:05
Julida87 has quit [Ping timeout: 240 seconds]
01:05
unblig61 has quit [Ping timeout: 240 seconds]
01:06
victori has joined #ruby
01:18
Pastorinni has quit [Remote host closed the connection]
01:19
bambanxx has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
01:20
victori has joined #ruby
01:23
bambanxx has joined #ruby
01:24
Evertonlc has quit [Quit: Client closed]
01:31
victori has joined #ruby
01:45
nannan16 has quit [Ping timeout: 240 seconds]
01:49
Dooky has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
01:52
Pastorinni has joined #ruby
01:54
bambanxx has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
02:05
Pastorinni has quit [Ping timeout: 246 seconds]
02:11
ignorand_ has quit [Ping timeout: 252 seconds]
02:34
Pastorinni has joined #ruby
02:43
Pastorinni has quit [Ping timeout: 260 seconds]
02:48
gabrielcsf has quit [Remote host closed the connection]
02:48
gabrielcsf has joined #ruby
02:56
moldorcoder7 has quit [Ping timeout: 255 seconds]
02:58
Pastorinni has joined #ruby
03:11
ap4y has joined #ruby
03:25
madprops has joined #ruby
03:25
<
madprops >
line.gsub(/function \((.*)\)/, "(\1) =>")
03:25
<
madprops >
i can't use the \1 ... it's always empty
03:26
<
madprops >
function (a, b) for example
03:26
<
madprops >
i would expect a, b
03:26
<
madprops >
(a, b) =>
03:26
<
madprops >
but it always throws () =>
03:27
<
gr33n7007h >
madprops: has to be single quotes for back references
03:28
<
madprops >
ohhh.. why is that?
03:28
<
gr33n7007h >
madprops: haven't a clue.
03:30
<
gr33n7007h >
actually, my bad... you have to escape \1 like \\1 with double quotes.
03:31
<
madprops >
single quotes worked though
03:31
<
madprops >
im ok with either
03:32
<
gr33n7007h >
nice 😃
03:35
Pastorinni has quit [Ping timeout: 246 seconds]
03:50
ap4y has quit [Remote host closed the connection]
04:00
mooff has quit [Remote host closed the connection]
04:04
mooff has joined #ruby
04:29
Pastorinni has joined #ruby
04:34
Pastorinni has quit [Ping timeout: 265 seconds]
04:40
jhass has quit [Ping timeout: 276 seconds]
04:42
jhass has joined #ruby
04:50
Pastorinni has joined #ruby
04:51
jhass has quit [Ping timeout: 252 seconds]
04:52
jhass has joined #ruby
04:55
otisolsen70 has joined #ruby
05:06
Pastorinni has quit [Ping timeout: 246 seconds]
05:19
Pastorinni has joined #ruby
05:35
grenierm has joined #ruby
05:35
mexen has joined #ruby
05:39
Pastorinni has quit [Ping timeout: 248 seconds]
05:55
Pastorinni has joined #ruby
05:59
gr33n7007h has quit [Ping timeout: 240 seconds]
06:01
gr33n7007h has joined #ruby
06:06
roadie has joined #ruby
06:40
Pastorinni has quit [Ping timeout: 252 seconds]
06:54
mooff has quit [Remote host closed the connection]
06:55
mooff has joined #ruby
07:08
Pastorinni has joined #ruby
07:11
Thiago23 has joined #ruby
07:16
Pastorinni has quit [Ping timeout: 265 seconds]
07:46
Pastorinni has joined #ruby
07:54
shokohsc4 has joined #ruby
07:54
shokohsc has quit [Ping timeout: 255 seconds]
07:54
shokohsc4 is now known as shokohsc
07:55
grenierm has quit [Ping timeout: 245 seconds]
07:57
Pastorinni has quit [Ping timeout: 260 seconds]
07:57
teclator has joined #ruby
08:00
TomyWork has joined #ruby
08:01
_ht has joined #ruby
08:11
Pastorinni has joined #ruby
08:18
Pastorinni has quit [Ping timeout: 252 seconds]
08:21
jvalleroy has joined #ruby
08:31
crespire1 has joined #ruby
08:31
crespire has quit [Killed (NickServ (GHOST command used by crespire1))]
08:31
crespire has joined #ruby
08:35
crespire1 has quit [Ping timeout: 252 seconds]
08:52
Linux_Kerio has joined #ruby
08:55
Linux_Kerio has quit [Read error: Connection reset by peer]
08:56
Linux_Kerio has joined #ruby
09:05
Bish has quit [Ping timeout: 240 seconds]
09:06
Bish has joined #ruby
09:11
Ignorand has joined #ruby
09:14
lena64t has quit [Ping timeout: 240 seconds]
09:17
lena64t has joined #ruby
09:17
FullMetalStacker has joined #ruby
09:24
ignorand_ has joined #ruby
09:28
Ignorand has quit [Ping timeout: 264 seconds]
09:41
Thiago23 has quit [Quit: Client closed]
09:47
ignorand__ has joined #ruby
09:51
ignorand_ has quit [Ping timeout: 248 seconds]
10:00
ignorand_ has joined #ruby
10:02
thomas25 has quit [Ping timeout: 248 seconds]
10:03
ignorand__ has quit [Ping timeout: 240 seconds]
10:03
hightower3 has joined #ruby
10:05
hightower2 has quit [Ping timeout: 276 seconds]
10:17
Pastorinni has joined #ruby
10:25
Pastorinni has quit [Ping timeout: 246 seconds]
10:44
Malin has quit [Quit: Ping timeout (120 seconds)]
10:47
Malin has joined #ruby
10:47
Malin has quit [Client Quit]
11:01
Pastorinni has joined #ruby
11:02
gemmaro has joined #ruby
11:03
moldorcoder7 has joined #ruby
11:05
Pastorinni has quit [Ping timeout: 252 seconds]
11:31
dminuoso has joined #ruby
11:32
<
dminuoso >
Havent done Ruby for a bunch of years, and I stumbled over this construct
11:32
<
dminuoso >
name { "Friendly User" }
11:32
<
dminuoso >
What is this?
11:34
<
dminuoso >
Or hold on, is this just an argumentless block?
11:38
Malin has joined #ruby
11:38
bambanxx has joined #ruby
12:01
Dooky has joined #ruby
12:04
gemmaro has quit [Remote host closed the connection]
12:10
Bruno29 has joined #ruby
12:20
Bruno29 has quit [Quit: Client closed]
12:23
Sankalp has quit [Ping timeout: 255 seconds]
12:24
Sankalp has joined #ruby
12:33
crespire1 has joined #ruby
12:33
crespire has quit [Killed (NickServ (GHOST command used by crespire1))]
12:38
Evertonlc has joined #ruby
12:42
ignorand_ has quit [Ping timeout: 248 seconds]
12:46
<
dminuoso >
I guess that's one way to get lazyness into a language.
12:53
gemmaro has joined #ruby
12:54
cek has joined #ruby
12:56
Evertonlc has quit [Quit: Client closed]
12:56
Evertonlc has joined #ruby
13:00
infinityfye has joined #ruby
13:00
Pastorinni has joined #ruby
13:14
donofrio_ has joined #ruby
13:14
donofrio__ has joined #ruby
13:17
John_Ivan has quit [Quit: Phantom of the future.]
13:17
John_Ivan has joined #ruby
13:17
donofrio has quit [Ping timeout: 250 seconds]
13:18
donofrio_ has quit [Ping timeout: 252 seconds]
13:30
thomas25 has joined #ruby
13:49
Ignorand has joined #ruby
13:54
luffy[m]1 has quit [Ping timeout: 246 seconds]
13:54
flan[m] has quit [Ping timeout: 246 seconds]
13:57
ignorand_ has joined #ruby
14:01
Ignorand has quit [Ping timeout: 276 seconds]
14:04
ignorand__ has joined #ruby
14:05
ignorand_ has quit [Read error: Connection reset by peer]
14:06
ignorand_ has joined #ruby
14:09
ignorand__ has quit [Ping timeout: 276 seconds]
14:12
flan[m] has joined #ruby
14:29
CrazyEddy has quit [Ping timeout: 248 seconds]
14:32
CrazyEddy has joined #ruby
14:33
<
ox1eef_ >
FactoryBot uses that pattern quite a lot.
14:33
luffy[m]1 has joined #ruby
14:43
tomtmym has joined #ruby
14:43
tomtmym has quit [Changing host]
14:43
tomtmym has joined #ruby
14:45
bambanxx has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
14:46
sugges has joined #ruby
14:50
jvalleroy has joined #ruby
15:01
sunshi72 has joined #ruby
15:04
sugges has quit [Ping timeout: 246 seconds]
15:05
sunshi72 has quit [Ping timeout: 246 seconds]
15:25
Sheilong has joined #ruby
15:36
johnjay has quit [Read error: Connection reset by peer]
15:40
Thiago92 has joined #ruby
15:46
shokohsc has quit [Ping timeout: 250 seconds]
15:49
shokohsc has joined #ruby
15:51
TomyWork has quit [Remote host closed the connection]
15:53
teclator has quit [Ping timeout: 276 seconds]
16:07
roadie has quit [Quit: ERC 5.5 (IRC client for GNU Emacs 29.0.90)]
16:09
Doc_XI has joined #ruby
16:09
roadie has joined #ruby
16:32
ignorand_ has quit [Ping timeout: 276 seconds]
16:40
bambanxx has joined #ruby
16:41
RDSM is now known as RDSM
16:42
moldorcoder7 has quit [Ping timeout: 240 seconds]
16:50
Evertonlc has quit [Quit: Client closed]
16:50
Evertonlc has joined #ruby
17:28
<
isene >
How do I change a variable containing the integer 644 to 0644 (required for input when using File.chmod)?
17:28
<
leah2 >
>> 644.to_s.to_i(8) == 0644
17:49
Bruno34 has joined #ruby
17:53
bambanxx has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
18:05
Dooky_ has joined #ruby
18:06
Dooky has quit [Ping timeout: 252 seconds]
18:06
AlexBrownSobinec has joined #ruby
18:06
<
AlexBrownSobinec >
Yo
18:09
Thiago92 has quit [Quit: Client closed]
18:12
Doc_XI has quit [Ping timeout: 276 seconds]
18:14
Dooky has joined #ruby
18:24
<
adam12 >
AlexBrownSobinec: yo
18:42
<
isene >
leah2: Excellent. Thanks.
18:46
<
isene >
If there is a specific place in the code that requires a module to be loaded - is it better for performance to require that module at that place rather than require it generally at the top/beginning of the code?
18:48
<
weaksauce >
depends on what performance you are looking to optimize for
18:48
<
weaksauce >
you could just autoload it
18:53
<
adam12 >
isene: Autoload or require it inside the method that needs it.
18:54
John_Ivan_ has joined #ruby
18:57
Doc_X has joined #ruby
18:57
ele_mesmo has joined #ruby
18:58
John_Ivan has quit [Ping timeout: 246 seconds]
18:59
<
ox1eef_ >
isene: That depends if you want to optimize boot time or runtime. If you want to optimize runtime performance, require towards the top of the file.
19:02
<
weaksauce >
yeah it depends on when you want the parsing hit to occur
19:02
<
weaksauce >
and memory hit of having it loaded
19:02
<
weaksauce >
(though that's likely small)
19:21
Pastorinni has quit [Remote host closed the connection]
19:21
bambanxx has joined #ruby
19:23
Pastorinni has joined #ruby
19:23
Pastorinni has quit [Client Quit]
19:25
Bruno34 has quit [Ping timeout: 245 seconds]
19:34
cek has quit [Quit: Connection closed for inactivity]
19:44
bambanxx has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
19:46
shokohsc has quit [Read error: Connection reset by peer]
19:48
Evertonlc has quit [Quit: Client closed]
19:49
ele_mesmo has quit [Quit: Client closed]
19:51
shokohsc has joined #ruby
20:28
_ht has quit [Quit: _ht]
20:42
<
isene >
OK, I'm this case, the boot time is more important, and that function is rarely invoked. But it would only load it once even though the require 'etc' is encountered every time the function is invoked, right?
20:43
<
isene >
s/ I'm/ in/
21:00
otisolsen70 has quit [Quit: Leaving]
21:04
<
weaksauce >
correct
21:05
<
weaksauce >
it would just return false every time you call it after the first one
21:09
lena64t has quit [Ping timeout: 240 seconds]
21:10
lena64t has joined #ruby
21:10
<
ox1eef_ >
IIRC requires checks $LOADED_FEATURES every time, so it does have an extra cost each time it is called. I wouldn't try to optimize that much until performance is actually a problem.
21:12
<
isene >
Excellent. Thanks for the answers.
21:13
<
weaksauce >
you could do a feature loaded flag to conditionally require it so it's just a small hit if performance was a thing or just autoload it once at the start and you don't have to worry about it
21:13
<
weaksauce >
require 'foo' unless @feature_loaded
21:13
<
ox1eef_ >
You could be solving a problem that doesn't exist though.
21:14
<
ox1eef_ >
For the sake of the conversation, require_relative won't walk $LOAD_PATH.
21:18
roadie has quit [Remote host closed the connection]
21:20
lunks has joined #ruby
21:25
tomtmym has quit [Quit: Gone.]
21:31
moldorcoder7 has joined #ruby
21:49
mretka_mobile has joined #ruby
21:50
mretka_mobile70 has joined #ruby
21:51
mretka_mobile70 has quit [Client Quit]
21:54
mretka_mobile has quit [Ping timeout: 245 seconds]
21:54
mexen has quit [Quit: Connection closed for inactivity]
22:00
ruby[bot] has quit [Remote host closed the connection]
22:00
ruby[bot] has joined #ruby
22:01
Ignorand has joined #ruby
22:22
Linux_Kerio has quit [Ping timeout: 252 seconds]
22:33
bambanxx has joined #ruby
22:46
lunks has quit [Quit: Client closed]
23:31
bambanxx has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
23:45
Sankalp has quit [Ping timeout: 248 seconds]
23:47
kaivai has quit [Excess Flood]
23:47
kaivai has joined #ruby
23:51
Al2O3 has quit [Ping timeout: 260 seconds]