havenwood changed the topic of #ruby to: Ruby 3.2.2, 3.1.4, 3.3.0-preview1: https://www.ruby-lang.org | Rules: https://ruby-community.com | Logs: https://libera.irclog.whitequark.org/ruby
konsolebox has quit [Quit: Leaving]
ox1eef_ has joined #ruby
roadie` has joined #ruby
roadie` has quit [Ping timeout: 255 seconds]
markong has quit [Ping timeout: 240 seconds]
dalan03822 has quit [Ping timeout: 264 seconds]
dalan03822 has joined #ruby
mags has quit [Remote host closed the connection]
roadie` has joined #ruby
roadie` has quit [Ping timeout: 255 seconds]
roadie` has joined #ruby
roadie` has quit [Ping timeout: 255 seconds]
konsolebox has joined #ruby
caedmon has joined #ruby
caedmon has quit [Ping timeout: 246 seconds]
_ht has joined #ruby
mags has joined #ruby
caedmon has joined #ruby
konsolebox has quit [Quit: Leaving]
grenierm has joined #ruby
caedmon has quit [Ping timeout: 246 seconds]
roadie` has joined #ruby
_ht has quit [Quit: _ht]
Sankalp has quit [Ping timeout: 240 seconds]
dalan03822 has quit [Quit: dalan03822]
dalan03822 has joined #ruby
Sankalp has joined #ruby
hightower3 has quit [Quit: Leaving]
brokkoli_origin has quit [Ping timeout: 246 seconds]
roadie` is now known as roadie
teclator has joined #ruby
tomtmym has joined #ruby
tomtmym has quit [Changing host]
tomtmym has joined #ruby
otisolsen70 has joined #ruby
Sobinec has joined #ruby
infinityfye has joined #ruby
taupiqueur_shiny has joined #ruby
taupiqueur_shiny has quit [Remote host closed the connection]
brokkoli_origin has joined #ruby
havenwood has quit [Quit: Ping timeout (120 seconds)]
valley has joined #ruby
havenwood has joined #ruby
grenierm has quit [Ping timeout: 246 seconds]
jvalleroy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
jvalleroy has joined #ruby
momo- has joined #ruby
sgtapple has quit [Ping timeout: 245 seconds]
Sankalp has quit [Ping timeout: 246 seconds]
sgtapple has joined #ruby
Sankalp has joined #ruby
otisolsen70 has quit [Quit: Leaving]
Linux_Kerio has joined #ruby
valley has quit [Remote host closed the connection]
valley has joined #ruby
momo- has quit [Ping timeout: 240 seconds]
valley has quit [Remote host closed the connection]
valley has joined #ruby
<nona> hmm ... do we agree with https://thoughtbot.com/blog/don-t-inline-rescue-in-ruby ? i never felt mislead by inline rescue the way the author describes. but perhaps that's just me?
<nona> and i'm wondering why sometimes i see `thing.that_can_go_wrong rescue raise StandardError` and sometimes `thing.that_can_go_wrong rescue StandardError`? the latter seems kind of nonsensical.
BazzaBazaa has joined #ruby
momo- has joined #ruby
momo- has quit [Ping timeout: 260 seconds]
konsolebox has joined #ruby
<sarna> to me sounds like the real problem with inline rescue is that it's a bare rescue?
<sarna> it'll rescue *all* exceptions, including typos and such
<sarna> so the regular caveats wrt bare rescue apply
finalblast has joined #ruby
<nona> hmm yeah it is overly broad
<nona> thanks for the shift of perspective
jetchisel has quit [Quit: Unfortunately time is always against us -- [Morpheus]]
jetchisel has joined #ruby
momo- has joined #ruby
TomyWork has joined #ruby
markong has joined #ruby
BazzaBazaa has quit [Remote host closed the connection]
valley has quit [Remote host closed the connection]
valley has joined #ruby
jhass has quit [Quit: Bye]
valley has quit [Remote host closed the connection]
BazzaBazaa has joined #ruby
jhass has joined #ruby
jhass[m] has left #ruby [#ruby]
jhass has quit [Remote host closed the connection]
jhass has joined #ruby
BazzaBazaa has quit [Remote host closed the connection]
BazzaBazaa has joined #ruby
<adam12> nona: IMHO, avoid inline rescue.
markong has quit [Ping timeout: 252 seconds]
BazzaBazaa has quit [Remote host closed the connection]
momo- has quit [Ping timeout: 250 seconds]
sagax has joined #ruby
<sagax> hi all
<Sobinec> Hi, @sagax
<sagax> how to convert string to hexcode? example, when i puts some string, i see in stdout not only hexcode
markong has joined #ruby
<Sobinec> string = "Hello, World!"
<Sobinec> hex_code = string.unpack('H*').first
<Sobinec> Like that, if I wasnt wrong
<nona> adam12: funny, i was just thinking "yeah, no single reason to ever use it" and then i just found https://gist.github.com/sixtyfive/52bcc0e42261289a4ea907e6907ec580
<sagax> Sobinec: i know this method
<adam12> nona: Fun stuff.
<Sobinec> @sagax , well, I can't help with anything else then :(
<nona> adam12: i mean, c'mon https://gist.github.com/sixtyfive/6c604b5850e8d06a87a5d36fc653a7d2 isn't much worse but much more concise
TomyLobo2 has joined #ruby
TomyWork has quit [Ping timeout: 246 seconds]
<ox1eef_> nona: Generally not considered a best practice but there can be exceptions to the rule.
BazzaBazaa has joined #ruby
<nona> ox1eef_: even in light of https://bugs.ruby-lang.org/issues/10042 ?
<nona> oh. that's completely new syntax to me.
<nona> -> is a "lambda", right?
<adam12> nona: yeah
<ox1eef_> It is not something I would use in a production environment but for quick hacks.
<nona> and .call and -> go together?
<adam12> nona: lambda/proc's have #call method. So we need to invoke the .call method.
<nona> sadly, ox1eef_, this is most certainly production...
<adam12> nona: There's shorthands that could work here but they are not as elegant, imho. try.() { current_baz }. try[] { current_baz }
<adam12> the later is only on newer Ruby versions, IIRC.
<nona> oh that looks cool tho
<nona> unfortunately i'm stuck on 2.7 for now
<adam12> I'd probably extract method in production code with a better name.
<nona> oooh, the brackets only substitute `call`
<adam12> And drop the proc in favour of the method.
<nona> i understood some of those words
<nona> proc being the {} behind .call?
<adam12> Well, presumably this would be in a class of some sort. GatherFoobars. You have some perform method that does the gathering.
<adam12> I might have a private method that is `handle_failure` which does the same as my proc.
<adam12> then `perform` could be `[handle_failure { current_foo }, handle_failure { current_bar }, ...]`.
<nona> alas, it's not in a class but buried in 4 levels of modules
<adam12> Classes all the things
<nona> but what you describe should still work
<adam12> Extract Class and Extract Method are some of the two best refactoring methods.
<adam12> Do you have the Refactoring Ruby book? It's pretty decent.
<adam12> Tho it's out of print so you'll need to hit up ebay/similar.
<nona> i do think i have it as a pdf
<nona> it's just that i'm not feeling confident enough with this codebase yet to improve things outside of a very local scope. like, rewrite a method ok, rewrite a module/class ... better wait until i've seen more of it.
<nona> the lambda technique looks fine for now
<adam12> Yeah. I'd focus on tests until you build up some confidence.
<adam12> A lot of walking skeleton tests.
<nona> hahah. tests. good one :)
<adam12> LOL
<nona> in all seriousness, there are some. just nowhere near full coverage.
<nona> hmm, i never heard "walking skeleton test" before though.
<adam12> I'd focus on outside in tests. Something that just treats it like a blackbox.
<adam12> It's from the book ... let me think.
<adam12> Working Effectively with Legacy Code
<adam12> by Feathers, IIRC.
<ox1eef_> Capybara / chromedriver
<adam12> Looks similar enough. Basically, start the application, automate tests somehow, then shut down the application. At least that's my memory of it.
<adam12> Cover all the happy paths, then you can start slowly refactoring or adding more tests.
<adam12> It's been a while since I read the book...
<nona> i'll talk about that with my boss
<nona> the problem is that the customer's management doesn't allow them even to fix bugs ... they want them to focus on new features
<adam12> People start with unit testing which can work but sometimes you don't have enough knowledge about.
<ox1eef_> That's a recipe for disaster.
<adam12> Tho there is a guilded rose video that does mutation testing + unit testing and it looked super interesting. I'd love to try it.
<adam12> Yeah, that's bad management. Like buying a car but never servicing it.
<nona> yeah ox1eef_ the development team know about it. and they have a really cool scrum master, who's trying to shield them from management's weirdnesses and do deals, like "ok, we'll do feature x without complaining about it, but then you'll have to allow us a bugweek first".
<adam12> Here's the guilded rose video. 3 short parts but not in Ruby. https://youtu.be/zyM2Ep28ED8
<adam12> I spend most of my time consulting, so the "no bug fixes" is something I do see fairly often. But generally I find management just doesn't want a huge rewrite of features.
<nona> oh wow, Emily Bach seems cool
<adam12> I ship a ton of refactorings every week. I'm pretty sure even in the Refactoring Ruby book, they call out that you should always be refactoring.
<adam12> For me, sometimes refactoring is a bug fix :)
<nona> so i'll aspire to be like you :)
<adam12> LOL. If you ship features + bugs, nobody cares.
<adam12> s/bugs/bug fixes
<nona> so far i've been doing a lot of what i've learned is known as "boyscouting" and its been appreciated
<adam12> but if you only ship refactoring / bug fixes, it's where people start to complain about lack of forward direction.
<ox1eef_> On the other hand, it is important to deliver value and not focus entirely on engineering that doesn't reflect in end user experience.
<nona> hmm ok so it's about balance
<ox1eef_> Yep
<adam12> Just cite Kent Beck. For each desired change, make the change easy (warning: this may be hard), then make the easy change.
<adam12> If I'm tasked to ship a feature, I generally won't just drop it on top because it's likely a poor fit. I might insert a few seams or break up a very large class before doing the feature work.
<adam12> Anyways, speaking of work. Good luck!
<nona> you too! :)
<ox1eef_> Have a good one
<nona> and you, ox1eef_
<ox1eef_> Cheers
konsolebox has quit [Quit: Leaving]
eddof13 has joined #ruby
krk85 has joined #ruby
krk85 has quit [Client Quit]
BazzaBazaa has quit [Remote host closed the connection]
_ht has joined #ruby
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eddof13 has joined #ruby
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
___nick___ has joined #ruby
Sankalp has quit [Ping timeout: 245 seconds]
graywolf has joined #ruby
Sankalp has joined #ruby
teclator has quit [Ping timeout: 260 seconds]
highs78 has joined #ruby
konsolebox has joined #ruby
eddof13 has joined #ruby
markong has quit [Ping timeout: 260 seconds]
Sampersand has joined #ruby
<Sampersand> Hi all! Question about rspec: Is there a way to have toplevel `before`s run _AFTER_ `before`s defined in children `context`s?
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gabrielcsf has quit [Remote host closed the connection]
konsolebox has quit [Ping timeout: 240 seconds]
<ox1eef_> Sampersand: they're run in the order they're defined.
<Sampersand> darn, ok
konsolebox has joined #ruby
TomyLobo2 has quit [Remote host closed the connection]
mbarbar has quit [Ping timeout: 240 seconds]
mbarbar has joined #ruby
teclator has joined #ruby
Sampersand has quit [Quit: Client closed]
smp has quit [Ping timeout: 245 seconds]
smp has joined #ruby
octobear has quit [Remote host closed the connection]
eddof13 has joined #ruby
highs78 has quit [Remote host closed the connection]
foggin has joined #ruby
Linux_Kerio has quit [Ping timeout: 260 seconds]
infernix has quit [Remote host closed the connection]
<isene> Having battled with curses (again) for a few days, I now have an upgrade to my curses extension: https://github.com/isene/Ruby-Curses-Class-Extension
<isene> I'm thinking about rewriting the whole curses class for ruby from scratch - the one that exists is silly
zachb has joined #ruby
zaben has quit [*.net *.split]
finalblast has quit [Quit: WeeChat 3.8]
Sobinec has quit [Remote host closed the connection]
<adam12> isene: The curses class is definitely an odd one.
<ox1eef_> Probably have more success learning the C API and building on top of that. At least the C API is well documented.
<isene> ox1eef_: Yes, that's what I actually meant
caedmon has joined #ruby
weaksauc_ has joined #ruby
weaksauce has quit [Ping timeout: 246 seconds]
<isene> Our maybe I should write it from scratch in our Ruby. Shouldn't be very difficult.
<weaksauc_> progress happens by the people around
caedmon has quit [Ping timeout: 260 seconds]
Sobinec has joined #ruby
kaivai has quit [Ping timeout: 252 seconds]
konsolebox has quit [Quit: Leaving]
fowl9 has joined #ruby
___nick___ has quit [Ping timeout: 245 seconds]
fowl has quit [Ping timeout: 258 seconds]
fowl9 is now known as fowl
infinityfye has quit [Quit: Leaving]
caedmon has joined #ruby
Thanzex has quit [Quit: The Lounge - https://thelounge.chat]
<isene> Damn autocorrect; Or maybe I should write it from scratch in pure Ruby. Shouldn't be very difficult.
foggin has quit [Quit: Best CPUs can count to infinity twice without being bugged out by zero division errors or whatnot.]
Thanzex has joined #ruby
_ht has quit [Quit: _ht]
caedmon has quit [Ping timeout: 245 seconds]
Sobinec has quit [Remote host closed the connection]
infernix has joined #ruby
Sampersand has joined #ruby
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
reset has quit [Ping timeout: 246 seconds]
caedmon has joined #ruby
mark22k has quit [Quit: The Lounge - https://thelounge.chat]
mark22k has joined #ruby
caedmon has quit [Ping timeout: 245 seconds]
c10l has quit [Quit: See ya! o/]
c10l has joined #ruby
Sampersand has quit [Quit: Client closed]
neshpion has joined #ruby
ua_ has quit [Excess Flood]
ua_ has joined #ruby
tomtmym has quit [Quit: Gone.]
anihil has joined #ruby
roadie has quit [Ping timeout: 255 seconds]
roadie has joined #ruby
roadie has quit [Ping timeout: 255 seconds]
anihil has quit [Quit: WeeChat 4.0.1]
Guest8 has joined #ruby
Guest8 has quit [Client Quit]
Thanzex has quit [Quit: The Lounge - https://thelounge.chat]
Thanzex has joined #ruby
roadie has joined #ruby
teclator has quit [Ping timeout: 252 seconds]
roadie` has joined #ruby
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
roadie has quit [Ping timeout: 255 seconds]
indomi has joined #ruby
indomi has quit [Quit: Best CPUs can count to infinity twice without being bugged out by zero division errors or whatnot.]
roadie` has quit [Ping timeout: 255 seconds]
graywolf has quit [Ping timeout: 250 seconds]
roadie` has joined #ruby
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eddof13 has joined #ruby
roadie` has quit [Ping timeout: 255 seconds]
Sankalp has quit [Ping timeout: 245 seconds]
Sampersand has joined #ruby
Sankalp has joined #ruby
kaivai has joined #ruby
mags has quit [Remote host closed the connection]
mags has joined #ruby
Sampersand has quit [Quit: Client closed]
markong has joined #ruby