ruby
Just used “ensure” in Ruby exception handling for—I think—the first time. Immediately got confused by it! Even if it’s the last thing occurring in a method, the last line isn’t the return value of the method unless you explicitly return it. I presume things are getting handed back up the stack in a way that loses the value, but should investigate the behaviour to understand it when I have time.
Tags:
I'm not a fan of most of RSpec's DSL, so appreciated this article from Test Double suggesting the use of Ruby 3's endless method syntax instead of using let.
def foo = bar.new
instead of
let foo { bar.new }
Not considered that before, and combined with using instance variables instead of let!, it reinforces and makes more obvious the difference.
Tags:
Read through Avdi Grimm’s Exceptional Ruby. I don’t think there was much in there new to me but it cemented a few things and touched on some more obscure nuggets I’ve not come across before.
Tags:
Signed up for First Ruby Friend after Brighton Ruby and have just been matched to someone! First chat tomorrow.
Tags:
Writing the Jobs plugin for Redmine is the first time I've got to use some Ruby features in anger-the ability to reopen classes and throw a bunch more code inside is incredibly powerful, and means Redmine's plugin system doesn't need to do a huge amount to let you do... pretty much anything.
Tags:
I really need to remember to use --only-failures more often when debugging RSpec specs.
Tags:
Note to self that I should learn mocha more thoroughly. The test failure blocking my Kamal PR is mocha-related, and it seems to be a solid addition to a minitest-based test suite.
Tags:
Finished reading the RSpec book yesterday. I’m not sure I learned much on a technical level but I have a slightly deeper understanding and respect for the design choices that went into making it what it is, I think.
Not that I like it any more than I did.
Not that I like it any more than I did.
Tags:
I've gotten a lot better at diving into other people's source code (e.g. gems) when debugging, but note to self to use `source_location` and `bundle show` to speed up this process.
Tags:
Spent some time today Rubocopping a legacy application. Think I had a fairly good workflow that will be worth writing up.
Tags:
Wrote a simple feature flagging gem. Its nice how little functionality this needs to be useful.
https://rubygems.org/gems/flaggle_rock
https://rubygems.org/gems/flaggle_rock
Tags:
Set up virus scanning on Active storage attachments with Clamby. Might be worth a quick blog post or PR to their docs as there were a couple of gotchas.
Tags:
I’ve written a nice little gem to generate an iCalendar feed of birthdays from CardDAV contacts. Very rewarding little self-contained project.