-
With last week’s release of my gem, re2, I had to update its documentation. I use YARD to generate the documentation from the source code and host it using GitHub Pages.
After generating the latest documentation with
yard doc
, I noticed some broken links when I deployed it, specifically when trying to load the alphabetic index. This is a known issue with YARD and GitHub Pages as Jekyll will ignore any files beginning with an underscore.Chris suggested that I stop GitHub Pages running the documentation through Jekyll altogether by placing a
.nojekyll
file in the root of the repository and that fixed the missing index. -
Tom tweeted about an upcoming change to Ruby that will allow you to use
MatchData
objects when pattern matching, e.g.if NAN_REGEXP.match(string) in { sign:, payload: } Nan.new(payload: payload&.to_i(16) || 0, negated: sign == '-') elsif INFINITE_REGEXP.match(string) in { sign: } Infinite.new(negated: sign == '-') end
As I haven’t yet tried pattern matching in recent versions of Ruby, I implemented it for
RE2::MatchData
and released it in 1.6.0.if RE2('foo(?P<suffix>...)').match('foobar') in suffix: puts suffix end # bar
It was quite fun to figure out exactly how
RE2::MatchData#deconstruct
andRE2::MatchData#deconstruct_keys
should behave but the tests in Ruby were a huge help. -
We’ve been slowly but steadily replacing flimsy things in our kitchen with OXO Good Grips equivalents when they break:
Draw your own similarities to the IKEA scene from “Fight Club”.
Weeknotes #98
By Paul Mucur,
on