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.
- data/CHANGELOG +5 -0
- data/README +118 -123
- data/guides/source/3_0_release_notes.textile +13 -11
- data/guides/source/action_controller_overview.textile +2 -2
- data/guides/source/action_mailer_basics.textile +70 -26
- data/guides/source/action_view_overview.textile +1 -1
- data/guides/source/active_record_basics.textile +9 -1
- data/guides/source/active_record_querying.textile +2 -2
- data/guides/source/active_support_core_extensions.textile +377 -9
- data/guides/source/activerecord_validations_callbacks.textile +98 -55
- data/guides/source/association_basics.textile +1 -1
- data/guides/source/caching_with_rails.textile +1 -1
- data/guides/source/command_line.textile +23 -23
- data/guides/source/configuring.textile +1 -3
- data/guides/source/contribute.textile +27 -28
- data/guides/source/credits.html.erb +4 -4
- data/guides/source/debugging_rails_applications.textile +2 -2
- data/guides/source/form_helpers.textile +7 -6
- data/guides/source/generators.textile +19 -29
- data/guides/source/getting_started.textile +106 -49
- data/guides/source/i18n.textile +27 -27
- data/guides/source/index.html.erb +18 -8
- data/guides/source/initialization.textile +140 -514
- data/guides/source/layout.html.erb +6 -4
- data/guides/source/layouts_and_rendering.textile +5 -5
- data/guides/source/migrations.textile +7 -3
- data/guides/source/nested_model_forms.textile +2 -2
- data/guides/source/performance_testing.textile +11 -12
- data/guides/source/plugins.textile +30 -30
- data/guides/source/rails_application_templates.textile +3 -3
- data/guides/source/rails_on_rack.textile +3 -66
- data/guides/source/routing.textile +10 -4
- data/guides/source/security.textile +1 -1
- data/guides/source/testing.textile +55 -52
- data/guides/w3c_validator.rb +67 -0
- data/lib/rails.rb +1 -0
- data/lib/rails/application.rb +49 -13
- data/lib/rails/application/bootstrap.rb +7 -6
- data/lib/rails/application/configuration.rb +24 -47
- data/lib/rails/application/finisher.rb +8 -3
- data/lib/rails/backtrace_cleaner.rb +11 -12
- data/lib/rails/commands.rb +54 -54
- data/lib/rails/commands/application.rb +7 -2
- data/lib/rails/commands/{performance/benchmarker.rb → benchmarker.rb} +0 -0
- data/lib/rails/commands/dbconsole.rb +4 -3
- data/lib/rails/commands/destroy.rb +1 -0
- data/lib/rails/commands/generate.rb +1 -0
- data/lib/rails/commands/{performance/profiler.rb → profiler.rb} +0 -0
- data/lib/rails/commands/runner.rb +4 -2
- data/lib/rails/configuration.rb +36 -0
- data/lib/rails/engine.rb +24 -24
- data/lib/rails/engine/configuration.rb +0 -1
- data/lib/rails/generators.rb +48 -10
- data/lib/rails/generators/actions.rb +5 -3
- data/lib/rails/generators/base.rb +23 -17
- data/lib/rails/generators/erb/scaffold/templates/_form.html.erb +9 -8
- data/lib/rails/generators/erb/scaffold/templates/show.html.erb +1 -1
- data/lib/rails/generators/generated_attribute.rb +7 -6
- data/lib/rails/generators/rails/app/USAGE +2 -2
- data/lib/rails/generators/rails/app/app_generator.rb +242 -97
- data/lib/rails/generators/rails/app/templates/Gemfile +3 -0
- data/lib/rails/generators/rails/app/templates/README +167 -130
- data/lib/rails/generators/rails/app/templates/Rakefile +0 -3
- data/lib/rails/generators/rails/app/templates/config/boot.rb +9 -2
- data/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml +5 -5
- data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +4 -0
- data/lib/rails/generators/rails/app/templates/script/rails +2 -5
- data/lib/rails/generators/rails/generator/templates/%file_name%_generator.rb.tt +1 -3
- data/lib/rails/generators/rails/stylesheets/templates/scaffold.css +5 -9
- data/lib/rails/generators/test_case.rb +12 -0
- data/lib/rails/generators/test_unit/integration/templates/integration_test.rb +1 -1
- data/lib/rails/generators/test_unit/performance/templates/performance_test.rb +1 -1
- data/lib/rails/info.rb +0 -33
- data/lib/rails/log_subscriber.rb +13 -6
- data/lib/rails/rack/logger.rb +4 -3
- data/lib/rails/railtie.rb +4 -0
- data/lib/rails/railtie/configuration.rb +21 -4
- data/lib/rails/tasks/documentation.rake +2 -0
- data/lib/rails/tasks/framework.rake +22 -0
- data/lib/rails/tasks/middleware.rake +1 -1
- data/lib/rails/tasks/routes.rake +5 -1
- data/lib/rails/test_help.rb +3 -1
- data/lib/rails/test_unit/testing.rake +3 -1
- data/lib/rails/version.rb +1 -1
- metadata +12 -19
- data/lib/rails/application/metal_loader.rb +0 -50
- data/lib/rails/dispatcher.rb +0 -24
- data/lib/rails/generators/rails/mailer/USAGE +0 -15
- data/lib/rails/generators/rails/mailer/mailer_generator.rb +0 -14
- data/lib/rails/generators/rails/mailer/templates/mailer.rb +0 -16
- data/lib/rails/generators/rails/metal/USAGE +0 -8
- data/lib/rails/generators/rails/metal/metal_generator.rb +0 -11
- data/lib/rails/generators/rails/metal/templates/metal.rb +0 -12
@@ -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"
|
7
|
-
that are primarily responsible for inserting pre-built data in between
|
8
|
-
The model contains the "smart" domain objects (such as Account,
|
9
|
-
Post) that holds all the business logic and knows how to
|
10
|
-
a database. The controller handles the incoming requests
|
11
|
-
Update Product, Show Post) by manipulating the model
|
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.
|
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,
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
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
|
40
|
-
Rails will use WEBrick, the
|
41
|
-
with
|
42
|
-
|
43
|
-
Mongrel is a Ruby-based
|
44
|
-
suitable for development
|
45
|
-
getting up and running with mongrel is as easy as:
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
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.
|
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.
|
102
|
-
on the server.log and development.log. Rails will automatically display
|
103
|
-
and runtime information to these files. Debugging info will also be
|
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
|
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
|
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
|
-
*
|
126
|
-
* Learn to Program: http://pine.fm/LearnToProgram/
|
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
|
129
|
-
|
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
|
135
|
-
|
136
|
-
in the code, investigate and change the model,
|
137
|
-
You need to install ruby-debug to run the server in debugging
|
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
|
152
|
-
|
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
|
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
|
-
|
169
|
-
Here you'll have all parts of the application
|
170
|
-
application is running. You can inspect
|
171
|
-
|
172
|
-
|
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
|
179
|
-
You would be connected to the database with the credentials
|
180
|
-
Starting the script without arguments will connect you
|
181
|
-
argument will connect you to a different
|
182
|
-
Currently works for
|
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
|
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
|
-
|
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
|
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
|
205
|
-
header/footer method of wrapping views. In your views, define a layout
|
206
|
-
<tt>layout :default</tt> and create a file named default.html.erb.
|
207
|
-
call <% yield %> to render the view using this
|
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
|
211
|
-
for you automatically when using
|
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,
|
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.
|
219
|
-
|
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
|
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
|
227
|
-
belong under controllers, models, or helpers. This directory is in
|
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
|
231
|
-
and javascripts. Also contains the dispatchers and the
|
232
|
-
set as the DOCUMENT_ROOT of your web
|
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
|
239
|
-
test files will be generated for you and placed in this
|
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
|
243
|
-
If the app has frozen rails, those gems also go here, under
|
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.
|
@@ -1,6 +1,13 @@
|
|
1
1
|
require 'rubygems'
|
2
|
+
|
2
3
|
# Set up gems listed in the Gemfile.
|
3
|
-
|
4
|
+
gemfile = File.expand_path('../../Gemfile', __FILE__)
|
5
|
+
begin
|
6
|
+
ENV['BUNDLE_GEMFILE'] = gemfile
|
4
7
|
require 'bundler'
|
5
8
|
Bundler.setup
|
6
|
-
|
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
|
4
|
-
# gem install
|
5
|
-
# On Mac OS X:
|
6
|
-
# gem install
|
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
|
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:
|