Skip to content
CAI
Software that uses CAICheck a score

rails/spring

71.9

Strong · 19 September 2026

2.5k

lines of production code

Ruby

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

This system is Spring, an application preloader designed to accelerate Rails and Rake command execution by keeping application processes alive in the background. It manages the lifecycle of these preloaded processes, monitors file changes to trigger automatic reloading, and provides a structured command-line interface for interacting with the server. The implementation has been modernized to use process spawning instead of forking, with strict support requirements for Ruby 3.1+ and Rails 6.0+.

How it got here

2012 — Spring 4.7.0 architectural upgrade

8 changes.

This period focused on upgrading the Spring preloader to version 4.7.0, which introduced a major architectural shift from forking to Process.spawn and dropped support for legacy Rails and Ruby versions. The work included updating the binstub for compatibility, removing the old library entry point, and refactoring the test suite to align with the new requirements and dependencies.

2013–2019 — Client restructuring and test infrastructure

5 changes.

The Spring client was restructured into distinct command classes with modernized binstub generation and improved environment handling for Rails and Rake tasks. This period also involved refactoring the file watcher into an abstract base class and establishing comprehensive unit and acceptance test suites to validate the new architecture.

Removals

Removal of the main Spring library entry point

The primary \lib/spring.rb\ file has been deleted, removing the \Spring\ class that previously handled server bootstrapping, client-server communication via UNIX sockets, and command execution. This change eliminates the core runtime logic for managing the Spring application preloader process.

lib · high confidence

Architecture

Refactored file watcher into abstract base class with polling implementation

The file watching logic has been restructured by extracting common functionality into a new \Spring::Watcher::Abstract\ base class, which handles path resolution, symlink validation, and stale-state management. A concrete \Spring::Watcher::Polling\ implementation is provided, which runs a background thread to periodically check file modification times and notify listeners when changes are detected. This change improves code organization and ensures that relative paths are automatically resolved against the root directory while gracefully handling dangling symlinks.

lib/spring/watcher · high confidence

Behavioural changes

Introduce structured Spring client commands and modernized binstub generation

The Spring client is restructured into distinct command classes (Help, Rails, Run, Server, Status, Stop, Version) to provide clearer CLI interfaces, including a unified \spring rails\ command that wraps subcommands like console, runner, generate, destroy, and test. Binstub generation is modernized with a new \lib/spring/client/binstub.rb\ that supports upgrading legacy binstubs, inserting Spring loaders while preserving shebangs and comments, and removing Spring integration via \--remove\. The \spring rails\ command also extends support to \db:\ tasks (excluding \db:system:change\) by routing them through rake, and the client now handles server version mismatches by auto-restarting the server to ensure compatibility.

lib/spring/client · high confidence

Spring binstub upgraded to v1.1 with client-based execution and compatibility checks

The bin/spring script has been updated to use the new Spring::Client interface instead of the legacy Spring.run method, which is a required step when upgrading from Spring 1.0 to 1.1. The script now detects if Spring is already loaded to prevent conflicts with older binstubs and provides clear instructions for regeneration. It also includes checks for Rubygems versions below 2.1.0 and warns users to run \gem pristine --all\ if unstubbed gems are detected, ensuring better startup performance.

bin · high confidence

Spring command wrappers for Rails and Rake with environment handling

Spring now includes dedicated command wrappers for \rails console\, \rails generate\, \rails destroy\, \rails runner\, \rails test\, and \rake\. These wrappers ensure that environment flags (such as \-e\ or \--environment\) are correctly parsed and passed to the underlying Rails or Rake processes. Specifically, \rails test\ defaults to the \test\ environment unless overridden, while \rails runner\ and \rails console\ respect explicit environment arguments. The \rake\ command supports environment matching via task names (e.g., \test:all\) and environment variables, defaulting to \test\ for test-related tasks.

lib/spring/commands · high confidence

Spring preloader upgraded to version 4.7.0 with major architectural changes

The Spring preloader has been upgraded to version 4.7.0, introducing a significant architectural shift from forking to using \Process.spawn\ for application processes, which improves stability and compatibility. This release drops support for Rails versions prior to 6.0 and Ruby versions prior to 2.7, and requires that application reloading be enabled (configurable via \Spring.dangerously\_allow\_disabling\_reloading\). The update also removes the dependency on the \fiddle\ library by replacing the \SID\ module, vendors the \OkJson\ library to prevent conflicts with bundled JSON gems, and introduces new environment variables like \SPRING\_TMP\_PATH\ and \SPRING\_SERVER\_COMMAND\ for greater configuration flexibility.

lib/spring · high confidence

Test coverage

Add Rails 3.2 test application scaffold; Added acceptance test and refactored test helper; Added unit tests for application stability, command environment parsing, and watcher behavior; Added unit tests for client help and version commands; New acceptance and watcher test infrastructure; Removed acceptance test suite for Rails 3.2 application behavior.

Dependencies

Update gemspec and development dependencies

The gemspec now requires Ruby 3.1 or higher, updates the homepage to the Rails organization, adds an MIT license, and includes changelog metadata. Development dependencies have been adjusted: \rake\ and \bump\ are added, \activesupport\ is moved to a development dependency (with version pinning for minitest), and the test app for Rails 3.2 has been removed.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Baseline

  • First survey — no prior run to compare against. CAI 72.

Lenses

  • Code Health 95
  • Architecture 98
  • Maturity 63
  • Readiness 76
  • Security 74

Changes since last survey

  • 300 commits — 258 feature/other, 42 fixes

By area

  • (root) — 95 commits
  • (repo) — 93 commits
  • lib/spring — 78 commits
  • test/support — 20 commits
  • .github/workflows — 9 commits
  • .devcontainer/Dockerfile — 2 commits
  • .devcontainer/devcontainer-lock.json — 1 commit
  • .devcontainer/devcontainer.json — 1 commit
  • .github/dependabot.yml — 1 commit

Notable commits

  • fix: Downgrade rubygems version to fix CI
  • fix: Fix Build status badge
  • fix: Fix CHANGELOG [ci skip]
  • fix: Fix CHANGELOG entry
  • fix: Fix Gemfile on bundler 2.5.0.dev
  • fix: Fix Rails 7.0 compatibility
  • fix: Fix Rails version that added enable_reloading
  • fix: Fix Ruby 1.9.3 tests
  • fix: Fix STDOUT/ERR kept open after preload failure (#423)
  • fix: Fix binstubs not being replaced when their quoting style was changed
  • fix: Fix check when no command is supplied
  • fix: Fix compatibility with --frozen-string-literal
  • fix: Fix issue with bundler 4
  • fix: Fix rails db:system:change command failure issue
  • fix: Fix raise signature for Ruby < 3.2
  • fix: Fix reloading in Ruby 3.3
  • fix: Fix spawn_on_env vars leaking from server to app
  • fix: Fix the Kernel#raise patch to be Ruby 3.2 compatible
  • fix: Fix the rubygems require
  • fix: Fix the tests for Ruby 3.4
  • …and 280 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

rails/spring was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 19 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 8fefb3850ce648e52a201d73a9882f9a495f3eee — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-13a154b7f5d1.