railties 3.0.0.beta3 → 3.0.0.beta4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. data/CHANGELOG +5 -0
  2. data/README +118 -123
  3. data/guides/source/3_0_release_notes.textile +13 -11
  4. data/guides/source/action_controller_overview.textile +2 -2
  5. data/guides/source/action_mailer_basics.textile +70 -26
  6. data/guides/source/action_view_overview.textile +1 -1
  7. data/guides/source/active_record_basics.textile +9 -1
  8. data/guides/source/active_record_querying.textile +2 -2
  9. data/guides/source/active_support_core_extensions.textile +377 -9
  10. data/guides/source/activerecord_validations_callbacks.textile +98 -55
  11. data/guides/source/association_basics.textile +1 -1
  12. data/guides/source/caching_with_rails.textile +1 -1
  13. data/guides/source/command_line.textile +23 -23
  14. data/guides/source/configuring.textile +1 -3
  15. data/guides/source/contribute.textile +27 -28
  16. data/guides/source/credits.html.erb +4 -4
  17. data/guides/source/debugging_rails_applications.textile +2 -2
  18. data/guides/source/form_helpers.textile +7 -6
  19. data/guides/source/generators.textile +19 -29
  20. data/guides/source/getting_started.textile +106 -49
  21. data/guides/source/i18n.textile +27 -27
  22. data/guides/source/index.html.erb +18 -8
  23. data/guides/source/initialization.textile +140 -514
  24. data/guides/source/layout.html.erb +6 -4
  25. data/guides/source/layouts_and_rendering.textile +5 -5
  26. data/guides/source/migrations.textile +7 -3
  27. data/guides/source/nested_model_forms.textile +2 -2
  28. data/guides/source/performance_testing.textile +11 -12
  29. data/guides/source/plugins.textile +30 -30
  30. data/guides/source/rails_application_templates.textile +3 -3
  31. data/guides/source/rails_on_rack.textile +3 -66
  32. data/guides/source/routing.textile +10 -4
  33. data/guides/source/security.textile +1 -1
  34. data/guides/source/testing.textile +55 -52
  35. data/guides/w3c_validator.rb +67 -0
  36. data/lib/rails.rb +1 -0
  37. data/lib/rails/application.rb +49 -13
  38. data/lib/rails/application/bootstrap.rb +7 -6
  39. data/lib/rails/application/configuration.rb +24 -47
  40. data/lib/rails/application/finisher.rb +8 -3
  41. data/lib/rails/backtrace_cleaner.rb +11 -12
  42. data/lib/rails/commands.rb +54 -54
  43. data/lib/rails/commands/application.rb +7 -2
  44. data/lib/rails/commands/{performance/benchmarker.rb → benchmarker.rb} +0 -0
  45. data/lib/rails/commands/dbconsole.rb +4 -3
  46. data/lib/rails/commands/destroy.rb +1 -0
  47. data/lib/rails/commands/generate.rb +1 -0
  48. data/lib/rails/commands/{performance/profiler.rb → profiler.rb} +0 -0
  49. data/lib/rails/commands/runner.rb +4 -2
  50. data/lib/rails/configuration.rb +36 -0
  51. data/lib/rails/engine.rb +24 -24
  52. data/lib/rails/engine/configuration.rb +0 -1
  53. data/lib/rails/generators.rb +48 -10
  54. data/lib/rails/generators/actions.rb +5 -3
  55. data/lib/rails/generators/base.rb +23 -17
  56. data/lib/rails/generators/erb/scaffold/templates/_form.html.erb +9 -8
  57. data/lib/rails/generators/erb/scaffold/templates/show.html.erb +1 -1
  58. data/lib/rails/generators/generated_attribute.rb +7 -6
  59. data/lib/rails/generators/rails/app/USAGE +2 -2
  60. data/lib/rails/generators/rails/app/app_generator.rb +242 -97
  61. data/lib/rails/generators/rails/app/templates/Gemfile +3 -0
  62. data/lib/rails/generators/rails/app/templates/README +167 -130
  63. data/lib/rails/generators/rails/app/templates/Rakefile +0 -3
  64. data/lib/rails/generators/rails/app/templates/config/boot.rb +9 -2
  65. data/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml +5 -5
  66. data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +4 -0
  67. data/lib/rails/generators/rails/app/templates/script/rails +2 -5
  68. data/lib/rails/generators/rails/generator/templates/%file_name%_generator.rb.tt +1 -3
  69. data/lib/rails/generators/rails/stylesheets/templates/scaffold.css +5 -9
  70. data/lib/rails/generators/test_case.rb +12 -0
  71. data/lib/rails/generators/test_unit/integration/templates/integration_test.rb +1 -1
  72. data/lib/rails/generators/test_unit/performance/templates/performance_test.rb +1 -1
  73. data/lib/rails/info.rb +0 -33
  74. data/lib/rails/log_subscriber.rb +13 -6
  75. data/lib/rails/rack/logger.rb +4 -3
  76. data/lib/rails/railtie.rb +4 -0
  77. data/lib/rails/railtie/configuration.rb +21 -4
  78. data/lib/rails/tasks/documentation.rake +2 -0
  79. data/lib/rails/tasks/framework.rake +22 -0
  80. data/lib/rails/tasks/middleware.rake +1 -1
  81. data/lib/rails/tasks/routes.rake +5 -1
  82. data/lib/rails/test_help.rb +3 -1
  83. data/lib/rails/test_unit/testing.rake +3 -1
  84. data/lib/rails/version.rb +1 -1
  85. metadata +12 -19
  86. data/lib/rails/application/metal_loader.rb +0 -50
  87. data/lib/rails/dispatcher.rb +0 -24
  88. data/lib/rails/generators/rails/mailer/USAGE +0 -15
  89. data/lib/rails/generators/rails/mailer/mailer_generator.rb +0 -14
  90. data/lib/rails/generators/rails/mailer/templates/mailer.rb +0 -16
  91. data/lib/rails/generators/rails/metal/USAGE +0 -8
  92. data/lib/rails/generators/rails/metal/metal_generator.rb +0 -11
  93. data/lib/rails/generators/rails/metal/templates/metal.rb +0 -12
@@ -23,6 +23,9 @@ gem '<%= gem_for_database %>'<% if require_for_database %>, :require => '<%= req
23
23
  # Deploy with Capistrano
24
24
  # gem 'capistrano'
25
25
 
26
+ # To use debugger
27
+ # gem 'ruby-debug'
28
+
26
29
  # Bundle the extra gems:
27
30
  # gem 'bj'
28
31
  # gem 'nokogiri', '1.4.1'
@@ -1,14 +1,15 @@
1
1
  == Welcome to Rails
2
2
 
3
- Rails is a web-application framework that includes everything needed to create
4
- database-backed web applications according to the Model-View-Control pattern.
3
+ Rails is a web-application framework that includes everything needed to create
4
+ database-backed web applications according to the Model-View-Control pattern.
5
5
 
6
- This pattern splits the view (also called the presentation) into "dumb" templates
7
- that are primarily responsible for inserting pre-built data in between HTML tags.
8
- The model contains the "smart" domain objects (such as Account, Product, Person,
9
- Post) that holds all the business logic and knows how to persist themselves to
10
- a database. The controller handles the incoming requests (such as Save New Account,
11
- Update Product, Show Post) by manipulating the model and directing data to the view.
6
+ This pattern splits the view (also called the presentation) into "dumb"
7
+ templates that are primarily responsible for inserting pre-built data in between
8
+ HTML tags. The model contains the "smart" domain objects (such as Account,
9
+ Product, Person, Post) that holds all the business logic and knows how to
10
+ persist themselves to a database. The controller handles the incoming requests
11
+ (such as Save New Account, Update Product, Show Post) by manipulating the model
12
+ and directing data to the view.
12
13
 
13
14
  In Rails, the model is handled by what's called an object-relational mapping
14
15
  layer entitled Active Record. This layer allows you to present the data from
@@ -21,90 +22,65 @@ layers by its two parts: Action View and Action Controller. These two layers
21
22
  are bundled in a single package due to their heavy interdependence. This is
22
23
  unlike the relationship between the Active Record and Action Pack that is much
23
24
  more separate. Each of these packages can be used independently outside of
24
- Rails. You can read more about Action Pack in
25
+ Rails. You can read more about Action Pack in
25
26
  link:files/vendor/rails/actionpack/README.html.
26
27
 
27
28
 
28
29
  == Getting Started
29
30
 
30
- 1. At the command prompt, start a new Rails application using the <tt>rails</tt> command
31
- and your application name. Ex: rails myapp
32
- 2. Change directory into myapp and start the web server: <tt>rails server</tt> (run with --help for options)
33
- 3. Go to http://localhost:3000/ and get "Welcome aboard: You're riding the Rails!"
34
- 4. Follow the guidelines to start developing your application
31
+ 1. At the command prompt, create a new Rails application:
32
+ <tt>rails myapp</tt> (where <tt>myapp</tt> is the application name)
33
+
34
+ 2. Change directory to <tt>myapp</tt> and start the web server:
35
+ <tt>cd myapp; rails server</tt> (run with --help for options)
36
+
37
+ 3. Go to http://localhost:3000/ and you'll see:
38
+ "Welcome aboard: You're riding the Rails!"
39
+
40
+ 4. Follow the guidelines to start developing your application. You can find
41
+ the following resources handy:
42
+
43
+ * The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html
44
+ * Ruby on Rails Tutorial Book: http://www.railstutorial.org/
35
45
 
36
46
 
37
47
  == Web Servers
38
48
 
39
- By default, Rails will try to use Mongrel if it's installed when started with <tt>rails server</tt>, otherwise
40
- Rails will use WEBrick, the webserver that ships with Ruby. But you can also use Rails
41
- with a variety of other web servers.
42
-
43
- Mongrel is a Ruby-based webserver with a C component (which requires compilation) that is
44
- suitable for development and deployment of Rails applications. If you have Ruby Gems installed,
45
- getting up and running with mongrel is as easy as: <tt>gem install mongrel</tt>.
46
- More info at: http://mongrel.rubyforge.org
47
-
48
- Say other Ruby web servers like Thin and Ebb or regular web servers like Apache or LiteSpeed or
49
- Lighttpd or IIS. The Ruby web servers are run through Rack and the latter can either be setup to use
50
- FCGI or proxy to a pack of Mongrels/Thin/Ebb servers.
51
-
52
- == Apache .htaccess example for FCGI/CGI
53
-
54
- # General Apache options
55
- AddHandler fastcgi-script .fcgi
56
- AddHandler cgi-script .cgi
57
- Options +FollowSymLinks +ExecCGI
58
-
59
- # If you don't want Rails to look in certain directories,
60
- # use the following rewrite rules so that Apache won't rewrite certain requests
61
- #
62
- # Example:
63
- # RewriteCond %{REQUEST_URI} ^/notrails.*
64
- # RewriteRule .* - [L]
65
-
66
- # Redirect all requests not available on the filesystem to Rails
67
- # By default the cgi dispatcher is used which is very slow
68
- #
69
- # For better performance replace the dispatcher with the fastcgi one
70
- #
71
- # Example:
72
- # RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
73
- RewriteEngine On
74
-
75
- # If your Rails application is accessed via an Alias directive,
76
- # then you MUST also set the RewriteBase in this htaccess file.
77
- #
78
- # Example:
79
- # Alias /myrailsapp /path/to/myrailsapp/public
80
- # RewriteBase /myrailsapp
81
-
82
- RewriteRule ^$ index.html [QSA]
83
- RewriteRule ^([^.]+)$ $1.html [QSA]
84
- RewriteCond %{REQUEST_FILENAME} !-f
85
- RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
86
-
87
- # In case Rails experiences terminal errors
88
- # Instead of displaying this message you can supply a file here which will be rendered instead
89
- #
90
- # Example:
91
- # ErrorDocument 500 /500.html
92
-
93
- ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"
49
+ By default, Rails will try to use Mongrel if it's installed when started with
50
+ <tt>rails server</tt>, otherwise Rails will use WEBrick, the web server that
51
+ ships with Ruby.
52
+
53
+ Mongrel is a Ruby-based web server with a C component (which requires
54
+ compilation) that is suitable for development. If you have Ruby Gems installed,
55
+ getting up and running with mongrel is as easy as:
56
+ <tt>sudo gem install mongrel</tt>.
57
+
58
+ You can find more info at: http://mongrel.rubyforge.org
59
+
60
+ You can alternatively run Rails applications with other Ruby web servers, e.g.,
61
+ {Thin}[http://code.macournoyer.com/thin/], {Ebb}[http://ebb.rubyforge.org/], and
62
+ Apache with {mod_rails}[http://www.modrails.com/]. However, <tt>rails server</tt>
63
+ doesn't search for or start them.
64
+
65
+ For production use, often a web/proxy server, e.g., {Apache}[http://apache.org],
66
+ {Nginx}[http://nginx.net/], {LiteSpeed}[http://litespeedtech.com/],
67
+ {Lighttpd}[http://www.lighttpd.net/], or {IIS}[http://www.iis.net/], is deployed
68
+ as the front end server with the chosen Ruby web server running in the back end
69
+ and receiving the proxied requests via one of several protocols (HTTP, CGI, FCGI).
94
70
 
95
71
 
96
72
  == Debugging Rails
97
73
 
98
- Sometimes your application goes wrong. Fortunately there are a lot of tools that
74
+ Sometimes your application goes wrong. Fortunately there are a lot of tools that
99
75
  will help you debug it and get it back on the rails.
100
76
 
101
- First area to check is the application log files. Have "tail -f" commands running
102
- on the server.log and development.log. Rails will automatically display debugging
103
- and runtime information to these files. Debugging info will also be shown in the
104
- browser on requests from 127.0.0.1.
77
+ First area to check is the application log files. Have "tail -f" commands
78
+ running on the server.log and development.log. Rails will automatically display
79
+ debugging and runtime information to these files. Debugging info will also be
80
+ shown in the browser on requests from 127.0.0.1.
105
81
 
106
- You can also log your own messages directly into the log file from your code using
107
- the Ruby logger class from inside your controllers. Example:
82
+ You can also log your own messages directly into the log file from your code
83
+ using the Ruby logger class from inside your controllers. Example:
108
84
 
109
85
  class WeblogController < ActionController::Base
110
86
  def destroy
@@ -116,26 +92,27 @@ the Ruby logger class from inside your controllers. Example:
116
92
 
117
93
  The result will be a message in your log file along the lines of:
118
94
 
119
- Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1
95
+ Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1!
120
96
 
121
97
  More information on how to use the logger is at http://www.ruby-doc.org/core/
122
98
 
123
- Also, Ruby documentation can be found at http://www.ruby-lang.org/ including:
99
+ Also, Ruby documentation can be found at http://www.ruby-lang.org/. There are
100
+ several books available online as well:
124
101
 
125
- * The Learning Ruby (Pickaxe) Book: http://www.ruby-doc.org/docs/ProgrammingRuby/
126
- * Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
102
+ * Programming Ruby: http://www.ruby-doc.org/docs/ProgrammingRuby/ (Pickaxe)
103
+ * Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
127
104
 
128
- These two online (and free) books will bring you up to speed on the Ruby language
129
- and also on programming in general.
105
+ These two books will bring you up to speed on the Ruby language and also on
106
+ programming in general.
130
107
 
131
108
 
132
109
  == Debugger
133
110
 
134
- Debugger support is available through the debugger command when you start your Mongrel or
135
- Webrick server with --debugger. This means that you can break out of execution at any point
136
- in the code, investigate and change the model, AND then resume execution!
137
- You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install ruby-debug'
138
- Example:
111
+ Debugger support is available through the debugger command when you start your
112
+ Mongrel or WEBrick server with --debugger. This means that you can break out of
113
+ execution at any point in the code, investigate and change the model, and then,
114
+ resume execution! You need to install ruby-debug to run the server in debugging
115
+ mode. With gems, use <tt>sudo gem install ruby-debug</tt>. Example:
139
116
 
140
117
  class WeblogController < ActionController::Base
141
118
  def index
@@ -148,97 +125,157 @@ So the controller will accept the action, run the first line, then present you
148
125
  with a IRB prompt in the server window. Here you can do things like:
149
126
 
150
127
  >> @posts.inspect
151
- => "[#<Post:0x14a6be8 @attributes={\"title\"=>nil, \"body\"=>nil, \"id\"=>\"1\"}>,
152
- #<Post:0x14a6620 @attributes={\"title\"=>\"Rails you know!\", \"body\"=>\"Only ten..\", \"id\"=>\"2\"}>]"
128
+ => "[#<Post:0x14a6be8
129
+ @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>,
130
+ #<Post:0x14a6620
131
+ @attributes={"title"=>"Rails", "body"=>"Only ten..", "id"=>"2"}>]"
153
132
  >> @posts.first.title = "hello from a debugger"
154
133
  => "hello from a debugger"
155
134
 
156
- ...and even better is that you can examine how your runtime objects actually work:
135
+ ...and even better, you can examine how your runtime objects actually work:
157
136
 
158
137
  >> f = @posts.first
159
138
  => #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
160
139
  >> f.
161
140
  Display all 152 possibilities? (y or n)
162
141
 
163
- Finally, when you're ready to resume execution, you enter "cont"
142
+ Finally, when you're ready to resume execution, you can enter "cont".
164
143
 
165
144
 
166
145
  == Console
167
146
 
168
- You can interact with the domain model by starting the console through <tt>rails console</tt>.
169
- Here you'll have all parts of the application configured, just like it is when the
170
- application is running. You can inspect domain models, change values, and save to the
171
- database. Starting the script without arguments will launch it in the development environment.
172
- Passing an argument will specify a different environment, like <tt>rails console production</tt>.
147
+ The console is a Ruby shell, which allows you to interact with your
148
+ application's domain model. Here you'll have all parts of the application
149
+ configured, just like it is when the application is running. You can inspect
150
+ domain models, change values, and save to the database. Starting the script
151
+ without arguments will launch it in the development environment.
152
+
153
+ To start the console, run <tt>rails console</tt> from the application
154
+ directory.
155
+
156
+ Options:
157
+
158
+ * Passing the <tt>-s, --sandbox</tt> argument will rollback any modifications
159
+ made to the database.
160
+ * Passing an environment name as an argument will load the corresponding
161
+ environment. Example: <tt>rails console production</tt>.
162
+
163
+ To reload your controllers and models after launching the console run
164
+ <tt>reload!</tt>
165
+
166
+ More information about irb can be found at:
167
+ link:http://www.rubycentral.com/pickaxe/irb.html
173
168
 
174
- To reload your controllers and models after launching the console run <tt>reload!</tt>
175
169
 
176
170
  == dbconsole
177
171
 
178
- You can go to the command line of your database directly through <tt>rails dbconsole</tt>.
179
- You would be connected to the database with the credentials defined in database.yml.
180
- Starting the script without arguments will connect you to the development database. Passing an
181
- argument will connect you to a different database, like <tt>rails dbconsole production</tt>.
182
- Currently works for mysql, postgresql and sqlite.
172
+ You can go to the command line of your database directly through <tt>rails
173
+ dbconsole</tt>. You would be connected to the database with the credentials
174
+ defined in database.yml. Starting the script without arguments will connect you
175
+ to the development database. Passing an argument will connect you to a different
176
+ database, like <tt>rails dbconsole production</tt>. Currently works for MySQL,
177
+ PostgreSQL and SQLite 3.
183
178
 
184
179
  == Description of Contents
185
180
 
181
+ The default directory structure of a generated Ruby on Rails application:
182
+
183
+ |-- app
184
+ | |-- controllers
185
+ | |-- helpers
186
+ | |-- models
187
+ | `-- views
188
+ | `-- layouts
189
+ |-- config
190
+ | |-- environments
191
+ | |-- initializers
192
+ | `-- locales
193
+ |-- db
194
+ |-- doc
195
+ |-- lib
196
+ | `-- tasks
197
+ |-- log
198
+ |-- public
199
+ | |-- images
200
+ | |-- javascripts
201
+ | `-- stylesheets
202
+ |-- script
203
+ | `-- performance
204
+ |-- test
205
+ | |-- fixtures
206
+ | |-- functional
207
+ | |-- integration
208
+ | |-- performance
209
+ | `-- unit
210
+ |-- tmp
211
+ | |-- cache
212
+ | |-- pids
213
+ | |-- sessions
214
+ | `-- sockets
215
+ `-- vendor
216
+ `-- plugins
217
+
186
218
  app
187
219
  Holds all the code that's specific to this particular application.
188
220
 
189
221
  app/controllers
190
222
  Holds controllers that should be named like weblogs_controller.rb for
191
- automated URL mapping. All controllers should descend from ApplicationController
192
- which itself descends from ActionController::Base.
223
+ automated URL mapping. All controllers should descend from
224
+ ApplicationController which itself descends from ActionController::Base.
193
225
 
194
226
  app/models
195
- Holds models that should be named like post.rb.
196
- Most models will descend from ActiveRecord::Base.
227
+ Holds models that should be named like post.rb. Models descend from
228
+ ActiveRecord::Base by default.
197
229
 
198
230
  app/views
199
231
  Holds the template files for the view that should be named like
200
- weblogs/index.html.erb for the WeblogsController#index action. All views use eRuby
201
- syntax.
232
+ weblogs/index.html.erb for the WeblogsController#index action. All views use
233
+ eRuby syntax by default.
202
234
 
203
235
  app/views/layouts
204
- Holds the template files for layouts to be used with views. This models the common
205
- header/footer method of wrapping views. In your views, define a layout using the
206
- <tt>layout :default</tt> and create a file named default.html.erb. Inside default.html.erb,
207
- call <% yield %> to render the view using this layout.
236
+ Holds the template files for layouts to be used with views. This models the
237
+ common header/footer method of wrapping views. In your views, define a layout
238
+ using the <tt>layout :default</tt> and create a file named default.html.erb.
239
+ Inside default.html.erb, call <% yield %> to render the view using this
240
+ layout.
208
241
 
209
242
  app/helpers
210
- Holds view helpers that should be named like weblogs_helper.rb. These are generated
211
- for you automatically when using rails generate for controllers. Helpers can be used to
212
- wrap functionality for your views into methods.
243
+ Holds view helpers that should be named like weblogs_helper.rb. These are
244
+ generated for you automatically when using generators for controllers.
245
+ Helpers can be used to wrap functionality for your views into methods.
213
246
 
214
247
  config
215
- Configuration files for the Rails environment, the routing map, the database, and other dependencies.
248
+ Configuration files for the Rails environment, the routing map, the database,
249
+ and other dependencies.
216
250
 
217
251
  db
218
- Contains the database schema in schema.rb. db/migrate contains all
219
- the sequence of Migrations for your schema.
252
+ Contains the database schema in schema.rb. db/migrate contains all the
253
+ sequence of Migrations for your schema.
220
254
 
221
255
  doc
222
- This directory is where your application documentation will be stored when generated
223
- using <tt>rake doc:app</tt>
256
+ This directory is where your application documentation will be stored when
257
+ generated using <tt>rake doc:app</tt>
224
258
 
225
259
  lib
226
- Application specific libraries. Basically, any kind of custom code that doesn't
227
- belong under controllers, models, or helpers. This directory is in the load path.
260
+ Application specific libraries. Basically, any kind of custom code that
261
+ doesn't belong under controllers, models, or helpers. This directory is in
262
+ the load path.
228
263
 
229
264
  public
230
- The directory available for the web server. Contains subdirectories for images, stylesheets,
231
- and javascripts. Also contains the dispatchers and the default HTML files. This should be
232
- set as the DOCUMENT_ROOT of your web server.
265
+ The directory available for the web server. Contains subdirectories for
266
+ images, stylesheets, and javascripts. Also contains the dispatchers and the
267
+ default HTML files. This should be set as the DOCUMENT_ROOT of your web
268
+ server.
233
269
 
234
270
  script
235
271
  Helper scripts for automation and generation.
236
272
 
237
273
  test
238
- Unit and functional tests along with fixtures. When using the rails generate command, template
239
- test files will be generated for you and placed in this directory.
274
+ Unit and functional tests along with fixtures. When using the rails generate
275
+ command, template test files will be generated for you and placed in this
276
+ directory.
240
277
 
241
278
  vendor
242
- External libraries that the application depends on. Also includes the plugins subdirectory.
243
- If the app has frozen rails, those gems also go here, under vendor/rails/.
244
- This directory is in the load path.
279
+ External libraries that the application depends on. Also includes the plugins
280
+ subdirectory. If the app has frozen rails, those gems also go here, under
281
+ vendor/rails/. This directory is in the load path.
@@ -2,9 +2,6 @@
2
2
  # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
3
 
4
4
  require File.expand_path('../config/application', __FILE__)
5
-
6
5
  require 'rake'
7
- require 'rake/testtask'
8
- require 'rake/rdoctask'
9
6
 
10
7
  Rails::Application.load_tasks
@@ -1,6 +1,13 @@
1
1
  require 'rubygems'
2
+
2
3
  # Set up gems listed in the Gemfile.
3
- if File.exist?(File.expand_path('../../Gemfile', __FILE__))
4
+ gemfile = File.expand_path('../../Gemfile', __FILE__)
5
+ begin
6
+ ENV['BUNDLE_GEMFILE'] = gemfile
4
7
  require 'bundler'
5
8
  Bundler.setup
6
- end
9
+ rescue Bundler::GemNotFound => e
10
+ STDERR.puts e.message
11
+ STDERR.puts "Try running `bundle install`."
12
+ exit!
13
+ end if File.exist?(gemfile)
@@ -1,11 +1,11 @@
1
1
  # PostgreSQL. Versions 7.4 and 8.x are supported.
2
2
  #
3
- # Install the ruby-postgres driver:
4
- # gem install ruby-postgres
5
- # On Mac OS X:
6
- # gem install ruby-postgres -- --include=/usr/local/pgsql
3
+ # Install the pg driver:
4
+ # gem install pg
5
+ # On Mac OS X with macports:
6
+ # gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
7
7
  # On Windows:
8
- # gem install ruby-postgres
8
+ # gem install pg
9
9
  # Choose the win32 build.
10
10
  # Install PostgreSQL and put its /bin directory on your path.
11
11
  development: