aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorOscar Del Ben <info@oscardelben.com>2012-05-22 08:55:59 -0700
committerOscar Del Ben <info@oscardelben.com>2012-05-22 08:55:59 -0700
commit63f094bf2984127132589f5c93e6dabcad898b12 (patch)
tree35303f02d99e967a309b2b27466a0ecbeac04717 /guides
parentba55dd59ece04aa11bdb305dddfe4e975de9177a (diff)
downloadrails-63f094bf2984127132589f5c93e6dabcad898b12.tar.gz
rails-63f094bf2984127132589f5c93e6dabcad898b12.tar.bz2
rails-63f094bf2984127132589f5c93e6dabcad898b12.zip
[Guides] Update rails commands section
Diffstat (limited to 'guides')
-rw-r--r--guides/source/initialization.textile5
1 files changed, 5 insertions, 0 deletions
diff --git a/guides/source/initialization.textile b/guides/source/initialization.textile
index fdbee7b332..dc089bfb90 100644
--- a/guides/source/initialization.textile
+++ b/guides/source/initialization.textile
@@ -187,6 +187,8 @@ h4. +rails/commands.rb+
Once +config/boot.rb+ has finished, the next file that is required is +rails/commands+ which will execute a command based on the arguments passed in. In this case, the +ARGV+ array simply contains +server+ which is extracted into the +command+ variable using these lines:
<ruby>
+ARGV << '--help' if ARGV.empty?
+
aliases = {
"g" => "generate",
"c" => "console",
@@ -199,6 +201,9 @@ command = ARGV.shift
command = aliases[command] || command
</ruby>
+TIP: As you can see, an empty ARGV list will make Rails show the help
+snippet.
+
If we used <tt>s</tt> rather than +server+, Rails will use the +aliases+ defined in the file and match them to their respective commands. With the +server+ command, Rails will run this code:
<ruby>