{"id":20481159,"url":"https://github.com/siman-man/state_transition","last_synced_at":"2025-08-07T16:18:14.733Z","repository":{"id":10134289,"uuid":"12207048","full_name":"siman-man/state_transition","owner":"siman-man","description":"StateMachine for Ruby","archived":false,"fork":false,"pushed_at":"2014-04-27T15:29:38.000Z","size":228,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-28T17:13:25.860Z","etag":null,"topics":["gem","ruby"],"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/siman-man.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-08-19T04:16:00.000Z","updated_at":"2017-02-17T00:41:55.000Z","dependencies_parsed_at":"2022-08-31T04:53:00.062Z","dependency_job_id":null,"html_url":"https://github.com/siman-man/state_transition","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/siman-man/state_transition","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siman-man%2Fstate_transition","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siman-man%2Fstate_transition/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siman-man%2Fstate_transition/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siman-man%2Fstate_transition/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/siman-man","download_url":"https://codeload.github.com/siman-man/state_transition/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siman-man%2Fstate_transition/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269287115,"owners_count":24391575,"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","status":"online","status_checked_at":"2025-08-07T02:00:09.698Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["gem","ruby"],"created_at":"2024-11-15T16:07:04.465Z","updated_at":"2025-08-07T16:18:14.678Z","avatar_url":"https://github.com/siman-man.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# StateTransition\n\nhttps://github.com/jakesgordon/javascript-state-machine\nThis program is very useful. so I created ruby ver.\n\nversion 0.1.0 is active only upper 2.1.0.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'state_transition'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install state_transition\n\n## Usage\n\n    require 'state_transition'\n\n    state = StateTransition::StateMachine.new({\n      initial: :first,\n\n      actions: [\n        { name: \"move_first\", from: [ :second, :third ], to: :first },\n        { name: \"move_second\", from: [ :first, :third ], to: :second },\n        { name: \"move_third\", from: :second, to: :third },\n      ],\n\n      callbacks: {\n        before_second: -\u003e { puts \"before_second\" },\n        after_second: -\u003e { puts \"after_second\" },\n      }\n    })\n\n    puts state.current            #=\u003e :first\n    puts state.can_move?(:second) #=\u003e true\n    puts state.can_move?(:third)  #=\u003e false\n\n    state.move_second\n\n    puts state.current            #=\u003e :second\n\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiman-man%2Fstate_transition","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsiman-man%2Fstate_transition","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiman-man%2Fstate_transition/lists"}