havenwood changed the topic of #ruby to: Ruby 3.3.1, 3.2.4, 3.4.0-preview1 https://www.ruby-lang.org | Logs https://libera.irclog.whitequark.org/ruby
Guest57 has joined #ruby
Guest57 has quit [Client Quit]
jaredce has joined #ruby
jaredce has quit [Ping timeout: 260 seconds]
Obsdark has quit [Ping timeout: 264 seconds]
shiboka has quit [Remote host closed the connection]
brokkoli_origina has joined #ruby
brokkoli_origin has quit [Ping timeout: 264 seconds]
xdminsy has quit [Quit: Konversation terminated!]
xdminsy has joined #ruby
konsolebox has joined #ruby
konsolebox_ has joined #ruby
konsolebox has quit [Ping timeout: 240 seconds]
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
teardown has joined #ruby
xdminsy has quit [Read error: Connection reset by peer]
<teardown> i'm using caller_locations(1,1)[0].label.to_sym to get the name of the method that called my method. is there a way to get the name of the method up one level higher, ie: the name of the method that called the method that called the current method?
<teardown> i need the name of grandpa method
xdminsy has joined #ruby
ih8u1 has joined #ruby
ih8u has quit [Ping timeout: 252 seconds]
ih8u1 is now known as ih8u
Fridtjof has quit [Quit: ZNC - http://znc.in]
Fridtjof has joined #ruby
legahc has quit [Quit: %bye%]
cnsvc has quit [Quit: %bye%]
legahc has joined #ruby
cnsvc has joined #ruby
wyclif has quit [Ping timeout: 264 seconds]
wyclif has joined #ruby
cappy has joined #ruby
reset has quit [Quit: reset]
grenierm has joined #ruby
brokkoli_origina has quit [Ping timeout: 260 seconds]
tarel2 has quit [Quit: Client closed]
<wnd> I must have missed something but caller_locations(2,1), perhaps?
cappy has quit [Quit: Leaving]
Inline has quit [Ping timeout: 240 seconds]
<mooff> try caller_locations[1].label
<mooff> >> caller_locations.map(&:label)
<ruby[bot]> mooff: # => [] (https://carc.in/#/r/guva)
<mooff> heh, funky result from ruby[bot] :)
<mooff> == caller_locations.map(&:label)
<ruby-eval> => ["eval", "<main>"]
<mooff> == (def grandparent() = parent; def parent() = child; def child() = caller_locations[1].label); grandparent()
<ruby-eval> => "grandparent"
dviola has joined #ruby
Paris has joined #ruby
Paris has joined #ruby
Paris has quit [Changing host]
wyclif has quit [Quit: leaving]
polishdub has quit [Ping timeout: 256 seconds]
polishdub has joined #ruby
tirnanog has joined #ruby
yeahitsme has joined #ruby
jaredce has joined #ruby
Inline has joined #ruby
yeahitsme has quit [Quit: Leaving]
gaussianblue has joined #ruby
Paris has quit [Ping timeout: 240 seconds]
Paris has joined #ruby
Paris has quit [Quit: quit]
cappy has joined #ruby
grenierm has quit [Ping timeout: 250 seconds]
jhass has quit [Remote host closed the connection]
jhass has joined #ruby
brokkoli_origin has joined #ruby
Al2O3 has quit [Ping timeout: 246 seconds]
trnzecs has joined #ruby
trnzecs has quit [Remote host closed the connection]
hellstabber_ has joined #ruby
hellstabber_ has quit [Client Quit]
jbg_ is now known as jbg
jbg has quit []
jbg has joined #ruby
whysthatso125070 has quit [Quit: The Lounge - https://thelounge.chat]
whysthatso125070 has joined #ruby
jaredce has quit [Ping timeout: 260 seconds]
Guest26 has joined #ruby
<Guest26> is there a way to do a scoped override of a class function?
<Guest26> for example
<Guest26> class Foo
<Guest26>   def self.doit
<Guest26>     puts "doit"
<Guest26>   end
<Guest26> end
<Guest26> class Bar
<Guest26>   scoped class Foo
<Guest26>     def self.doit
<Guest26>       puts "Bar doit"
<Guest26>     end
<Guest26>   end
<Guest26>   def self.gogo
<Guest26>     Foo.doit #Bar doit
<Guest26>   end
<Guest26> end
shiboka has joined #ruby
<leftylink> I'd use a refinement for this purpose
<Guest26> refinement thanks for the keyword. will look into it!
<leftylink> and since exactly how to refine a class function may be a little obscure, I will also provide an example
<leftylink> pandabot rb class Foo def self.doit; :original end end; class Bar using(Module.new { refine(Foo.singleton_class) { def doit; :overridden end } }); def self.dothat; Foo.doit end end; [Foo.doit, Bar.dothat]
<pandabot> [:original, :overridden] - https://carc.in/#/r/guvq
Vonter has quit [Quit: WeeChat 4.2.2]
Vonter has joined #ruby
<Guest26> ooh nice. thanks
<konsolebox_> Injecting a module to an object's singleton class can also be simpler, sometimes.
<Guest26> can you explain a bit more. im a ruby noob :(
<Guest26> also, the refine method worked out (ty leftylink)
jaredce has joined #ruby
cappy has quit [Quit: Leaving]
tirnanog has quit [Quit: = ""]
whysthatso125070 has quit [Quit: The Lounge - https://thelounge.chat]
whysthatso125070 has joined #ruby
Paris has joined #ruby
Guest26 has quit [Quit: Client closed]
Guest26 has joined #ruby
Guest26 has quit [Quit: Client closed]
[0x1eef] has quit [Quit: Rebooting a new world]
[0x1eef] has joined #ruby
<konsolebox_> Too bad they left.
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
orbyt_v10 has joined #ruby
orbyt_v10 has quit [Client Quit]
orbyt_v10 has joined #ruby
orbyt_v10 has quit [Client Quit]
kyber has joined #ruby
<kyber> is there a similar thing in ruby as with python, when you install things as `pip install scipy[extras]`?
<kyber> and you get the additonal modules include in `extras`, in addition to the `scipy` library?
orbyt_v10 has joined #ruby
Guest82 has joined #ruby
orbyt_v10 has quit [Client Quit]
Thanzex0 has quit [Ping timeout: 252 seconds]
Thanzex0 has joined #ruby
hightower2 has joined #ruby
<[0x1eef]> Nope. It sounds kind of similar to features in Cargo but Ruby has nothing like that beyond a gem like scipy-extras.
<rapha> i wish ruby-doc.org had a major version selector in the top bar, or at least responded positively to manually changing the URL to something like https://ruby-doc.org/core-3.2.4/File.html from the https://ruby-doc.org/core-2.5.1/File.html or whatever google usually gives
<[0x1eef]> rapha: There's https://docs.ruby-lang.org/en/
<kyber> bummer, that would have been nice to have
<rapha> and also rubyapi.org, [0x1eef], neither of which google will usually return
<rapha> the latter, actually, is really great. if i was allowed a better wish, i'd have ruby-doc.org and docs.ruby-lang.org forwarded to that, or mirroring it, or something
<[0x1eef]> True true, I've long been irritated by how well ruby-doc.org ranks and how bad the ux is on its generated docs.
<teardown> wnd, moof, thakns
<rapha> google the unknowable animal
<kyber> at first i was pretty happy w package management in ruby but i've run into quite a few wtf's now with bundler
<[0x1eef]> https://rubyapi.org/ is nice too
<rapha> [0x1eef]: i just linked that 3 lines above ;)
<[0x1eef]> Oh woops. Time to reboot my brain. :)
<kyber> i like apidock
<rapha> know the feeling...
<kyber> something about the layout of apidock works well for me
<rapha> apidock is also nice. only weird that they stopped at ruby + rails + rspec
brokkoli_origin has quit [Ping timeout: 260 seconds]
brokkoli_origin has joined #ruby
<rapha> to keep elaborating on my wish: the UI of rubyapi.org with apidock.org's "Related" list and some way for authors to submit their own projects so that it might grow beyond just 3
<kyber> the versioning bar kind of throws me off in apidock
<rapha> hmm, never used that. it's not visually great tho, lol. and the version selector of rubyapi.org is good enough. i do see how people would want a bar like that. perhaps it could be touched by a UX designer.
<kyber> i don't like how in rubyapi.org you have two separate scroll bars for the instance methods thingy on the left and then the documentation for the module itself
<kyber> but that's just my opinion
<rapha> hmm, yeah, that could be copied over from apidock.org, kyber
<[0x1eef]> I'm not sure there's any language that excels at docs. I don't know of one. Languages like Java are kind of self-documenting if you take just the type annotiations I guess.
<rapha> ruby _is_ one of the better ones in that regard
<kyber> i like ruby's docs in comparison to others.. def not complaining there
<rapha> my complaint is more about google than about the ruby docs i guess
<kyber> google sucks with a lot of search results these days
<rapha> oh! https://crystal-lang.org/api/1.12.1/BigDecimal.html => change URL to 1.11.1 => works just fine. go figure.
<[0x1eef]> You could try write a query that excludes ruby-doc.org. I think that's possible but never tried.
<rapha> it is, [0x1eef] ... -site:ruby-doc.org
<[0x1eef]> Does that help?
<rapha> well, it's more typing
<rapha> and ofc doesn't ehlp with version selection
<rapha> since from june, i'll loose my ruby-related task at work, sadly, perhaps i'll get into crystal a little. that looks like it could be fun.
<[0x1eef]> I don't think there's a good default but you could exclude ruby-doc.org and combine that with a simple web page or browser extension for searching for ruby docs.
<rapha> all of that would only help me, not anyone else. sad that google as a company are so unavailable to their users.
<[0x1eef]> I've experienced the same problem as you, and eventually realized that google wasn't the best goto for ruby docs.
<rapha> which engine did you switch to, [0x1eef]?
<[0x1eef]> I use bookmarks far more often. So instead of searching all the time you return to articles or websites you've already read / visited.
<rapha> in the case of File that would make a lot of sense lol ... i seem to be hanging out there more often thant with my friends
<[0x1eef]> Firefox has a nice UI for bookmarks
<[0x1eef]> Makes it easy to narrow down results and integrates well with the browser
<rapha> hmm ... one Ctrl-b away, too
<[0x1eef]> Bookmarks seem to have been forgotten about as a piece of history but I think they have a lot of potential, especially with modern techniques like machine learning and being an extension to a note taking system.
Guest82 has quit [Quit: Client closed]
<kyber> i think googles search results are only going to get worse from here on
<kyber> seems that all they care about is AI
user71 has joined #ruby
<rapha> that's not them alone
<rapha> sometimes i feel as though technology as such has gone far too far. the rate of change is too high for social development to keep up with it, and so thinks often get worse instead of better. we're not ready as a species for most of the magical things we've created.
jaredce has quit [Ping timeout: 240 seconds]
Al2O3 has joined #ruby
Al2O3 has quit [Changing host]
Al2O3 has joined #ruby
<kyber> i think some people believe that eventually you won't even need webpages content or links to webpages or even an ability to search those things
Paris has quit [Remote host closed the connection]
<rapha> some people believe that eventually we'll "transcend" biological bodies and take to the stars as robots
<kyber> :facepalm:
rvalue has quit [Ping timeout: 264 seconds]
rvalue- has joined #ruby
rvalue- is now known as rvalue
<rapha> the usual suspect, Elon, but it's not his original ideas. seems anyone can make him believe anything, you just have to wrap it up nicely to stroke his narcissim. look up "transhumanism" if you feel like some cringe.
<rapha> there's people who are actually interesting, like Neil Harbisson
<rapha> ah, found the name of the other guy ... Ray Kurzweil. not that i'd think his "singularity" wouldn't be in the realm of possibilities, somewhere, somewhen. but why would we want this?
heinrich5991 has quit [Quit: quit.]
heinrich5991 has joined #ruby
jaredce has joined #ruby
jaredce has quit [Ping timeout: 256 seconds]
graywolf has joined #ruby
<kyber> rapha: yeah i've read about transhumanism :grimace:
hightower3 has joined #ruby
srbaker has joined #ruby
hightower2 has quit [Ping timeout: 252 seconds]
niv has quit [Quit: Powered by LunarBNC: https://LunarBNC.net]
niv has joined #ruby
teardown has quit [Remote host closed the connection]
teardown has joined #ruby
gaussianblue has quit [Quit: leaving]
grenierm has joined #ruby
Guest82 has joined #ruby
Guest82 has quit [Client Quit]
tirnanog has joined #ruby
sadome has joined #ruby
sadome has joined #ruby
sadome has quit [Excess Flood]
sam113102 has joined #ruby
sam113101 has quit [Ping timeout: 255 seconds]
sam113102 is now known as sam113101
Vonter has quit [Ping timeout: 260 seconds]
Vonter has joined #ruby
user71 has quit [Quit: Leaving]
grenierm has quit [Quit: Client closed]
tirnanog has quit [Ping timeout: 256 seconds]
konsolebox_ has quit [Quit: .]
tirnanog has joined #ruby
graywolf has quit [Quit: WeeChat 4.2.2]
r3m has quit [Quit: WeeChat 4.3.0-dev]
r3m has joined #ruby
Obsdark has joined #ruby
Obsdark has quit [Changing host]
Obsdark has joined #ruby
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
cappy has joined #ruby
jaredce has joined #ruby
jaredce has quit [Ping timeout: 264 seconds]
reset has joined #ruby
reset has quit [Client Quit]
reset has joined #ruby
reset has quit [Ping timeout: 264 seconds]
reset has joined #ruby
desnudopenguino1 has joined #ruby
desnudopenguino has quit [Ping timeout: 256 seconds]
desnudopenguino1 is now known as desnudopenguino
desnudopenguino has quit [Ping timeout: 252 seconds]
mange has joined #ruby
centurio1 is now known as centurion
cappy has quit [Quit: Leaving]