# pluginaweek/state_machine

Adds support for creating state machines for attributes on any Ruby class

Repository: https://github.com/pluginaweek/state_machine
Canonical: https://ross.abutalabs.com/products/state_machine
Homepage: http://www.pluginaweek.org
Language: Ruby
License: MIT
License Family: permissive
Last push: 2024-03-12T12:13:22+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 6643, "days_push": 904, "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 3722, forks 517 (observed 2026-08-28T04:08:15.523755+00:00)

## What it is
A Ruby library that adds support for creating state machines for attributes on any Ruby class. It provides states, events, transitions, callbacks, and integrations with ORMs like ActiveRecord, Mongoid, and Sequel.

## Use cases
- manage object state transitions in ruby
- define a finite state machine for a ruby class
- add state machine to activerecord model
- replace boolean flags with state-driven behavior
- add before/after transition callbacks to model lifecycle
- visualize state machine transitions with graphviz

## When to choose
- you need state machines on plain ruby classes or ORM models
- you want transition hooks, predicates, and namespaced states
- you need integrations with ActiveRecord, Mongoid, DataMapper, or Sequel

## When to avoid
- you are not working in Ruby
- you need a modern actively developed alternative with newer Ruby support
- you only need simple boolean flags without complex transitions

## Facets
- artifact type: library
- maturity: maintenance
- function: state-management, developer-tools
- domain: developer-tools, web-development
- platform: ruby
- tags: state-machine, ruby-gem, activerecord, finite-state-machine, transitions, callbacks, automation

## Member repositories
- pluginaweek/state_machine (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:15.523755+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-29T18:29:18.995619+00:00, confidence not recorded.
  - readme: https://github.com/pluginaweek/state_machine (fetched 2026-08-28T04:08:15.523755+00:00, sha 7d81f8afb866)
  - homepage: http://www.pluginaweek.org (fetched 2026-08-29T09:24:06.521585+00:00, sha 543f800b548c)
  - site_page: https://www.pluginaweek.org/best-ai-web-hosting-services-in-2026-features-pricing-and-comparison (fetched 2026-08-29T09:24:06.531531+00:00, sha 8d32bec14eb1)
- Data as of 2026-08-30T08:39:29.467469+00:00.
