https://github.com/styd/diff-routes
:mag: Inspect route changes in Rails console.
https://github.com/styd/diff-routes
console pry rails refactoring-tools routes
Last synced: about 1 year ago
JSON representation
:mag: Inspect route changes in Rails console.
- Host: GitHub
- URL: https://github.com/styd/diff-routes
- Owner: styd
- License: mit
- Created: 2020-03-07T10:32:10.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-12-12T10:10:45.000Z (over 5 years ago)
- Last Synced: 2025-05-28T13:29:41.323Z (about 1 year ago)
- Topics: console, pry, rails, refactoring-tools, routes
- Language: Ruby
- Homepage:
- Size: 1.06 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# DiffRoutes 
> Inspect routes changes in Rails console.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'pry-rails-diff-routes', group: :development
```
DiffRoutes will set Pry as the REPL in your Rails console, just like when you use PryRails.
If you already used PryRails, you should install DiffRoutes after it.
```ruby
gem 'pry-rails' # not a dependency
gem 'pry-rails-diff-routes'
```
When you type `help` in Rails console, you'll notice that `diff-routes` is listed in the same
group as PryRails commands.
```
Rails
diff-routes Show the difference you made in routes.
find-route See which urls match a given controller.
recognize-path See which route matches a url.
show-middleware Show all middleware (that rails knows about).
show-model Show the given model.
show-models Show all models.
show-routes Show all routes in match order.
```
## Usage
### Flags
A route is considered the same route if it maintains its verb (http method, e.g. `GET`, `POST`,
etc.) and uri path. When its other properties are changed, we call it a modified route.
#### `-R` or `--removed`
Show removed routes only.
#### `-M` or `--modified`
Show modified routes only.
#### `-N` or `--new`
Show new routes only.
#### `-S` or `--save`
Make current routes as the basis for changes.
You can combine `-R`, `-M`, and `-N` together, but not `-S`.
### Demo Screenshot

## Contributing
Bug reports and pull requests are welcome on GitHub at
https://github.com/styd/diff-routes.
This project is intended to be a safe, welcoming space for collaboration, and contributors are
expected to adhere to the
[code of conduct](https://github.com/styd/diff-routes/blob/master/CODE_OF_CONDUCT.md).
## License
The gem is available as open source under the terms of the
[MIT License](https://opensource.org/licenses/MIT).
## Code of Conduct
Everyone interacting in the DiffRoutes project's codebases, issue trackers, chat rooms
and mailing lists is expected to follow the
[code of conduct](https://github.com/styd/routes/blob/master/CODE_OF_CONDUCT.md).