Skip to content
This repository
Browse code

fix usage examples and more to use new invocations

Signed-off-by: Carl Lerche <carllerche@mac.com>
  • Loading branch information...
commit f44a0b1d524064a2e919cd10d3013db680af9b17 1 parent 6958eac
Roman Dittert authored February 06, 2010 Carl Lerche committed February 06, 2010

Showing 44 changed files with 173 additions and 173 deletions. Show diff stats Hide diff stats

  1. 2  actionmailer/README
  2. 2  actionmailer/lib/action_mailer/base.rb
  3. 4  activerecord/lib/active_record/migration.rb
  4. 2  activesupport/lib/active_support/core_ext/kernel/debugger.rb
  5. 2  activesupport/lib/active_support/whiny_nil.rb
  6. 18  railties/README
  7. 6  railties/guides/source/3_0_release_notes.textile
  8. 6  railties/guides/source/action_mailer_basics.textile
  9. 2  railties/guides/source/active_support_core_extensions.textile
  10. 2  railties/guides/source/activerecord_validations_callbacks.textile
  11. 58  railties/guides/source/command_line.textile
  12. 12  railties/guides/source/debugging_rails_applications.textile
  13. 28  railties/guides/source/generators.textile
  14. 26  railties/guides/source/getting_started.textile
  15. 10  railties/guides/source/migrations.textile
  16. 16  railties/guides/source/performance_testing.textile
  17. 28  railties/guides/source/plugins.textile
  18. 10  railties/guides/source/rails_on_rack.textile
  19. 8  railties/guides/source/testing.textile
  20. 16  railties/lib/generators/rails/app/templates/README
  21. 2  railties/lib/generators/rails/controller/USAGE
  22. 2  railties/lib/generators/rails/generator/USAGE
  23. 2  railties/lib/generators/rails/generator/templates/USAGE.tt
  24. 2  railties/lib/generators/rails/helper/USAGE
  25. 2  railties/lib/generators/rails/integration_test/USAGE
  26. 2  railties/lib/generators/rails/mailer/USAGE
  27. 2  railties/lib/generators/rails/metal/USAGE
  28. 4  railties/lib/generators/rails/migration/USAGE
  29. 4  railties/lib/generators/rails/model/USAGE
  30. 2  railties/lib/generators/rails/observer/USAGE
  31. 2  railties/lib/generators/rails/performance_test/USAGE
  32. 2  railties/lib/generators/rails/plugin/USAGE
  33. 6  railties/lib/generators/rails/resource/USAGE
  34. 8  railties/lib/generators/rails/scaffold/USAGE
  35. 2  railties/lib/generators/rails/scaffold_controller/USAGE
  36. 2  railties/lib/generators/rails/session_migration/USAGE
  37. 2  railties/lib/generators/rails/stylesheets/USAGE
  38. 2  railties/lib/rails/commands/console.rb
  39. 12  railties/lib/rails/commands/plugin.rb
  40. 4  railties/lib/rails/generators/actions.rb
  41. 8  railties/lib/rails/generators/base.rb
  42. 2  railties/lib/rails/rack/debugger.rb
  43. 10  railties/test/generators/actions_test.rb
  44. 2  railties/test/isolation/abstract_unit.rb
2  actionmailer/README
@@ -101,7 +101,7 @@ Example:
101 101
 This Mailman can be the target for Postfix or other MTAs. In Rails, you would use the runner in the 
102 102
 trivial case like this:
103 103
 
104  
-  ./script/runner 'Mailman.receive(STDIN.read)'
  104
+  rails runner 'Mailman.receive(STDIN.read)'
105 105
 
106 106
 However, invoking Rails in the runner for each mail to be received is very resource intensive.  A single 
107 107
 instance of Rails should be run within a daemon if it is going to be utilized to process more than just 
2  actionmailer/lib/action_mailer/base.rb
@@ -9,7 +9,7 @@ module ActionMailer #:nodoc:
9 9
   #
10 10
   # To use Action Mailer, you need to create a mailer model.
11 11
   #
12  
-  #   $ script/generate mailer Notifier
  12
+  #   $ rails generate mailer Notifier
13 13
   #
14 14
   # The generated model inherits from ActionMailer::Base. Emails are defined by creating methods
15 15
   # within the model which are then used to set variables to be used in the mail template, to
4  activerecord/lib/active_record/migration.rb
@@ -107,7 +107,7 @@ def initialize(name)
107 107
   # The Rails package has several tools to help create and apply migrations.
108 108
   #
109 109
   # To generate a new migration, you can use
110  
-  #   script/generate migration MyNewMigration
  110
+  #   rails generate migration MyNewMigration
111 111
   #
112 112
   # where MyNewMigration is the name of your migration. The generator will
113 113
   # create an empty migration file <tt>timestamp_my_new_migration.rb</tt> in the <tt>db/migrate/</tt>
@@ -117,7 +117,7 @@ def initialize(name)
117 117
   # MyNewMigration.
118 118
   #
119 119
   # There is a special syntactic shortcut to generate migrations that add fields to a table.
120  
-  #   script/generate migration add_fieldname_to_tablename fieldname:string
  120
+  #   rails generate migration add_fieldname_to_tablename fieldname:string
121 121
   #
122 122
   # This will generate the file <tt>timestamp_add_fieldname_to_tablename</tt>, which will look like this:
123 123
   #   class AddFieldnameToTablename < ActiveRecord::Migration
2  activesupport/lib/active_support/core_ext/kernel/debugger.rb
... ...
@@ -1,6 +1,6 @@
1 1
 module Kernel
2 2
   unless respond_to?(:debugger)
3  
-    # Starts a debugging session if ruby-debug has been loaded (call script/server --debugger to do load it).
  3
+    # Starts a debugging session if ruby-debug has been loaded (call rails server --debugger to do load it).
4 4
     def debugger
5 5
       message = "\n***** Debugger requested, but was not available: Start server with --debugger to enable *****\n"
6 6
       defined?(Rails) ? Rails.logger.info(message) : $stderr.puts(message)
2  activesupport/lib/active_support/whiny_nil.rb
@@ -11,7 +11,7 @@
11 11
 # classes in NilClass::WHINERS the error message suggests which could be the
12 12
 # actual intended class:
13 13
 #
14  
-#   $ script/runner nil.destroy 
  14
+#   $ rails runner nil.destroy 
15 15
 #   ...
16 16
 #   You might have expected an instance of ActiveRecord::Base.
17 17
 #   ...
18  railties/README
@@ -29,14 +29,14 @@ link:files/vendor/rails/actionpack/README.html.
29 29
 
30 30
 1. At the command prompt, start a new Rails application using the <tt>rails</tt> command
31 31
    and your application name. Ex: <tt>rails myapp</tt>
32  
-2. Change directory into myapp and start the web server: <tt>script/server</tt> (run with --help for options)
  32
+2. Change directory into myapp and start the web server: <tt>rails server</tt> (run with --help for options)
33 33
 3. Go to http://localhost:3000/ and get "Welcome aboard: You're riding the Rails!"
34 34
 4. Follow the guidelines to start developing your application
35 35
 
36 36
 
37 37
 == Web Servers
38 38
 
39  
-By default, Rails will try to use Mongrel if it's installed when started with script/server, otherwise
  39
+By default, Rails will try to use Mongrel if it's installed when started with <tt>rails server</tt>, otherwise
40 40
 Rails will use WEBrick, the webserver that ships with Ruby. But you can also use Rails with a variety of
41 41
 other web servers.
42 42
 
@@ -45,7 +45,7 @@ suitable for development and deployment of Rails applications. If you have Ruby
45 45
 getting up and running with mongrel is as easy as: <tt>gem install mongrel</tt>.
46 46
 More info at: http://mongrel.rubyforge.org
47 47
 
48  
-Other ruby web servers exist which can run your rails application, however script/server does
  48
+Other ruby web servers exist which can run your rails application, however <tt>rails server</tt> does
49 49
 not search for them or start them.  These include {Thin}[http://code.macournoyer.com/thin/], {Ebb}[http://ebb.rubyforge.org/], and Apache with {mod_rails}[http://www.modrails.com/].
50 50
 
51 51
 For production use, often a web/proxy server such as {Apache}[http://apache.org], {Nginx}[http://nginx.net/], {LiteSpeed}[http://litespeedtech.com/], {Lighttpd}[http://www.lighttpd.net/] or {IIS}[http://www.iis.net/] is
@@ -168,22 +168,22 @@ model. Here you'll have all parts of the application configured, just like it is
168 168
 application is running. You can inspect domain models, change values, and save to the
169 169
 database. Starting the script without arguments will launch it in the development environment.
170 170
 
171  
-To start the console, just run <tt>script/console</tt> from the application directory.
  171
+To start the console, just run <tt>rails console</tt> from the application directory.
172 172
 
173 173
 Options:
174 174
 
175 175
 * Passing the <tt>-s, --sandbox</tt> argument will rollback any modifications made to the database.
176 176
 * Passing an environment name as an argument will load the corresponding environment.
177  
-  Example: <tt>script/console production</tt>.
  177
+  Example: <tt>rails console production</tt>.
178 178
 
179 179
 More information about irb can be found at link:http://www.rubycentral.com/pickaxe/irb.html
180 180
 
181 181
 == dbconsole
182 182
 
183  
-You can go to the command line of your database directly through <tt>script/dbconsole</tt>.
  183
+You can go to the command line of your database directly through <tt>rails dbconsole</tt>.
184 184
 You would be connected to the database with the credentials defined in database.yml.
185 185
 Starting the script without arguments will connect you to the development database. Passing an
186  
-argument will connect you to a different database, like <tt>script/dbconsole production</tt>.
  186
+argument will connect you to a different database, like <tt>rails dbconsole production</tt>.
187 187
 Currently works for mysql, postgresql and sqlite.
188 188
 
189 189
 == Description of Contents
@@ -250,7 +250,7 @@ app/views/layouts
250 250
 
251 251
 app/helpers
252 252
   Holds view helpers that should be named like weblogs_helper.rb. These are generated
253  
-  for you automatically when using script/generate for controllers. Helpers can be used to
  253
+  for you automatically when using <tt>rails generate</tt> for controllers. Helpers can be used to
254 254
   wrap functionality for your views into methods.
255 255
 
256 256
 config
@@ -277,7 +277,7 @@ script
277 277
   Helper scripts for automation and generation.
278 278
 
279 279
 test
280  
-  Unit and functional tests along with fixtures. When using the script/generate scripts, template
  280
+  Unit and functional tests along with fixtures. When using the <tt>rails generate</tt> scripts, template
281 281
   test files will be generated for you and placed in this directory.
282 282
 
283 283
 vendor
6  railties/guides/source/3_0_release_notes.textile
Source Rendered
@@ -39,8 +39,8 @@ h4. script/* replaced by script/rails
39 39
 The new <tt>script/rails</tt> replaces all the scripts that used to be in the <tt>script</tt> directory. You do not run <tt>script/rails</tt> directly though, the +rails+ command detects it is being invoked in the root of a Rails application and runs the script for you. Intended usage is:
40 40
 
41 41
 <shell>
42  
-rails console                      # => ./script/console
43  
-rails g scaffold post title:string # => ./script/generate scaffold post title:string
  42
+rails console                      # => ./script/rails console
  43
+rails g scaffold post title:string # => ./script/rails generate scaffold post title:string
44 44
 </shell>
45 45
 
46 46
 Run rails --help for a list of all the options.
@@ -557,4 +557,4 @@ h3. Credits
557 557
 
558 558
 See the "full list of contributors to Rails":http://contributors.rubyonrails.org/ for the many people who spent many hours making Rails 3.  Kudos to all of them.
559 559
 
560  
-Rails 3.0 Release Notes were compiled by "Mikel Lindsaar":http://lindsaar.net.
  560
+Rails 3.0 Release Notes were compiled by "Mikel Lindsaar":http://lindsaar.net.
6  railties/guides/source/action_mailer_basics.textile
Source Rendered
@@ -19,7 +19,7 @@ h4. Walkthrough to Generating a Mailer
19 19
 h5. Create the Mailer
20 20
 
21 21
 <shell>
22  
-./script/generate mailer UserMailer
  22
+rails generate mailer UserMailer
23 23
 create  app/mailers/user_mailer.rb
24 24
 invoke  erb
25 25
 create    app/views/user_mailer
@@ -111,7 +111,7 @@ Let's see how we would go about wiring it up using an observer.
111 111
 First off, we need to create a simple +User+ scaffold:
112 112
 
113 113
 <shell>
114  
-$ script/generate scaffold user name:string email:string login:string
  114
+$ rails generate scaffold user name:string email:string login:string
115 115
 $ rake db:migrate
116 116
 </shell>
117 117
 
@@ -333,7 +333,7 @@ Receiving and parsing emails with Action Mailer can be a rather complex endeavou
333 333
 
334 334
 * Implement a +receive+ method in your mailer.
335 335
 
336  
-* Configure your email server to forward emails from the address(es) you would like your app to receive to +/path/to/app/script/runner 'UserMailer.receive(STDIN.read)'+.
  336
+* Configure your email server to forward emails from the address(es) you would like your app to receive to +/path/to/app/script/rails runner 'UserMailer.receive(STDIN.read)'+.
337 337
 
338 338
 Once a method called +receive+ is defined in any mailer, Action Mailer will parse the raw incoming email into an email object, decode it, instantiate a new mailer, and pass the email object to the mailer +receive+ instance method. Here's an example:
339 339
 
2  railties/guides/source/active_support_core_extensions.textile
Source Rendered
@@ -1805,7 +1805,7 @@ Rails hijacks +LoadError.new+ to return a +MissingSourceFile+ exception:
1805 1805
 $ ruby -e 'require "nonexistent"'
1806 1806
 ...: no such file to load -- nonexistent (LoadError)
1807 1807
 ...
1808  
-$ script/runner 'require "nonexistent"'
  1808
+$ rails runner 'require "nonexistent"'
1809 1809
 ...: no such file to load -- nonexistent (MissingSourceFile)
1810 1810
 ...
1811 1811
 </shell>
2  railties/guides/source/activerecord_validations_callbacks.textile
Source Rendered
@@ -44,7 +44,7 @@ class Person < ActiveRecord::Base
44 44
 end
45 45
 </ruby>
46 46
 
47  
-We can see how it works by looking at some script/console output:
  47
+We can see how it works by looking at some +rails console+ output:
48 48
 
49 49
 <shell>
50 50
 >> p = Person.new(:name => "John Doe")
58  railties/guides/source/command_line.textile
Source Rendered
@@ -58,7 +58,7 @@ Without any prodding of any kind, +server+ will run our new shiny Rails app:
58 58
 
59 59
 <shell>
60 60
 $ cd commandsapp
61  
-$ ./script/server
  61
+$ rails server
62 62
 => Booting WEBrick...
63 63
 => Rails 2.2.0 application started on http://0.0.0.0:3000
64 64
 => Ctrl-C to shutdown server; call with --help for options
@@ -76,8 +76,8 @@ h4. +generate+
76 76
 The +generate+ command uses templates to create a whole lot of things. You can always find out what's available by running +generate+ by itself. Let's do that:
77 77
 
78 78
 <shell>
79  
-$ ./script/generate
80  
-Usage: ./script/generate generator [options] [args]
  79
+$ rails generate
  80
+Usage: rails generate generator [options] [args]
81 81
 
82 82
 ...
83 83
 ...
@@ -95,17 +95,17 @@ Using generators will save you a large amount of time by writing *boilerplate co
95 95
 
96 96
 Let's make our own controller with the controller generator. But what command should we use? Let's ask the generator:
97 97
 
98  
-INFO: All Rails console utilities have help text. As with most *NIX utilities, you can try adding +--help+ or +-h+ to the end, for example +./script/server --help+.
  98
+INFO: All Rails console utilities have help text. As with most *NIX utilities, you can try adding +--help+ or +-h+ to the end, for example +rails server --help+.
99 99
 
100 100
 <shell>
101  
-$ ./script/generate controller
102  
-Usage: ./script/generate controller ControllerName [options]
  101
+$ rails generate controller
  102
+Usage: rails generate controller ControllerName [options]
103 103
 
104 104
 ...
105 105
 ...
106 106
 
107 107
 Example:
108  
-    ./script/generate controller CreditCard open debit credit close
  108
+    rails generate controller CreditCard open debit credit close
109 109
 
110 110
     Credit card controller with URLs like /credit_card/debit.
111 111
         Controller: app/controllers/credit_card_controller.rb
@@ -114,7 +114,7 @@ Example:
114 114
         Test:       test/functional/credit_card_controller_test.rb
115 115
 
116 116
 Modules Example:
117  
-    ./script/generate controller 'admin/credit_card' suspend late_fee
  117
+    rails generate controller 'admin/credit_card' suspend late_fee
118 118
 
119 119
     Credit card admin controller with URLs /admin/credit_card/suspend.
120 120
         Controller: app/controllers/admin/credit_card_controller.rb
@@ -126,7 +126,7 @@ Modules Example:
126 126
 Ah, the controller generator is expecting parameters in the form of +generate controller ControllerName action1 action2+. Let's make a +Greetings+ controller with an action of *hello*, which will say something nice to us.
127 127
 
128 128
 <shell>
129  
-$ ./script/generate controller Greetings hello
  129
+$ rails generate controller Greetings hello
130 130
      exists  app/controllers/
131 131
      exists  app/helpers/
132 132
      create  app/views/greetings
@@ -157,10 +157,10 @@ Then the view, to display our nice message (in +app/views/greetings/hello.html.e
157 157
 <p><%= @message %></p>
158 158
 </html>
159 159
 
160  
-Deal. Go check it out in your browser. Fire up your server. Remember? +./script/server+ at the root of your Rails application should do it.
  160
+Deal. Go check it out in your browser. Fire up your server. Remember? +rails server+ at the root of your Rails application should do it.
161 161
 
162 162
 <shell>
163  
-$ ./script/server
  163
+$ rails server
164 164
 => Booting WEBrick...
165 165
 </shell>
166 166
 
@@ -173,13 +173,13 @@ INFO: With a normal, plain-old Rails application, your URLs will generally follo
173 173
 "What about data, though?", you ask over a cup of coffee. Rails comes with a generator for data models too. Can you guess its generator name?
174 174
 
175 175
 <shell>
176  
-$ ./script/generate model
177  
-Usage: ./script/generate model ModelName [field:type, field:type]
  176
+$ rails generate model
  177
+Usage: rails generate model ModelName [field:type, field:type]
178 178
 
179 179
 ...
180 180
 
181 181
 Examples:
182  
-    ./script/generate model account
  182
+    rails generate model account
183 183
 
184 184
         creates an Account model, test, fixture, and migration:
185 185
             Model:      app/models/account.rb
@@ -187,7 +187,7 @@ Examples:
187 187
             Fixtures:   test/fixtures/accounts.yml
188 188
             Migration:  db/migrate/XXX_add_accounts.rb
189 189
 
190  
-    ./script/generate model post title:string body:text published:boolean
  190
+    rails generate model post title:string body:text published:boolean
191 191
 
192 192
         creates a Post model with a string title, text body, and published flag.
193 193
 </shell>
@@ -197,7 +197,7 @@ But instead of generating a model directly (which we'll be doing later), let's s
197 197
 Let's set up a simple resource called "HighScore" that will keep track of our highest score on video games we play.
198 198
 
199 199
 <shell>
200  
-$ ./script/generate scaffold HighScore game:string score:integer
  200
+$ rails generate scaffold HighScore game:string score:integer
201 201
     exists  app/models/
202 202
     exists  app/controllers/
203 203
     exists  app/helpers/
@@ -244,13 +244,13 @@ $ rake db:migrate
244 244
 
245 245
 INFO: Let's talk about unit tests. Unit tests are code that tests and makes assertions about code. In unit testing, we take a little part of code, say a method of a model, and test its inputs and outputs. Unit tests are your friend. The sooner you make peace with the fact that your quality of life will drastically increase when you unit test your code, the better. Seriously. We'll make one in a moment.
246 246
 
247  
-Let's see the interface Rails created for us. ./script/server; http://localhost:3000/high_scores
  247
+Let's see the interface Rails created for us. rails server; http://localhost:3000/high_scores
248 248
 
249 249
 We can create new high scores (55,160 on Space Invaders!)
250 250
 
251 251
 h4. +console+
252 252
 
253  
-The +console+ command lets you interact with your Rails application from the command line. On the underside, +script/console+ uses IRB, so if you've ever used it, you'll be right at home. This is useful for testing out quick ideas with code and changing data server-side without touching the website.
  253
+The +console+ command lets you interact with your Rails application from the command line. On the underside, +rails console+ uses IRB, so if you've ever used it, you'll be right at home. This is useful for testing out quick ideas with code and changing data server-side without touching the website.
254 254
 
255 255
 h4. +dbconsole+
256 256
 
@@ -265,7 +265,7 @@ Let's say you're creating a website for a client who wants a small accounting sy
265 265
 There is such a thing! The plugin we're installing is called "acts_as_paranoid", and it lets models implement a "deleted_at" column that gets set when you call destroy. Later, when calling find, the plugin will tack on a database check to filter out "deleted" things.
266 266
 
267 267
 <shell>
268  
-$ ./script/plugin install http://svn.techno-weenie.net/projects/plugins/acts_as_paranoid
  268
+$ rails plugin install http://svn.techno-weenie.net/projects/plugins/acts_as_paranoid
269 269
 + ./CHANGELOG
270 270
 + ./MIT-LICENSE
271 271
 ...
@@ -277,7 +277,7 @@ h4. +runner+
277 277
 <tt>runner</tt> runs Ruby code in the context of Rails non-interactively. For instance:
278 278
 
279 279
 <shell>
280  
-$ ./script/runner "Model.long_running_method"
  280
+$ rails runner "Model.long_running_method"
281 281
 </shell>
282 282
 
283 283
 h4. +destroy+
@@ -285,7 +285,7 @@ h4. +destroy+
285 285
 Think of +destroy+ as the opposite of +generate+. It'll figure out what generate did, and undo it. Believe you-me, the creation of this tutorial used this command many times!
286 286
 
287 287
 <shell>
288  
-$ ./script/generate model Oops
  288
+$ rails generate model Oops
289 289
       exists  app/models/
290 290
       exists  test/unit/
291 291
       exists  test/fixtures/
@@ -294,7 +294,7 @@ $ ./script/generate model Oops
294 294
       create  test/fixtures/oops.yml
295 295
       exists  db/migrate
296 296
       create  db/migrate/20081221040817_create_oops.rb
297  
-$ ./script/destroy model Oops
  297
+$ rails destroy model Oops
298 298
     notempty  db/migrate
299 299
     notempty  db
300 300
           rm  db/migrate/20081221040817_create_oops.rb
@@ -314,7 +314,7 @@ h4. +about+
314 314
 Check it: Version numbers for Ruby, RubyGems, Rails, the Rails subcomponents, your application's folder, the current Rails environment name, your app's database adapter, and schema version! +about+ is useful when you need to ask for help, check if a security patch might affect you, or when you need some stats for an existing Rails installation.
315 315
 
316 316
 <shell>
317  
-$ ./script/about
  317
+$ rails about
318 318
 About your application's environment
319 319
 Ruby version              1.8.6 (i486-linux)
320 320
 RubyGems version          1.3.1
@@ -399,7 +399,7 @@ Many people have created a large number different web servers in Ruby, and many
399 399
 
400 400
 NOTE: For more details on the Rack integration, see "Rails on Rack":rails_on_rack.html.
401 401
 
402  
-To use a different server, just install its gem, then use its name for the first parameter to +script/server+:
  402
+To use a different server, just install its gem, then use its name for the first parameter to +rails server+:
403 403
 
404 404
 <shell>
405 405
 $ sudo gem install mongrel
@@ -412,9 +412,9 @@ Successfully installed mongrel-1.1.5
412 412
 ...
413 413
 ...
414 414
 Installing RDoc documentation for mongrel-1.1.5...
415  
-$ script/server mongrel
416  
-=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
417  
-=> Rails 2.2.0 application starting on http://0.0.0.0:3000
  415
+$ rails server mongrel
  416
+=> Booting Mongrel (use 'rails server webrick' to force WEBrick)
  417
+=> Rails 3.0.0 application starting on http://0.0.0.0:3000
418 418
 ...
419 419
 </shell>
420 420
 
@@ -481,7 +481,7 @@ I got assigned some args:
481 481
 Then we'll make sure it got included in the list of available generators:
482 482
 
483 483
 <shell>
484  
-$ ./script/generate
  484
+$ rails generate
485 485
 ...
486 486
 ...
487 487
 Installed Generators
@@ -491,7 +491,7 @@ Installed Generators
491 491
 SWEET! Now let's generate some text, yeah!
492 492
 
493 493
 <shell>
494  
-$ ./script/generate tutorial_test arg1 arg2 arg3
  494
+$ rails generate tutorial_test arg1 arg2 arg3
495 495
       exists  public
496 496
       create  public/tutorial.txt
497 497
 </shell>
12  railties/guides/source/debugging_rails_applications.textile
Source Rendered
@@ -247,9 +247,9 @@ If you see the message in the console or logs:
247 247
 Make sure you have started your web server with the option +--debugger+:
248 248
 
249 249
 <shell>
250  
-~/PathTo/rails_project$ script/server --debugger
251  
-=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
252  
-=> Rails 2.2.0 application starting on http://0.0.0.0:3000
  250
+~/PathTo/rails_project$ rails server --debugger
  251
+=> Booting Mongrel (use 'rails server webrick' to force WEBrick)
  252
+=> Rails 3.0.0 application starting on http://0.0.0.0:3000
253 253
 => Debugger enabled
254 254
 ...
255 255
 </shell>
@@ -472,10 +472,10 @@ class Author < ActiveRecord::Base
472 472
 end
473 473
 </ruby>
474 474
 
475  
-TIP: You can use ruby-debug while using script/console. Just remember to +require "ruby-debug"+ before calling the +debugger+ method.
  475
+TIP: You can use ruby-debug while using +rails console+. Just remember to +require "ruby-debug"+ before calling the +debugger+ method.
476 476
 
477 477
 <shell>
478  
-/PathTo/project $ script/console
  478
+/PathTo/project $ rails console
479 479
 Loading development environment (Rails 2.1.0)
480 480
 >> require "ruby-debug"
481 481
 => []
@@ -636,7 +636,7 @@ require 'bleak_house' if ENV['BLEAK_HOUSE']
636 636
 Start a server instance with BleakHouse integration:
637 637
 
638 638
 <shell>
639  
-RAILS_ENV=production BLEAK_HOUSE=1 ruby-bleak-house ./script/server
  639
+RAILS_ENV=production BLEAK_HOUSE=1 ruby-bleak-house rails server
640 640
 </shell>
641 641
 
642 642
 Make sure to run a couple hundred requests to get better data samples, then press +CTRL-C+. The server will stop and Bleak House will produce a dumpfile in +/tmp+:
28  railties/guides/source/generators.textile
Source Rendered
@@ -17,18 +17,18 @@ NOTE: This guide is about Rails generators for versions >= 3.0. Rails generators
17 17
 
18 18
 h3. First contact
19 19
 
20  
-When you create an application using the +rails+ command, you are in fact using a Rails generator. After that, you can get a list of all available generators by just invoking +script/generate+:
  20
+When you create an application using the +rails+ command, you are in fact using a Rails generator. After that, you can get a list of all available generators by just invoking +rails generate+:
21 21
 
22 22
 <shell>
23 23
 $ rails myapp
24 24
 $ cd myapp
25  
-$ ruby script/generate
  25
+$ rails generate
26 26
 </shell>
27 27
 
28 28
 You will get a list of all generators that comes with Rails. If you need a detailed description, for instance about the helper generator, you can simply do:
29 29
 
30 30
 <shell>
31  
-$ ruby script/generate helper --help
  31
+$ rails generate helper --help
32 32
 </shell>
33 33
 
34 34
 h3. Creating your first generator
@@ -50,13 +50,13 @@ Our new generator is quite simple: it inherits from +Rails::Generators::Base+ an
50 50
 To invoke our new generator, we just need to do:
51 51
 
52 52
 <shell>
53  
-$ ruby script/generate initializer
  53
+$ rails generate initializer
54 54
 </shell>
55 55
 
56 56
 Before we go on, let's see our brand new generator description:
57 57
 
58 58
 <shell>
59  
-$ ruby script/generate initializer --help
  59
+$ rails generate initializer --help
60 60
 </shell>
61 61
 
62 62
 Rails usually is able to generate good descriptions if a generator is namespaced, as +ActiveRecord::Generators::ModelGenerator+, but not in this particular case. We can solve this problem in two ways. The first one is calling +desc+ inside our generator:
@@ -77,7 +77,7 @@ h3. Creating generators with generators
77 77
 A faster way to create a generator is using the generator's generator:
78 78
 
79 79
 <shell>
80  
-$ ruby script/generate generator initializer
  80
+$ rails generate generator initializer
81 81
       create  lib/generators/initializer
82 82
       create  lib/generators/initializer/initializer_generator.rb
83 83
       create  lib/generators/initializer/USAGE
@@ -99,9 +99,9 @@ At first, we can notice that we are inheriting from +Rails::Generators::NamedBas
99 99
 We can see that by invoking the description of this new generator (don't forget to delete the old generator file):
100 100
 
101 101
 <shell>
102  
-$ ruby script/generate initializer --help
  102
+$ rails generate initializer --help
103 103
 Usage:
104  
-  script/generate initializer NAME [options]
  104
+  rails generate initializer NAME [options]
105 105
 </shell>
106 106
 
107 107
 We can also see in our new generator that it has a class method called +source_root+. This method points to where our generator templates will be placed and by default it points to the created directory under +RAILS_APP/lib/generators/initializer/templates+. In order to understand what a generator template means, let's create a file at +RAILS_APP/lib/generators/initializer/templates/initializer.rb+ with the following content:
@@ -128,7 +128,7 @@ end
128 128
 And let's execute our generator:
129 129
 
130 130
 <shell>
131  
-$ ruby script/generate initializer foo
  131
+$ rails generate initializer foo
132 132
 </shell>
133 133
 
134 134
 We can see that now a initializer named foo was created at +config/initializers/foo.rb+ with the contents of our template. That means that copy_file copied a file in our source root to the destination path we gave. The method +file_name+ is automatically created when we inherit from +Rails::Generators::NamedBase+.
@@ -166,7 +166,7 @@ end
166 166
 Before we customize our workflow, let's first see how our scaffold looks like:
167 167
 
168 168
 <shell>
169  
-$ ruby script/generate scaffold User name:string
  169
+$ rails generate scaffold User name:string
170 170
       invoke  active_record
171 171
       create    db/migrate/20091120125558_create_users.rb
172 172
       create    app/models/user.rb
@@ -212,7 +212,7 @@ If we generate another resource on scaffold, we can notice that neither styleshe
212 212
 To show that, we are going to create a new helper generator that simply adds some instance variable readers. First, we create a generator:
213 213
 
214 214
 <shell>
215  
-$ ruby script/generate generator my_helper
  215
+$ rails generate generator my_helper
216 216
 </shell>
217 217
 
218 218
 After that, we can delete both templates directory and the +source_root+ class method from our new generators, because we are not going to need them. So our new generator looks like the following:
@@ -232,7 +232,7 @@ end
232 232
 We can try out our new generator by creating a helper for users:
233 233
 
234 234
 <shell>
235  
-$ ruby script/generate my_helper users
  235
+$ rails generate my_helper users
236 236
 </shell>
237 237
 
238 238
 And it will generate the following helper file in app/helpers:
@@ -258,7 +258,7 @@ end
258 258
 And see it in action when invoking generator once again:
259 259
 
260 260
 <shell>
261  
-$ ruby script/generate scaffold Post body:text
  261
+$ rails generate scaffold Post body:text
262 262
       [...]
263 263
       invoke    my_helper
264 264
       create      app/helpers/posts_helper.rb
@@ -343,7 +343,7 @@ Rails::Generators.fallbacks[:shoulda] = :test_unit
343 343
 Now, if create a Comment scaffold, you will see that shoulda generators are being invoked, and at the end, they are just falling back to test unit generators:
344 344
 
345 345
 <shell>
346  
-$ ruby script/generate scaffold Comment body:text
  346
+$ rails generate scaffold Comment body:text
347 347
       invoke  active_record
348 348
       create    db/migrate/20091120151323_create_comments.rb
349 349
       create    app/models/comment.rb
26  railties/guides/source/getting_started.textile
Source Rendered
@@ -258,10 +258,10 @@ h3. Hello, Rails!
258 258
 One of the traditional places to start with a new language is by getting some text up on screen quickly. To do that in Rails, you need to create at minimum a controller and a view. Fortunately, you can do that in a single command. Enter this command in your terminal:
259 259
 
260 260
 <shell>
261  
-$ script/generate controller home index
  261
+$ rails generate controller home index
262 262
 </shell>
263 263
 
264  
-TIP: If you're on Windows, or your Ruby is set up in some non-standard fashion, you may need to explicitly pass Rails +script+ commands to Ruby: +ruby script/generate controller home index+.
  264
+TIP: If you're on Windows, or your Ruby is set up in some non-standard fashion, you may need to explicitly pass Rails +script+ commands to Ruby: +rails generate controller home index+.
265 265
 
266 266
 Rails will create several files for you, including +app/views/home/index.html.erb+. This is the template that will be used to display the results of the +index+ action (method) in the +home+ controller. Open this file in your text editor and edit it to contain a single line of code:
267 267
 
@@ -274,7 +274,7 @@ h4. Starting up the Web Server
274 274
 You actually have a functional Rails application already - after running only two commands! To see it, you need to start a web server on your development machine. You can do this by running another command:
275 275
 
276 276
 <shell>
277  
-$ script/server
  277
+$ rails server
278 278
 </shell>
279 279
 
280 280
 This will fire up an instance of the Mongrel web server by default (Rails can also use several other web servers). To see your application in action, open a browser window and navigate to +http://localhost:3000+. You should see Rails' default information page:
@@ -323,7 +323,7 @@ h3. Creating a Resource
323 323
 In the case of the blog application, you can start by generating a scaffolded Post resource: this will represent a single blog posting. To do this, enter this command in your terminal:
324 324
 
325 325
 <shell>
326  
-$ script/generate scaffold Post name:string title:string content:text
  326
+$ rails generate scaffold Post name:string title:string content:text
327 327
 </shell>
328 328
 
329 329
 NOTE. While scaffolding will get you up and running quickly, the "one size fits all" code that it generates is unlikely to be a perfect fit for your application. In most cases, you'll need to customize the generated code. Many experienced Rails developers avoid scaffolding entirely, preferring to write all or most of their source code from scratch.
@@ -349,7 +349,7 @@ The scaffold generator will build 14 files in your application, along with some
349 349
 
350 350
 h4. Running a Migration
351 351
 
352  
-One of the products of the +script/generate scaffold+ command is a _database migration_. Migrations are Ruby classes that are designed to make it simple to create and modify database tables. Rails uses rake commands to run migrations, and it's possible to undo a migration after it's been applied to your database. Migration filenames include a timestamp to ensure that they're processed in the order that they were created.
  352
+One of the products of the +rails generate scaffold+ command is a _database migration_. Migrations are Ruby classes that are designed to make it simple to create and modify database tables. Rails uses rake commands to run migrations, and it's possible to undo a migration after it's been applied to your database. Migration filenames include a timestamp to ensure that they're processed in the order that they were created.
353 353
 
354 354
 If you look in the +db/migrate/20090113124235_create_posts.rb+ file (remember, yours will have a slightly different name), here's what you'll find:
355 355
 
@@ -400,7 +400,7 @@ Now you're ready to start working with posts. To do that, navigate to +http://lo
400 400
 
401 401
 !images/posts_index.png(Posts Index screenshot)!
402 402
 
403  
-This is the result of Rails rendering the +index+ view of your posts. There aren't currently any posts in the database, but if you click the +New Post+ link you can create one. After that, you'll find that you can edit posts, look at their details, or destroy them. All of the logic and HTML to handle this was built by the single +script/generate scaffold+ command.
  403
+This is the result of Rails rendering the +index+ view of your posts. There aren't currently any posts in the database, but if you click the +New Post+ link you can create one. After that, you'll find that you can edit posts, look at their details, or destroy them. All of the logic and HTML to handle this was built by the single +rails generate scaffold+ command.
404 404
 
405 405
 TIP: In development mode (which is what you're working in by default), Rails reloads your application with every browser request, so there's no need to stop and restart the web server.
406 406
 
@@ -435,7 +435,7 @@ h4. Using the Console
435 435
 To see your validations in action, you can use the console. The console is a command-line tool that lets you execute Ruby code in the context of your application:
436 436
 
437 437
 <shell>
438  
-$ script/console
  438
+$ rails console
439 439
 </shell>
440 440
 
441 441
 After the console loads, you can use it to work with your application's models:
@@ -516,7 +516,7 @@ TIP: For more details on the rendering process, see "Layouts and Rendering in Ra
516 516
 
517 517
 h4. Customizing the Layout
518 518
 
519  
-The view is only part of the story of how HTML is displayed in your web browser. Rails also has the concept of +layouts+, which are containers for views. When Rails renders a view to the browser, it does so by putting the view's HTML into a layout's HTML. The +script/generate scaffold+ command automatically created a default layout, +app/views/layouts/posts.html.erb+, for the posts. Open this layout in your editor and modify the +body+ tag:
  519
+The view is only part of the story of how HTML is displayed in your web browser. Rails also has the concept of +layouts+, which are containers for views. When Rails renders a view to the browser, it does so by putting the view's HTML into a layout's HTML. The +rails generate scaffold+ command automatically created a default layout, +app/views/layouts/posts.html.erb+, for the posts. Open this layout in your editor and modify the +body+ tag:
520 520
 
521 521
 <erb>
522 522
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
@@ -859,7 +859,7 @@ h4. Generating a Model
859 859
 Models in Rails use a singular name, and their corresponding database tables use a plural name. For the model to hold comments, the convention is to use the name Comment. Even if you don't want to use the entire apparatus set up by scaffolding, most Rails developers still use generators to make things like models and controllers. To create the new model, run this command in your terminal:
860 860
 
861 861
 <shell>
862  
-$ script/generate model Comment commenter:string body:text
  862
+$ rails generate model Comment commenter:string body:text
863 863
     post:references
864 864
 </shell>
865 865
 
@@ -953,7 +953,7 @@ h4. Generating a Controller
953 953
 With the model in hand, you can turn your attention to creating a matching controller. Again, there's a generator for this:
954 954
 
955 955
 <shell>
956  
-$ script/generate controller Comments index show new edit
  956
+$ rails generate controller Comments index show new edit
957 957
 </shell>
958 958
 
959 959
 This creates eight files:
@@ -967,7 +967,7 @@ This creates eight files:
967 967
 * +test/functional/comments_controller_test.rb+ - The functional tests for the controller
968 968
 * +test/unit/helpers/comments_helper_test.rb+ - The unit tests for the helper
969 969
 
970  
-The controller will be generated with empty methods and views for each action that you specified in the call to +script/generate controller+:
  970
+The controller will be generated with empty methods and views for each action that you specified in the call to +rails generate controller+:
971 971
 
972 972
 <ruby>
973 973
 class CommentsController < ApplicationController
@@ -1052,7 +1052,7 @@ This creates a new +Comment+ object _and_ sets up the +post_id+ field to have th
1052 1052
 
1053 1053
 h4. Building Views
1054 1054
 
1055  
-Because you skipped scaffolding, you'll need to build views for comments "by hand". Invoking +script/generate controller+ will give you skeleton views, but they'll be devoid of actual content. Here's a first pass at fleshing out the comment views.
  1055
+Because you skipped scaffolding, you'll need to build views for comments "by hand". Invoking +rails generate controller+ will give you skeleton views, but they'll be devoid of actual content. Here's a first pass at fleshing out the comment views.
1056 1056
 
1057 1057
 The +views/comments/index.html.erb+ view:
1058 1058
 
@@ -1214,7 +1214,7 @@ h3. Building a Multi-Model Form
1214 1214
 Comments and posts are edited on two separate forms - which makes sense, given the flow of this mini-application. But what if you want to edit more than one thing on a single form? Rails 2.3 offers new support for nested forms. Let's add support for giving each post multiple tags, right in the form where you create the post. First, create a new model to hold the tags:
1215 1215
 
1216 1216
 <shell>
1217  
-$ script/generate model tag name:string post:references
  1217
+$ rails generate model tag name:string post:references
1218 1218
 </shell>
1219 1219
 
1220 1220
 Run the migration to create the database table:
10  railties/guides/source/migrations.textile
Source Rendered
@@ -105,7 +105,7 @@ h4. Creating a Model
105 105
 The model and scaffold generators will create migrations appropriate for adding a new model. This migration will already contain instructions for creating the relevant table. If you tell Rails what columns you want then statements for adding those will also be created. For example, running
106 106
 
107 107
 <shell>
108  
-ruby script/generate model Product name:string description:text
  108
+rails generate model Product name:string description:text
109 109
 </shell>
110 110
 
111 111
 will create a migration that looks like this
@@ -135,7 +135,7 @@ h4. Creating a Standalone Migration
135 135
 If you are creating migrations for other purposes (for example to add a column to an existing table) then you can use the migration generator:
136 136
 
137 137
 <shell>
138  
-ruby script/generate migration AddPartNumberToProducts
  138
+rails generate migration AddPartNumberToProducts
139 139
 </shell>
140 140
 
141 141
 This will create an empty but appropriately named migration:
@@ -153,7 +153,7 @@ end
153 153
 If the migration name is of the form "AddXXXToYYY" or "RemoveXXXFromYYY" and is followed by a list of column names and types then a migration containing the appropriate +add_column+ and +remove_column+ statements will be created.
154 154
 
155 155
 <shell>
156  
-ruby script/generate migration AddPartNumberToProducts part_number:string
  156
+rails generate migration AddPartNumberToProducts part_number:string
157 157
 </shell>
158 158
 
159 159
 will generate
@@ -173,7 +173,7 @@ end
173 173
 Similarly,
174 174
 
175 175
 <shell>
176  
-ruby script/generate migration RemovePartNumberFromProducts part_number:string
  176
+rails generate migration RemovePartNumberFromProducts part_number:string
177 177
 </shell>
178 178
 
179 179
 generates
@@ -193,7 +193,7 @@ end
193 193
 You are not limited to one magically generated column, for example
194 194
 
195 195
 <shell>
196  
-ruby script/generate migration AddDetailsToProducts part_number:string price:decimal
  196
+rails generate migration AddDetailsToProducts part_number:string price:decimal
197 197
 </shell>
198 198
 
199 199
 generates
16  railties/guides/source/performance_testing.textile
Source Rendered
@@ -37,7 +37,7 @@ h4. Generating Performance Tests
37 37
 Rails provides a generator called +performance_test+ for creating new performance tests:
38 38
 
39 39
 <shell>
40  
-script/generate performance_test homepage
  40
+rails generate performance_test homepage
41 41
 </shell>
42 42
 
43 43
 This generates +homepage_test.rb+ in the +test/performance+ directory:
@@ -381,19 +381,19 @@ h4. +benchmarker+
381 381
 Usage:
382 382
 
383 383
 <shell>
384  
-$ script/performance/benchmarker [times] 'Person.expensive_way' 'Person.another_expensive_way' ...
  384
+$ rails benchmarker [times] 'Person.expensive_way' 'Person.another_expensive_way' ...
385 385
 </shell>
386 386
 
387 387
 Examples:
388 388
 
389 389
 <shell>
390  
-$ script/performance/benchmarker 10 'Item.all' 'CouchItem.all'
  390
+$ rails benchmarker 10 'Item.all' 'CouchItem.all'
391 391
 </shell>
392 392
 
393 393
 If the +[times]+ argument is omitted, supplied methods are run just once:
394 394
 
395 395
 <shell>
396  
-$ script/performance/benchmarker 'Item.first' 'Item.last'
  396
+$ rails benchmarker 'Item.first' 'Item.last'
397 397
 </shell>
398 398
 
399 399
 h4. +profiler+
@@ -403,19 +403,19 @@ h4. +profiler+
403 403
 Usage:
404 404
 
405 405
 <shell>
406  
-$ script/performance/profiler 'Person.expensive_method(10)' [times] [flat|graph|graph_html]
  406
+$ rails profiler 'Person.expensive_method(10)' [times] [flat|graph|graph_html]
407 407
 </shell>
408 408
 
409 409
 Examples:
410 410
 
411 411
 <shell>
412  
-$ script/performance/profiler 'Item.all'
  412
+$ rails profiler 'Item.all'
413 413
 </shell>
414 414
 
415 415
 This will profile +Item.all+ in +RubyProf::WALL_TIME+ measure mode. By default, it prints flat output to the shell.
416 416
 
417 417
 <shell>
418  
-$ script/performance/profiler 'Item.all' 10 graph
  418
+$ rails profiler 'Item.all' 10 graph
419 419
 </shell>
420 420
 
421 421
 This will profile +10.times { Item.all }+ with +RubyProf::WALL_TIME+ measure mode and print graph output to the shell.
@@ -423,7 +423,7 @@ This will profile +10.times { Item.all }+ with +RubyProf::WALL_TIME+ measure mod
423 423
 If you want to store the output in a file:
424 424
 
425 425
 <shell>
426  
-$ script/performance/profiler 'Item.all' 10 graph 2> graph.txt
  426
+$ rails profiler 'Item.all' 10 graph 2> graph.txt
427 427
 </shell>
428 428
 
429 429
 h3. Helper Methods
28  railties/guides/source/plugins.textile
Source Rendered
@@ -39,9 +39,9 @@ The examples in this guide require that you have a working rails application.  T
39 39
 gem install rails
40 40
 rails yaffle_guide
41 41
 cd yaffle_guide
42  
-script/generate scaffold bird name:string
  42
+rails generate scaffold bird name:string
43 43
 rake db:migrate
44  
-script/server
  44
+rails server
45 45
 </pre>
46 46
 
47 47
 Then navigate to http://localhost:3000/birds.  Make sure you have a functioning rails app before continuing.
@@ -57,16 +57,16 @@ This creates a plugin in 'vendor/plugins' including an 'init.rb' and 'README' as
57 57
 
58 58
 Examples:
59 59
 <pre>
60  
-./script/generate plugin yaffle
61  
-./script/generate plugin yaffle --with-generator
  60
+rails generate plugin yaffle
  61
+rails generate plugin yaffle --with-generator
62 62
 </pre>
63 63
 
64  
-To get more detailed help on the plugin generator, type +./script/generate plugin+.
  64
+To get more detailed help on the plugin generator, type +rails generate plugin+.
65 65
 
66 66
 Later on this guide will describe how to work with generators, so go ahead and generate your plugin with the +--with-generator+ option now:
67 67
 
68 68
 <pre>
69  
-./script/generate plugin yaffle --with-generator
  69
+rails generate plugin yaffle --with-generator
70 70
 </pre>
71 71
 
72 72
 You should see the following output:
@@ -334,7 +334,7 @@ end
334 334
 To test that your method does what it says it does, run the unit tests with +rake+ from your plugin directory.  To see this in action, fire up a console and start squawking:
335 335
 
336 336
 <shell>
337  
-$ ./script/console
  337
+$ rails console
338 338
 >> "Hello World".to_squawk
339 339
 => "squawk! Hello World"
340 340
 </shell>
@@ -871,7 +871,7 @@ If you plan to distribute your plugin, developers will expect at least a minimum
871 871
 Rails ships with several built-in generators.  You can see all of the generators available to you by typing the following at the command line:
872 872
 
873 873
 <shell>
874  
-./script/generate
  874
+rails generate
875 875
 </shell>
876 876
 
877 877
 You should see something like this:
@@ -882,7 +882,7 @@ Installed Generators
882 882
   Builtin: controller, integration_test, mailer, migration, model, observer, plugin, resource, scaffold, session_migration
883 883
 </shell>
884 884
 
885  
-When you run +script/generate yaffle_definition -h+ you should see the contents of your 'vendor/plugins/yaffle/generators/yaffle_definition/USAGE'.
  885
+When you run +rails generate yaffle_definition -h+ you should see the contents of your 'vendor/plugins/yaffle/generators/yaffle_definition/USAGE'.
886 886
 
887 887
 For this plugin, update the USAGE file could look like this:
888 888
 
@@ -1111,11 +1111,11 @@ end
1111 1111
 To see this work, type:
1112 1112
 
1113 1113
 <shell>
1114  
-./script/generate yaffle_route
1115  
-./script/destroy yaffle_route
  1114
+rails generate yaffle_route
  1115
+rails destroy yaffle_route
1116 1116
 </shell>
1117 1117
 
1118  
-NOTE: If you haven't set up the custom route from above, 'script/destroy' will fail and you'll have to remove it manually.
  1118
+NOTE: If you haven't set up the custom route from above, 'rails destroy' will fail and you'll have to remove it manually.
1119 1119
 
1120 1120
 h3. Migrations
1121 1121
 
@@ -1195,7 +1195,7 @@ h4. Generate Migrations
1195 1195
 
1196 1196
 Generating migrations has several advantages over other methods.  Namely, you can allow other developers to more easily customize the migration.  The flow looks like this:
1197 1197
 
1198  
- * call your script/generate script and pass in whatever options they need
  1198
+ * call your rails generate script and pass in whatever options they need
1199 1199
  * examine the generated migration, adding/removing columns or other options as necessary
1200 1200
 
1201 1201
 This example will demonstrate how to use one of the built-in generator methods named 'migration_template' to create a migration file.  Extending the rails migration generator requires a somewhat intimate knowledge of the migration generator internals, so it's best to write a test first:
@@ -1289,7 +1289,7 @@ It's courteous to check to see if table names are being pluralized whenever you
1289 1289
 To run the generator, type the following at the command line:
1290 1290
 
1291 1291
 <shell>
1292  
-./script/generate yaffle_migration bird
  1292
+rails generate yaffle_migration bird
1293 1293
 </shell>
1294 1294
 
1295 1295
 and you will see a new file:
10  railties/guides/source/rails_on_rack.textile
Source Rendered
@@ -30,11 +30,11 @@ h4. Rails Application's Rack Object
30 30
 
31 31
 <tt>ActionController::Dispatcher.new</tt> is the primary Rack application object of a Rails application. Any Rack compliant web server should be using +ActionController::Dispatcher.new+ object to serve a Rails application.</p>
32 32
 
33  
-h4. +script/server+
  33
+h4. +rails server+
34 34
 
35  
-<tt>script/server</tt> does the basic job of creating a +Rack::Builder+ object and starting the webserver. This is Rails' equivalent of Rack's +rackup+ script.
  35
+<tt>rails server</tt> does the basic job of creating a +Rack::Builder+ object and starting the webserver. This is Rails' equivalent of Rack's +rackup+ script.
36 36
 
37  
-Here's how +script/server+ creates an instance of +Rack::Builder+
  37
+Here's how +rails server+ creates an instance of +Rack::Builder+
38 38
 
39 39
 <ruby>
40 40
 app = Rack::Builder.new {
@@ -54,7 +54,7 @@ Middlewares used in the code above are primarily useful only in the development
54 54
 
55 55
 h4. +rackup+
56 56
 
57  
-To use +rackup+ instead of Rails' +script/server+, you can put the following inside +config.ru+ of your Rails application's root directory:
  57
+To use +rackup+ instead of Rails' +rails server+, you can put the following inside +config.ru+ of your Rails application's root directory:
58 58
 
59 59
 <ruby>
60 60
 # RAILS_ROOT/config.ru
@@ -233,7 +233,7 @@ h4. Generating a Metal Application
233 233
 Rails provides a generator called +metal+ for creating a new Metal application:
234 234
 
235 235
 <shell>
236  
-$ script/generate metal poller
  236
+$ rails generate metal poller
237 237
 </shell>
238 238
 
239 239
 This generates +poller.rb+ in the +app/metal+ directory:
8  railties/guides/source/testing.textile
Source Rendered
@@ -56,7 +56,7 @@ h5. What are Fixtures?
56 56
 
57 57
 _Fixtures_ is a fancy word for sample data. Fixtures allow you to populate your testing database with predefined data before your tests run. Fixtures are database independent and assume one of two formats: *YAML* or *CSV*. In this guide we will use *YAML* which is the preferred format.
58 58
 
59  
-You'll find fixtures under your +test/fixtures+ directory. When you run +script/generate model+ to create a new model, fixture stubs will be automatically created and placed in this directory.
  59
+You'll find fixtures under your +test/fixtures+ directory. When you run +rails generate model+ to create a new model, fixture stubs will be automatically created and placed in this directory.
60 60
 
61 61
 h5. YAML
62 62
 
@@ -144,10 +144,10 @@ For this guide we will be using Rails _scaffolding_. It will create the model, a
144 144
 
145 145
 NOTE: For more information on Rails _scaffolding_, refer to "Getting Started with Rails":getting_started.html
146 146
 
147  
-When you use +script/generate scaffold+, for a resource among other things it creates a test stub in the +test/unit+ folder:
  147
+When you use +rails generate scaffold+, for a resource among other things it creates a test stub in the +test/unit+ folder:
148 148
 
149 149
 <pre>
150  
-$ script/generate scaffold post title:string body:text
  150
+$ rails generate scaffold post title:string body:text
151 151
 ...
152 152
 create  app/models/post.rb
153 153
 create  test/unit/post_test.rb
@@ -604,7 +604,7 @@ Integration tests are used to test the interaction among any number of controlle
604 604
 Unlike Unit and Functional tests, integration tests have to be explicitly created under the 'test/integration' folder within your application. Rails provides a generator to create an integration test skeleton for you.
605 605
 
606 606
 <shell>
607  
-$ script/generate integration_test user_flows
  607
+$ rails generate integration_test user_flows
608 608
       exists  test/integration/
609 609
       create  test/integration/user_flows_test.rb
610 610
 </shell>
16  railties/lib/generators/rails/app/templates/README
@@ -29,14 +29,14 @@ link:files/vendor/rails/actionpack/README.html.
29 29
 
30 30
 1. At the command prompt, start a new Rails application using the <tt>rails</tt> command
31 31
    and your application name. Ex: rails myapp
32  
-2. Change directory into myapp and start the web server: <tt>script/server</tt> (run with --help for options)
  32
+2. Change directory into myapp and start the web server: <tt>rails server</tt> (run with --help for options)
33 33
 3. Go to http://localhost:3000/ and get "Welcome aboard: You're riding the Rails!"
34 34
 4. Follow the guidelines to start developing your application
35 35
 
36 36
 
37 37
 == Web Servers
38 38
 
39  
-By default, Rails will try to use Mongrel if it's are installed when started with script/server, otherwise Rails will use WEBrick, the webserver that ships with Ruby. But you can also use Rails
  39
+By default, Rails will try to use Mongrel if it's are installed when started with <tt>rails server</tt>, otherwise Rails will use WEBrick, the webserver that ships with Ruby. But you can also use Rails
40 40
 with a variety of other web servers.
41 41
 
42 42
 Mongrel is a Ruby-based webserver with a C component (which requires compilation) that is
@@ -164,20 +164,20 @@ Finally, when you're ready to resume execution, you enter "cont"
164 164
 
165 165
 == Console
166 166
 
167  
-You can interact with the domain model by starting the console through <tt>script/console</tt>.
  167
+You can interact with the domain model by starting the console through <tt>rails console</tt>.
168 168
 Here you'll have all parts of the application configured, just like it is when the
169 169
 application is running. You can inspect domain models, change values, and save to the
170 170
 database. Starting the script without arguments will launch it in the development environment.
171  
-Passing an argument will specify a different environment, like <tt>script/console production</tt>.
  171
+Passing an argument will specify a different environment, like <tt>rails console production</tt>.
172 172
 
173 173
 To reload your controllers and models after launching the console run <tt>reload!</tt>
174 174
 
175 175
 == dbconsole
176 176
 
177  
-You can go to the command line of your database directly through <tt>script/dbconsole</tt>.
  177
+You can go to the command line of your database directly through <tt>rails dbconsole</tt>.
178 178
 You would be connected to the database with the credentials defined in database.yml.
179 179
 Starting the script without arguments will connect you to the development database. Passing an
180  
-argument will connect you to a different database, like <tt>script/dbconsole production</tt>.
  180
+argument will connect you to a different database, like <tt>rails dbconsole production</tt>.
181 181
 Currently works for mysql, postgresql and sqlite.
182 182
 
183 183
 == Description of Contents
@@ -207,7 +207,7 @@ app/views/layouts
207 207
 
208 208
 app/helpers
209 209
   Holds view helpers that should be named like weblogs_helper.rb. These are generated
210  
-  for you automatically when using script/generate for controllers. Helpers can be used to
  210
+  for you automatically when using <tt>rails generate</tt> for controllers. Helpers can be used to
211 211
   wrap functionality for your views into methods.
212 212
 
213 213
 config
@@ -234,7 +234,7 @@ script
234 234
   Helper scripts for automation and generation.
235 235
 
236 236
 test
237  
-  Unit and functional tests along with fixtures. When using the script/generate scripts, template
  237
+  Unit and functional tests along with fixtures. When using the <tt>rails generate</tt> scripts, template
238 238
   test files will be generated for you and placed in this directory.
239 239
 
240 240
 vendor
2  railties/lib/generators/rails/controller/USAGE
@@ -9,7 +9,7 @@ Description:
9 9
     template engine and test framework generators.
10 10
 
11 11
 Example:
12  
-    `./script/generate controller CreditCard open debit credit close`
  12
+    `rails generate controller CreditCard open debit credit close`
13 13
 
14 14
     Credit card controller with URLs like /credit_card/debit.
15 15
         Controller:      app/controllers/credit_card_controller.rb
2  railties/lib/generators/rails/generator/USAGE
@@ -3,7 +3,7 @@ Description:
3 3
     CamelCased or under_scored, as an argument. 
4 4
 
5 5
 Example:
6  
-    `./script/generate generator Awesome`
  6
+    `rails generate generator Awesome`
7 7
 
8 8
     creates a standard awesome generator:
9 9
         lib/generators/awesome/
2 &#x