diff options
author | Robby Russell <robby@planetargon.com> | 2013-12-01 13:33:00 -0800 |
---|---|---|
committer | Robby Russell <robby@planetargon.com> | 2013-12-01 13:33:00 -0800 |
commit | 7a27a1ce77bcc6c1cb7d2a08ba1943dae34d04e2 (patch) | |
tree | 5de8ae224a6bbfd9dc984cbaadf8e5cf855329f2 /plugins/rails/_rails | |
parent | 14005be4452814f9a5896f614fc48a6403b174e6 (diff) | |
parent | 1493d88e3f92c7034da5c1b1638ba19544aa3ccb (diff) | |
download | zsh-7a27a1ce77bcc6c1cb7d2a08ba1943dae34d04e2.tar.gz zsh-7a27a1ce77bcc6c1cb7d2a08ba1943dae34d04e2.tar.bz2 zsh-7a27a1ce77bcc6c1cb7d2a08ba1943dae34d04e2.zip |
Merge pull request #2240 from Kriechi/master
unified and improved Rails plugin -- consolidates Rails3 and Rails4 plugins into one.
Diffstat (limited to 'plugins/rails/_rails')
-rw-r--r-- | plugins/rails/_rails | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/plugins/rails/_rails b/plugins/rails/_rails new file mode 100644 index 000000000..96f57ce64 --- /dev/null +++ b/plugins/rails/_rails @@ -0,0 +1,63 @@ +#compdef rails +#autoload + +local -a _1st_arguments +_1st_arguments=( + 'generate:Generate new code (short-cut alias: "g")' + 'console:Start the Rails console (short-cut alias: "c")' + 'server:Start the Rails server (short-cut alias: "s")' + 'dbconsole:Start a console for the database specified in config/database.yml (short-cut alias: "db")' + 'new:Create a new Rails application. "rails new my_app" creates a new application called MyApp in "./my_app"' + 'application:Generate the Rails application code' + 'destroy:Undo code generated with "generate"' + + 'benchmarker:See how fast a piece of code runs' + 'profiler:Get profile information from a piece of code' + 'plugin:Install a plugin' + + 'plugin new:Generates skeleton for developing a Rails plugin' + 'runner:Run a piece of code in the application environment (short-cut alias: "r")' +) + +_rails_generate_arguments() { + generate_arguments=( + assets + controller + decorator + generator + helper + integration_test + mailer + migration + model + observer + performance_test + plugin + resource + scaffold + scaffold_controller + session_migration + stylesheets + task + ) +} + + +_arguments \ + '(--version)--version[show version]' \ + '(--help)--help[show help]' \ + '*:: :->subcmds' && return 0 + +if (( CURRENT == 1 )); then + _describe -t commands "rails subcommand" _1st_arguments + return +fi + +case "$words[1]" in + g|generate) + _rails_generate_arguments + _wanted generate_arguments expl 'all generate' compadd -a generate_arguments ;; + d|destroy) + _rails_generate_arguments + _wanted generate_arguments expl 'all generate' compadd -a generate_arguments ;; +esac |