Ruby
-
Statistics for My Blog
When thinking about how to kick off NaBloPoMo 2024 this past weekend, instead of picking one of several drafts or mostly written articles I naturally decided that we should instead start with something fresh!
-
Write cleaner, self-documented tests by defining methods in RSpec
Writing methods in RSpec lets us clean up our tests while improving their documentation value and isolation.
-
DRY Your Gemfile with .ruby-version
You probably have a
ruby "3.2.2"directive in your projects’ Gemfiles, and you may also have a .ruby-version file that your Ruby switcher uses. -
See the History of a Method with git log -L
Git can “trace the evolution” of a specific method, showing you logs of how it has changed over time.
-
The Decree Design Pattern
The Decree pattern helps developers write single-purpose service objects that have a predictable API contract, are composable, are easily tested, and isolate the core logic of your app.
-
Read Ruby's Enumerable Docs
Become familiar with Enumerable to grow as Rubyist and write clearer, more performant code.
-
Chesterton's Fence
We should heed Chesterton’s Fence and be careful to consider why our teammates wrote the code that they did before we look at it and think “there is a better way”.
-
Avoid Test Delays And Speed Up Your Development Cycle by Mocking Callbacks
It takes a bit more work to mock a method that has a callback block than one without, but it’s worth it.
-
Mixing it up with Mocktail
Mocktail is a new testing library from the lovely folks at Test Double. It seeks to provide a more modern, less intrusive, and friendlier interface for using test doubles.
-
Sorting Rubyists
We’ll visualize the steps for several sorting algorithms not only using pretty visualizations on a slide, but also with people as the objects being sorted. Don’t know what an algorithm is, what performance really means, or what “Big O” means, or what these best-, worst-, and average-case time...
-
Stabby Stubbing
Define a .call() on service objects to stub with Procs.