my xfce4 dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
5.0 KiB

3 years ago
  1. # Rails
  2. This plugin adds completion for [Ruby On Rails Framework](https://rubyonrails.org/) and [Rake](https://ruby.github.io/rake/) commands, as well as some aliases for logs and environment variables.
  3. To use it, add `rails` to the plugins array in your zshrc file:
  4. ```zsh
  5. plugins=(... rails)
  6. ```
  7. ## List of Aliases
  8. ### Rails aliases
  9. | Alias | Command | Description |
  10. |-------|----------------------------|----------------------------------------------------|
  11. | `rc` | `rails console` | Interact with your Rails app from the CLI |
  12. | `rcs` | `rails console --sandbox` | Test code in a sandbox, without changing any data |
  13. | `rd` | `rails destroy` | Undo a generate operation |
  14. | `rdb` | `rails dbconsole` | Interact with your db from the console |
  15. | `rgen`| `rails generate` | Generate boilerplate code |
  16. | `rgm` | `rails generate migration` | Generate a db migration |
  17. | `rp` | `rails plugin` | Run a Rails plugin command |
  18. | `rr` | `rails routes` | List all defined routes |
  19. | `rrg` | `rails routes \| grep` | List and filter the defined routes |
  20. | `ru` | `rails runner` | Run Ruby code in the context of Rails |
  21. | `rs` | `rails server` | Launch a web server |
  22. | `rsd` | `rails server --debugger` | Launch a web server with debugger |
  23. | `rsp` | `rails server --port` | Launch a web server and specify the listening port |
  24. ### Rake aliases
  25. | Alias | Command | Description |
  26. |---------|---------------------------------|--------------------------------------------------------|
  27. | `rdm` | `rake db:migrate` | Run pending db migrations |
  28. | `rdms` | `rake db:migrate:status` | Show current db migration status |
  29. | `rdmtc` | `rake db:migrate db:test:clone` | Run pending migrations and clone db into test database |
  30. | `rdr` | `rake db:rollback` | Roll back the last migration |
  31. | `rdc` | `rake db:create` | Create the database |
  32. | `rds` | `rake db:seed` | Seed the database |
  33. | `rdd` | `rake db:drop` | Delete the database |
  34. | `rdrs` | `rake db:reset` | Delete the database and set it up again |
  35. | `rdtc` | `rake db:test:clone` | Clone the database into the test database |
  36. | `rdtp` | `rake db:test:prepare` | Duplicate the db schema into your test database |
  37. | `rdsl` | `rake db:schema:load` | Load the database schema |
  38. | `rlc` | `rake log:clear` | Clear Rails logs |
  39. | `rn` | `rake notes` | Search for notes (`FIXME`, `TODO`) in code comments |
  40. | `rt` | `rake test` | Run Rails tests |
  41. | `rmd` | `rake middleware` | Interact with Rails middlewares |
  42. | `rsts` | `rake stats` | Print code statistics |
  43. ### Utility aliases
  44. | Alias | Command | Description |
  45. |-----------|-------------------------------|------------------------------------------------|
  46. | `devlog` | `tail -f log/development.log` | Show and follow changes to the development log |
  47. | `prodlog` | `tail -f log/production.log` | Show and follow changes to the production log |
  48. | `testlog` | `tail -f log/test.log` | Show and follow changes to the test log |
  49. ### Environment settings
  50. | Alias | Command | Description |
  51. |-------|-------------------------|---------------------------------|
  52. | `RED` | `RAILS_ENV=development` | Sets `RAILS_ENV` to development |
  53. | `REP` | `RAILS_ENV=production` | Sets `RAILS_ENV` to production |
  54. | `RET` | `RAILS_ENV=test` | Sets `RAILS_ENV` to test |
  55. These are global aliases. Use in combination with a command or just run them
  56. separately. For example: `REP rake db:migrate` will migrate the production db.
  57. ### Legacy stuff
  58. | Alias | Command |
  59. |---------|------------------------------------|
  60. | `sstat` | `thin --stats "/thin/stats" start` |
  61. | `sg` | `ruby script/generate` |
  62. | `sd` | `ruby script/destroy` |
  63. | `sp` | `ruby script/plugin` |
  64. | `sr` | `ruby script/runner` |
  65. | `ssp` | `ruby script/spec` |
  66. | `sc` | `ruby script/console` |
  67. | `sd` | `ruby script/server --debugger` |