{"id":23927110,"url":"https://github.com/rolemodel/rolemodel_rails","last_synced_at":"2025-04-12T06:08:20.106Z","repository":{"id":36140910,"uuid":"192988586","full_name":"RoleModel/rolemodel_rails","owner":"RoleModel","description":"Gem for generating new rails projects ","archived":false,"fork":false,"pushed_at":"2025-04-10T19:33:06.000Z","size":1159,"stargazers_count":4,"open_issues_count":11,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T06:08:12.261Z","etag":null,"topics":[],"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/RoleModel.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-20T21:18:13.000Z","updated_at":"2025-04-10T19:33:08.000Z","dependencies_parsed_at":"2024-01-11T16:52:42.250Z","dependency_job_id":"0908ad36-a22d-41ae-94e0-3a63b94668fe","html_url":"https://github.com/RoleModel/rolemodel_rails","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoleModel%2Frolemodel_rails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoleModel%2Frolemodel_rails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoleModel%2Frolemodel_rails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoleModel%2Frolemodel_rails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RoleModel","download_url":"https://codeload.github.com/RoleModel/rolemodel_rails/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248525141,"owners_count":21118619,"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":[],"created_at":"2025-01-05T22:14:18.361Z","updated_at":"2025-04-12T06:08:20.091Z","avatar_url":"https://github.com/RoleModel.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RoleModel Rails\n\nExecutable Best Practices for Rails apps, based on RoleModel's best approaches\n\nAttempts to solve the pain of:\n\n* Setup of a new Rails app is harder than it needs to be\n  * We've tried application templates, but only useful onetime\n* Our BestPractice learns don't often get ported into other projects as it isn't straightforward to do so\n* There is an emerging pattern of libraries using generators (e.g. webpacker) to migrate a setup between library versions\n\n## Precondition\n\nThe rolemodel_rails gem expects to be added to an existing Rails project. Typically those are started with:\n\n```shell\nrails new \u003capp-name\u003e --javascript=webpack --database=postgresql --skip-test\n```\n\nThe Devise generator requires your database to exist before running.\n\n```shell\nrails db:create\n```\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngroup :development do\n  gem 'rolemodel_rails', github: 'RoleModel/rolemodel_rails'\nend\n```\n\nAnd then execute:\n\n    $ bundle\n\n## Usage\n\nRun all generators (useful on a new app)\n\n```shell\nbin/rails g rolemodel:all\n```\n\nOr run a single generator\n\n```shell\nbin/rails g rolemodel:webpack\n```\n\nOr run a category subset\n\n```shell\nbin/rails g rolemodel:testing:all\n```\n\nYou can see complete list of available generators (including those under the RoleModel namespace) by running\n\n```shell\nbin/rails g\n```\n\n## Generators\n\n* [Github](./lib/generators/rolemodel/github)\n* [Semaphore](./lib/generators/rolemodel/semaphore)\n* [Heroku](./lib/generators/rolemodel/heroku)\n* [Readme](./lib/generators/rolemodel/readme)\n* [Webpack](./lib/generators/rolemodel/webpack)\n* [React](./lib/generators/rolemodel/react)\n* [Slim](./lib/generators/rolemodel/slim)\n* [Optics](./lib/generators/rolemodel/optics)\n  * [Base](./lib/generators/rolemodel/optics/base)\n  * [Icons](./lib/generators/rolemodel/optics/icons)\n* [Testing](./lib/generators/rolemodel/testing)\n  * [RSpec](./lib/generators/rolemodel/testing/rspec)\n  * [Factory Bot](./lib/generators/rolemodel/testing/factory_bot)\n  * [Test Prof](./lib/generators/rolemodel/testing/test_prof)\n* [SimpleForm](./lib/generators/rolemodel/simple_form)\n* [SoftDestroyable](./lib/generators/rolemodel/soft_destroyable)\n* [SaaS](./lib/generators/rolemodel/saas)\n  * [Devise](./lib/generators/rolemodel/saas/devise)\n* [Mailers](./lib/generators/rolemodel/mailers)\n* [Linters](./lib/generators/rolemodel/linters)\n  * [Rubocop](./lib/generators/rolemodel/linters/rubocop)\n  * [ESLint](./lib/generators/rolemodel/linters/eslint)\n* [Modals](./lib/generators/rolemodel/modals)\n* [Source Map](./lib/generators/rolemodel/source_map)\n* [Kaminari](./lib/generators/rolemodel/kaminari)\n* [GoodJob](./lib/generators/rolemodel/good_job)\n* [Editors](./lib/generators/rolemodel/editors)\n* [Tailored Select](./lib/generators/rolemodel/tailored_select)\n* [Lograge](./lib/generators/rolemodel/lograge)\n\n## Development\n\nInstall the versions of Node and Ruby specified in `.node-version` and `.ruby-version` on your machine. https://asdf-vm.com/ is a great tool for managing language versions. Then run `npm install -g yarn`.\n\nWe use the embeded Rails apps [Rails 8 Example](./recreate_rails8_example) to test the usage of the generators.\n\n`recreate_rails8_example` is simply a freshly generated Rails 8 app. To recreate it use:\n\n```shell\nbin/recreate_rails8_example\n```\n\nThen, cd into `example_rails8` and run a rolemodel generator to see how it affects a new Rails 8 project. For example:\n\n```shell\ncd example_rails8\nbin/rails g rolemodel:webpack\n```\n\n## Testing\n\nGenerator specs should be added to the [spec](./spec) directory.\n\nSetup \u0026 Teardown of the test-dummy app is handled for you, but there are 2 things that each spec needs in order to work correctly.\n\n1. A destination directory for the test-dummy app.\n2. To have your generator run against the test-dummy app.\n\ne.g.\n\n```ruby\nRSpec.describe Rolemodel::MyGenerator, type: :generator do\n  destination File.expand_path('tmp/', File.dirname(__FILE__))\n\n  before { run_generator_against_test_app }\nend\n```\n\nAdditional information about testing generators and the available assertions \u0026 matchers can be found at the following resources.\n\n* [Rails Guide](https://guides.rubyonrails.org/generators.html#testing-generators)\n* [API Documentation](https://api.rubyonrails.org/classes/Rails/Generators/Testing/Assertions.html)\n* [Generator Spec Gem](https://github.com/stevehodgkiss/generator_spec)\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/RoleModel/rolemodel_rails.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frolemodel%2Frolemodel_rails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frolemodel%2Frolemodel_rails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frolemodel%2Frolemodel_rails/lists"}