Jan. 25, 2025, 12:03 a.m.

Weeknotes: 20 January to 24 January 2025

Exploring Ruby's Struct class, RSpec's failing tests, more insights on project structure and sustainability design

Sandra's Weeknotes

View of a green field and a snowy Mount Kilimandjaro in the background
Kilima-Ndjaro, 22 VI (1909), Akseli Gallen-Kallela (Finnish, 1865 - 1931)

What I have found gripping

  • In Ruby programming, the class Struct creates a class that can store and fetch values. See an example from irb below:

Book = Struct.new('Book', :title, :author, :year)
Book = Struct.new('Book', 'Sula', 'Toni Morrison', '1973')
Book.inspect
=> "Struct::Book"
Book.members
=> [:Sula, :"Toni Morrison", :"1973"]
  • In RSpec, there is a command to only show failing tests: rspec --only-failures

  • Structuring a new project with a main feature and taking into account constraints involves slowing down before coding

What I have read

  • class Struct, Ruby doc

  • The Karlskrona Manifesto for Sustainability Design

  • Using the --only-failures option, RSpec

What I have watched

The Karlskrona Manifesto on Sustainability Design, Birgit Penzenstadler

Featured quote

Sustainability applies to both a system and its wider contexts. There are at least two spheres to consider in system design: the sustainability of the system itself and how it affects sustainability of the wider system of which it will be part. — The Karlskrona Manifesto

Further reading and resources

In English

  • RSpec docs

  • Sustainability Design: case studies

You just read issue #51 of Sandra's Weeknotes. You can also browse the full archives of this newsletter.

Share on LinkedIn Share via email
Powered by Buttondown, the easiest way to start and grow your newsletter.