40f49342f587167292461242dc13fdb93363278a
- Author
- Marc Cornellà <hello@mcornella.com>
- Committer
- Marc Cornellà <hello@mcornella.com>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/plugins/rails/_rails b/plugins/rails/_rails
2index ad75055068da86b48b57182cf86ac6083688f012..6dc85d458196985d1d7620a23ec55f23bbb52d95 100644
3--- a/plugins/rails/_rails
4+++ b/plugins/rails/_rails
5@@ -1,66 +1,624 @@
6 #compdef rails
7-#autoload
8-
9-local -a _1st_arguments
10-_1st_arguments=(
11- 'generate:Generate new code (short-cut alias: "g")'
12- 'console:Start the Rails console (short-cut alias: "c")'
13- 'server:Start the Rails server (short-cut alias: "s")'
14- 'dbconsole:Start a console for the database specified in config/database.yml (short-cut alias: "db")'
15- 'new:Create a new Rails application. "rails new my_app" creates a new application called MyApp in "./my_app"'
16- 'application:Generate the Rails application code'
17- 'destroy:Undo code generated with "generate"'
18-
19- 'benchmarker:See how fast a piece of code runs'
20- 'profiler:Get profile information from a piece of code'
21- 'plugin:Install a plugin'
22-
23- 'plugin new:Generates skeleton for developing a Rails plugin'
24- 'runner:Run a piece of code in the application environment (short-cut alias: "r")'
25-)
26-
27-_rails_generate_arguments() {
28- generate_arguments=(
29- assets
30- controller
31- decorator
32- generator
33- helper
34- integration_test
35- mailer
36- migration
37- model
38- observer
39- performance_test
40- plugin
41- resource
42- scaffold
43- scaffold_controller
44- session_migration
45- stylesheets
46- task
47- )
48-}
49-
50-
51-_arguments \
52- '(--version)--version[show version]' \
53- '(--help)--help[show help]' \
54- '*:: :->subcmds' && return 0
55-
56-if (( CURRENT == 1 )); then
57- _describe -t commands "rails subcommand" _1st_arguments
58- return
59-else
60- _files
61- return
62-fi
63-
64-case "$words[1]" in
65- g|generate)
66- _rails_generate_arguments
67- _wanted generate_arguments expl 'all generate' compadd -a generate_arguments ;;
68- d|destroy)
69- _rails_generate_arguments
70- _wanted generate_arguments expl 'all generate' compadd -a generate_arguments ;;
71-esac
72+# ------------------------------------------------------------------------------
73+# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users
74+# All rights reserved.
75+#
76+# Redistribution and use in source and binary forms, with or without
77+# modification, are permitted provided that the following conditions are met:
78+# * Redistributions of source code must retain the above copyright
79+# notice, this list of conditions and the following disclaimer.
80+# * Redistributions in binary form must reproduce the above copyright
81+# notice, this list of conditions and the following disclaimer in the
82+# documentation and/or other materials provided with the distribution.
83+# * Neither the name of the zsh-users nor the
84+# names of its contributors may be used to endorse or promote products
85+# derived from this software without specific prior written permission.
86+#
87+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
88+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
89+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
90+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
91+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
92+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
93+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
94+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
95+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
96+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
97+# ------------------------------------------------------------------------------
98+# Description
99+# -----------
100+#
101+# Completion script for Ruby on Rails (http://rubyonrails.org/).
102+#
103+# ------------------------------------------------------------------------------
104+# Authors