havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.7.2, 2.6.6, 3.0.0-preview1: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
joshuacronemeyer has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
siloxid has quit [Remote host closed the connection]
donofrio has quit [Remote host closed the connection]
bsdbandit-01 has quit [Read error: Connection reset by peer]
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
rafadc has quit [Ping timeout: 260 seconds]
mikecmpbll has quit [Ping timeout: 240 seconds]
bsdbandit-01 has joined #ruby
mikecmpbll has joined #ruby
bmurt has joined #ruby
duderonomy has quit [Ping timeout: 260 seconds]
duderono_ has joined #ruby
Swyper has joined #ruby
impermanence has quit [Ping timeout: 246 seconds]
TCZ has quit [Quit: Leaving]
drincruz has quit [Ping timeout: 264 seconds]
Swyper has quit [Remote host closed the connection]
Rudd0 has quit [Ping timeout: 240 seconds]
Swyper has joined #ruby
Swyper_ has joined #ruby
Swyper has quit [Ping timeout: 260 seconds]
gix has quit [Ping timeout: 240 seconds]
bvdw has quit [Quit: The Lounge - https://thelounge.chat]
bvdw has joined #ruby
Swyper_ has quit [Remote host closed the connection]
roshanavand_ has joined #ruby
roshanavand has quit [Ping timeout: 265 seconds]
roshanavand_ is now known as roshanavand
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Emmanuel_Chanel has quit [Ping timeout: 256 seconds]
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
arekushi has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
Swyper has quit [Remote host closed the connection]
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
mikecmpbll has quit [Ping timeout: 240 seconds]
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
mikecmpbll has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
evdubs_ is now known as evdubs
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
cthu| has quit [Ping timeout: 258 seconds]
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
dionysus69 has quit [Ping timeout: 240 seconds]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
alfiemax has joined #ruby
Rudd0 has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
ur5us has quit [Ping timeout: 260 seconds]
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Read error: Connection reset by peer]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
ap4y has quit [Ping timeout: 240 seconds]
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
pxl has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Ping timeout: 272 seconds]
pxl has quit [Quit: Leaving]
pxl has joined #ruby
cd has quit [Quit: cd]
alfiemax has quit [Ping timeout: 240 seconds]
alfiemax has joined #ruby
blueFire has joined #ruby
blueFire has quit [Client Quit]
_whitelogger has joined #ruby
jordanm has quit [Ping timeout: 272 seconds]
mikecmpbll has quit [Ping timeout: 240 seconds]
jordanm has joined #ruby
mikecmpbll has joined #ruby
ChmEarl has quit [Quit: Leaving]
rafadc has joined #ruby
rafadc has quit [Ping timeout: 246 seconds]
pxl has quit [Ping timeout: 240 seconds]
alfiemax has quit [Remote host closed the connection]
rafadc has joined #ruby
alfiemax has joined #ruby
a-l-e has joined #ruby
dfucci has joined #ruby
vondruch has joined #ruby
rafadc has quit [Read error: Connection reset by peer]
Swyper has joined #ruby
Swyper has quit [Read error: Connection reset by peer]
burgestrand has joined #ruby
Swyper has joined #ruby
rafadc has joined #ruby
Swyper has quit [Remote host closed the connection]
rafadc has quit [Read error: Connection reset by peer]
rafadc has joined #ruby
jobewan has quit [Ping timeout: 256 seconds]
Swyper has joined #ruby
jobewan has joined #ruby
Swyper_ has joined #ruby
Swyper has quit [Read error: Connection reset by peer]
dfucci has quit [Ping timeout: 240 seconds]
sleetdrop has joined #ruby
cuerbot has joined #ruby
elcuervo has quit [Ping timeout: 240 seconds]
akem has quit [Ping timeout: 264 seconds]
pentest1337 has joined #ruby
<pentest1337> hi
<pentest1337> !
ldepandis has joined #ruby
pentest1337 has left #ruby [#ruby]
dfucci has joined #ruby
mikecmpbll has quit [Ping timeout: 240 seconds]
akem has joined #ruby
sagax has quit [Read error: Connection reset by peer]
mikecmpbll has joined #ruby
ur5us has joined #ruby
alfiemax has quit [Remote host closed the connection]
rafadc_ has joined #ruby
rafadc has quit [Ping timeout: 272 seconds]
BSaboia has joined #ruby
alfiemax has joined #ruby
rafadc_ has quit [Read error: Connection reset by peer]
rafadc has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
Swyper_ has quit [Remote host closed the connection]
Swyper has joined #ruby
sagax has joined #ruby
dfucci has quit [Ping timeout: 260 seconds]
mikecmpbll has quit [Ping timeout: 258 seconds]
imode has quit [Ping timeout: 272 seconds]
Technodrome has joined #ruby
mikecmpbll has joined #ruby
lanky_leguan has joined #ruby
donofrio has joined #ruby
alfiemax has quit [Remote host closed the connection]
<lanky_leguan> rdoc delete_if says 'array is changed instantly every time the block is called', reject! says 'array may not be be changed instantly every time the block is called'; is that observable for me?
<lanky_leguan> probably IN the block, right?
alfiemax has joined #ruby
akem_ has joined #ruby
TCZ has joined #ruby
akem has quit [Ping timeout: 240 seconds]
dionysus69 has joined #ruby
lanky_leguan has quit [Remote host closed the connection]
akem_ has quit [Ping timeout: 240 seconds]
TCZ has quit [Quit: Leaving]
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TCZ has joined #ruby
mikecmpbll has quit [Ping timeout: 240 seconds]
rafadc has quit [Quit: ZNC - https://znc.in]
<EdwardIII> hey, i'm playing with minitest_benchmark for the first time, but i'm confused. i think assert_performance_constant should fail if the execution (or cpu time?) goes up. it looks like the numbers are going up, but the benchmark doesn't fail? https://gist.github.com/EdwardIII/b4cc6f9902962b5dea3cac82bbb8aa93
troulouliou_div2 has joined #ruby
mikecmpbll has joined #ruby
rafadc has joined #ruby
ramfjord_ has quit [Ping timeout: 240 seconds]
akem has joined #ruby
<jhass> EdwardIII: constant doesn't mean independent of n
<jhass> it tests that doubling n doesn't quadruple the time
ramfjord has joined #ruby
<jhass> (not exactly, paraphrasing)
<EdwardIII> jhass: ah ok, it actually says 'you probably want to tighten it from the default', so i should do that then :)
<EdwardIII> in my test i'm injecting in a double which is obviously lightning fast. but in reality it'll be an http request (i'm comparing a non-threading with a threading implementation. kinda for fun
<jhass> yeah, it's probably not good for anything that does IO
<jhass> benchmarking IO is very very hard
troulouliou_div2 has quit [Ping timeout: 265 seconds]
Rudd0^ has joined #ruby
Rudd0 has quit [Ping timeout: 272 seconds]
<EdwardIII> jhass: i was wondering about that. is there some way to emulate io blocking calls with a test double? i'm guessing based on your comment the answer is "not easily" :)
burgestrand has quit [Quit: burgestrand]
stan has quit [Quit: killed]
turt2live has quit [Quit: killed]
MeVegan[m] has quit [Quit: killed]
Arkaniad has quit [Quit: killed]
nod0n[m] has quit [Quit: killed]
r34lp0w3r[m] has quit [Quit: killed]
Romain[m] has quit [Quit: killed]
sepp2k has quit [Quit: killed]
linuus[m] has quit [Quit: killed]
hsiktas[m] has quit [Quit: killed]
finn[m] has quit [Quit: killed]
<jhass> I mean you could put a sleep call into a stubbed method body, but...
MeVegan[m] has joined #ruby
sleetdrop has quit [Ping timeout: 256 seconds]
<EdwardIII> jhass: but? :)
<jhass> I wouldn't be sure it unlocks the same locks
fercell has joined #ruby
<EdwardIII> hmm right
<EdwardIII> i guess as long as it's the kind of speed problem solved by threading in MRI it should show a big impact in the benchmarks
_whitelogger has joined #ruby
rubydoc has joined #ruby
fowl has joined #ruby
Lewix has joined #ruby
lxsameer has joined #ruby
fercell has quit [Ping timeout: 244 seconds]
fercell has joined #ruby
Swyper has joined #ruby
arekushi has joined #ruby
podman has joined #ruby
Liothen has joined #ruby
hsiktas[m] has joined #ruby
Arkaniad has joined #ruby
stan has joined #ruby
turt2live has joined #ruby
linuus[m] has joined #ruby
nod0n[m] has joined #ruby
sepp2k has joined #ruby
finn[m] has joined #ruby
burgestrand has joined #ruby
bmurt has joined #ruby
<EdwardIII> jhass: awesome, sleep seems to work perfectly: https://gist.github.com/EdwardIII/2015424fa615e148cf6af6ed189cb6a0 now i just need to figure out how to verify is i've done anything not thread-safe
mikecmpbll has quit [Ping timeout: 265 seconds]
mikecmpbll has joined #ruby
Nahra has joined #ruby
ap4y has joined #ruby
ap4y has quit [Ping timeout: 260 seconds]
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
vondruch has quit [Ping timeout: 260 seconds]
neozor has joined #ruby
<neozor> Hi! Just wanted to share some concerns i have of my OO design approach. I'm trying to put in practice The POODR by sandi metz, I'm building a very standard API which has a key and a series of get and post requests.
fercell has quit [Ping timeout: 260 seconds]
Nahra has quit [Ping timeout: 260 seconds]
<neozor> When i'm dveloping APIs i always hesitate where the put the module that takes care of the http requests and json parsing if it's present. This time wanted to make that responsibility as a role, moving the actual http request parsing and json parsing to another role called requestable, then including that module in my API. I think this is a good approach because in the future i can reuse this module that only depends on the
<neozor> 'HTTP' gem.
<neozor> The part where I'm not sure if this is really a role and I'm not separating responsibilities just for the sake of having less code in one file
<EdwardIII> neozor: i think this is how ActiveRecord does it, right? https://api.rubyonrails.org/classes/ActiveModel/Serializers/JSON.html
<neozor> Sometimes i'm not sure if I'm following the right path when working with modules and composition
drincruz has joined #ruby
<EdwardIII> neozor: well it depends on what you think is good :) obviously rails devs thought it was fine, but a lot of people don't like ActiveRecord. i guess a more 'purist' approach would be to have a service class that serialises the objects and just use that everywhere, but i find ActiveRecord's approach is OK in small doses
<EdwardIII> by adding this mixin to a class you are increasing it's responsibilities for sure, but you're also making it super easy to use, and keeping things in a logical place. so it's a trade-off :)
Nahra has joined #ruby
Nahra has quit [Client Quit]
wallace_mu has joined #ruby
<EdwardIII> neozor: as for whether it's premature, i guess the right approach is, if it's only one object that needs it, leave it on there, and extract it when necessary using TDD along the way to ensure it does what you think
<EdwardIII> (99 bottles of OOP is brilliant for this)
<neozor> EdwardIII: When you say that is how ActiveRecord does it, should i take a look at the serializers Module?
akem has quit [Ping timeout: 240 seconds]
<EdwardIII> neozor: well i meant just more from a perspective of "if activerecord does it, it can't be that bad", but opinions differ
weaksauce has quit [Ping timeout: 256 seconds]
Nahra has joined #ruby
<neozor> what i often see is the 'able' suffix not being followed 100% of time. So every mixin is not taken as a role
Nahra has quit [Client Quit]
<neozor> And sometimes is hard to follow this naming 'able' convention
<EdwardIII> neozor: yesss, although maybe that's a sign that it's not the right thing to do in a mixin
<EdwardIII> this is all very abstract :) got some code you can gist?
<neozor> Sure, i can copy it. Should i follow some rule about sharing a gist? Is there a common tool used here?
wallace_mu has quit []
wallace_mu has joined #ruby
wallace_mu has quit [Client Quit]
Nahra has joined #ruby
<EdwardIII> just pasting into gist and pasting the link is good i think. or do you have a public project on github?
troulouliou_div2 has joined #ruby
<ruby[bot]> neozor: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
<neozor> a shoot
davispuh has joined #ruby
<neozor> Here's an example
bsdbandit-01 has quit [Quit: -a- Connection Timed Out]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Excess Flood]
bsdbandit-01 has joined #ruby
Emmanuel_Chanel has joined #ruby
Emmanuel_Chanel has quit [Max SendQ exceeded]
akem has joined #ruby
vondruch has joined #ruby
alfiemax has quit [Remote host closed the connection]
BSaboia has quit [Quit: This computer has gone to sleep]
<EdwardIII> neozor: for my money, if i was making this, i'd rather just have a HttpClient or something and not use a mixin like this (also what's with webinar/base?)
<EdwardIII> i'd also be very careful about silently eating the RequestError
<EdwardIII> neozor: i think you'll find using TDD really helpful. make the simplest, quickest, maybe even dirtiest thing that makes the test pass, then build up from there if you think you need it (e.g. if you now need to add some new functionality and it doesn't seem easy)
Technodrome has joined #ruby
Nahra has quit [Quit: leaving]
Nahra has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
stoffus has quit [Quit: leaving]
Nahra has quit [Quit: leaving]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
weaksauce has joined #ruby
impermanence has joined #ruby
mikecmpbll has quit [Ping timeout: 240 seconds]
<neozor> EdwardIII: Thanks for the tips, I did my test suite first but from that side I'm covered
<EdwardIII> neozor: it's more the "do the basics, then only change something if you need to" :)
<EdwardIII> rather than just having tests at all
BSaboia has joined #ruby
ChmEarl has joined #ruby
mikecmpbll has joined #ruby
<neozor> EdwardIII: I was silently eating the request errors because I wanted my frontend not to worry about communication errors, just checking empty means that is invalid
<neozor> But maybe i need t move this validation a level up and make some intermediary between this API and my app
Emmanuel_Chanel has joined #ruby
<EdwardIII> neozor: it can be useful to give a reason the app can report back on
<EdwardIII> even if it's just "Sorry an error occured, try later"
<neozor> that's true, i was delegating the case of having an error to an empty object, but is better to fail hard
<neozor> Now that i see I'm making too much assumptions
<neozor> EdwardIII: Thanks a lot for your contributions, at the moment I'm in a very small team and sometimes i don't have the opportunity to discuss my ideas to another colleague
<EdwardIII> neozor: yeah, true of many people :) IRC is great for that
houhoulis has joined #ruby
neozor has quit []
bmurt has joined #ruby
bmurt has quit [Client Quit]
adu has joined #ruby
houhoulis has quit []
justache has quit [Remote host closed the connection]
justache has joined #ruby
fercell has joined #ruby
Technodrome has joined #ruby
troulouliou_div2 has quit [Quit: Leaving]
skryking has joined #ruby
<EdwardIII> if you use rubocop: do you folks bother writing top level comments for classes? or just disable that rubocop rule for test cases? looking at our tests, those comments would just be pointless noise i think
<burgestrand> EdwardIII for some, yes — I just joined a new project, and while the code-base is small/well-written I found it hard to parse what the purpose of some classes/modules existing
BSaboia has quit [Quit: This computer has gone to sleep]
<burgestrand> I kept forgetting what a class was for, and so I had to re-read its code all the time to remind myself, eventually I just added 1-2 YARD paragraphs and that made things so much better
<EdwardIII> burgestrand: that makes sense. i'm looking at things like this triggering the rule and thinking "hmm not sure a comment would bring much value": https://gist.github.com/EdwardIII/5017d514894a1d603161e271e2821d30
<burgestrand> EdwardIII that would indeed strike me as excessive :)
<EdwardIII> but i've also just realised this is off by default for tests in rubocop, and it's because i called my directory "tests" not test :)
dionysus69 has quit [Ping timeout: 256 seconds]
<EdwardIII> nice
Emmanuel_Chanel has quit [Quit: Leaving]
Emmanuel_Chanel has joined #ruby
BSaboia has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
adu has quit [Quit: adu]
Technodrome has joined #ruby
<havenwood> EdwardIII: I disable the cops that offend me, which aren't that many.
<apotheon> Taken out of context, that statement is hilarious.
<havenwood> apotheon: Reminds me of years ago talking a bit too loud in a Mexican restaurant about how we should kill *all* the Unicorns, including the leader, and see how God handles it compared to Blue Pill.
<apotheon> lovely
<Frankenlime> kill all parents and orphans
<apotheon> "After you kill parents, make sure you kill their orphans, too."
<havenwood> Frankenlime: What about the zombie orphans of the parents I've killed?
<Frankenlime> yeah but you have to kill -HEAD those
<EdwardIII> havenwood: makes sense
pxl has joined #ruby
foxxx0 has quit [Quit: foxxx0]
foxxx0 has joined #ruby
mikecmpbll has quit [Ping timeout: 240 seconds]
greengriminal has joined #ruby
burgestrand has quit [Quit: burgestrand]
TCZ has quit [Quit: Leaving]
mikecmpbll has joined #ruby
troulouliou_div2 has joined #ruby
cthu| has joined #ruby
ramfjord has quit [Ping timeout: 272 seconds]
mikecmpbll has quit [Quit: inabit. zz.]
ramfjord has joined #ruby
cd has joined #ruby
ramfjord has quit [Ping timeout: 272 seconds]
cthu| has quit [Read error: Connection reset by peer]
cthu| has joined #ruby
ramfjord has joined #ruby
greengriminal has quit [Quit: This computer has gone to sleep]
troulouliou_div2 has quit [Ping timeout: 260 seconds]
greengriminal has joined #ruby
cthu| has quit [Read error: Connection reset by peer]
cthu| has joined #ruby
ruurd has quit [Read error: Connection reset by peer]
ruurd has joined #ruby
vondruch has quit [Ping timeout: 240 seconds]
joshuacronemeyer has joined #ruby
akem_ has joined #ruby
akem_ has quit [Remote host closed the connection]
akem_ has joined #ruby
akem has quit [Ping timeout: 240 seconds]
akem_ is now known as akem
baweaver changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.7.2, 2.6.6, 3.0.0-preview1: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
<baweaver> havenwood: Woo, victory is mine this round
<havenwood> baweaver: What??? How?!?
<havenwood> What did I miss?
<baweaver> 2.7.2
<havenwood> Oh, wow. Of course! I swear I updated it, but must have dreampt it.
<havenwood> dreamt*
<havenwood> I put the "P" in dreamt, that's how hard I dream.
<havenwood> baweaver: touche
* havenwood waits to pounce on ruby-3.0.0-preview2...
davispuh has quit [Ping timeout: 240 seconds]
Swyper_ has joined #ruby
Swyper_ has quit [Remote host closed the connection]
Swyper has quit [Ping timeout: 272 seconds]
howdoi has joined #ruby
davispuh has joined #ruby
alfiemax has joined #ruby
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
akem has quit [Ping timeout: 264 seconds]
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
blueFire has joined #ruby
GankMove has quit [Quit: GankMove]
<apotheon> early adopters
davispuh has quit [Ping timeout: 264 seconds]
blueFire has quit [Quit: WeeChat 1.4]
davispuh has joined #ruby
arichiardi[m] has joined #ruby
<arichiardi[m]> I there I am new to ruby...how can I debug a "can't add a new key into hash during iteration" when initializing a logstash plugin?
<arichiardi[m]> actually never mind the "logstash" plugin part :D
<arichiardi[m]> I am inside an rspec test and I keep receiving that above error and I don't know how to solve
<jhass> arichiardi[m]: look for things doing some_hash.each do; some_hash[something] = else; end
<jhass> and don't do it
<arichiardi[m]> well, the code that throws is not in my control unfortunately...
<jhass> I believe it's an exception, are you sure there's none of your code in the backtrace?
adu has joined #ruby
<arichiardi[m]> only the starting point...it actually brought me to this piece
<arichiardi[m]> it seems like the class is still initializing or something, I read about lazy init in rspec but I am too noob at the moment for understanding what's going on
<jhass> well, it's quite specific. If you can publish some minimal case that reproduces it and people can just download to debug, it might be possible to figure out, but like this it's quite vague :)
<arichiardi[m]> right...yeah ok I will try what I can do...unfortunaetly I am debugging in a docker container...not ideal but thanks jbass
<arichiardi[m]> the culprit seems to be this deep_replace
alfiemax has quit [Remote host closed the connection]
a-l-e has quit [Ping timeout: 246 seconds]
<jhass> are you runnning things in threads somehow?
akem has joined #ruby
nofxx_ has joined #ruby
<jhass> it seems like this shouldn't happen if only a single thread is accessing the hash
<jhass> so maybe two competing threads try to run the initialization at the same time
<jhass> might be as simple as putting a lock around the initializer
Swyper has quit [Remote host closed the connection]
nofxx__ has quit [Ping timeout: 256 seconds]
<arichiardi[m]> I am running rspec, is rspec multi-threaded?
<arichiardi[m]> the code that initializes is `subject! { LogStash::Outputs::Mongodb.new(config) }`
<jhass> shouldn't be by default
<arichiardi[m]> and then in the code I have a `let(:config) do { ... settings stuff... return configuration end`
<jhass> maybe your application code does similar stuff at the same time, in a separate thread?
mikecmpbll has joined #ruby
<jhass> and gets loaded
<arichiardi[m]> well maybe...
braincrash has joined #ruby
cuerbot has quit [Read error: Connection reset by peer]
<arichiardi[m]> I see the params are actually deep-cloned as well https://github.com/elastic/logstash/blob/master/logstash-core/lib/logstash/plugin.rb#L74
Swyper has joined #ruby
<arichiardi[m]> I see the params are actually deep-cloned as well https://github.com/elastic/logstash/blob/master/logstash-core/lib/logstash/plugin.rb#L74
<arichiardi[m]> oh no wait, I...might have found a crazy problem
imode has joined #ruby
elcuervo has joined #ruby
<arichiardi[m]> I don't know what I did, but the problem went away :D
<arichiardi[m]> I think I modified the value of one of the nested keys
<arichiardi[m]> but I am not too sure about that :D
<jhass> heh
<jhass> what works works :)
<arichiardi[m]> oh I found a silly silly mistake
<arichiardi[m]> the input was `{"$inc" => {"quantity": 1}}` instead of `{"$inc" => {"quantity" => 1}}`
<arichiardi[m]> oh man
<arichiardi[m]> thanks jhass for yor asnwers - they indirectly helped a lot :)
<jhass> well, that's just avoiding it because it's stops the code from adding a new key to the hash
<jhass> seems like an upstream bug almost
<arichiardi[m]> uhm do you think? maybe I can file it actually
pxl has quit [Ping timeout: 256 seconds]
Swyper has quit [Read error: Connection reset by peer]
<jhass> I mean the code is supposed to normalize the keys to string keys, if a non-string key actually breaks it...
cliluw has quit [Ping timeout: 256 seconds]
ur5us has joined #ruby
cliluw has joined #ruby
<arichiardi[m]> no but that works...the problem there is the colon vs =>
<arichiardi[m]> which I don't really know if they are different things :D
skryking has quit [Quit: Konversation terminated!]
<jhass> yes, the difference is with the colon the key is not a string but a symbol
<jhass> &>> {a: 1, "b": 2, "c" => 3}
<rubydoc> # => {:a=>1, :b=>2, "c"=>3} (https://carc.in/#/r/9tcg)
<jhass> so "c".to_s is just "c" but :a.to_s is "a", so a new key
adu has quit [Quit: adu]
Azure has quit [Read error: Connection reset by peer]
Azure has joined #ruby
nofxx_ has quit [Ping timeout: 264 seconds]
nofxx has joined #ruby
nofxx has quit [Remote host closed the connection]
nofxx has joined #ruby
gix has joined #ruby
cliluw has quit [Ping timeout: 240 seconds]
<arichiardi[m]> jhass thanks I see now what you mean
joshuacronemeyer has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
nofxx has quit [Remote host closed the connection]
<arichiardi[m]> I will open an issue then
davispuh has quit [Ping timeout: 246 seconds]
nofxx has joined #ruby
skryking has joined #ruby
davispuh has joined #ruby
davispuhh has joined #ruby
davispuh has quit [Ping timeout: 258 seconds]
greengriminal has quit [Quit: This computer has gone to sleep]
adu has joined #ruby
greengriminal has joined #ruby
niceperl has joined #ruby
greengriminal has quit [Client Quit]
cliluw has joined #ruby
fercell has quit [Ping timeout: 240 seconds]
Eiam has quit [Ping timeout: 256 seconds]
Seich_ has joined #ruby
braincrash has quit [Read error: Connection reset by peer]
Seich_ has quit [Client Quit]
Seich_ has joined #ruby
Swyper has joined #ruby
braincrash has joined #ruby
skryking has quit [Ping timeout: 272 seconds]
Swyper has quit [Remote host closed the connection]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
skryking has joined #ruby
arooni_team_b is now known as arooni
ur5us has quit [Ping timeout: 260 seconds]
ur5us has joined #ruby
adu has quit [Quit: adu]
djellemah has joined #ruby
braincrash has quit [Ping timeout: 240 seconds]
skryking has quit [Quit: Konversation terminated!]
bsdband34 has joined #ruby
niceperl has quit [Quit: Leaving...]
bsdbandit-01 has quit [Ping timeout: 260 seconds]
impermanence has quit [Ping timeout: 240 seconds]
iNs_ has quit [Ping timeout: 240 seconds]
iNs has joined #ruby
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
Caerus has quit [Ping timeout: 264 seconds]
Caerus has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
drincruz has quit [Ping timeout: 240 seconds]
bsdband34 has quit [Read error: Connection reset by peer]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Excess Flood]
Emmanuel_Chanel has quit [Quit: Leaving]
Emmanuel_Chanel has joined #ruby
mikecmpbll has quit [Ping timeout: 264 seconds]
djellemah has quit [Ping timeout: 240 seconds]
mikecmpbll has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
ur5us has joined #ruby
Seich_ has quit [Quit: Gone fishing.]
Seich_ has joined #ruby
Seich_ has quit [Client Quit]
Seich_ has joined #ruby
adu has joined #ruby