One Class/Module per File Rules - Working With Nested Modules

This page summarizes the projects mentioned and recommended in the original post on /r/ruby

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • command_kit.rb

    A Ruby toolkit for building complete and robust CLI commands.

    A good way to gain a better understanding is to browse other Ruby code repositories. command_kit.rb is a good one. It has a lot of well organized sub-modules that are easy to to understand without being overwhelming.

  • zeitwerk

    Efficient and thread-safe code loader for Ruby

    If you're working on non-Rails apps and need to deal with loading code, zeitwerk can be used anywhere, unlike the old Rails autoloader. It's also really easy to set up.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

  • HexaPDF

    Versatile PDF creation and manipulation for Ruby

    Break the "rules" if need be. There is no need to separate out small classes into their own file because "something says so". If one were to look for the file of such a class, they would see there isn't one and automatically look into the file of the parent module/class. See e.g. https://github.com/gettalong/hexapdf/blob/master/lib/hexapdf/type/annotation.rb

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts