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

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

Our great sponsors
  • InfluxDB - Build time-series-based applications quickly and at scale.
  • SonarQube - Static code analysis for 29 languages.
  • 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

    Build time-series-based applications quickly and at scale.. InfluxDB is the Time Series Platform where developers build real-time applications for analytics, IoT and cloud-native services. Easy to start, it is available in the cloud or on-premises.

  • 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.

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