havenwood changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.1.1, 3.0.3, 2.7.5: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ
ZAJDAN has quit [Ping timeout: 240 seconds]
ua__ has quit [Ping timeout: 256 seconds]
justAstache has quit [Read error: Connection reset by peer]
justAstache has joined #ruby
Synthead has joined #ruby
<Synthead> I have this typical line in a network-enabled program:
<Synthead> Faraday::Connection.new do |faraday|
<Synthead> end
<Synthead> faraday.request(:authorization, :Bearer, access_token)
<Synthead> How can I use rspec to test that faraday is getting configured with the access token?
ur5us has joined #ruby
<adam12> Synthead: Not really what I would test, and I don't use rspec, but you could mock Faraday::Connection.new to yield a double, and then expect on that double to receive request, with the data you expect.
<adam12> Technically you're mocking what you don't own tho, and that's kind of a no-no
<Synthead> yeah I don't like it either
<adam12> Synthead: Maybe you can mock that access_token is expected? Or inspect the faraday connection? I'm not sure.
donofrio has joined #ruby
<Synthead> adam12: yeah... there aren't a lot of great options is what I'm finding
<Synthead> I'm doing the yield thing now, but I'm also calling more than #request on the object, so it's kind of funky
<Synthead> there isn't a great way to read the token either, unless I want to pick at instance vars in the faraday object
<adam12> Could you yield a null object, then expect on that?
<adam12> Then your other calls to the faraday object wouldn't matter?
<adam12> I'd have to see code to give any more suggestions, I think.
<Synthead> adam12: I am yielding a double, yeah
<mooff> agree it's sus
Cena has joined #ruby
<mooff> can you test that it sends a sensible request, rather than 'uses Faraday and calls this method then that method with these args'?
Cena has quit [Ping timeout: 256 seconds]
<adam12> Doh. Misconfigured Rack::Static and realized I lost a few days of Rubygem webhooks for gemdocs.org..
bluedust has joined #ruby
bluedust has quit [Ping timeout: 256 seconds]
ur5us has quit [Ping timeout: 240 seconds]
kaivai has quit [Quit: ZNC - https://znc.in]
kaivai has joined #ruby
gr33n7007h has quit [Ping timeout: 240 seconds]
Rounin has quit [Ping timeout: 240 seconds]
gr33n7007h has joined #ruby
donofrio has quit [Ping timeout: 256 seconds]
justAstache has quit [Remote host closed the connection]
justAstache has joined #ruby
Guest77 has joined #ruby
<Guest77> sdl【】
Guest77 has quit [Quit: Client closed]
ur5us has joined #ruby
michigan has joined #ruby
ur5us has quit [Ping timeout: 256 seconds]
<michigan> adam12: Hey!
<michigan> adam12: Cool!
Starfoxxes has quit [Ping timeout: 260 seconds]
<michigan> Better to put my heart and soul into my Ruby buddies, rather than some random boss who only wants me for his fame and fortune
<michigan> adam12: I redid that latest version based on architectural principles
<michigan> Everything is pixel-perfect and evenly spaced
<michigan> And tilted by 12°
bluedust has joined #ruby
<michigan> Oh yo!
bluedust_ has joined #ruby
<michigan> Doubt I can make a logo as great as Gemdocs, but the other day you also introduced me to NLP.
<michigan> ruby-nlp
<michigan> It's been taking up all my time lately! nor-nlp: https://i.imgur.com/4gyrsRt.png
bluedust has quit [Ping timeout: 240 seconds]
Starfoxxes has joined #ruby
<michigan> People ask me, who is Adam12?
<michigan> I tell them the same thing every time: Disintegrin and metalloproteinase domain-containing protein 12 (previously Meltrin) is an enzyme that in humans is encoded by the ADAM12 gene.
<michigan> lol
<michigan> Later brotherman, I'm out!
polishdub has quit [Quit: Lost terminal]
polishdub has joined #ruby
fef has joined #ruby
polishdub has quit [Remote host closed the connection]
hololeap has quit [Read error: Connection reset by peer]
aeris has quit [Read error: Connection reset by peer]
fef has quit [Read error: Connection reset by peer]
hololeap has joined #ruby
aeris has joined #ruby
fef has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
ua_ has joined #ruby
hololeap has quit [Remote host closed the connection]
fef has quit [Write error: Connection reset by peer]
aeris has quit [Write error: Connection reset by peer]
aeris has joined #ruby
fef has joined #ruby
hololeap has joined #ruby
ur5us has joined #ruby
ur5us_ has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
Synthead has quit [Quit: Leaving]
ur5us_ has quit [Ping timeout: 240 seconds]
seabre has quit [Ping timeout: 250 seconds]
michigan has quit [Quit: Connection closed for inactivity]
seabre has joined #ruby
dhruvasagar has joined #ruby
michigan has joined #ruby
TzilTzal has joined #ruby
ur5us_ has joined #ruby
freeworld has joined #ruby
some14u has joined #ruby
ZAJDAN has joined #ruby
Rounin has joined #ruby
oxfuxxx has joined #ruby
oxfuxxx has quit [Client Quit]
oxfuxxx has joined #ruby
teclator has joined #ruby
oxfuxxx has quit [Quit: Yankies Motherfh@ckers C0[k Astroboys]
oxfuxxx has joined #ruby
taupiqueur has joined #ruby
cybertron has joined #ruby
bluedust_ has quit [Remote host closed the connection]
ur5us_ has quit [Ping timeout: 240 seconds]
ua_ has quit [Ping timeout: 256 seconds]
ua_ has joined #ruby
Jonopoly has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ua_ has quit [Ping timeout: 250 seconds]
ua_ has joined #ruby
oxfuxxx has quit [Quit: Yankies Motherfh@ckers C0[k Astroboys]
oxfuxxx has joined #ruby
ua_ has quit [Ping timeout: 256 seconds]
bluedust has joined #ruby
ua_ has joined #ruby
mitt3ns has quit [Quit: later]
bluedust has quit [Ping timeout: 240 seconds]
bluedust has joined #ruby
_ht has joined #ruby
oxfuxxx has quit [Quit: Yankies Motherfh@ckers C0[k Astroboys]
oxfuxxx has joined #ruby
some14u has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has joined #ruby
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
TzilTzal has quit [Remote host closed the connection]
dhruvasagar has quit [Ping timeout: 256 seconds]
dhruvasagar has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ZAJDAN has quit [Read error: Connection reset by peer]
some14u has joined #ruby
dhruvasagar has quit [Ping timeout: 256 seconds]
dhruvasagar has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dhruvasagar has quit [Ping timeout: 272 seconds]
dhruvasagar has joined #ruby
dhruvasagar has quit [Ping timeout: 240 seconds]
splud has quit [Remote host closed the connection]
splud has joined #ruby
gr33n7007h has quit [Quit: WeeChat 3.4]
Aylat has joined #ruby
Aylat has joined #ruby
Aylat has quit [Changing host]
gr33n7007h has joined #ruby
TCZ has joined #ruby
dhruvasagar has joined #ruby
Jonopoly has quit [Quit: WeeChat 3.0]
dhruvasagar has quit [Ping timeout: 268 seconds]
TomyWork has joined #ruby
taupiqueur has quit [Quit: taupiqueur]
taupiqueur has joined #ruby
oxfuxxx has quit [Ping timeout: 250 seconds]
bluedust has quit [Remote host closed the connection]
dhruvasagar has joined #ruby
bluedust has joined #ruby
dhruvasagar has quit [Ping timeout: 272 seconds]
dhruvasagar has joined #ruby
dhruvasagar has quit [Ping timeout: 256 seconds]
Cena has joined #ruby
gr33n7007h has quit [Quit: WeeChat 3.4]
<rapha> y'all
<rapha> why does `if foo = :foo; ...; end` work, but `if (foo, bar = [:foo, :bar]); ...; end` doesn't?
michigan has quit [Quit: Connection closed for inactivity]
TCZ has quit [Quit: Leaving]
roadie has joined #ruby
Aylat has quit [Read error: Connection reset by peer]
<leah2> wfm?
<leah2> has a warning tho
<rapha> "wfm", leah2?
<rapha> oh, "works for me"
<rapha> ok maybe i'm on too new of a ruby and in yours its just deprecated
<leah2> mine is ruby 3.0
<rapha> oh wait, i get the warning, too, trying it in pry now
<leah2> what does it say in yours?
<rapha> (3.0, too)
<rapha> sad
<rapha> this is very practical
<rapha> but i hate using things that give warnings
<leah2> the warning makes sense in the one-argument case :p
<rapha> hmmm, but there, no warning
<rapha> huh, wait
<rapha> oooooooh
<rapha> ONLY gives a warning if you assign a value
<rapha> gives NO warning if you call upon a function
some14u has joined #ruby
<rapha> and then you can also use 2
<rapha> veeeeeeeeery nice
<leah2> ah reasonable
<leah2> >> if foo = :foo.itself; foo; end
<leah2> :D
<leah2> iirc one didnt need the ()?
<leah2> ah hm, one does
<rapha> hmm i'm using it without () when just needing one
<rapha> also nice hack there :P
<leah2> :p
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Jonopoly has joined #ruby
some14u has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<rapha> is there some nice way of inserting into a Hash after a specific key and before whichever comes next? or is rebuilding the hash manually the only option?
justAstache has quit [Read error: Connection reset by peer]
justAstache has joined #ruby
<leah2> not sure one has control over the order except when adding new stuff
TzilTzal has joined #ruby
<leah2> not sure adding the order at all was such a great idea :p
roadie has quit [Ping timeout: 252 seconds]
<rapha> i would not be able to properly use them if they weren't order-of-insertion
<rapha> but well, fair enough ... i'll make it into an Array, insert where it's needed, and .to_h it oncem ore
TzilTzal has quit [Remote host closed the connection]
roadie has joined #ruby
roadie has quit [Ping timeout: 252 seconds]
dhruvasagar has joined #ruby
roadie has joined #ruby
<ox1eef> at one time it was said that ordered hashs in Ruby are an implementation detail (of Ruby) and shouldn't be relied on. Not that practical though, i think all implementations of Ruby have ordered hashes.
some14u has joined #ruby
some14u has quit [Client Quit]
<rapha> yeah if they removed that implementation detail i think i would either never update ruby again or implement my own OHash class or whatever
some14u has joined #ruby
some14u has quit [Client Quit]
some14u has joined #ruby
some14u has quit [Client Quit]
<ox1eef> hehe
<ox1eef> maybe there's some die hards out there running 1.8.6 or before.
<leah2> it was added later no?
<leah2> 1.9 wow
some14u has joined #ruby
some14u has quit [Client Quit]
justAstache has quit [Read error: Connection reset by peer]
justAstache has joined #ruby
<ox1eef> yeah, that rings a bell.
<havenwood> rapha: Now it's documented and guaranteed. ;)
<havenwood> Set is the new thing that's currently ordered but Matz reserves the right to make it unordered in the future.
<ox1eef> what of SortedSet then? gone, or just an alias?
<havenwood> ox1eef: It's out of stdlib. External gem.
<havenwood> Regular Set happens to be sorted by insertion order, since it's based on Hash, but Matz wants to keep it open to change. Seems kinda like folk are probably relying on it and it'd be hard to change in Ruby 3 but ¯\_(ツ)_/¯
<ox1eef> good to know thanks.
<rapha> havenwood: Thanks for that reassurance :-D
<havenwood> "I weakly disagree with #16992. Currently set orders are determined by the internal hash. We may change the implementation in the future to improve performance or memory overhead. Fixing the order could possibly restrict the future implementation choice." -Matz
* mooff currently relying on it :)
gproto23 has joined #ruby
* mooff even wants Set#first,last,pop,shift,unshift,insert
some14u has joined #ruby
bluedust has quit [Remote host closed the connection]
Cena has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has joined #ruby
Jonopoly has quit [Quit: WeeChat 3.0]
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Cena has joined #ruby
<ox1eef> mooff: i thought sorted set might have those, but doesn't look like it.
mmalter has joined #ruby
some14u has joined #ruby
some14u has quit [Client Quit]
taupiqueur has quit [Read error: Connection reset by peer]
taupiqueur has joined #ruby
bluedust has joined #ruby
bluedust has quit [Remote host closed the connection]
<nakilon> isn't sorted set a tree + optionally hash for lookup?
bluedust has joined #ruby
<nakilon> I don't get how it's integrated; the rbtree rubygems homepage link is rubyforge and is dead
<nakilon> ah, I see, "The interface is the almost identical to that of Hash." -- that's how it glued together
bluedust has quit [Remote host closed the connection]
hesco3 is now known as hresco3
<ox1eef> jruby is usually a special case :)
<ox1eef> i could never really get behind the jvm or its ecosystem, undoubtedly it has cool stuff though.
bluedust has joined #ruby
bluedust has quit [Ping timeout: 272 seconds]
<havenwood> nakilon: When SortedSet was in the stdlib it was a strange implementation where by default it was in Ruby built on top of Set but if rbtree gem (or one of the modern variants that all have lib/rbtree) then it'd use them instead.
<nakilon> the rubygems says it's modern but I don't understand where is the source
<nakilon> code
<havenwood> nakilon: Ah, yeah, looks like rbtree is actively maintained again. It had a lull a few years back and I wasn't tracking.
<ox1eef> SortedSet still seems useful, it's a different kind of sort using the spaceship operator.
taupiqueur has quit [Ping timeout: 240 seconds]
some14u has joined #ruby
some14u has quit [Client Quit]
<mooff> yeah. spaceship sorted, rather than insertion ordered
taupiqueur has joined #ruby
oxfuxxx has joined #ruby
nmollerup has joined #ruby
szkl has quit [Quit: Connection closed for inactivity]
oxfuxxx has quit [Ping timeout: 272 seconds]
<ox1eef> pretty cool and done with very little code, obviously there's more to it when you consider the source of rbtree.
<mooff> substitution principle in action :)
fef has quit [Remote host closed the connection]
mitt3ns has joined #ruby
mitt3ns has quit [Changing host]
mitt3ns has joined #ruby
justAstache has quit [Ping timeout: 272 seconds]
some14u has joined #ruby
ur5us_ has joined #ruby
ur5us_ has quit [Ping timeout: 240 seconds]
Cena has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ua_ has quit [Ping timeout: 252 seconds]
ua_ has joined #ruby
gproto23 has quit [Ping timeout: 256 seconds]
justAstache has joined #ruby
roadie has quit [Ping timeout: 268 seconds]
gproto23 has joined #ruby
Cena has joined #ruby
gigamo has quit [Ping timeout: 252 seconds]
Fusl has quit [Ping timeout: 250 seconds]
gigamo has joined #ruby
Exa has quit [Quit: see ya!]
Exa has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
moldorcoder7 has quit [Quit: %bye mirc%]
moldorcoder7 has joined #ruby
Fusl has joined #ruby
ur5us_ has joined #ruby
roadie has joined #ruby
SebasDev has joined #ruby
dhruvasagar has quit [Quit: WeeChat 3.4]
<SebasDev> Hello
SebasDev has quit [Client Quit]
roadie has quit [Ping timeout: 268 seconds]
<adam12> heh
<adam12> o/ bye
roadie has joined #ruby
some14u has joined #ruby
roadie has quit [Ping timeout: 252 seconds]
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roadie has joined #ruby
some14u has joined #ruby
some14u has quit [Client Quit]
roadie has quit [Ping timeout: 252 seconds]
fowl9 has joined #ruby
gproto23 has quit [Remote host closed the connection]
fowl has quit [Ping timeout: 272 seconds]
fowl9 is now known as fowl
roadie has joined #ruby
roadie has quit [Remote host closed the connection]
roadie has joined #ruby
bluedust has joined #ruby
mitt3ns has quit [Read error: Connection reset by peer]
mitt3ns has joined #ruby
mitt3ns has joined #ruby
mitt3ns has quit [Changing host]
bluedust has quit [Ping timeout: 250 seconds]
ccooke has quit [Remote host closed the connection]
some14u has joined #ruby
_ht has quit [Remote host closed the connection]
roadie has quit [Ping timeout: 268 seconds]
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has joined #ruby
FetidToot6 has joined #ruby
FetidToot has quit [Ping timeout: 256 seconds]
FetidToot has joined #ruby
peer has quit [Quit: Ping timeout (120 seconds)]
peer has joined #ruby
FetidToot6 has quit [Ping timeout: 260 seconds]
mitt3ns has quit [Ping timeout: 245 seconds]
mitt3ns has joined #ruby
mitt3ns has quit [Changing host]
mitt3ns has joined #ruby
aeris has quit [Quit: ZNC - http://znc.sourceforge.net]
aeris has joined #ruby
roadie has joined #ruby
cahoots has joined #ruby
<cahoots> hi, how can i find the location of my irb command history?
roadie has quit [Ping timeout: 250 seconds]
TomyWork has quit [Remote host closed the connection]
roadie has joined #ruby
roadie has quit [Ping timeout: 252 seconds]
some14u has quit [Quit: Textual IRC Client: www.textualapp.com]
roadie has joined #ruby
Pixi_ has joined #ruby
_axx4 has joined #ruby
HyLian has quit [Ping timeout: 256 seconds]
benjamin- has joined #ruby
HyLian has joined #ruby
cnsvc- has quit [Ping timeout: 256 seconds]
benjaminwil has quit [Ping timeout: 256 seconds]
cnsvc has joined #ruby
mitt3ns has quit [Ping timeout: 272 seconds]
pandabot_ has joined #ruby
pandabot has quit [Ping timeout: 256 seconds]
Pixi has quit [Ping timeout: 256 seconds]
miah has quit [Ping timeout: 256 seconds]
eam has quit [Ping timeout: 256 seconds]
_axx has quit [Ping timeout: 256 seconds]
_axx4 is now known as _axx
eam has joined #ruby
miah has joined #ruby
roadie has quit [Ping timeout: 260 seconds]
taupiqueur has quit [Ping timeout: 240 seconds]
mitt3ns has joined #ruby
mitt3ns has joined #ruby
roadie has joined #ruby
donofrio has joined #ruby
roadie has quit [Ping timeout: 260 seconds]
mitt3ns has quit [Ping timeout: 250 seconds]
<ox1eef> it should be ~/.irb_history on *nix
pandabot_ is now known as pandabot
mitt3ns has joined #ruby
mitt3ns has quit [Changing host]
mitt3ns has joined #ruby
roadie has joined #ruby
mitt3ns has quit [Ping timeout: 256 seconds]
ur5us_ has quit [Ping timeout: 240 seconds]
donofrio has quit [Ping timeout: 256 seconds]
roadie has quit [Ping timeout: 240 seconds]
Cena has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mitt3ns has joined #ruby
mitt3ns has quit [Changing host]
mitt3ns has joined #ruby