havenwood changed the topic of #ruby to: Ruby 3.2.2, 3.1.4, 3.3.0-preview2: https://www.ruby-lang.org | Rules: https://ruby-community.com | Logs: https://libera.irclog.whitequark.org/ruby
Arsen has joined #ruby
<Arsen> o/ I have a Foo.new(x) and I'd like to skip the new and return nil if x is nil
<Arsen> is there an idiomatic way to do so?
constxqt has joined #ruby
<wnd> Not sure what you're after, nor can I tell what's idiomatic, but. I probably wouldn't write it like this, but /if/ wanted to look clever, I might have y = x && Foo.new(x)
<wnd> "y = Foo.new(x) if x" is probably closer to what you're after
<weaksauc_> coming from c the first one looks more normal than the second one but that's probably just me
constxqt has quit [Ping timeout: 246 seconds]
<Arsen> weaksauc_: note that there it's not being used as a condition :P
<Arsen> wnd: the latter seems reasonable to me, thanks
* Arsen for some reason only thought of guards
constxqt has joined #ruby
<weaksauc_> something about accessing variables that are conditionally assigned like that rubs me wrong
<weaksauc_> y = something && something else feels better to me
<weaksauc_> since it's always going to get "something" and is always going to be defined
<weaksauc_> i know you can do it but it feels wrong
constxqt has quit [Ping timeout: 255 seconds]
<havenwood> return unless x
<havenwood> Unless the method goes on.
xlymian has quit [Ping timeout: 255 seconds]
caedmon has joined #ruby
caedmon has quit [Ping timeout: 246 seconds]
caedmon has joined #ruby
jess has quit [*.net *.split]
jess has joined #ruby
caedmon has quit [Quit: caedmon]
jas-maelstrom has quit [Quit: Leaving]
edr has quit [Quit: Leaving]
<ox1eef_> Guard approach is most common IME.
jas-maelstrom has joined #ruby
xlymian has joined #ruby
deadmarshal_ has quit [Server closed connection]
deadmarshal_ has joined #ruby
clemens3 has quit [Server closed connection]
clemens3 has joined #ruby
Aminda has quit [Remote host closed the connection]
Aminda has joined #ruby
grenierm has joined #ruby
Vonter has quit [Ping timeout: 258 seconds]
Vonter has joined #ruby
donofrio has quit [Remote host closed the connection]
Aminda has quit [Remote host closed the connection]
donofrio has joined #ruby
Aminda has joined #ruby
schne1der has joined #ruby
tomtmym has joined #ruby
tomtmym has quit [Changing host]
tomtmym has joined #ruby
legahc has quit [Server closed connection]
legahc has joined #ruby
Vonter has quit [Ping timeout: 246 seconds]
Vonter has joined #ruby
leftylink has quit [Server closed connection]
leftylink has joined #ruby
grenierm has quit [Ping timeout: 250 seconds]
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
_ht has joined #ruby
MomosOrDeath5 has joined #ruby
MomosOrDeath has quit [Ping timeout: 255 seconds]
MomosOrDeath5 is now known as MomosOrDeath
mattf has quit [Server closed connection]
mattf has joined #ruby
Vonter has quit [Ping timeout: 255 seconds]
teclator has quit [Ping timeout: 258 seconds]
Vonter has joined #ruby
Vonter has quit [Ping timeout: 260 seconds]
Vonter has joined #ruby
reset has quit [Quit: reset]
ollysmith has quit [Quit: ZNC 1.8.2+deb3.1 - https://znc.in]
ollysmith has joined #ruby
Aminda has quit [Remote host closed the connection]
Aminda has joined #ruby
schne1der has quit [Quit: schne1der]
schne1der has joined #ruby
gr33n7007h has quit [Ping timeout: 246 seconds]
gr33n7007h has joined #ruby
Artea has quit [Server closed connection]
Artea has joined #ruby
sarna has quit [Ping timeout: 255 seconds]
sts has quit [Server closed connection]
sts has joined #ruby
sarna has joined #ruby
xlymian has quit [Ping timeout: 255 seconds]
TrillionEuroNote has quit [Server closed connection]
TrillionEuroNote has joined #ruby
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
xlymian has joined #ruby
constxqt has joined #ruby
Linux_Kerio has joined #ruby
Thanzex has quit [Ping timeout: 264 seconds]
raz3time has joined #ruby
Guest26nakilon has joined #ruby
<Guest26nakilon> why do I get "gem install smarter_csv" -> Gem::RemoteFetcher::FetchError bad response Forbidden 403
<Guest26nakilon> and https://index.rubygems.org/quick/Marshal.4.8/smarter_csv-1.9.1.gemspec.rz is AccessDenied XML in browser too
<Guest26nakilon> same error even from server for curl -s -o /dev/null -w "%{http_code}\n" 'https://index.rubygems.org/quick/Marshal.4.8/smarter_csv-1.9.1.gemspec.rz'
xlymian has quit [Read error: Connection reset by peer]
<Guest26nakilon> then the question is why gem install tries to install the yanked version
Thanzex has joined #ruby
reset has joined #ruby
raz3time has quit [Ping timeout: 260 seconds]
mdr has quit [Quit: WeeChat 3.5]
petru has joined #ruby
Thanzex has quit [Quit: Ping timeout (120 seconds)]
teclator has joined #ruby
Thanzex has joined #ruby
joast has quit [Quit: Leaving.]
<adam12> Guest26nakilon: Weird. Bug maybe?
<Guest26nakilon> adam12 can't be; when I come here saying that there is a bug I'm being told I'm wrong ..D
<Guest26nakilon> *it's a feature
r3m has quit [Quit: WeeChat 4.2.0-dev]
r3m has joined #ruby
dviola has joined #ruby
teclator has quit [Ping timeout: 255 seconds]
white_magic has joined #ruby
yziquel has joined #ruby
Aminda has quit [Remote host closed the connection]
Aminda has joined #ruby
yziquel has quit [Ping timeout: 250 seconds]
yziquel has joined #ruby
Linux_Kerio has quit [Ping timeout: 255 seconds]
yziquel has quit [Quit: Client closed]
white_magic has quit [Quit: Client closed]
foxxx0 has quit [Server closed connection]
foxxx0 has joined #ruby
constellati0n has joined #ruby
Guest26nakilon has quit [Quit: Client closed]
xlymian has joined #ruby
nemesit has quit [Server closed connection]
nemesit has joined #ruby
constellati0n has quit [Ping timeout: 246 seconds]
_ht has quit [Quit: _ht]
gr33n7007h has quit [Ping timeout: 246 seconds]
gr33n7007h has joined #ruby
Fridtjof has quit [Server closed connection]
Fridtjof has joined #ruby
jtperreault has quit [Server closed connection]
jtperreault has joined #ruby
ccooke has quit [Server closed connection]
ccooke has joined #ruby
svartur-hrafn has joined #ruby
gr33n7007h has quit [Ping timeout: 255 seconds]
acosta has joined #ruby
gr33n7007h has joined #ruby
xlymian has quit [Read error: Connection reset by peer]
schne1der has quit [Ping timeout: 246 seconds]
constellati0n has joined #ruby
constellati0n has quit [Ping timeout: 252 seconds]
tomtmym has quit [Quit: Gone.]
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
Thanzex has quit [Ping timeout: 260 seconds]
Thanzex has joined #ruby
coffeejunk has quit [Server closed connection]
coffeejunk has joined #ruby