# egonSchiele/contracts.ruby

Contracts for Ruby.

Repository: https://github.com/egonSchiele/contracts.ruby
Canonical: https://ross.abutalabs.com/products/contractsruby
Homepage: http://egonschiele.github.com/contracts.ruby
Language: Ruby
License: BSD-2-Clause
License Family: permissive
Last push: 2026-07-31T22:20:45+00:00

## Health v2 (maintenance only)
Score: 75/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 95, release rhythm 35, longevity 100
- inputs: {"age_days": 5200, "days_push": 33, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1457, forks 82 (observed 2026-08-28T04:04:46.983457+00:00)

## What it is
contracts.ruby is a Ruby library for design-by-contract programming, letting you declare one-line contracts above methods that validate arguments and return values. It replaces boilerplate defensive code with clear, declarative checks and detailed contract-violation errors.

## Use cases
- validate method arguments and return values in Ruby
- replace defensive boilerplate code with declarative contracts
- get detailed error messages when a method receives wrong types
- add runtime type checking to Ruby classes
- enforce preconditions and postconditions on Ruby methods

## When to choose
- you want design-by-contract style validation in Ruby
- you want to cut down on manual argument-checking boilerplate
- you're on Ruby 3.x and want lightweight runtime contracts

## When to avoid
- you need static type checking rather than runtime validation
- you're on Ruby 2.x and can't use the 0.16.x line
- the project needs an actively maintained library - it is seeking a new maintainer

## Facets
- artifact type: library
- maturity: maintenance
- function: testing, error-handling, type-system
- domain: developer-tools, programming-languages
- platform: ruby
- tags: design-by-contract, contracts, runtime-validation, assertions

## Member repositories
- egonSchiele/contracts.ruby (main) score 75

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:46.983457+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:35:32.920543+00:00, confidence not recorded.
  - readme: https://github.com/egonSchiele/contracts.ruby (fetched 2026-08-28T04:04:46.983457+00:00, sha d6d8ac630744)
- Data as of 2026-08-30T08:39:29.467469+00:00.
