jfelchner/ruby-progressbar
54.6
Adequate · 6 November 2026
1k
lines of production code
Ruby
primary language
4
measurements over time
What this system is
This system is a Ruby library that provides a customizable progress bar for command-line and non-terminal environments. It features modular components for rendering status, dynamic terminal width detection, and an enumerator refinement for seamless integration with iteration loops. The codebase includes comprehensive test coverage and tooling for gem signing and multi-version Ruby compatibility.
How it got here
2009–2013 — Modular refactoring and test expansion
13 changes.
The project underwent a significant architectural refactoring, breaking down the monolithic progress bar logic into modular component classes for formatting, state management, and output. This structural overhaul was accompanied by the establishment of a comprehensive RSpec test suite to ensure reliability and the introduction of new features like unknown progress support and custom error handling.
2014–2023 — dynamic terminal support and developer tooling
8 changes.
The project introduced dynamic terminal width detection to ensure progress bars adapt correctly to the current window size, replacing static behavior. It also expanded output modes for better control in non-terminal environments and added a Ruby Enumerator refinement for seamless progress bar integration during iteration. Additionally, the period saw the addition of developer convenience scripts, gem signing infrastructure, and comprehensive test coverage for the new features.
Features
Add Enumerator refinement for progress bar integration
Introduces a new refinement module that adds a \with\_progressbar\ method to Ruby's \Enumerator\ class. This allows users to iterate over enumerables while automatically updating a progress bar, handling argument passing based on the block's arity.
lib/ruby-progressbar/refinements · high confidence
Added Ruby gem signing certificate
A new public certificate (jfelchner.pem) has been added to the repository to enable signing of Ruby gems. This certificate is valid from February 2023 to February 2026 and is associated with the account [e-mail redacted], allowing for secure distribution and verification of signed gem packages.
certs · high confidence
New bin/console and bin/setup scripts for interactive and initial project configuration
Added a new bin/console script that launches an IRB session with the project's default and console Bundler groups loaded, enabling interactive development. Additionally, introduced a bin/setup script that automates initial project configuration by installing Ruby and NPM dependencies, configuring Bundler credentials via environment variables, setting local Git configuration values (such as application name and deployment profile), and installing the overcommit gem to manage Git hooks.
bin · high confidence
New output modes and environment variable support
The library now supports three distinct output modes: TTY (default, respects the new RUBY\_PROGRESS\_BAR\_FORMAT environment variable), NonTty (optimized for non-terminal environments to prevent errors on decrement), and Null (silences all output). Users can now explicitly choose to suppress progress bar output entirely or customize the format string via an environment variable.
lib/ruby-progressbar/outputs · high confidence
Behavioural changes
Add InvalidProgressError for invalid progress states
A new InvalidProgressError class has been added to the library, inheriting from RuntimeError. This allows parent libraries to specifically catch and handle errors related to invalid progress values, rather than relying on generic error handling.
lib/ruby-progressbar/errors · high confidence
New dynamic terminal width calculation for progress bar length
The progress bar now automatically detects the terminal width to adjust its length dynamically, replacing the previous static or environment-variable-only behavior. This is achieved by introducing a new \ProgressBar::Calculators::Length\ class that attempts to determine the column count via the \winsize\ attribute on the output stream, the \IO.console\ object, or by falling back to shell commands (\stty\ or \tput\) if the standard libraries are unavailable. This ensures the progress bar fits the current terminal window size correctly, especially in environments like Spring where dynamic length detection was previously broken.
lib/ruby-progressbar/calculators · high confidence
Progress bar components refactored into modular classes
The internal structure of the progress bar has been refactored to separate concerns into distinct component classes (Bar, Percentage, Rate, Time, Title). This change introduces support for a configurable 'remainder\_mark' to customize the appearance of the uncompleted portion of the bar, adds a wall clock time completion estimate (%W flag), and allows the rate component to be scaled via a custom lambda. The refactoring also standardizes time formatting with 2-decimal precision for rates and handles unknown progress states with a configurable animation.
lib/ruby-progressbar/components · high confidence
Progress bar state management and output behavior updates
The progress bar now prevents duplicate output when methods like finish, resume, or stop are called multiple times, and it no longer allows progress changes (such as setting total or progress) while the bar is in a stopped state. Additionally, the library now supports an 'unknown' total amount of progress, displaying '??' for the total and using a specific animation for unknown progress steps, while the deprecated 'smoothing' and 'running\_average\_rate' options now trigger warnings directing users to the new projector configuration.
lib/ruby-progressbar · high confidence
Refactored progress bar formatting into modular components
The formatting logic for the progress bar has been restructured into distinct, reusable components (title, percentage, time, bar, and rate) to improve maintainability and consistency. This change introduces new format flags, including %R for rate display with two decimal places of precision, %u to show a placeholder when the total is unknown, and %W for a complete bar with percentage. It also adds support for right-justified percentages via %j and %J, and displays wall clock time to completion using %l. The underlying parsing engine now uses a molecule-based approach to handle format strings, ensuring that bar and non-bar elements are processed separately for accurate length calculations.
lib/ruby-progressbar/format · high confidence
Standardize entry point and add backward-compatible factory method
The library now exposes a unified entry point via \lib/progressbar.rb\ (and \lib/ruby-progressbar.rb\) that loads the core \ProgressBar::Base\ and conditionally loads refinements. To maintain backward compatibility with pre-1.0 usage patterns, a \ProgressBar.create\ factory method is provided, which delegates to \ProgressBar::Base.new\, allowing existing code to instantiate progress bars without immediate refactoring.
lib · high confidence
Test coverage
Add RSpec test configuration and support files; Added benchmark fixture script; Added comprehensive RSpec test suite for Ruby Progressbar components; Added comprehensive test coverage for progress bar components; Added test infrastructure for time mocking and warning filtering; Added tests for the Length calculator; Added tests for the Progress Enumerator refinement; Added tests for the progress bar format components.
Dependencies
Add development dependencies and multi-version Gemfile scaffolding
The project now includes a structured set of development dependencies and a multi-version Gemfile configuration to support testing across different Ruby environments. The gemspec defines development dependencies for rspec (\~\> 3.7), rspectacular (\~\> 0.70.6), fuubar (\~\> 2.3), and timecop (\~\> 0.9). Additionally, a new \gemfiles/\ directory introduces version-specific Gemfiles (v1, v2.3, v2.4, v2.7, v4.0) that pin specific versions of \ruby-prof\ (ranging from 0.15.8 to 1.6+) and \awesome\_print\ (\~\> 1.6) for MRI platforms, alongside updated lockfiles reflecting these dependency resolutions.
(dependencies) · high confidence
Added checksums for ruby-progressbar gem versions
Added MD5, SHA256, and SHA512 checksum files for the ruby-progressbar gem versions 1.8.0, 1.8.1, 1.8.3, 1.9.0, 1.10.0, 1.10.1, 1.11.0, 1.12.0, and 1.13.0, as well as the progressbar gem versions 1.8.1, 1.8.2, 1.9.0, 1.10.0, 1.10.1, 1.11.0, 1.12.0, and 1.13.0. These checksums allow for verification of the integrity of the respective gem packages.
checksum · high confidence
Housekeeping
Repository initialization with comprehensive configuration and documentation
This change establishes the project's foundational structure by adding a complete set of configuration files, including a detailed .gitignore, .ruby-version (3.4.8), and an extensive suite of RuboCop configuration files (.rubocop.yml and its modular includes for Capybara, FactoryBot, RSpec, Performance, and Thread Safety). It also introduces a .remarkrc for Markdown linting, a .yamllint configuration, an .overcommit.yml for Git hooks, and a .chamber.pub.pem for secret management. Documentation is standardized with a new CHANGELOG.md, README.md, LICENSE.txt, and CODE-OF-CONDUCT.md, while legacy files like ChangeLog and progressbar.en.rd are removed.
(repo-wide) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 55 → 55 (-0.3)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 61 → 61 (+0.0)
- Architecture 69 → 69 (+0.0)
- Maturity 41 → 41 (+0.0)
- Readiness 71 → 71 (+0.0)
- Security 90 → 83 (-6.9)
Resolved (10)
- Combinatorial explosion of methods: Four methods exist for percentage display, varying by justification and precision. This is a classic API inconsistency where simple variations are exposed as distinct methods rather than parameters.
- Duplicate lifecycle control: Both Base and Progress expose a reset method. This suggests duplicated state reset logic or ambiguous responsibility for what 'reset' entails (does it reset the timer? the progress count? both?).
- Duplicate lifecycle control: Both Base and Progress expose a start method with identical signatures. Since ProgressBar inherits from Base and likely composes or delegates to Progress for state management, having two public start methods creates ambiguity about which state machine is being triggered.
- Duplicate lifecycle control: Similar to start, both Base and Progress expose a finish method. This redundancy confuses users regarding whether calling finish on the bar updates the progress tracker, the timer, or both.
- Duplicate state mutation: Both Base and Progress expose increment and decrement. Since ProgressBar is the public-facing class inheriting from Base, users might call increment on the base class, unaware it might not update the Progress component's internal state if delegation is missing or inconsistent.
- Duplicate state mutation: Both Base and Progress expose a setter for progress. This creates two entry points for the same state, risking inconsistency if one setter updates the other and the other does not.
- Duplicate state mutation: Both Base and Progress expose a setter for total. Same risk as progress=.
- Fragmented API for similar intent: There are five distinct methods for calculating/displaying estimated time, each handling a different edge case or format. This forces users to choose the correct method based on internal state knowledge rather than providing a single flexible method.
- Inconsistent interface implementation: NonTty and Tty implement clear(), but Null also implements clear(). While this might be intentional for interface consistency, Null typically implies no-op behavior. If Null is a valid output strategy, it should be clear that clear is a no-op. However, the bigger issue is that NonTty and Tty have divergent method sets (e.g., NonTty has last_update_length and bar_update_string, while Tty does not).
- Inconsistent naming and parameterization: One method takes a format string, the other implies precision handling. This suggests two different ways to achieve similar output formatting.
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
jfelchner/ruby-progressbar 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 6 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit bafa278bfb14353282c2ae3207060f69615db7ae — the exact code this score is about.
- Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.2+preprod-5c4e66d9318b.