{"id":24442177,"url":"https://github.com/serihiro/flatten_routes","last_synced_at":"2025-04-28T11:45:54.717Z","repository":{"id":4291908,"uuid":"52651667","full_name":"serihiro/flatten_routes","owner":"serihiro","description":"Gem for Rails that converts the routes.rb to not using resource style.","archived":false,"fork":false,"pushed_at":"2023-08-10T00:46:59.000Z","size":29,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-26T13:51:26.790Z","etag":null,"topics":["gem","rails","routes","ruby","ruby-gem"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/flatten_routes","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/serihiro.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,"governance":null}},"created_at":"2016-02-27T05:26:22.000Z","updated_at":"2021-04-21T05:09:53.000Z","dependencies_parsed_at":"2023-07-05T20:46:50.440Z","dependency_job_id":null,"html_url":"https://github.com/serihiro/flatten_routes","commit_stats":{"total_commits":22,"total_committers":3,"mean_commits":7.333333333333333,"dds":"0.13636363636363635","last_synced_commit":"22362b311511d912bcec7c9c77d54747a7e4e074"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serihiro%2Fflatten_routes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serihiro%2Fflatten_routes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serihiro%2Fflatten_routes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serihiro%2Fflatten_routes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serihiro","download_url":"https://codeload.github.com/serihiro/flatten_routes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246296569,"owners_count":20754635,"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":["gem","rails","routes","ruby","ruby-gem"],"created_at":"2025-01-20T21:46:29.042Z","updated_at":"2025-03-30T09:18:03.658Z","avatar_url":"https://github.com/serihiro.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Gem Version](https://badge.fury.io/rb/flatten_routes.svg)](https://badge.fury.io/rb/flatten_routes)\n\n# FlattenRoutes\n\nConvert the routes.rb to not using resource style.\nThis gem provides 2 rake tasks.\n\n```\nrake flatten_routes:annotate            # Annotate routes.rb\nrake flatten_routes:convert             # Convert routes.rb to not using resource style\n```\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'flatten_routes'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install flatten_routes\n\n## Usage\n\n### Convert your routes.rb.\n\nExecute the following command in your Rails.root.\n\n```ruby\n$ rake flatten_routes:convert\n```\n\nIf routes.rb is like this,\n\n```ruby\nRails.application.routes.draw do\n  ActiveAdmin.routes(self)\n  resources :todos, except: [:new, :edit] do\n    member do\n      post :start\n      post :finish\n      post :restart\n      post :giveup\n      put :awesome\n    end\n    collection do\n      get :finished\n      get :not_yet\n    end\n  end\nend\n```\n\nthen your routes.rb will become like this.\n\n```ruby\nRails.application.routes.draw do\n# == generated by flatten_routes from here 2016-02-27 17:53:37 +0900\n  get    '/admin'                    =\u003e 'admin/dashboard#index'\n  get    '/admin/dashboard'          =\u003e 'admin/dashboard#index'\n  post   '/admin/todos/batch_action' =\u003e 'admin/todos#batch_action'\n  get    '/admin/todos'              =\u003e 'admin/todos#index'\n  post   '/admin/todos'              =\u003e 'admin/todos#create'\n  get    '/admin/todos/new'          =\u003e 'admin/todos#new'\n  get    '/admin/todos/:id/edit'     =\u003e 'admin/todos#edit'\n  get    '/admin/todos/:id'          =\u003e 'admin/todos#show'\n  patch  '/admin/todos/:id'          =\u003e 'admin/todos#update'\n  put    '/admin/todos/:id'          =\u003e 'admin/todos#update'\n  delete '/admin/todos/:id'          =\u003e 'admin/todos#destroy'\n  get    '/admin/comments'           =\u003e 'admin/comments#index'\n  post   '/admin/comments'           =\u003e 'admin/comments#create'\n  get    '/admin/comments/:id'       =\u003e 'admin/comments#show'\n  delete '/admin/comments/:id'       =\u003e 'admin/comments#destroy'\n  post   '/todos/:id/start'          =\u003e 'todos#start'\n  post   '/todos/:id/finish'         =\u003e 'todos#finish'\n  post   '/todos/:id/restart'        =\u003e 'todos#restart'\n  post   '/todos/:id/giveup'         =\u003e 'todos#giveup'\n  put    '/todos/:id/awesome'        =\u003e 'todos#awesome'\n  get    '/todos/finished'           =\u003e 'todos#finished'\n  get    '/todos/not_yet'            =\u003e 'todos#not_yet'\n  get    '/todos'                    =\u003e 'todos#index'\n  post   '/todos'                    =\u003e 'todos#create'\n  get    '/todos/:id'                =\u003e 'todos#show'\n  patch  '/todos/:id'                =\u003e 'todos#update'\n  put    '/todos/:id'                =\u003e 'todos#update'\n  delete '/todos/:id'                =\u003e 'todos#destroy'\n# == generated by flatten_routes to here\n# ActiveAdmin.routes(self)\n# resources :todos, except: [:new, :edit] do\n#   member do\n#     post :start\n#     post :finish\n#     post :restart\n#     post :giveup\n#     put :awesome\n#   end\n#   collection do\n#     get :finished\n#     get :not_yet\n#   end\n# end\n```\n\n### Annotate your routes.rb with simple style routes definitions as comment.\n\nExecute the following command in your Rails.root.\n\n```ruby\n$ rake flatten_routes:annotate\n```\n\n```ruby\nRails.application.routes.draw do\n# == generated by flatten_routes from here 2016-02-27 17:56:31 +0900\n#  get    '/admin'                    =\u003e 'admin/dashboard#index'\n#  get    '/admin/dashboard'          =\u003e 'admin/dashboard#index'\n#  post   '/admin/todos/batch_action' =\u003e 'admin/todos#batch_action'\n#  get    '/admin/todos'              =\u003e 'admin/todos#index'\n#  post   '/admin/todos'              =\u003e 'admin/todos#create'\n#  get    '/admin/todos/new'          =\u003e 'admin/todos#new'\n#  get    '/admin/todos/:id/edit'     =\u003e 'admin/todos#edit'\n#  get    '/admin/todos/:id'          =\u003e 'admin/todos#show'\n#  patch  '/admin/todos/:id'          =\u003e 'admin/todos#update'\n#  put    '/admin/todos/:id'          =\u003e 'admin/todos#update'\n#  delete '/admin/todos/:id'          =\u003e 'admin/todos#destroy'\n#  get    '/admin/comments'           =\u003e 'admin/comments#index'\n#  post   '/admin/comments'           =\u003e 'admin/comments#create'\n#  get    '/admin/comments/:id'       =\u003e 'admin/comments#show'\n#  delete '/admin/comments/:id'       =\u003e 'admin/comments#destroy'\n#  post   '/todos/:id/start'          =\u003e 'todos#start'\n#  post   '/todos/:id/finish'         =\u003e 'todos#finish'\n#  post   '/todos/:id/restart'        =\u003e 'todos#restart'\n#  post   '/todos/:id/giveup'         =\u003e 'todos#giveup'\n#  put    '/todos/:id/awesome'        =\u003e 'todos#awesome'\n#  get    '/todos/finished'           =\u003e 'todos#finished'\n#  get    '/todos/not_yet'            =\u003e 'todos#not_yet'\n#  get    '/todos'                    =\u003e 'todos#index'\n#  post   '/todos'                    =\u003e 'todos#create'\n#  get    '/todos/:id'                =\u003e 'todos#show'\n#  patch  '/todos/:id'                =\u003e 'todos#update'\n#  put    '/todos/:id'                =\u003e 'todos#update'\n#  delete '/todos/:id'                =\u003e 'todos#destroy'\n# == generated by flatten_routes to here\n  ActiveAdmin.routes(self)\n  resources :todos, except: [:new, :edit] do\n    member do\n      post :start\n      post :finish\n      post :restart\n      post :giveup\n      put :awesome\n    end\n    collection do\n      get :finished\n      get :not_yet\n    end\n  end\nend\n```\n\n## Note\n* If you update annotated comments, just execute `$ rake flatten_routes:convert` again.\n\n\n## Dependency\n* Rails '\u003c~ 5.2.0'\n* Supporting Rails 6.x has not finished yet.\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/[USERNAME]/flatten_routes. 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\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserihiro%2Fflatten_routes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserihiro%2Fflatten_routes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserihiro%2Fflatten_routes/lists"}