adam12 changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.2.2, 3.1.4, 3.0.6, 2.7.8: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://t.ly/9ua4 | Logs: https://libera.irclog.whitequark.org/ruby/
FullMetalStacker has quit [Remote host closed the connection]
ignorand_ has joined #ruby
Ignorand has quit [Remote host closed the connection]
xalynn has joined #ruby
xalynn has left #ruby [Leaving]
Ignorand has joined #ruby
ignorand_ has quit [Ping timeout: 250 seconds]
mretka has quit [Quit: WeeChat 2.8]
miriam has joined #ruby
miriam is now known as mretka
mretka has quit [Changing host]
mretka has joined #ruby
CrazyEddy has quit [Ping timeout: 248 seconds]
mretka has quit [Quit: WeeChat 2.8]
ignorand_ has joined #ruby
mretka has joined #ruby
Ignorand has quit [Ping timeout: 255 seconds]
CrazyEddy has joined #ruby
unblig61 has joined #ruby
Julida87 has joined #ruby
nannan16 has joined #ruby
victori has quit [Remote host closed the connection]
Julida87 has quit [Ping timeout: 240 seconds]
unblig61 has quit [Ping timeout: 240 seconds]
victori has joined #ruby
victori has quit [Quit: ZNC 1.8.2 - https://znc.in]
Pastorinni has quit [Remote host closed the connection]
bambanxx has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
victori has joined #ruby
bambanxx has joined #ruby
Evertonlc has quit [Quit: Client closed]
victori has quit [Quit: ZNC 1.8.2 - https://znc.in]
victori has joined #ruby
nannan16 has quit [Ping timeout: 240 seconds]
Dooky has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Pastorinni has joined #ruby
bambanxx has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
Pastorinni has quit [Ping timeout: 246 seconds]
ignorand_ has quit [Ping timeout: 252 seconds]
Pastorinni has joined #ruby
Pastorinni has quit [Ping timeout: 260 seconds]
gabrielcsf has quit [Remote host closed the connection]
gabrielcsf has joined #ruby
moldorcoder7 has quit [Ping timeout: 255 seconds]
Pastorinni has joined #ruby
ap4y has joined #ruby
madprops has joined #ruby
<madprops> line.gsub(/function \((.*)\)/, "(\1) =>")
<madprops> i can't use the \1 ... it's always empty
<madprops> function (a, b) for example
<madprops> i would expect a, b
<madprops> (a, b) =>
<madprops> but it always throws () =>
<gr33n7007h> madprops: has to be single quotes for back references
<madprops> ohhh.. why is that?
<gr33n7007h> madprops: haven't a clue.
<gr33n7007h> actually, my bad... you have to escape \1 like \\1 with double quotes.
<madprops> single quotes worked though
<madprops> im ok with either
<gr33n7007h> nice 😃
Pastorinni has quit [Ping timeout: 246 seconds]
ap4y has quit [Remote host closed the connection]
mooff has quit [Remote host closed the connection]
mooff has joined #ruby
Pastorinni has joined #ruby
Pastorinni has quit [Ping timeout: 265 seconds]
jhass has quit [Ping timeout: 276 seconds]
jhass has joined #ruby
Pastorinni has joined #ruby
jhass has quit [Ping timeout: 252 seconds]
jhass has joined #ruby
otisolsen70 has joined #ruby
Pastorinni has quit [Ping timeout: 246 seconds]
Pastorinni has joined #ruby
grenierm has joined #ruby
mexen has joined #ruby
Pastorinni has quit [Ping timeout: 248 seconds]
Pastorinni has joined #ruby
gr33n7007h has quit [Ping timeout: 240 seconds]
gr33n7007h has joined #ruby
roadie has joined #ruby
Pastorinni has quit [Ping timeout: 252 seconds]
mooff has quit [Remote host closed the connection]
mooff has joined #ruby
Pastorinni has joined #ruby
Thiago23 has joined #ruby
Pastorinni has quit [Ping timeout: 265 seconds]
Pastorinni has joined #ruby
shokohsc4 has joined #ruby
shokohsc has quit [Ping timeout: 255 seconds]
shokohsc4 is now known as shokohsc
grenierm has quit [Ping timeout: 245 seconds]
Pastorinni has quit [Ping timeout: 260 seconds]
teclator has joined #ruby
TomyWork has joined #ruby
_ht has joined #ruby
Pastorinni has joined #ruby
Pastorinni has quit [Ping timeout: 252 seconds]
jvalleroy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
jvalleroy has joined #ruby
crespire1 has joined #ruby
crespire has quit [Killed (NickServ (GHOST command used by crespire1))]
crespire has joined #ruby
crespire1 has quit [Ping timeout: 252 seconds]
Linux_Kerio has joined #ruby
Linux_Kerio has quit [Read error: Connection reset by peer]
Linux_Kerio has joined #ruby
Bish has quit [Ping timeout: 240 seconds]
Bish has joined #ruby
Ignorand has joined #ruby
lena64t has quit [Ping timeout: 240 seconds]
lena64t has joined #ruby
FullMetalStacker has joined #ruby
ignorand_ has joined #ruby
Ignorand has quit [Ping timeout: 264 seconds]
Thiago23 has quit [Quit: Client closed]
ignorand__ has joined #ruby
ignorand_ has quit [Ping timeout: 248 seconds]
ignorand_ has joined #ruby
thomas25 has quit [Ping timeout: 248 seconds]
ignorand__ has quit [Ping timeout: 240 seconds]
hightower3 has joined #ruby
hightower2 has quit [Ping timeout: 276 seconds]
Pastorinni has joined #ruby
Pastorinni has quit [Ping timeout: 246 seconds]
Malin has quit [Quit: Ping timeout (120 seconds)]
Malin has joined #ruby
Malin has quit [Client Quit]
Pastorinni has joined #ruby
gemmaro has joined #ruby
moldorcoder7 has joined #ruby
Pastorinni has quit [Ping timeout: 252 seconds]
dminuoso has joined #ruby
<dminuoso> Havent done Ruby for a bunch of years, and I stumbled over this construct
<dminuoso> name { "Friendly User" }
<dminuoso> What is this?
<dminuoso> Or hold on, is this just an argumentless block?
Malin has joined #ruby
bambanxx has joined #ruby
<leah2> yes
Dooky has joined #ruby
gemmaro has quit [Remote host closed the connection]
Bruno29 has joined #ruby
Bruno29 has quit [Quit: Client closed]
Sankalp has quit [Ping timeout: 255 seconds]
Sankalp has joined #ruby
crespire1 has joined #ruby
crespire has quit [Killed (NickServ (GHOST command used by crespire1))]
Evertonlc has joined #ruby
ignorand_ has quit [Ping timeout: 248 seconds]
<dminuoso> I guess that's one way to get lazyness into a language.
gemmaro has joined #ruby
cek has joined #ruby
Evertonlc has quit [Quit: Client closed]
Evertonlc has joined #ruby
infinityfye has joined #ruby
Pastorinni has joined #ruby
donofrio_ has joined #ruby
donofrio__ has joined #ruby
John_Ivan has quit [Quit: Phantom of the future.]
John_Ivan has joined #ruby
donofrio has quit [Ping timeout: 250 seconds]
donofrio_ has quit [Ping timeout: 252 seconds]
thomas25 has joined #ruby
Ignorand has joined #ruby
FullMetalStacker has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
luffy[m]1 has quit [Ping timeout: 246 seconds]
flan[m] has quit [Ping timeout: 246 seconds]
ignorand_ has joined #ruby
Ignorand has quit [Ping timeout: 276 seconds]
ignorand__ has joined #ruby
ignorand_ has quit [Read error: Connection reset by peer]
ignorand_ has joined #ruby
ignorand__ has quit [Ping timeout: 276 seconds]
flan[m] has joined #ruby
CrazyEddy has quit [Ping timeout: 248 seconds]
CrazyEddy has joined #ruby
<ox1eef_> FactoryBot uses that pattern quite a lot.
luffy[m]1 has joined #ruby
tomtmym has joined #ruby
tomtmym has quit [Changing host]
tomtmym has joined #ruby
bambanxx has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
sugges has joined #ruby
jvalleroy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
jvalleroy has joined #ruby
sunshi72 has joined #ruby
sugges has quit [Ping timeout: 246 seconds]
sunshi72 has quit [Ping timeout: 246 seconds]
Sheilong has joined #ruby
johnjay has quit [Read error: Connection reset by peer]
Thiago92 has joined #ruby
shokohsc has quit [Ping timeout: 250 seconds]
shokohsc has joined #ruby
TomyWork has quit [Remote host closed the connection]
teclator has quit [Ping timeout: 276 seconds]
roadie has quit [Quit: ERC 5.5 (IRC client for GNU Emacs 29.0.90)]
Doc_XI has joined #ruby
roadie has joined #ruby
ignorand_ has quit [Ping timeout: 276 seconds]
bambanxx has joined #ruby
RDSM is now known as RDSM
moldorcoder7 has quit [Ping timeout: 240 seconds]
Evertonlc has quit [Quit: Client closed]
Evertonlc has joined #ruby
<adam12> gday
<lena64t> ge
<isene> How do I change a variable containing the integer 644 to 0644 (required for input when using File.chmod)?
<leah2> >> 644.to_s.to_i(8) == 0644
<ruby[bot]> leah2: # => true (https://carc.in/#/r/eyl1)
Bruno34 has joined #ruby
bambanxx has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
Dooky_ has joined #ruby
Dooky has quit [Ping timeout: 252 seconds]
AlexBrownSobinec has joined #ruby
<AlexBrownSobinec> Yo
Thiago92 has quit [Quit: Client closed]
Doc_XI has quit [Ping timeout: 276 seconds]
Dooky_ has quit [Quit: Textual IRC Client: www.textualapp.com]
Dooky has joined #ruby
<adam12> AlexBrownSobinec: yo
<isene> leah2: Excellent. Thanks.
<leah2> np
<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?
<weaksauce> depends on what performance you are looking to optimize for
<weaksauce> you could just autoload it
<adam12> isene: Autoload or require it inside the method that needs it.
John_Ivan_ has joined #ruby
Doc_X has joined #ruby
ele_mesmo has joined #ruby
John_Ivan has quit [Ping timeout: 246 seconds]
<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.
<weaksauce> yeah it depends on when you want the parsing hit to occur
<weaksauce> and memory hit of having it loaded
<weaksauce> (though that's likely small)
Pastorinni has quit [Remote host closed the connection]
bambanxx has joined #ruby
Pastorinni has joined #ruby
Pastorinni has quit [Client Quit]
Bruno34 has quit [Ping timeout: 245 seconds]
cek has quit [Quit: Connection closed for inactivity]
bambanxx has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
shokohsc has quit [Read error: Connection reset by peer]
Evertonlc has quit [Quit: Client closed]
ele_mesmo has quit [Quit: Client closed]
shokohsc has joined #ruby
_ht has quit [Quit: _ht]
<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?
<isene> s/ I'm/ in/
otisolsen70 has quit [Quit: Leaving]
<weaksauce> correct
<weaksauce> it would just return false every time you call it after the first one
lena64t has quit [Ping timeout: 240 seconds]
lena64t has joined #ruby
<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.
<isene> Excellent. Thanks for the answers.
<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
<weaksauce> require 'foo' unless @feature_loaded
<ox1eef_> You could be solving a problem that doesn't exist though.
<weaksauce> yeah
<ox1eef_> For the sake of the conversation, require_relative won't walk $LOAD_PATH.
roadie has quit [Remote host closed the connection]
lunks has joined #ruby
tomtmym has quit [Quit: Gone.]
moldorcoder7 has joined #ruby
mretka_mobile has joined #ruby
mretka_mobile70 has joined #ruby
mretka_mobile70 has quit [Client Quit]
mretka_mobile has quit [Ping timeout: 245 seconds]
mexen has quit [Quit: Connection closed for inactivity]
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
Ignorand has joined #ruby
Linux_Kerio has quit [Ping timeout: 252 seconds]
bambanxx has joined #ruby
lunks has quit [Quit: Client closed]
bambanxx has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
Sankalp has quit [Ping timeout: 248 seconds]
kaivai has quit [Excess Flood]
kaivai has joined #ruby
Al2O3 has quit [Ping timeout: 260 seconds]