havenwood changed the topic of #ruby to: Ruby 3.3.3, 3.2.4, 3.4.0-preview1 https://www.ruby-lang.org | Logs https://libera.irclog.whitequark.org/ruby
some14u- has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has joined #ruby
some14u has quit [Client Quit]
some14u has joined #ruby
Linux_Kerio has quit [Ping timeout: 268 seconds]
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xdminsy has quit [Ping timeout: 240 seconds]
xdminsy has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
semigloss has joined #ruby
ih8u has joined #ruby
semigloss has quit [Quit: leaving]
jenrzzz has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
mange has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
jenrzzz has joined #ruby
grenierm has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
jvalleroy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
jvalleroy has joined #ruby
jvalleroy has joined #ruby
jvalleroy has quit [Changing host]
gaussianblue has joined #ruby
infinityfye has joined #ruby
jenrzzz has joined #ruby
osc4rpt has quit [Ping timeout: 264 seconds]
jenrzzz has quit [Ping timeout: 268 seconds]
osc4rpt has joined #ruby
jenrzzz has joined #ruby
osc4rpt has quit [Ping timeout: 246 seconds]
jenrzzz has quit [Ping timeout: 252 seconds]
osc4rpt has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
osc4rpt has quit [Ping timeout: 264 seconds]
osc4rpt has joined #ruby
jenrzzz has joined #ruby
some14u- has joined #ruby
some14u- has quit [Client Quit]
jenrzzz has quit [Ping timeout: 264 seconds]
Linux_Kerio has joined #ruby
Linux_Kerio has quit [Read error: Connection reset by peer]
pusewicz has joined #ruby
osc4rpt has quit [Ping timeout: 260 seconds]
<pusewicz> Hey! I wrote a Vim plugin manager in Ruby (as the scope seemed small to try to write a little CLI tool). It's available at https://github.com/pusewicz/vimpk. I'd love to hear thoughts on the README, so that I can make it easier for someone landing on the github repo to understand what this tool is, what it does and how to use it. Thanks!
osc4rpt has joined #ruby
grenierm has quit [Ping timeout: 250 seconds]
osc4rpt has quit [Ping timeout: 268 seconds]
osc4rpt has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
<ih8u> how can i get nil to print as "nil"
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
<ih8u> specifically as part of string interpolation
<mange> "x is #{x.inspect}"?
<ih8u> i'd like to do it as inspect
<ih8u> i'm seeing something strange
<ih8u> in 3.1.2 irb:
<ih8u> pp "!!!", "#{nil}"
<ih8u> "!!!"
<ih8u> "nil"
<ih8u> but if i put that same line in a file and run with `ruby _.rb`:
<ih8u> "!!!"
<ih8u> ""
<ih8u> what's up with that?
<mange> What does nil.to_s do in your irb?
<ih8u> can anyone reproduce?
<ih8u> => ""
<mange> I couldn't reproduce with 3.1.4. I'm building 3.1.2 now.
<ih8u> wait, it's stopped doing it in irb
<ih8u> weird
<ih8u> i must have read something wrong or something
<ih8u> `pp nil` will print "nil" in irb and ruby, and `pp "#{nil}"` will print "" in both
<ih8u> i did in one file extend class NilClass to try `def to_s "nil" end`
<mange> Yep, can't reproduce in 3.1.2. I would expect pp "!!!", nil; to print "!!!" then nil, but never "nil". "#{nil}" should always be the same as nil.to_s, but you can redefine that with class NilClass; def to_s = "nil"; end; at which point pp "#{nil}" will print "nil".
<ih8u> maybe that messed up my irb temporarily while it was present in the file?
<ih8u> yeah that was my first thought
<ih8u> unfortunately, it can't be that easy, because apparently the Sequel gem relies on nil returning ""
<ih8u> i want to be able to print that i've inserted a nil value to a database
<ih8u> is there a way to scope class extensions?
<mange> You don't have control of the call site? So you can't just do "inserted: #{x.nil? ? "nil" : x}" or similar?
<mange> If you wanted to be *absolutely insane* you could redefine to_s to check caller, or something, but that's a shockingly bad idea.
<ih8u> i don't want to be insane, just lazy
<ih8u> #{x.nil? ? "nil" : x}" works just fine, but it's too much typing
<ih8u> and i'd have to go back and change all my existing statements
<ih8u> instead of just being able to account for nils in some more catch-all way
<ih8u> something elegant, i guess, lol
<mange> The catch-all way is to use .inspect, but I guess you don't want to do that for some reason?
<ih8u> i just already have a bunch of print statements and i don't want to go back manually and add the inspect
Starfoxxes has joined #ruby
<ih8u> i was hoping pp would be my answer, since it actually prints the characters `nil` if you ask it to
<mange> So you want to change the behaviour of existing code, but in a way that only affects some call sites? And that seems more elegant to you than using the method that is intended for the thing that you're doing?
<ih8u> just not with string interpolation
<ih8u> which i guess makes sense
<ih8u> i'm just monumentally lazy
<mange> String interpolation is just to_s, so you can't special-case string interpolation. It just seems like you're "right now" lazy, at the expense of doing more work later when you inevitably have to debug your mess of magic.
user71 has joined #ruby
<ih8u> yeah, you're probably right
<ih8u> i thougt it might be a fun learning opportunity
<ih8u> ruby constantly surprises me with what it allows me to do
<ih8u> i thought maybe there was some extra magic i wasn't aware of
jenrzzz has joined #ruby
graywolf has joined #ruby
mark22k has quit [Quit: The Lounge - https://thelounge.chat]
mark22k has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
mange has quit [Remote host closed the connection]
mark22k has quit [Quit: The Lounge - https://thelounge.chat]
mark22k has joined #ruby
donofrio has joined #ruby
jenrzzz has joined #ruby
some14u has joined #ruby
donofrio_ has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
donofrio has quit [Ping timeout: 246 seconds]
donofrio_ has quit [Ping timeout: 255 seconds]
Triviality has joined #ruby
infinity_fye has joined #ruby
infinity_fye has quit [Remote host closed the connection]
infinityfye has quit [Ping timeout: 255 seconds]
jenrzzz has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has quit [Ping timeout: 264 seconds]
avu has quit [Quit: avu]
Inline has joined #ruby
gaussianblue has quit [Quit: leaving]
some14u has joined #ruby
some14u has quit [Ping timeout: 246 seconds]
some14u has joined #ruby
some14u has quit [Client Quit]
osc4rpt has left #ruby [#ruby]
jenrzzz has joined #ruby
Linux_Kerio has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
jenrzzz has joined #ruby
osc4rpt has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
ua__ has quit [Ping timeout: 268 seconds]
ua_ has joined #ruby
maroloccio has joined #ruby
mx has quit [Quit: ZNC 1.8.2 - https://znc.in]
Triviality has quit [Ping timeout: 272 seconds]
jenrzzz has joined #ruby
mx has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
graywolf has quit [Quit: WeeChat 4.3.3]
Inline has quit [Quit: Leaving]
Inline has joined #ruby
victori has quit [Ping timeout: 264 seconds]
victori has joined #ruby
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
nmollerup has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
cognemo has quit [Ping timeout: 252 seconds]
user71 has quit [Quit: Leaving]
some14u has joined #ruby
cognemo has joined #ruby
ollysmith_ has quit [Quit: ZNC 1.9.0+deb2 - https://znc.in]
some14u has quit [Client Quit]
ollysmith has joined #ruby
ua_ has quit [Ping timeout: 268 seconds]
some14u has joined #ruby
jenrzzz has joined #ruby
ua_ has joined #ruby
user71 has joined #ruby
ollysmith has quit [Quit: ZNC 1.9.0+deb2+b1 - https://znc.in]
jenrzzz has quit [Ping timeout: 264 seconds]
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has joined #ruby
some14u has quit [Client Quit]
jenrzzz has joined #ruby
some14u has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
some14u- has joined #ruby
some14u has quit [Ping timeout: 272 seconds]
jenrzzz has joined #ruby
maroloccio has quit [Quit: WeeChat 3.8]
some14u- has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mx has quit [Quit: ZNC 1.8.2 - https://znc.in]
jenrzzz has quit [Ping timeout: 256 seconds]
some14u has joined #ruby
ua_ has quit [Ping timeout: 268 seconds]
some14u has quit [Client Quit]
ua_ has joined #ruby
mx has joined #ruby
user71 has quit [Quit: Leaving]
yosafbridge has quit [Quit: Leaving]
wbooze has joined #ruby
user71 has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
yosafbridge has joined #ruby
some14u has joined #ruby
some14u has quit [Client Quit]
mx has quit [Quit: ZNC 1.8.2 - https://znc.in]
mx has joined #ruby
some14u has joined #ruby
some14u has quit [Ping timeout: 272 seconds]
some14u has joined #ruby
jenrzzz has joined #ruby
peder has quit [Ping timeout: 252 seconds]
jenrzzz has quit [Ping timeout: 264 seconds]
Arsen has quit [Quit: Quit.]
peder has joined #ruby
Arsen has joined #ruby
Arsen is now known as Guest702
Guest702 has quit [Changing host]
Guest702 has joined #ruby
Guest702 has quit [Quit: Quit.]
Arsen has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
desnudopenguino has quit [Read error: Connection reset by peer]
desnudopenguino has joined #ruby
Starfoxxes has quit [Remote host closed the connection]
some14u has joined #ruby
some14u- has joined #ruby
some14u has quit [Ping timeout: 255 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
Linux_Kerio has quit [Ping timeout: 252 seconds]
havenwood has quit [Quit: The Lounge - https://thelounge.chat]
havenwood has joined #ruby
Triviality has joined #ruby
jenrzzz has joined #ruby
some14u- has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has joined #ruby
cognemo has quit [Ping timeout: 264 seconds]
jenrzzz has quit [Ping timeout: 268 seconds]
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has joined #ruby
some14u has quit [Client Quit]
some14u has joined #ruby
some14u has quit [Client Quit]
some14u has joined #ruby
some14u has quit [Client Quit]
cappy has joined #ruby
some14u has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
cognemo has joined #ruby
jenrzzz has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
user71 has quit [Quit: Leaving]
jenrzzz has quit [Ping timeout: 268 seconds]
some14u has joined #ruby
some14u has quit [Client Quit]
some14u has joined #ruby
kagirinaku has joined #ruby
ruby[bot] has quit [Remote host closed the connection]
desnudopenguino1 has joined #ruby
ruby[bot] has joined #ruby
desnudopenguino has quit [Ping timeout: 268 seconds]
desnudopenguino1 is now known as desnudopenguino
pusewicz_ has joined #ruby
jenrzzz has joined #ruby
pusewicz has quit [Ping timeout: 268 seconds]
kagirinaku has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
ua_ has quit [Read error: Connection reset by peer]
ua__ has joined #ruby
ua__ has quit [Read error: Connection reset by peer]
ua_ has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
some14u has quit [Ping timeout: 264 seconds]
some14u has joined #ruby
Rounin has quit [Remote host closed the connection]
Rounin has joined #ruby
Rounin has quit [Changing host]
Rounin has joined #ruby
mange has joined #ruby
ftajhii has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Triviality has quit [Ping timeout: 272 seconds]
some14u has joined #ruby
some14u has quit [Ping timeout: 252 seconds]
some14u has joined #ruby
jenrzzz has joined #ruby
havenwood has quit [Quit: The Lounge - https://thelounge.chat]
havenwood has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
havenwood has quit [Client Quit]
havenwood has joined #ruby
cappy has quit [Quit: Leaving]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
jenrzzz has joined #ruby