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
neshpion has joined #ruby
ur5us has quit [Ping timeout: 250 seconds]
hanzo has quit [Quit: Connection closed for inactivity]
ralu1 has quit [Ping timeout: 256 seconds]
comet23 has quit [Ping timeout: 250 seconds]
roadie has joined #ruby
roadie has quit [Ping timeout: 260 seconds]
roadie has joined #ruby
roadie has quit [Ping timeout: 260 seconds]
TCZ has joined #ruby
TCZ is now known as proportions
roadie has joined #ruby
Rounin has quit [Ping timeout: 256 seconds]
roadie has quit [Ping timeout: 240 seconds]
proportions has quit [Quit: ...]
John_Ivan_ has quit [Ping timeout: 246 seconds]
swaggboi has quit [Ping timeout: 250 seconds]
swaggboi has joined #ruby
ur5us has joined #ruby
ua_ has joined #ruby
Pixi` has joined #ruby
Pixi has quit [Ping timeout: 256 seconds]
ua__ has quit [Ping timeout: 256 seconds]
ralu1 has joined #ruby
Sheilong has quit []
<ox1eef> 'final answer' reminds me of that show, 'who wants to be a millionaire'
roadie has joined #ruby
roadie has quit [Ping timeout: 260 seconds]
emcb546 has joined #ruby
emcb54 has quit [Ping timeout: 276 seconds]
emcb546 is now known as emcb54
neshpion has quit [Quit: neshpion]
Ziyan has joined #ruby
tbob has quit [Quit: leaving]
libsys has joined #ruby
jpn has quit [Ping timeout: 240 seconds]
mooff has quit [Remote host closed the connection]
roadie has joined #ruby
mooff has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
ur5us has quit [Ping timeout: 250 seconds]
jpn has joined #ruby
jpn has quit [Ping timeout: 250 seconds]
jpn has joined #ruby
jpn has quit [Ping timeout: 256 seconds]
jpn has joined #ruby
Ziyan has quit [Ping timeout: 240 seconds]
jpn has quit [Ping timeout: 256 seconds]
favadi has joined #ruby
roadie has joined #ruby
ur5us has joined #ruby
jpn has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
jpn has quit [Ping timeout: 276 seconds]
fowl6 has joined #ruby
fowl has quit [Ping timeout: 256 seconds]
fowl6 is now known as fowl
roadie has joined #ruby
Pixi` has quit [Quit: Leaving]
Pixi has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
roadie has quit [Ping timeout: 248 seconds]
favadi has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jpn has joined #ruby
Ziyan has joined #ruby
jpn has quit [Ping timeout: 276 seconds]
roadie has joined #ruby
jpn has joined #ruby
favadi has joined #ruby
jpn has quit [Ping timeout: 276 seconds]
hololeap has joined #ruby
favadi has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
favadi has joined #ruby
favadi has quit [Client Quit]
teclator has joined #ruby
some14u has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has joined #ruby
favadi has joined #ruby
jpn has joined #ruby
favadi has quit [Read error: Connection reset by peer]
jpn has quit [Ping timeout: 246 seconds]
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ziyan has quit [Ping timeout: 256 seconds]
some14u has joined #ruby
Ziyan has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Rounin has joined #ruby
jpn has joined #ruby
Ziyan has quit [Ping timeout: 276 seconds]
jpn has quit [Ping timeout: 256 seconds]
idiocrash has joined #ruby
jpn has joined #ruby
AndreYuhai has joined #ruby
<AndreYuhai> If we've got an haml file for providers/show like this https://bpa.st/IHBQ ,is the JS request made from that file still CORS?
hololeap has quit [Excess Flood]
<AndreYuhai> I'm just confused what would be considered CORS and what not unless it's two different domains which is obvious I guess
hololeap has joined #ruby
jmcgnh has quit [Ping timeout: 246 seconds]
jpn has quit [Ping timeout: 276 seconds]
jmcgnh has joined #ruby
dionysus69 has joined #ruby
dionysus70 has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
dionysus70 is now known as dionysus69
jpn has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
dionysus69 has quit [Ping timeout: 240 seconds]
jpn has quit [Ping timeout: 248 seconds]
roadie has joined #ruby
some14u has joined #ruby
roadie` has joined #ruby
roadie has quit [Remote host closed the connection]
roadie` has quit [Ping timeout: 260 seconds]
roadie` has joined #ruby
oxfuxxx has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jpn has joined #ruby
fef has joined #ruby
jpn has quit [Ping timeout: 246 seconds]
tsujp has joined #ruby
jpn has joined #ruby
dionysus69 has joined #ruby
jpn has quit [Ping timeout: 240 seconds]
some14u has joined #ruby
some14u has quit [Client Quit]
jpn has joined #ruby
jhawthorn_ has quit [Quit: ZNC 1.8.2 - https://znc.in]
jhawthorn has joined #ruby
jpn has quit [Quit: leaving]
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
some14u has joined #ruby
some14u has quit [Client Quit]
Ziyan has joined #ruby
sylario has joined #ruby
Ziyan has quit [Ping timeout: 240 seconds]
some14u has joined #ruby
Ziyan has joined #ruby
oxfuxxx has quit [Ping timeout: 250 seconds]
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ralu1 has quit [Ping timeout: 240 seconds]
some14u has joined #ruby
fef has quit [Quit: Leaving]
Ziyan has quit [Ping timeout: 256 seconds]
Ziyan has joined #ruby
e2 has quit [Remote host closed the connection]
Ziyan has quit [Ping timeout: 240 seconds]
Ziyan has joined #ruby
Ziyan has quit [Ping timeout: 256 seconds]
Ziyan has joined #ruby
ralu1 has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
John_Ivan_ has joined #ruby
Ziyan has quit [Ping timeout: 246 seconds]
some14u has joined #ruby
Ziyan has joined #ruby
dionysus69 has quit [Ping timeout: 246 seconds]
dionysus69 has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ziyan_ has joined #ruby
some14u has joined #ruby
Ziyan has quit [Ping timeout: 250 seconds]
some14u has quit [Client Quit]
CrazyEddy has quit [Ping timeout: 250 seconds]
some14u has joined #ruby
Ziyan has joined #ruby
Ziyan_ has quit [Ping timeout: 260 seconds]
dionysus69 has quit [Ping timeout: 250 seconds]
Ziyan has quit [Ping timeout: 256 seconds]
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
teclator has joined #ruby
reset has joined #ruby
some14u has joined #ruby
AndreYuhai has quit [Ping timeout: 256 seconds]
some14u has quit [Client Quit]
some14u has joined #ruby
<adam12> Does anyone know/remember what IRB calls to display the object return value in the REPL? I thought it might call inspect/pretty_inspect but I'm having no luck.
tsujp has quit [*.net *.split]
hololeap has quit [*.net *.split]
aeris has quit [*.net *.split]
ssh073 has quit [*.net *.split]
roadie` has quit [Ping timeout: 250 seconds]
some14u has quit [Ping timeout: 248 seconds]
<ox1eef> adam12: pretty_print
<adam12> ox1eef: I did try that but to no avail. I think it's an IRB issue.
aeris has joined #ruby
<ox1eef> what does it say? this is how I use it, works for both Object and BasicObject: https://github.com/0x1eef/ryo.rb/blob/master/lib/ryo.rb#L89-L91
<ox1eef> last time i tested it, it was working in irb and pry
<adam12> ox1eef: I'm trying to figure out if it's an issue with IRB or Delegate, but here's an example.
<adam12> require "delegate"; class Foo < SimpleDelegator; def pretty_print(*); raise; end; end; Foo.new("")
<ox1eef> it wont work if you raise
<adam12> Same issue if I return a String. It's just never called.
hololeap has joined #ruby
<ox1eef> please try the example i pasted.
<ox1eef> you shouldnt return a string either
<ox1eef> you should use the object it passes
some14u has joined #ruby
<adam12> ox1eef: Pry does use pretty_print, and using raise or your example does demonstrate it (raise just returns nothing which was fine). IRB doesn't.
<ox1eef> that's strange, as i said that example is working fine for me both in irb and pry. maybe it is an issue with SimpleDelegator.
<adam12> ox1eef: So suspiciously, the Delegator classes all seem to ignore certain methods, but they've been there since the turn of the century so I'm not sure if there's any discussion as to why.
<ox1eef> i'll try your example locally, 1moment
roadie` has joined #ruby
<ox1eef> ah i think i know how it works, you should implement it on the object you delegate to. 1sec and ill confirm.
<ox1eef> yep, thats it adam12
<adam12> Yeah, I was trying to avoid that. This has been a long standing issue for me, since in some ways I feel like it really limits the use of the Delegator.
<adam12> But I see that Tempfile suffers the same fate. Tempfile.new # => #<File ...>. Not that I normally care, but technically it's a #<Tempfile ...>.
<adam12> Anyways, I guess I'll just ditch the delegator.
<adam12> Thanks for looking.
<ox1eef> who knows what voodoo it is doing to do that, a option might be to use the proxy pattern instead.
<ox1eef> no problem.
<ox1eef> that pattern is pretty interesting, i found it in JS - pretty much lets you apply monkeypatches without touching the original object.
bit4bit has joined #ruby
<adam12> ox1eef: Link? I'm doing something similar right now, and have in the past, but if I can't give this a great name for debugging there's going to be confusion.
<adam12> ox1eef: ie. Client and ObservableClient. ObservableClient delegates to Client, but tracks some method calls. But if you have an variable `client`, I kind of expect inspect to show `#<ObservableClient client=other client>`.
roadie` has quit [Ping timeout: 248 seconds]
<adam12> IRB does call pretty_print. It must be Delegate's fault.
* adam12 shakes fist
<ox1eef> it works something like: new Proxy(obj, monkeypatches), then on dispatch of a method it first looks on the monkeypatch object, if it is not there it goes to the first object
tsujp has joined #ruby
<adam12> Interesting, RefactoringGuru uses inheritance and not Delegate for their example. https://refactoring.guru/design-patterns/proxy/ruby/example
<adam12> Which I've contemplated before, but it seems like kind of a hack... but I guess it's fine.
<adam12> Composition over Inheritance and all that.
<ox1eef> yeah, that's not how i would do it. i would implement it much closer to JS.
<adam12> Oh, they use an abstract class too. Hmm.
<ox1eef> they probably do that to share state, but with metaprogramming you can solve that and have an interface much more similar to JS.
roadie` has joined #ruby
some14u has quit [Read error: Connection reset by peer]
some14u has joined #ruby
<ox1eef> that's like the Java model for proxies
<adam12> Definitely.
<adam12> The JS example looks super close to SimpleDelegate :|
<adam12> Unless I'm going crazy.
tsujp has quit [Quit: Client closed]
AndreYuhai has joined #ruby
<ox1eef> kind of, the Reflect object is related, its interface is the same as the monkeypatch / handlier object: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect
<ox1eef> it lets you intercept fundamental operations of any JS object. pretty cool.
AndreYuhai has quit [Ping timeout: 250 seconds]
<jongsta> i have a capistrano script i'm running to execute commands on a remote server. the current line looks like: run %Q(sed -i "s/GRUB_DEFAULT=0/GRUB=DEFAULT='Advanced options for Ubuntu>Ubuntu, with Linux 5.4.0-1072-aws'/" /etc/default/grub)
<jongsta> i want to change it to something like run %Q(sed -i "s/GRUB_DEFAULT=0/GRUB=DEFAULT='Advanced options for Ubuntu>Ubuntu, with Linux $(dpkg-query --showformat='${Version}' --show 'linux-image-5.4*')-aws'/" /etc/default/grub)
<jongsta> will that work the way i have it or are there any special considerations i need to make?
ferr_ has joined #ruby
fercell has quit [Ping timeout: 248 seconds]
Ziyan has joined #ruby
coolshaurya has quit [Quit: Reconnecting]
coolshaurya has joined #ruby
dza has quit [Quit: ]
dza has joined #ruby
dza has quit [Client Quit]
dza has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<adam12> jongsta: It looks fine from a Ruby standpoint.
oxfuxxx has joined #ruby
<jongsta> yah, i tested it out, thanks
e2 has joined #ruby
_ht has joined #ruby
some14u has joined #ruby
some14u has quit [Ping timeout: 248 seconds]
some14u has joined #ruby
some14u has quit [Client Quit]
AndreYuhai has joined #ruby
AndreYuhai has quit [Ping timeout: 256 seconds]
some14u has joined #ruby
some14u- has joined #ruby
ralu1 has quit [Ping timeout: 276 seconds]
idiocrash has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has quit [Ping timeout: 260 seconds]
swaggboi has quit [Ping timeout: 240 seconds]
some14u- has quit [Ping timeout: 260 seconds]
swaggboi has joined #ruby
ralu1 has joined #ruby
CrazyEddy has joined #ruby
AndreYuhai has joined #ruby
oxfuxxx has quit [Ping timeout: 240 seconds]
AndreYuhai has quit [Ping timeout: 240 seconds]
sgt_chuckles has joined #ruby
hololeap has quit [Ping timeout: 240 seconds]
hololeap has joined #ruby
sgt_chuckles has quit [Quit: Client closed]
yxhuvud has quit [Remote host closed the connection]
hololeap has quit [Ping timeout: 240 seconds]
hololeap has joined #ruby
hololeap has quit [Ping timeout: 240 seconds]
SteveR has joined #ruby
hololeap has joined #ruby
SteveR has quit [Quit: Client closed]
axisys_ has quit [Remote host closed the connection]
hololeap has quit [Ping timeout: 240 seconds]
Ziyan has quit [Ping timeout: 246 seconds]
hololeap has joined #ruby
Ziyan has joined #ruby
yxhuvud has joined #ruby
dionysus69 has joined #ruby
some14u has joined #ruby
yxhuvud has quit [Remote host closed the connection]
havenwood has quit [Quit: The Lounge - https://thelounge.chat]
havenwood has joined #ruby
yxhuvud has joined #ruby
yxhuvud has quit [Remote host closed the connection]
gr33n7001 has quit [Quit: WeeChat 3.5]
AndreYuhai has joined #ruby
Ziyan has quit [Ping timeout: 240 seconds]
gr33n7007h has joined #ruby
AndreYuhai has quit [Ping timeout: 256 seconds]
Ziyan has joined #ruby
yxhuvud has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ziyan has quit [Ping timeout: 246 seconds]
Ziyan has joined #ruby
acosta has quit [Remote host closed the connection]
acosta has joined #ruby
some14u has quit [Ping timeout: 248 seconds]
dionysus69 has quit [Quit: dionysus69]
dionysus69 has joined #ruby
Ziyan has quit [Quit: Textual IRC Client: www.textualapp.com]
_ht has quit [Remote host closed the connection]
dionysus69 has quit [Ping timeout: 256 seconds]
danjo00 has joined #ruby
danjo0 has quit [Ping timeout: 252 seconds]
danjo00 is now known as danjo0
oxfuxxx has joined #ruby
some14u has joined #ruby
AndreYuhai has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AndreYuhai has quit [Ping timeout: 272 seconds]
oxfuxxx has quit [Quit: [H]EAT ROX FUCK R0X SHIT BRIX. = The Yankies M0th3Rphackers Coconut Aerospace =]
ur5us has joined #ruby
opv has joined #ruby
<opv> hi all. i know very little of the language and need your help in getting a ruby-based piece of software to work
<opv> the maintainer is providing "prerelease" fixes for a bug which is waiting for upstream, but when i attempt to install the gems i get version errors, namely ffi complaining it needs 6.3 but has 1.15
ur5us has quit [Remote host closed the connection]
<opv> this is the files and information... what am i doing wrong? https://github.com/vagrant-libvirt/vagrant-libvirt/issues/1371
<opv> thank you
hololeap has quit [Ping timeout: 240 seconds]
hololeap has joined #ruby
CrazyEddy is now known as foxhole
duderonomy has joined #ruby
hololeap has quit [Ping timeout: 240 seconds]
hololeap has joined #ruby
sgt_chuckles has joined #ruby
<sgt_chuckles> i keep getting this rubocop error:   [18]:NestedIterators: Okta::Connect::Endpoints::Keys#call contains iterators nested 2 deep [https://github.com/troessner/reek/blob/v6.1.0/docs/Nested-Iterators.md]
<sgt_chuckles> ere is the code in question: https://www.toptal.com/developers/hastebin/xafowetika.sql
<sgt_chuckles> *here
<sgt_chuckles> how can i refactor this elegantly?
<sgt_chuckles> my solution was to do this: https://www.toptal.com/developers/hastebin/anazavuyut.lua
<sgt_chuckles> but idk if theres a more functional way to do it
shiru has joined #ruby
sylario has quit [Quit: Connection closed for inactivity]
shiru has quit [Quit: leaving]
AndreYuhai has joined #ruby
AndreYuhai has quit [Ping timeout: 240 seconds]
hololeap has quit [Ping timeout: 240 seconds]
bit4bit has quit [Quit: Leaving]
hololeap has joined #ruby
ssh073 has joined #ruby
<havenwood> sgt_chuckles: Seems like you could omit the ` { |params| }` part?
<havenwood> sgt_chuckles: No, that doesn't work.
<havenwood> sgt_chuckles: I mean, your refactor doesn't make sense.
hololeap has quit [Ping timeout: 240 seconds]
hololeap has joined #ruby
<havenwood> sgt_chuckles: More code would help with recommendations.
<leftylink> don't see any reason why I should be forbidden from having a block inside another, but if that's what's being enforced, I agree with those above suggestions, which essentially just remove the `then`
<sgt_chuckles> havenwood: i refactored it to this before your response: https://www.toptal.com/developers/hastebin/cudanitevo.lua
<leftylink> the `then` seems pretty easy to remove anyway so it's the most verifiably-correc way of complying
<sgt_chuckles> but the first in your example is good actually
<havenwood> sgt_chuckles: I like the `bind(&:to_h)`
<sgt_chuckles> is there a way to tie that into your `first.rb` example?
<havenwood> sgt_chuckles: It was unclear to me that that'd actually work. We'd need to see more code to know.
<havenwood> But give it a go!
<sgt_chuckles> havenwood: it's just the contents of a method for making an api request.
<sgt_chuckles> your example worked, but I modified it a bit: https://www.toptal.com/developers/hastebin/cadudadoyu.sql
TCZ has joined #ruby
fercell has joined #ruby
ferr_ has quit [Ping timeout: 248 seconds]