Skip to content
CAI
Software that uses CAICheck a score

bokmann/business_time

63.4

Adequate · 19 September 2026

637

lines of production code

Ruby

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

This system is a Ruby gem that extends Date, Time, and ActiveSupport::TimeWithZone classes to perform calculations based on business rules, such as workdays, holidays, and custom work hours. It provides methods for determining business day/hour increments, checking weekday status, and calculating consecutive business or non-business days. The library supports flexible configuration via thread-local settings, per-call holiday overrides, and YAML-based initialization, with generators available for Rails integration.

Features

Add Rails generator for Business Time configuration

A new Rails generator has been added that allows users to automatically create and install the default Business Time configuration files. Running the generator produces a \business\_time.rb\ initializer and a \business\_time.yml\ configuration file in the standard Rails directories, streamlining the setup process for the library.

lib/generators · high confidence

Add Rails generator for business time configuration

A new Rails generator has been added to scaffold business time configuration files. Running the generator creates a \config/initializers/business\_time.rb\ file that loads settings from a YAML file, and a \config/business\_time.yml\ file containing default values for work hours (9:00 am to 5:00 pm), holidays, and the work week (Monday through Friday). This allows users to easily customize business hours and holidays via a central YAML configuration file.

_rails\generators · high confidence

Added development convenience scripts for interactive console and environment setup

New executable scripts have been added to the bin directory to streamline local development. The bin/console script provides an interactive Ruby IRB environment pre-loaded with the gem's dependencies (including business\_time), allowing developers to experiment with the codebase easily. The bin/setup script automates the initial environment configuration by running bundle install to ensure all required gems are present.

bin · high confidence

Core extensions for Date, Integer, and Time classes added

This change introduces new core extensions for Ruby's Date, Integer, and Time classes to support business time calculations. The Date class now includes methods for determining workdays, weekdays, and fiscal date metrics (such as fiscal year, quarter, and week). The Integer class gains methods like \business\_hours\ and \business\_days\ to facilitate relative time arithmetic (e.g., \5.business\_hours.from\_now\). The Time class is extended with workday/weekday concepts and class methods. These extensions form the foundation for the library's business logic, enabling users to perform date and time calculations based on business rules.

_lib/business\_time/core\ext · high confidence

Behavioural changes

Business time methods now available on TimeWithZone objects

ActiveSupport::TimeWithZone instances now support business time calculations (such as weekday checks and workday computations) by including the same extensions previously available only on standard Time objects. This ensures consistent behavior for business logic regardless of whether a datetime is stored as a Time or a TimeWithZone.

_lib/business\_time/core\_ext/active\support · high confidence

BusinessTime 0.13.0: Thread-safe config, per-call holidays, and ActiveSupport-compatible date math

This release introduces thread-local configuration support via a new \Config.with\ block, allowing temporary overrides of work hours and holidays without affecting other threads. It also adds the ability to pass a \holidays\ array directly to methods like \workday?\, \business\_days\, and \business\_hours\, enabling per-call holiday definitions that override the static global config. The API now mirrors ActiveSupport's interface with \since\/\ago\ aliases for \after\/\before\ on \BusinessDays\ and \BusinessHours\, and includes new instance methods \weekday?\ and \workday?\ on \Time\. Additionally, the gem now supports configuring per-day work hours via \Config.work\_hours\ and provides \consecutive\_workdays\ and \consecutive\_non\_working\_days\ for calculating streaks of business or non-business days.

_lib/business\time · high confidence

Library initialization and core extension loading

The main library entry point now explicitly requires the core extension files for Integer, Date, Time, and ActiveSupport::TimeWithZone, ensuring these modules are loaded when business\_time is included. This change also adds dependencies on the 'set', 'time', and 'yaml' standard libraries, and loads the configuration, business hours, and business days modules, establishing the foundational structure for the library's time calculation capabilities.

lib · high confidence

Project maintenance and documentation updates

This change introduces several non-functional updates to the project infrastructure and documentation. A new \.gitmessage\ file is added to standardize commit message formatting for contributors. The \README\ has been converted from RDoc to Markdown format, and a \CHANGELOG.md\ file has been added to track version history according to the Keep a Changelog standard. The \CODE\_OF\_CONDUCT.md\ file is introduced, adopting the Contributor Covenant. Additionally, the \Rakefile\ has been refactored to remove the Jeweler gem dependency in favor of Bundler and standard Rake tasks, and the \.gitignore\ has been updated to exclude common local configuration files like \.ruby-version\ and \gemfile.lock\.

(repo-wide) · high confidence

Test coverage

Added comprehensive test suite for business day and hour calculations

Added a new test suite covering business day and business hour calculations for Time and Date objects, including support for standard, Eastern, and UTC time zones. The tests verify correct handling of positive and negative business day/hour increments, weekend rollovers, holiday exclusions (both global and per-call), and custom work hour configurations.

test · high confidence

Dependencies

Expanded Active Support version compatibility

The gemfiles have been updated to support testing against Active Support versions 3 through 8. This includes adding new gemfiles for Active Support 4, 5, 6, 7, and 8, while also ensuring compatibility with Active Support 3 by locking the tzinfo gem to version 1.2. For Active Support 6, the concurrent-ruby gem is constrained to versions less than 1.3.5.

gemfiles · high confidence

Initial gemspec and Gemfile setup for business\_time

The project now includes a Gemfile and a gemspec file to define its structure and dependencies. The gemspec specifies 'business\_time' as the package name, requires RubyGems as the source, and declares runtime dependencies on 'activesupport' (version 3.2.0 or higher) and 'tzinfo'. It also lists development dependencies including 'rake', 'rdoc', 'minitest', and 'minitest-reporters'.

(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 63.

Lenses

  • Code Health 100
  • Architecture 69
  • Maturity 49
  • Readiness 72
  • Security 96

Changes since last survey

  • 300 commits — 280 feature/other, 20 fixes

By area

  • (root) — 104 commits
  • (repo) — 95 commits
  • lib/business_time — 65 commits
  • .github/workflows — 12 commits
  • test/test_business_days.rb — 6 commits
  • rails_generators/business_time_config — 3 commits
  • test/test_time_extensions.rb — 3 commits
  • gemfiles/active_support_3.gemfile — 2 commits
  • lib/business_time.rb — 2 commits
  • test/test_business_hours.rb — 2 commits
  • test/test_calculating_business_duration.rb — 2 commits
  • .github/dependabot.yml — 1 commit
  • lib/extensions — 1 commit
  • test/test_calculating_consecutive_days.rb — 1 commit
  • test/test_parsed_time.rb — 1 commit

Notable commits

  • fix: All test passing with fixed time lib
  • fix: Fix 0.business_days and 0.business_hours calculation
  • fix: Fix bug when a threaded environment
  • fix: Fix configuration sharing between threads
  • fix: Fix for ruby 1.9 and time 24:00
  • fix: Fix load path in test suite
  • fix: Fix merge conflicts
  • fix: Fix minitest deprecation warning
  • fix: Fix same day .before for work hours
  • fix: Fix thread safe issues
  • fix: Fix timezone inconsistencies
  • fix: Fix warnings for ambiguous - operator usage
  • fix: Merge pull request #18 from hmarr/holiday-yaml-fix
  • fix: Merge pull request #202 from rmm5t/fix-warnings
  • fix: Merge pull request #82 from StudioMelipone/fix-sharing-config-between-threads
  • fix: Merge pull request #84 from dimelo/fix-critical-bug-end-of-day-parsing-error
  • fix: Revert "Add pry as development dependency"
  • fix: Revert "add Time#previous_business_day"
  • fix: bugfix within initializer template
  • fix: fix end of workday + business hours computation when working with timezone
  • …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

bokmann/business_time 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 0a9f42141e03a2599f9b7155a29df4c89f1bf97c — 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-b51f968c9b10.