{"id":23249522,"url":"https://github.com/wizardone/minimus","last_synced_at":"2025-10-24T18:34:11.732Z","repository":{"id":56883844,"uuid":"120501541","full_name":"wizardone/minimus","owner":"wizardone","description":"Minimalistic state machine for ruby objects","archived":false,"fork":false,"pushed_at":"2018-05-08T23:10:38.000Z","size":18,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-25T07:01:04.441Z","etag":null,"topics":["machine","minimalistic","ruby","state"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wizardone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-06T18:06:59.000Z","updated_at":"2023-03-09T04:20:03.000Z","dependencies_parsed_at":"2022-08-20T13:10:48.699Z","dependency_job_id":null,"html_url":"https://github.com/wizardone/minimus","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wizardone%2Fminimus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wizardone%2Fminimus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wizardone%2Fminimus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wizardone%2Fminimus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wizardone","download_url":"https://codeload.github.com/wizardone/minimus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247422017,"owners_count":20936401,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["machine","minimalistic","ruby","state"],"created_at":"2024-12-19T08:19:48.561Z","updated_at":"2025-10-24T18:34:11.661Z","avatar_url":"https://github.com/wizardone.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Minimus\n[![Build Status](https://travis-ci.org/wizardone/minimus.svg?branch=master)](https://travis-ci.org/wizardone/minimus)\n\nMinimalistic predictable sequential state machine for Ruby. If you want something\nreally simple.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'minimus'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install minimus\n\n## Usage\nAll you need to do is to provide a list of states, the first one will be the\ndefault initial state.\n```ruby\nstate = Minimus.new(:new, :updated, :destroyed)\nstate.initial_state\n=\u003e :new\nstate.current_state\n=\u003e :new\nstate.move(:destroyed)\n=\u003e false\nstate.move(:updated)\nstate.current_state\n=\u003e :updated\nstate.move!(:illegal)\n=\u003e Minimus::TransitionError\nstate.move!(:destroyed)\nstate.current_state\n=\u003e :destroyed\n```\n\nYou can pass blocks as callbacks\n```ruby\nstate.move(:updated) do\n  puts \"Callback\"\nend\n```\n\nIf you want to be slightly more unpredictable you can define your transitions:\n```ruby\nstate.can(:new, possible: :destroyed)\nstate.current_state\n=\u003e :new\nstate.move(:destroyed)\nstate.current_state\n=\u003e :destroyed\n```\nYou can also supply an array of possibilities:\n```ruby\nstate.can(:new, possible: [:created, :destroyed])\n```\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/wizardone/minimus. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Minimus project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/wizardone/minimus/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwizardone%2Fminimus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwizardone%2Fminimus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwizardone%2Fminimus/lists"}