{"id":13411591,"url":"https://github.com/fastruby/next_rails","last_synced_at":"2025-03-14T17:30:58.769Z","repository":{"id":36323531,"uuid":"131363221","full_name":"fastruby/next_rails","owner":"fastruby","description":"A toolkit to upgrade your next Rails application ","archived":false,"fork":true,"pushed_at":"2024-09-09T20:51:39.000Z","size":173,"stargazers_count":482,"open_issues_count":17,"forks_count":31,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-09-09T22:57:28.180Z","etag":null,"topics":["dual-boot","hacktoberfest","hacktoberfest2022","rails-upgrades","upgrade-rails"],"latest_commit_sha":null,"homepage":"https://www.fastruby.io/blog/upgrade-rails/dual-boot/dual-boot-with-rails-6-0-beta.html?utm_source=github\u0026utm_medium=description\u0026utm_campaign=github\u0026utm_term=next-rails","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"clio/ten_years_rails","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fastruby.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null}},"created_at":"2018-04-28T02:15:13.000Z","updated_at":"2024-09-09T18:34:11.000Z","dependencies_parsed_at":"2023-01-17T00:46:19.963Z","dependency_job_id":null,"html_url":"https://github.com/fastruby/next_rails","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastruby%2Fnext_rails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastruby%2Fnext_rails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastruby%2Fnext_rails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastruby%2Fnext_rails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fastruby","download_url":"https://codeload.github.com/fastruby/next_rails/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243618635,"owners_count":20320269,"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":["dual-boot","hacktoberfest","hacktoberfest2022","rails-upgrades","upgrade-rails"],"created_at":"2024-07-30T20:01:14.783Z","updated_at":"2025-03-14T17:30:58.758Z","avatar_url":"https://github.com/fastruby.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# Next Rails\n\n[![Continuous Integration](https://github.com/fastruby/next_rails/actions/workflows/main.yml/badge.svg)](https://github.com/fastruby/next_rails/actions/workflows/main.yml)\n\nThis is a toolkit to upgrade your next Rails application. It will help you\nset up dual booting, track deprecation warnings, and get a report on outdated\ndependencies for any Rails application.\n\nThis project is a fork of [`ten_years_rails`](https://github.com/clio/ten_years_rails)\n\n## History\n\nThis gem started as a companion to the \"[Ten Years of Rails Upgrades](https://www.youtube.com/watch?v=6aCfc0DkSFo)\"\nconference talk by Jordan Raine.\n\n\u003e You'll find various utilities that we use at Clio to help us prepare for and\n\u003e complete Rails upgrades.\n\n\u003e These scripts are still early days and may not work in every environment or app.\n\n\u003e I wouldn't recommend adding this to your Gemfile long-term. Rather, try out\n\u003e the scripts and use them as a point of reference. Feel free to tweak them to\n\u003e better fit your environment.\n\n## Usage\n\n### `bundle_report`\n\nLearn about your Gemfile and see what needs updating.\n\n```bash\n# Show all out-of-date gems\nbundle_report outdated\n\n# Show five oldest, out-of-date gems\nbundle_report outdated | head -n 5\n\n# Show all out-of-date gems in machine readable JSON format\nbundle_report outdated --json\n\n# Show gems that don't work with Rails 5.2.0\nbundle_report compatibility --rails-version=5.2.0\n\n# Show gems that don't work with Ruby 3.0\nbundle_report compatibility --ruby-version=3.0\n\n# Find minimum compatible ruby version with Rails 7.0.0\nbundle_report ruby_check --rails-version=7.0.0\n\n# Show the usual help message\nbundle_report --help\n```\n\n### Application usage\n\nEvery now and then it will be necessary to add code like this to your\napplication:\n\n```ruby\nif NextRails.next?\n  # Do things \"the Rails 7 way\"\nelse\n  # Do things \"the Rails 6.1 way\"\nend\n```\n\nThe `NextRails.next?` method will use your environment\n(e.g. `ENV['BUNDLE_GEMFILE]`) to determine whether your application is\nrunning with the next set of dependencies or the current set of dependencies.\n\nThis might come in handy if you need to inject\n[Ruby or Rails shims](https://www.fastruby.io/blog/rails/upgrades/rails-upgrade-shims.html).\n\n### Deprecation tracking\n\nIf you're using RSpec, add this snippet to `rails_helper.rb` or `spec_helper.rb` (whichever loads Rails).\n\n```ruby\nRSpec.configure do |config|\n  # Tracker deprecation messages in each file\n  if ENV[\"DEPRECATION_TRACKER\"]\n    DeprecationTracker.track_rspec(\n      config,\n      shitlist_path: \"spec/support/deprecation_warning.shitlist.json\",\n      mode: ENV[\"DEPRECATION_TRACKER\"],\n      transform_message: -\u003e (message) { message.gsub(\"#{Rails.root}/\", \"\") }\n    )\n  end\nend\n```\n\nIf using minitest, add this somewhere close to the top of your `test_helper.rb`:\n\n```ruby\n# Tracker deprecation messages in each file\nif ENV[\"DEPRECATION_TRACKER\"]\n  DeprecationTracker.track_minitest(\n    shitlist_path: \"test/support/deprecation_warning.shitlist.json\",\n    mode: ENV[\"DEPRECATION_TRACKER\"],\n    transform_message: -\u003e (message) { message.gsub(\"#{Rails.root}/\", \"\") }\n  )\nend\n```\n\n\u003e Keep in mind this is currently not compatible with the `minitest/parallel_fork` gem!\n\nOnce you have that, you can start using deprecation tracking in your tests:\n\n```bash\n# Run your tests and save the deprecations to the shitlist\nDEPRECATION_TRACKER=save rspec\n# Run your tests and raise an error when the deprecations change\nDEPRECATION_TRACKER=compare rspec\n```\n\n#### `deprecations` command\n\nOnce you have stored your deprecations, you can use `deprecations` to display common warnings, run specs, or update the shitlist file.\n\n```bash\ndeprecations info\ndeprecations info --pattern \"ActiveRecord::Base\"\ndeprecations run\ndeprecations --help # For more options and examples\n```\n\nRight now, the path to the shitlist is hardcoded so make sure you store yours at `spec/support/deprecation_warning.shitlist.json`.\n\n#### `next_rails` command\n\nYou can use `next_rails` to fetch the version of the gem installed.\n\n```bash\nnext_rails --version\nnext_rails --help # For more options and examples\n```\n\n### Dual-boot Rails next\n\nThis command helps you dual-boot your application.\n\n```bash\nnext_next --init    # Create Gemfile.next and Gemfile.next.lock\nvim Gemfile         # Tweak your dependencies conditionally using `next?`\nnext bundle install # Install new gems\nnext rails s        # Start server using Gemfile.next\n```\n\n## Installation\n\nAdd this line to your application's Gemfile\n\n\u003e NOTE: If you add this gem to a group, make sure it is the test env group\n\n```ruby\ngem 'next_rails'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install next_rails\n\n## Setup\n\nExecute:\n\n    $ next_rails --init\n\nInit will create a Gemfile.next and an initialized Gemfile.next.lock.\nThe Gemfile.next.lock is initialized with the contents of your existing\nGemfile.lock lock file. We initialize the Gemfile.next.lock to prevent\nmajor version jumps when running the next version of Rails.\n\n## Contributing\n\nHave a fix for a problem you've been running into or an idea for a new feature you think would be useful? Want to see how you can support `next_rails`?\n\nTake a look at the [Contributing document](CONTRIBUTING.md) for instructions to set up the repo on your machine!\n\n## Releases\n\n`next_rails` adheres to [semver](https://semver.org). So given a version number MAJOR.MINOR.PATCH, we will increment the:\n\n1. MAJOR version when you make incompatible API changes,\n2. MINOR version when you add functionality in a backwards compatible manner, and\n3. PATCH version when you make backwards compatible bug fixes.\n\nHere are the steps to release a new version:\n\n1. Update the `version.rb` file with the proper version number\n2. Update `CHANGELOG.md` to have the right headers\n3. Commit your changes to a `release/v-1-1-0` branch\n4. Push your changes and submit a pull request\n5. Merge your pull request to the `main` branch\n6. Git tag the latest version of the `main` branch (`git tag v1.1.0`)\n7. Push tags to GitHub (`git push --tags`)\n8. Build the gem (`gem build next_rails.gemspec`)\n9. Push the .gem package to Rubygems.org (`gem push next_rails-1.1.0.gem`)\n10. You are all done!\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%2Ffastruby%2Fnext_rails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffastruby%2Fnext_rails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastruby%2Fnext_rails/lists"}