8d95f76050b3e936f83f23d244f226b01693f73c

Author
Ivan Polchenko <ipzent@gmail.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

rails: create README (#5841)

Diff

 1diff --git a/plugins/rails/README.md b/plugins/rails/README.md
 2new file mode 100644
 3index 0000000000000000000000000000000000000000..7a3db3d64f2531c1fd3071dcf79202214a5b483c
 4--- /dev/null
 5+++ b/plugins/rails/README.md
 6@@ -0,0 +1,83 @@
 7+# Rails
 8+
 9+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.
10+
11+To use it, add `rails` to the plugins array in your zshrc file:
12+
13+```zsh
14+plugins=(... rails)
15+```
16+
17+## List of Aliases
18+
19+### Rails aliases
20+
21+| Alias | Command                    | Description                                        |
22+|-------|----------------------------|----------------------------------------------------|
23+| `rc`  | `rails console`            | Interact with your Rails app from the CLI          |
24+| `rcs` | `rails console --sandbox`  | Test code in a sandbox, without changing any data  |
25+| `rd`  | `rails destroy`            | Undo a generate operation                          |
26+| `rdb` | `rails dbconsole`          | Interact with your db from the console             |
27+| `rg`  | `rails generate`           | Generate boilerplate code                          |
28+| `rgm` | `rails generate migration` | Generate a db migration                            |
29+| `rp`  | `rails plugin`             | Run a Rails plugin command                         |
30+| `ru`  | `rails runner`             | Run Ruby code in the context of Rails              |
31+| `rs`  | `rails server`             | Launch a web server                                |
32+| `rsd` | `rails server --debugger`  | Launch a web server with debugger                  |
33+| `rsp` | `rails server --port`      | Launch a web server and specify the listening port |
34+
35+### Rake aliases
36+
37+| Alias   | Command                         | Description                                            |
38+|---------|---------------------------------|--------------------------------------------------------|
39+| `rdm`   | `rake db:migrate`               | Run pending db migrations                              |
40+| `rdms`  | `rake db:migrate:status`        | Show current db migration status                       |
41+| `rdmtc` | `rake db:migrate db:test:clone` | Run pending migrations and clone db into test database |
42+| `rdr`   | `rake db:rollback`              | Roll back the last migration                           |
43+| `rdc`   | `rake db:create`                | Create the database                                    |
44+| `rds`   | `rake db:seed`                  | Seed the database                                      |
45+| `rdd`   | `rake db:drop`                  | Delete the database                                    |
46+| `rdrs`  | `rake db:reset`                 | Delete the database and set it up again                |
47+| `rdtc`  | `rake db:test:clone`            | Clone the database into the test database              |
48+| `rdtp`  | `rake db:test:prepare`          | Duplicate the db schema into your test database        |
49+| `rdsl`  | `rake db:schema:load`           | Load the database schema                               |
50+| `rlc`   | `rake log:clear`                | Clear Rails logs                                       |
51+| `rn`    | `rake notes`                    | Search for notes (`FIXME`, `TODO`) in code comments    |
52+| `rr`    | `rake routes`                   | List all defined routes                                |
53+| `rrg`   | `rake routes | grep`            | List and filter the defined routes                     |
54+| `rt`    | `rake test`                     | Run Rails tests                                        |
55+| `rmd`   | `rake middleware`               | Interact with Rails middlewares                        |
56+| `rsts`  | `rake stats`                    | Print code statistics                                  |
57+
58+### Utility aliases
59+
60+| Alias     | Command                       | Description                                    |
61+|-----------|-------------------------------|------------------------------------------------|
62+| `devlog`  | `tail -f log/development.log` | Show and follow changes to the development log |
63+| `prodlog` | `tail -f log/production.log`  | Show and follow changes to the production log  |
64+| `testlog` | `tail -f log/test.log`        | Show and follow changes to the test log        |
65+
66+### Environment settings
67+
68+| Alias | Command                 | Description                     |
69+|-------|-------------------------|---------------------------------|
70+| `RED` | `RAILS_ENV=development` | Sets `RAILS_ENV` to development |
71+| `REP` | `RAILS_ENV=production`  | Sets `RAILS_ENV` to production  |
72+| `RET` | `RAILS_ENV=test`        | Sets `RAILS_ENV` to test        |
73+
74+These are global aliases. Use in combination with a command or just run them
75+separately. For example: `RED rake db:migrate` will migrate the production db.
76+
77+### Legacy stuff
78+
79+| Alias   | Command                            |
80+|---------|------------------------------------|
81+| `sstat` | `thin --stats "/thin/stats" start` |
82+| `sg`    | `ruby script/generate`             |
83+| `sd`    | `ruby script/destroy`              |
84+| `sp`    | `ruby script/plugin`               |
85+| `sr`    | `ruby script/runner`               |
86+| `ssp`   | `ruby script/spec`                 |
87+| `sc`    | `ruby script/console`              |
88+| `sd`    | `ruby script/server --debugger`    |
89+