desnudopenguino has quit [Remote host closed the connection]
desnudopenguino has joined #ruby
motherr has quit [Quit: zzz]
orbyt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
postmodern has quit [Read error: Connection reset by peer]
Danishman has joined #ruby
gr33n7007h has quit [Ping timeout: 252 seconds]
ur5us has quit [Ping timeout: 240 seconds]
mune has joined #ruby
dyCrazyEd is now known as CrazyEddy
gggp has joined #ruby
mune has quit [Ping timeout: 250 seconds]
gggp_ has joined #ruby
gggp has quit [Ping timeout: 252 seconds]
roadie has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
roadie has joined #ruby
roadie has quit [Ping timeout: 250 seconds]
roadie has joined #ruby
mune has joined #ruby
roadie has quit [Ping timeout: 250 seconds]
mmalter has quit [Quit: Lost terminal]
roadie has joined #ruby
mune has quit [Ping timeout: 250 seconds]
ur5us has joined #ruby
mune has joined #ruby
mune has quit [Read error: Connection reset by peer]
ur5us has quit [Quit: Leaving]
ur5us has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
roadie has joined #ruby
roadie has quit [Ping timeout: 250 seconds]
roadie has joined #ruby
kiki_lamb has joined #ruby
kiki_lamb has quit [Client Quit]
kiki_lamb has joined #ruby
roadie has quit [Ping timeout: 250 seconds]
jpw has joined #ruby
roadie has joined #ruby
fdan has joined #ruby
gggp__ has joined #ruby
gggp_ has quit [Ping timeout: 240 seconds]
roadie has quit [Ping timeout: 240 seconds]
_ht has joined #ruby
roadie has joined #ruby
jrgriffiniii has joined #ruby
<jrgriffiniii>
list
Danishman has quit [Quit: Leaving]
jrgriffiniii has quit []
fdan has quit [Quit: Client closed]
fdan has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
jetchisel has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
roadie has joined #ruby
roadie has quit [Ping timeout: 250 seconds]
roadie has joined #ruby
nesoi has quit [Quit: Leaving.]
Rounin has joined #ruby
Oxfuxxx has quit [Quit: brb]
michigan has joined #ruby
mjh has joined #ruby
Oxfuxxx has joined #ruby
rubion has joined #ruby
rubion has quit [Ping timeout: 252 seconds]
Tuor has joined #ruby
Oxfuxxx has quit [Ping timeout: 250 seconds]
Oxfuxxx has joined #ruby
noa has joined #ruby
flooose has joined #ruby
random-jellyfish has joined #ruby
<rapha>
hi all
<rapha>
i'm trying to monkeypatch Array, but in order to not make a mess, i've tried putting the monkeypatched Array as well as my own class into a module. unfortunately, inside my own class, the monkeypatched Array isn't available. what's the trick here?
roadie has quit [Quit: ERC (IRC client for Emacs 25.3.50.1)]
motherr has quit [Quit: zzz]
<Tuor>
Hi, when installing gems with `bundle install` what happens if two different projects do need a gem in different version? projectA needs gem1 in Version 3.0 and projectB needs the same gem1 in version 4.0
noa has quit [Ping timeout: 250 seconds]
gr33n7007h has joined #ruby
random-jellyfish has quit [Ping timeout: 246 seconds]
venue has quit [Quit: adios]
Oxfuxxx has quit [Ping timeout: 250 seconds]
Oxfuxxx has joined #ruby
noa has joined #ruby
<aesthetikx>
Tuor: both versions will be installed and available. Type something like `gem which rails` to see where your gems are installed, then go to that directory to see all the different versions of all the gems you have installed.
<aesthetikx>
This also applies to different ruby versions, if you are using something like rbenv
danjo9 has joined #ruby
fdan has quit [Quit: Client closed]
danjo has quit [Ping timeout: 268 seconds]
danjo9 is now known as danjo
<nakilon>
Tuor different projects use different Gemfile
<Tuor>
I'm using rbenv.
<Tuor>
so ruby will know because of the Gemfile which of the installed versions of a gem has to be used in an application?
<nakilon>
yes, if you launch it with 'bundle exec'
<rapha>
hmm
<rapha>
okay now i tried to add a bang method to String
<rapha>
but `class String; self.replace("blah"); end` doesn't work at all (like it used to) because self is ofc frozen in ruby3
<rapha>
how does one write that kind of bang method now? o_O
<rapha>
oh, nevermind, the input is frozen already
<Tuor>
ah ok thx
<rapha>
but there must be a way to create an unfrozen string
<rapha>
aside from the global # frozen_string_literal: true that is
<rapha>
er, false
<gr33n7007h>
rapha: +str
<rapha>
huh? like, literally put a + in front?
* rapha
tries
<rapha>
wow, go figure
entel_ has quit [Quit: Connection closed for inactivity]
<aesthetikx>
Tuor: Gemfile.lock is what actually lists the (ruby version and) gem versions
<aesthetikx>
rapha: yeah I did not know that either
<gr33n7007h>
rapha: String#+@ literally is self.dup if self is frozen.
<rapha>
more TIL
<rapha>
thx :)
noa has quit [Ping timeout: 250 seconds]
dviola has quit [Quit: WeeChat 3.2]
flooose has quit [Ping timeout: 240 seconds]
Guest53 has quit [Ping timeout: 246 seconds]
xuochi has joined #ruby
aeris has quit [Remote host closed the connection]
aeris has joined #ruby
Guest49 has joined #ruby
jetchisel has quit [Ping timeout: 250 seconds]
kwilczynski has quit [Ping timeout: 240 seconds]
r0bby has quit [Read error: Connection reset by peer]
kwilczynski has joined #ruby
r0bby has joined #ruby
noa has joined #ruby
<rapha>
wow, weird quantum physics phenomenon here
<rapha>
why is it always giving "no array" in my code
gr33n7007h has quit [Ping timeout: 252 seconds]
gr33n7007h has joined #ruby
bit4bit has joined #ruby
jpw has quit [Ping timeout: 240 seconds]
dachi_ has joined #ruby
<rapha>
wow, so it works if it's not in a module. once you copy and paste it into a module, it stops working. crazy.
dachinat has quit [Ping timeout: 268 seconds]
<jhass[m]>
rapha: sure it's just any module? Does it work with ::Array ?
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
<rapha>
jhass[m]: so far i'm not able to reproduce it inside of a minimal example.
<rapha>
there's a lot of non-ASCII unicode chars in that file though. i think i'll go home, have dinner, prune the aquarium plants, watch a nice show, then try this again in bed.
howdoi has joined #ruby
<howdoi>
arr << topic
<howdoi>
arr << topic.gsub(":", "_global:")
<howdoi>
Can this be rewritten?
gr33n7007h has quit [Quit: WeeChat 3.2]
kiki_lamb has quit [Ping timeout: 248 seconds]
gr33n7007h has joined #ruby
<aesthetikx>
not that i can see howdoi
<aesthetikx>
I mean I could come up with stuff, but nothing shorter really
<howdoi>
okies, it is from each_with_object([]) do |topic, arr|
Guest49 has quit [Quit: Client closed]
dachi__ has joined #ruby
dachi_ has quit [Ping timeout: 252 seconds]
kiki_lamb has joined #ruby
kiki_lamb has quit [Ping timeout: 250 seconds]
dachi__ has quit [Quit: Leaving]
<jhass[m]>
could .flat_map {|topic| [topic, topic.gsub(":", "_global:") } or if order is not important stuff + stuff.map {|topic| topic.gusb(":", "_global:") }
Oxfuxxx has quit [Ping timeout: 240 seconds]
dachinat has joined #ruby
dviola has joined #ruby
gggp__ has quit [Ping timeout: 250 seconds]
kiki_lamb has joined #ruby
jpw has joined #ruby
kiki_lamb has quit [Ping timeout: 252 seconds]
gggp__ has joined #ruby
kiki_lamb has joined #ruby
kiki_lamb has quit [Ping timeout: 268 seconds]
bit4bit has quit [Quit: Leaving]
Oxfuxxx has joined #ruby
gggp__ has quit [Ping timeout: 268 seconds]
kiki_lamb has joined #ruby
kiki_lamb has quit [Ping timeout: 252 seconds]
michigan has quit []
roadie has joined #ruby
kiki_lamb has joined #ruby
entel_ has joined #ruby
kiki_lamb has quit [Ping timeout: 248 seconds]
reset has joined #ruby
kiki_lamb has joined #ruby
rubion has joined #ruby
kiki_lamb has quit [Ping timeout: 250 seconds]
orbyt has joined #ruby
Oxfuxxx has quit [Ping timeout: 250 seconds]
Oxfuxxx has joined #ruby
noa has quit [Ping timeout: 248 seconds]
kiki_lamb has joined #ruby
kiki_lamb has quit [Ping timeout: 268 seconds]
kwilczynski has quit []
kiki_lamb has joined #ruby
kiki_lamb has quit [Ping timeout: 248 seconds]
kiki_lamb has joined #ruby
kiki_lamb has quit [Ping timeout: 250 seconds]
venue has joined #ruby
mrkz_c has joined #ruby
roadie has quit [Quit: ERC (IRC client for Emacs 25.3.50.1)]
motherr has joined #ruby
noa has joined #ruby
kiki_lamb has joined #ruby
motherr has quit [Ping timeout: 252 seconds]
kiki_lamb has quit [Ping timeout: 268 seconds]
flooose has joined #ruby
kiki_lamb has joined #ruby
kiki_lamb has quit [Ping timeout: 252 seconds]
mirko_ has joined #ruby
_ht has quit [Remote host closed the connection]
<mirko_>
'lo, ruby newbie here.. I'm trying to manually raise an IO::WaitReadable exception and fail doing so. What would be the correct way?
<dachinat>
What you raise has to be exception object
<dachinat>
IO:WaitReadable is not I think
<mirko_>
i'm confused - isn't it a class deriving from the standard exception which i "just" should be able to raise?
<leftylink>
that adsfahdsfjahdsfkjashd obviousy doesn't exist
<adam12>
mirko_: What are you doing, at a higher level?
<adam12>
mirko_: Could you raise something like IO::EAGAINWaitReadable? I hesitate to suggest it without knowing what you're doing, but essentially I suspect that one of the classes that might be raised that you're rescuing.
<adam12>
mirko_: IO::WaitReadable is a module that's mixed into IO::EAGAINWaitReadable, so that's why the rescue works, as it's in the ancestor tree... or at least I suspect that's what is going on but didn't look too close.
fmccann has joined #ruby
<adam12>
Maybe you want a rescue/re-raise, and raise your own exception that you can raise.
<mirko_>
yeah, let me explain what i'mt rying to achieve: i'm rescueing a couple of exceptions when handling serial communication (UART but also ACM) and i see various types of exceptions can be thrown. when trying to catch them all, rubocop complains about one exception shadowing the other. so i figured to better my understanding, i should throw e.g. IO::WaitReadable manually and will then be able to see if "rescue
<mirko_>
rescueing IO::WaitReadable, IO:EAGAINWaitReadable e.g. rubocop tells me no-no, because of one shadowing the other (not help that it doesn't tell me which one shadows the other exactly)
<adam12>
>> IO::EAGAINWaitReadable.ancestors
<ruby[bot]>
adam12: # => [IO::EAGAINWaitReadable, IO::WaitReadable, Errno::EAGAIN, SystemCallError, StandardError, Exception, ...check link for more (https://carc.in/#/r/bslj)
<adam12>
I suspect it's `IO::WaitReadable`. It's kind of an "alias" for rescue, in the sense that exceptions that include it can be matched in the rescue (Maybe because of === but again I'm not 100%).
<mirko_>
does that mean i should rescue IO::WaitReadable and Errno::EAGAIN and then i should be fine?
<adam12>
You could maybe make your own to demonstrate this.