Tag: ruby
-
Working with an old codebase today, I moved a method from one file to another. CI was happy.
Then I realised the method didn't have any automated tests, so I wrote one. It turns out its entire (new) file didn't have any, so my change would improve test coverage. Nice.
But it didn't. CI complained that test coverage had dropped. Wait, what? All I did was move some code and add a unit test.
Then I realised that the coverage analysis tool was only counting files that actually contained any tested code. By adding a test to part of a previously-untested file, that file became part of the scored codebase. Uh-oh.
Looked deeper. Turns out the code coverage tool was also counting the test files themselves as being part of the code-under-test.
Fixed all of the above. Code coverage score dropped by about 40%. ๐ฑ
Now I've got more work to do.
Happy Friday. Check what your coverage tool is inspecting, folks.
-
BBC News RSS... with full-size thumbnails!
A user of my Improved BBC News Feeds reached out to suggest that I upgrade the resolution of the thumbnail images. Turns out this was a quick win: my noodles hadn't even cooled before I finished.
-
Some days, developing Three Rings is about being hunched over a keyboard alone in the middle of the night, swearing at Rubygem incompatibilities.
But just ocassionally it's about getting together in beautiful places with some of the most dedicated geeks I know... to swear about Rubygem incompatibilities.
Either way, a walk in the garden can lead to the insight that gets you to the solution.
Alt
A beautiful country house with a huge garden.
-
Did I Cheat?
I solved a puzzle geocache in an unconventional way: by writing a program to permute all the possible solutions and check them for me. Was that cheating? I can see arguments either way...
-
Highlight of my workday was debugging an issue that turned out to be nothing like what the reporter had diagnosed.
The report suggested that our system was having problems parsing URLs with colons in the pathname, suggesting perhaps an encoding issue. It wasn't until I took a deep dive into the logs that I realised that this was a secondary characteristic of many URLs found in customers' SharePoint installations. And many of those URLs get redirected. And SharePoint often uses relative URLs when it sends redirections. And it turned out that our systems' redirect handler... wasn't correctly handling relative URLs.
It all turned into a hundred line automated test to mock SharePoint and demonstrate the problem... followed by a tiny two-line fix to the actual code. And probably the most-satisfying part of my workday!
-
Nostalgia, Music, and Computers
It turns out that I get nostalgic about technology in the same way as I get nostalgic about music. Here's some things that take me right back to being nine, eleven, thirteen and fifteen years old.
-
Pushing RSS to WhatsApp (for free?)
RSS remains the gold standard for subscribing to Web content... but WhatsApp Channels/Newsletters provide another interesting opportunity for syndication. If only somebody had written an RSS-to-WhatApp integration that could run for free in a GitHub Action? Oh wait, that's what I just did!
-
I Wrote the Same Code Six Times!
Could I rock an interview tech-test in a programming language I haven't touched in a decade? I wanted to know, so I found a tech-test... then solved it in six different programming languages in a single sitting.
-
BBC News RSS... your way!
It turns out my filtered BBC News RSS feeds are more-popular than I thought, so I've launched a new site with all of them (plus all the source code to produce them) in a variety of editions.
-
BBC News RSS... with the sport?
Somebody commented on my blog to say they liked my "BBC News... Without The Crap" script, but still wanted sports news in their RSS feed. Luckily, I know just the person for the job: me!
-
The Beeb continue to keep adding more and more non-news content to the BBC News RSS feed (like this ad for the iPlayer app!), so I've once again had to update my script to "fix" the feed so that it only contains, y'know, news.
Alt
Screenshot from a web-based RSS reader, showing an item "Download the BBC iPlayer app"
-
BBC News... without the crap
BBC News' RSS feed has lately started getting duplicates because they're mucking about with guids. Also what's with the iPlayer and BBC Sounds content in there? Let's "fix" that for them, shall we?
-
UK Strikes in .ics Format
Need all the UK strike action in your calendar app? I just helped a coworker with that, and I'm happy to share the results with you.
-
Nginx Caching for Passenger Applications
Adding Nginx microcaching to a Passenger application requires a little thought. Let's save you from thinking about it.
-
LABS Comic RSS Archive
For the benefit of anybody wanting to read LABS comic from the beginning in their RSS reader, Dan writes a tool to facilitate that.










