jhass[m] changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.1.2, 3.0.4, 2.7.6: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ
smp_ has joined #ruby
smp has quit [Ping timeout: 268 seconds]
smp_ is now known as smp
brand1 has quit [Quit: WeeChat 3.6]
markong has quit [Ping timeout: 265 seconds]
cocalero has quit [Quit: Going offline, see ya! (www.adiirc.com)]
taiju` has joined #ruby
taiju` is now known as taiju
EternalSunshine has joined #ruby
fercell has joined #ruby
fercell has quit [Ping timeout: 265 seconds]
m-antis has quit [Ping timeout: 264 seconds]
oxfuxxx has joined #ruby
artemis has joined #ruby
oxfuxxx has quit [Ping timeout: 268 seconds]
fercell has joined #ruby
oxfuxxx has joined #ruby
artemis has quit [Ping timeout: 265 seconds]
fercell has quit [Ping timeout: 268 seconds]
eddof13 has joined #ruby
eddof13 has quit [Client Quit]
jhass has quit [Ping timeout: 244 seconds]
jhass has joined #ruby
m-antis has joined #ruby
Guimauve has joined #ruby
nirvdrum has joined #ruby
Guimauve has quit [Ping timeout: 252 seconds]
EternalSunshine has quit [Quit: WeeChat 3.6]
Guest6 has joined #ruby
taiju has quit [Remote host closed the connection]
Guest6 is now known as Guimauve
taiju` has joined #ruby
taiju` is now known as taiju
jetchisel has quit [Quit: Unfortunately time is always against us -- [Morpheus]]
nirvdrum has quit [Quit: nirvdrum]
nirvdrum has joined #ruby
<libsys> people... seems like refinements cannot be namespaced?
<libsys> I try with `module Namespace; module String; refine String` and I refinement is not recognized when I do `using Namespace::String`
<libsys> but it works if I simply say `module Namespace; refine String` and then do `using Namsepace`
Successus has quit []
m-antis has quit [Ping timeout: 264 seconds]
nirvdrum has quit [Quit: nirvdrum]
<leftylink> pandabot: rb module Out module In refine String do def ref; :REFINED end end end end; using Out::In; ?a.ref
<pandabot> :REFINED - https://carc.in/#/r/dqzj
<leftylink> the above shows that refinements were successfully namespaced
<leftylink> so it can be good to compare that working example against the non-working example - the differences should explain what has gone wrong
nirvdrum has joined #ruby
<leftylink> here I'll even make the example closer to the original question by using String as the inner name.
<leftylink> pandabot: rb module Out module String refine ::String do def ref; :REFINED end end end end; using Out::In; ?a.ref
<pandabot> stderr: -e:2:in `<main>': uninitialized constant Out::In (NameError) - exit 1 - https://carc.in/#/r/dqzk
<leftylink> pandabot: rb module Out module String refine ::String do def ref; :REFINED end end end end; using Out::String; ?a.ref
<pandabot> :REFINED - https://carc.in/#/r/dqzl
<leftylink> so there we go
<libsys> ok... I needed to add :: to the refined class
<leftylink> a programming language can only do what it is told to do
<leftylink> if a module is told to refine itself, it will do that
<leftylink> pandabot: rb module ShowRef refine(Module) { def refine(m); super.then { "just refined #{m}" } end } end; using ShowRef; module Out module String refine(String) {} end end
<pandabot> "just refined Out::String" - https://carc.in/#/r/dqzq
aeris has quit [Ping timeout: 258 seconds]
nirvdrum has quit [Quit: nirvdrum]
aeris has joined #ruby
nirvdrum has joined #ruby
nirvdrum has quit [Quit: nirvdrum]
nirvdrum has joined #ruby
nirvdrum has quit [Client Quit]
nirvdrum has joined #ruby
aeris has quit [Remote host closed the connection]
aeris has joined #ruby
nirvdrum has quit [Quit: nirvdrum]
Linux_Kerio has joined #ruby
ur5us has quit [Ping timeout: 264 seconds]
teclator has joined #ruby
fercell has joined #ruby
protektwar has joined #ruby
protektwar has quit [Changing host]
protektwar has joined #ruby
fercell has quit [Ping timeout: 264 seconds]
Rounin has joined #ruby
protektwar has quit [Ping timeout: 250 seconds]
mahlon has quit [Ping timeout: 250 seconds]
mahlon has joined #ruby
shokohsc has quit [Quit: The Lounge - https://thelounge.chat]
shokohsc has joined #ruby
Aminda has quit [Remote host closed the connection]
Aminda has joined #ruby
reset has quit [Quit: reset]
gr33n7007h has quit [Quit: WeeChat 3.6]
shokohsc has quit [Quit: The Lounge - https://thelounge.chat]
libsys has quit [Remote host closed the connection]
gr33n7007h has joined #ruby
libsys has joined #ruby
protektwar has joined #ruby
protektwar has joined #ruby
shokohsc has joined #ruby
libsys has quit [Remote host closed the connection]
libsys has joined #ruby
<leftylink> pandabot: what's obviously
<pandabot> obviously is: ->f{f[f]}[->f{Hash.new{|h,k|h[k]=f[f]}}] https://stackoverflow.com/a/17585165
dionysus69 has joined #ruby
Guimauve has quit [Quit: Client closed]
jhass[m] has quit [Quit: Bridge terminating on SIGTERM]
sixecho has quit [Quit: Bridge terminating on SIGTERM]
jollyrogue[m] has quit [Quit: Bridge terminating on SIGTERM]
taiju[m] has quit [Quit: Bridge terminating on SIGTERM]
jhass[m] has joined #ruby
sixecho has joined #ruby
taiju[m] has joined #ruby
jollyrogue[m] has joined #ruby
ur5us has joined #ruby
jpn has joined #ruby
taiju has quit [Ping timeout: 264 seconds]
oxfuxxx has quit [Ping timeout: 250 seconds]
oxfuxxx has joined #ruby
infinityfye has joined #ruby
jpn has quit [Ping timeout: 265 seconds]
fercell has joined #ruby
jpn has joined #ruby
fercell has quit [Ping timeout: 264 seconds]
depesz has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
depesz has joined #ruby
oxfuxxx has quit [Ping timeout: 268 seconds]
TomyWork has joined #ruby
protektwar has quit [Ping timeout: 268 seconds]
markong has joined #ruby
oxfuxxx has joined #ruby
John_Ivan has joined #ruby
protektwar has joined #ruby
protektwar has quit [Changing host]
protektwar has joined #ruby
oxfuxxx has quit [Ping timeout: 268 seconds]
ur5us has quit [Ping timeout: 264 seconds]
SteveR has joined #ruby
m-antis has joined #ruby
jpn has quit [Ping timeout: 264 seconds]
SteveR has quit [Quit: Client closed]
jpn has joined #ruby
mikecmpbll has joined #ruby
oxfuxxx has joined #ruby
jpn has quit [Ping timeout: 268 seconds]
aeris has quit [Remote host closed the connection]
aeris has joined #ruby
<depesz> hi. is there any way to list all modules and classes that get created after I did some require '...' ?
perrierjouet has quit [Quit: WeeChat 3.6]
fercell has joined #ruby
donofrio has joined #ruby
fercell has quit [Ping timeout: 244 seconds]
donofrio_ has joined #ruby
donofrio__ has quit [Ping timeout: 268 seconds]
donofrio__ has joined #ruby
donofrio has quit [Ping timeout: 244 seconds]
donofrio_ has quit [Ping timeout: 264 seconds]
anokasion has quit [Remote host closed the connection]
jpn has joined #ruby
oxfuxxx has quit [Ping timeout: 264 seconds]
taiju` has joined #ruby
taiju` is now known as taiju
John_Ivan_ has joined #ruby
John_Ivan__ has joined #ruby
John_Ivan has quit [Ping timeout: 265 seconds]
protektwar has quit [Ping timeout: 250 seconds]
John_Ivan_ has quit [Ping timeout: 268 seconds]
dionysus69 has quit [Quit: dionysus69]
dionysus69 has joined #ruby
dionysus69 has quit [Ping timeout: 252 seconds]
<adam12> depesz: You can hook into Tracepoint for this.
taiju has quit [Quit: rcirc on GNU Emacs 28.1]
<depesz> can you point me in *any* direction, adam12? that's the first time i hear about "tracepoint", and while I did find https://ruby-doc.org/core-2.7.0/TracePoint.html - i'm not sure how can it help
dionysus69 has joined #ruby
<depesz> gr33n7007h: thanks. that's what I needed
<adam12> depesz: gr33n7007h has a nice solution for ObjectSpace, which is just as well. I'd use Tracepoint if you absolutely need to know what files defined what, but if you only care about new modules/classes, maybe ObjectSpace is more straight forward.
<adam12> depesz: Using tracepoint is similar; assign existing defined classes to variable. Setup trace on :end. When trace is triggered, check existing defined classes for existing constant, and check file path in trace event if necessary.
<depesz> thx. will play with tracepoint, but for now gr33n7007h solution looks to be perfect
szkl has quit [Quit: Connection closed for inactivity]
<gr33n7007h> depesz: here's a tracepoint solution adam12 suggested, to get you started.
<gr33n7007h> TracePoint.new(:end) { puts "\x1b[01;34m#{_1.self}\x1b[0m ::: #{_1.path}" }.enable { require '...' }
perrierjouet has joined #ruby
<adam12> Very nice. Doesn't cover monkey patching but it's what I had in mind, in general.
<gr33n7007h> adam12: do you reckon we could include monkey-patches somehow?
<gr33n7007h> thinking about it, i don't think that's possibility
dionysus69 has quit [Ping timeout: 264 seconds]
dionysus69 has joined #ruby
mdemo has quit [Quit: The Lounge - https://thelounge.github.io]
eddof13 has joined #ruby
mdemo has joined #ruby
<adam12> gr33n7007h: I just figured we'd see if it's defining a new class/module or not. Check objectspace first, then decide if the `end` event triggered on an already known class or not.
oxfuxxx has joined #ruby
oxfuxxx has quit [Client Quit]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Sankalp- has joined #ruby
Sankalp has quit [Ping timeout: 264 seconds]
Sankalp- is now known as Sankalp
eddof13 has joined #ruby
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<gr33n7007h> adam12: didn't think of that approach tbh but that seems the way to go about it.
_ht has joined #ruby
polishdub has joined #ruby
eddof13 has joined #ruby
nirvdrum has joined #ruby
nirvdrum has quit [Client Quit]
jpn has quit [Ping timeout: 250 seconds]
fercell has joined #ruby
reset has joined #ruby
fercell has quit [Ping timeout: 250 seconds]
jpn has joined #ruby
dionysus69 has quit [Ping timeout: 268 seconds]
jpn has quit [Ping timeout: 264 seconds]
dionysus69 has joined #ruby
jpn has joined #ruby
jpn has quit [Ping timeout: 264 seconds]
gschanuel has joined #ruby
jpn has joined #ruby
Aminda has quit [Read error: Connection reset by peer]
aeris has quit [Read error: Connection reset by peer]
aeris has joined #ruby
Aminda has joined #ruby
donofrio has joined #ruby
markong has quit [Ping timeout: 264 seconds]
desnudopenguino has quit [Ping timeout: 244 seconds]
donofrio__ has quit [Ping timeout: 250 seconds]
jpn has quit [Ping timeout: 264 seconds]
Aminda has quit [Remote host closed the connection]
Aminda has joined #ruby
desnudopenguino has joined #ruby
Synthead has joined #ruby
<Synthead> Hey weird question! Is there a way I can package up and create an "installer" for an app I'm working on for windows?
<Synthead> I suppose I'd need to package ruby and some gems, then wrap it in an installer or something?
desnudopenguino has quit [Client Quit]
desnudopenguino has joined #ruby
<adam12> Synthead: I'm not sure there's a great technique anymore. There was ruby2exe and another Windows variant.
<adam12> Synthead: It might be worth exploring JRuby in this case. You can package it into a JAR using something like Warbler.
<Synthead> hey that's interesting
keb has joined #ruby
fercell has joined #ruby
jpn has joined #ruby
fercell has quit [Ping timeout: 265 seconds]
<mikecmpbll> there's also ruby-packer, but i haven't use it (https://github.com/pmq20/ruby-packer)
oxfuxxx has joined #ruby
oxfuxxx has quit [Ping timeout: 265 seconds]
TomyWork has quit [Remote host closed the connection]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Synthead has quit [Ping timeout: 244 seconds]
jpn has quit [Ping timeout: 265 seconds]
Synthead has joined #ruby
eddof13 has joined #ruby
cocalero has joined #ruby
cocalero has quit [Quit: Going offline, see ya! (www.adiirc.com)]
_ht has quit [Remote host closed the connection]
desnudopenguino has quit [Quit: desnudopenguino]
desnudopenguino has joined #ruby
dionysus69 has quit [Ping timeout: 265 seconds]
Aminda has quit [Remote host closed the connection]
Aminda has joined #ruby
jpn has joined #ruby
desnudopenguino has quit [Quit: desnudopenguino]
desnudopenguino has joined #ruby
jpn has quit [Ping timeout: 268 seconds]
perrierjouet has quit [Quit: WeeChat 3.6]
perrierjouet has joined #ruby
ur5us has joined #ruby
markong has joined #ruby
oxfuxxx has joined #ruby
Linux_Kerio has quit [Ping timeout: 250 seconds]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
teclator has quit [Remote host closed the connection]
sagax has quit [Read error: Connection reset by peer]
oxfuxxx has quit [Ping timeout: 268 seconds]
oxfuxxx has joined #ruby
oxfuxxx has quit [Client Quit]
aeris has quit [Remote host closed the connection]
aeris has joined #ruby
infinityfye has quit [Quit: Leaving]
littlebuddy has quit [Ping timeout: 252 seconds]
littlebuddy has joined #ruby
plujon has joined #ruby
fercell has joined #ruby
<plujon> Greetings; I have a project dependent on an abandoned gem that appears to not work with ruby 3.0+. I'm thinking of updating it to work with Ruby 3.0, but my ruby-fu is a little weak.
<plujon> The gem is The gem is https://github.com/stripe-ruby-mock/stripe-ruby-mock , and it fails with Ruby 3.0 because it does this: Stripe::StripeClient.send(:define_method, :execute_request) { |*args| instance.mock_request(*args) }
jpn has joined #ruby
fercell has quit [Ping timeout: 268 seconds]
<plujon> And, as you may guess, the mock_request method has some named parameters with default values: def mock_request(method, url, api_key: nil, params: {}, headers: {})
jpn has quit [Ping timeout: 264 seconds]
<leftylink> dang I was trying to figure out why I couldn't get it to fail then realised I'm testing on 2.7. very inattentive I was.
<leftylink> pandabot: rb def f(a, b: nil, c: {}); "f #{a} #{b} #{c}" end; lambda { |*args| f(*args) }[1, b: 1]
<pandabot> stderr: -e:2:in `f': wrong number of arguments (given 2, expected 1) (ArgumentError) - exit 1 - https://carc.in/#/r/dr7u
<leftylink> okay indeed indeed
<leftylink> pandabot: rb def f(a, b: nil, c: {}); "f #{a} #{b} #{c}" end; lambda { |*args, **kwargs| f(*args, **kwargs) }[1, b: 1]
<pandabot> "f 1 1 {}" - https://carc.in/#/r/dr7w
<leftylink> well, perhaps there is hope that that is good enough...
Rounin has quit [Ping timeout: 264 seconds]
keb has quit [Remote host closed the connection]
taiju has joined #ruby
Synthead has quit [Quit: Leaving]