railties 3.0.0.beta4 → 3.0.0.rc

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. data/CHANGELOG +24 -6
  2. data/README.rdoc +25 -0
  3. data/guides/assets/javascripts/code_highlighter.js +0 -0
  4. data/guides/assets/javascripts/guides.js +0 -0
  5. data/guides/assets/stylesheets/print.css +0 -0
  6. data/guides/assets/stylesheets/reset.css +0 -0
  7. data/guides/assets/stylesheets/style.css +0 -0
  8. data/guides/source/3_0_release_notes.textile +5 -3
  9. data/guides/source/action_controller_overview.textile +19 -0
  10. data/guides/source/active_record_basics.textile +27 -21
  11. data/guides/source/active_record_querying.textile +39 -37
  12. data/guides/source/{activerecord_validations_callbacks.textile → active_record_validations_callbacks.textile} +30 -29
  13. data/guides/source/active_support_core_extensions.textile +232 -107
  14. data/guides/source/api_documentation_guidelines.textile +187 -0
  15. data/guides/source/association_basics.textile +45 -1
  16. data/guides/source/configuring.textile +7 -7
  17. data/guides/source/contributing_to_rails.textile +42 -15
  18. data/guides/source/form_helpers.textile +1 -1
  19. data/guides/source/generators.textile +37 -37
  20. data/guides/source/getting_started.textile +11 -11
  21. data/guides/source/i18n.textile +1 -1
  22. data/guides/source/index.html.erb +14 -6
  23. data/guides/source/initialization.textile +130 -124
  24. data/guides/source/layout.html.erb +5 -2
  25. data/guides/source/layouts_and_rendering.textile +2 -2
  26. data/guides/source/migrations.textile +4 -3
  27. data/guides/source/plugins.textile +15 -15
  28. data/guides/source/rails_application_templates.textile +2 -2
  29. data/guides/source/routing.textile +83 -62
  30. data/guides/source/security.textile +2 -2
  31. data/guides/w3c_validator.rb +30 -6
  32. data/lib/rails.rb +3 -3
  33. data/lib/rails/application.rb +43 -19
  34. data/lib/rails/application/bootstrap.rb +2 -0
  35. data/lib/rails/application/configuration.rb +3 -3
  36. data/lib/rails/application/finisher.rb +6 -6
  37. data/lib/rails/cli.rb +1 -19
  38. data/lib/rails/commands.rb +5 -5
  39. data/lib/rails/commands/application.rb +1 -1
  40. data/lib/rails/commands/console.rb +1 -4
  41. data/lib/rails/commands/generate.rb +0 -0
  42. data/lib/rails/commands/plugin.rb +57 -52
  43. data/lib/rails/commands/runner.rb +2 -1
  44. data/lib/rails/commands/server.rb +6 -2
  45. data/lib/rails/configuration.rb +2 -3
  46. data/lib/rails/console/app.rb +0 -2
  47. data/lib/rails/engine.rb +14 -15
  48. data/lib/rails/engine/configuration.rb +5 -5
  49. data/lib/rails/generators.rb +2 -3
  50. data/lib/rails/generators/actions.rb +4 -4
  51. data/lib/rails/generators/base.rb +1 -1
  52. data/lib/rails/generators/erb/scaffold/scaffold_generator.rb +1 -6
  53. data/lib/rails/generators/erb/scaffold/templates/_form.html.erb +4 -4
  54. data/lib/rails/generators/erb/scaffold/templates/edit.html.erb +3 -3
  55. data/lib/rails/generators/erb/scaffold/templates/index.html.erb +7 -7
  56. data/lib/rails/generators/erb/scaffold/templates/new.html.erb +2 -2
  57. data/lib/rails/generators/erb/scaffold/templates/show.html.erb +3 -3
  58. data/lib/rails/generators/generated_attribute.rb +2 -1
  59. data/lib/rails/generators/named_base.rb +24 -0
  60. data/lib/rails/generators/rails/app/app_generator.rb +10 -9
  61. data/lib/rails/generators/rails/app/templates/Gemfile +4 -3
  62. data/lib/rails/generators/rails/app/templates/README +6 -31
  63. data/lib/rails/generators/rails/app/templates/Rakefile +1 -1
  64. data/lib/rails/generators/rails/app/templates/app/controllers/application_controller.rb +0 -1
  65. data/lib/rails/generators/rails/app/templates/app/mailers/.empty_directory +0 -0
  66. data/lib/rails/generators/rails/app/templates/config/application.rb +11 -11
  67. data/lib/rails/generators/rails/app/templates/config/databases/ibm_db.yml +36 -24
  68. data/lib/rails/generators/rails/app/templates/config/databases/mysql.yml +1 -1
  69. data/lib/rails/generators/rails/app/templates/config/databases/oracle.yml +1 -1
  70. data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +3 -0
  71. data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +3 -0
  72. data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +3 -0
  73. data/lib/rails/generators/rails/app/templates/config/initializers/inflections.rb +1 -1
  74. data/lib/rails/generators/rails/app/templates/config/initializers/secret_token.rb.tt +2 -2
  75. data/lib/rails/generators/rails/app/templates/config/initializers/session_store.rb.tt +2 -2
  76. data/lib/rails/generators/rails/app/templates/config/routes.rb +1 -1
  77. data/lib/rails/generators/rails/app/templates/public/index.html +0 -17
  78. data/lib/rails/generators/rails/app/templates/public/javascripts/prototype.js +2027 -900
  79. data/lib/rails/generators/rails/app/templates/public/javascripts/rails.js +114 -57
  80. data/lib/rails/generators/rails/app/templates/test/test_helper.rb.tt +1 -1
  81. data/lib/rails/generators/rails/model/USAGE +1 -1
  82. data/lib/rails/generators/rails/resource/resource_generator.rb +4 -14
  83. data/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb +0 -2
  84. data/lib/rails/generators/rails/scaffold_controller/templates/controller.rb +28 -30
  85. data/lib/rails/generators/resource_helpers.rb +1 -1
  86. data/lib/rails/generators/test_case.rb +25 -11
  87. data/lib/rails/generators/test_unit/model/model_generator.rb +1 -1
  88. data/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb +0 -1
  89. data/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb +13 -15
  90. data/lib/rails/info.rb +1 -2
  91. data/lib/rails/info_routes.rb +1 -1
  92. data/lib/rails/initializable.rb +3 -16
  93. data/lib/rails/paths.rb +31 -36
  94. data/lib/rails/plugin.rb +10 -6
  95. data/lib/rails/rack/logger.rb +11 -13
  96. data/lib/rails/railtie.rb +14 -42
  97. data/lib/rails/ruby_version_check.rb +19 -5
  98. data/lib/rails/script_rails_loader.rb +29 -0
  99. data/lib/rails/tasks/annotations.rake +2 -2
  100. data/lib/rails/tasks/documentation.rake +47 -16
  101. data/lib/rails/tasks/framework.rake +9 -9
  102. data/lib/rails/tasks/middleware.rake +1 -1
  103. data/lib/rails/tasks/misc.rake +5 -5
  104. data/lib/rails/tasks/routes.rake +1 -1
  105. data/lib/rails/tasks/tmp.rake +5 -5
  106. data/lib/rails/test_unit/testing.rake +38 -14
  107. data/lib/rails/version.rb +1 -1
  108. metadata +29 -17
  109. data/README +0 -281
  110. data/lib/rails/application/routes_reloader.rb +0 -46
  111. data/lib/rails/log_subscriber.rb +0 -115
  112. data/lib/rails/log_subscriber/test_helper.rb +0 -97
  113. data/lib/rails/webrick_server.rb +0 -156
@@ -37,13 +37,14 @@ ARGV.delete(code_or_file)
37
37
  ENV["RAILS_ENV"] = options[:environment]
38
38
 
39
39
  require APP_PATH
40
- Rails::Application.require_environment!
40
+ Rails.application.require_environment!
41
41
 
42
42
  begin
43
43
  if code_or_file.nil?
44
44
  $stderr.puts "Run '#{$0} -h' for help."
45
45
  exit 1
46
46
  elsif File.exist?(code_or_file)
47
+ $0 = code_or_file
47
48
  eval(File.read(code_or_file), nil, code_or_file)
48
49
  else
49
50
  eval(code_or_file)
@@ -9,7 +9,7 @@ module Rails
9
9
  args, options = args.dup, {}
10
10
 
11
11
  opt_parser = OptionParser.new do |opts|
12
- opts.banner = "Usage: rails server [options]"
12
+ opts.banner = "Usage: rails server [mongrel, thin, etc] [options]"
13
13
  opts.on("-p", "--port=port", Integer,
14
14
  "Runs Rails on the specified port.", "Default: 3000") { |v| options[:Port] = v }
15
15
  opts.on("-b", "--binding=ip", String,
@@ -21,6 +21,9 @@ module Rails
21
21
  opts.on("-e", "--environment=name", String,
22
22
  "Specifies the environment to run this server under (test/development/production).",
23
23
  "Default: development") { |v| options[:environment] = v }
24
+ opts.on("-P","--pid=pid",String,
25
+ "Specifies the PID file.",
26
+ "Default: tmp/pids/server.pid") { |v| options[:pid] = v }
24
27
 
25
28
  opts.separator ""
26
29
 
@@ -83,7 +86,8 @@ module Rails
83
86
  :environment => (ENV['RAILS_ENV'] || "development").dup,
84
87
  :daemonize => false,
85
88
  :debugger => false,
86
- :pid => "tmp/pids/server.pid"
89
+ :pid => File.expand_path("tmp/pids/server.pid"),
90
+ :config => File.expand_path("config.ru")
87
91
  })
88
92
  end
89
93
  end
@@ -56,12 +56,11 @@ module Rails
56
56
 
57
57
  return @options[method] if args.empty?
58
58
 
59
- if method == :rails
60
- namespace, configuration = :rails, args.shift
61
- elsif args.first.is_a?(Hash)
59
+ if method == :rails || args.first.is_a?(Hash)
62
60
  namespace, configuration = method, args.shift
63
61
  else
64
62
  namespace, configuration = args.shift, args.shift
63
+ namespace = namespace.to_sym if namespace.respond_to?(:to_sym)
65
64
  @options[:rails][method] = namespace
66
65
  end
67
66
 
@@ -30,5 +30,3 @@ def reload!(print=true)
30
30
  ActionDispatch::Callbacks.new(Proc.new {}, false).call({})
31
31
  true
32
32
  end
33
-
34
- reload!(false)
@@ -32,14 +32,14 @@ module Rails
32
32
  # == Configuration
33
33
  #
34
34
  # Besides the Railtie configuration which is shared across the application, in a
35
- # Rails::Engine you can access load_paths, eager_load_paths and load_once_paths,
35
+ # Rails::Engine you can access autoload_paths, eager_load_paths and autoload_once_paths,
36
36
  # which differently from a Railtie, are scoped to the current Engine.
37
37
  #
38
38
  # Example:
39
39
  #
40
40
  # class MyEngine < Rails::Engine
41
41
  # # Add a load path for this specific Engine
42
- # config.load_paths << File.expand_path("../lib/some/path", __FILE__)
42
+ # config.autoload_paths << File.expand_path("../lib/some/path", __FILE__)
43
43
  #
44
44
  # initializer "my_engine.add_middleware" do |app|
45
45
  # app.middleware.use MyEngine::Middleware
@@ -142,7 +142,7 @@ module Rails
142
142
 
143
143
  # Add configured load paths to ruby load paths and remove duplicates.
144
144
  initializer :set_load_path, :before => :bootstrap_hook do
145
- config.load_paths.reverse_each do |path|
145
+ _all_load_paths.reverse_each do |path|
146
146
  $LOAD_PATH.unshift(path) if File.directory?(path)
147
147
  end
148
148
  $LOAD_PATH.uniq!
@@ -154,17 +154,13 @@ module Rails
154
154
  # This needs to be an initializer, since it needs to run once
155
155
  # per engine and get the engine as a block parameter
156
156
  initializer :set_autoload_paths, :before => :bootstrap_hook do |app|
157
- ActiveSupport::Dependencies.load_paths.unshift(*config.load_paths)
158
-
159
- if reloadable?(app)
160
- ActiveSupport::Dependencies.load_once_paths.unshift(*config.load_once_paths)
161
- else
162
- ActiveSupport::Dependencies.load_once_paths.unshift(*config.load_paths)
163
- end
157
+ ActiveSupport::Dependencies.autoload_paths.unshift(*_all_autoload_paths)
158
+ ActiveSupport::Dependencies.autoload_once_paths.unshift(*config.autoload_once_paths)
164
159
 
165
160
  # Freeze so future modifications will fail rather than do nothing mysteriously
166
- config.load_paths.freeze
167
- config.load_once_paths.freeze
161
+ config.autoload_paths.freeze
162
+ config.eager_load_paths.freeze
163
+ config.autoload_once_paths.freeze
168
164
  end
169
165
 
170
166
  initializer :add_routing_paths do |app|
@@ -195,7 +191,6 @@ module Rails
195
191
  ActiveSupport.on_load(:action_controller) do
196
192
  prepend_view_path(views)
197
193
  end
198
-
199
194
  ActiveSupport.on_load(:action_mailer) do
200
195
  prepend_view_path(views)
201
196
  end
@@ -214,8 +209,12 @@ module Rails
214
209
 
215
210
  protected
216
211
 
217
- def reloadable?(app)
218
- app.config.reload_engines
212
+ def _all_autoload_paths
213
+ @_all_autoload_paths ||= (config.autoload_paths + config.eager_load_paths + config.autoload_once_paths).uniq
214
+ end
215
+
216
+ def _all_load_paths
217
+ @_all_load_paths ||= (config.paths.load_paths + _all_autoload_paths).uniq
219
218
  end
220
219
  end
221
220
  end
@@ -4,7 +4,7 @@ module Rails
4
4
  class Engine
5
5
  class Configuration < ::Rails::Railtie::Configuration
6
6
  attr_reader :root
7
- attr_writer :eager_load_paths, :load_once_paths, :load_paths
7
+ attr_writer :eager_load_paths, :autoload_once_paths, :autoload_paths
8
8
 
9
9
  def initialize(root=nil)
10
10
  super()
@@ -41,12 +41,12 @@ module Rails
41
41
  @eager_load_paths ||= paths.eager_load
42
42
  end
43
43
 
44
- def load_once_paths
45
- @load_once_paths ||= paths.load_once
44
+ def autoload_once_paths
45
+ @autoload_once_paths ||= paths.autoload_once
46
46
  end
47
47
 
48
- def load_paths
49
- @load_paths ||= paths.load_paths
48
+ def autoload_paths
49
+ @autoload_paths ||= paths.autoload_paths
50
50
  end
51
51
  end
52
52
  end
@@ -50,7 +50,6 @@ module Rails
50
50
  :performance_tool => nil,
51
51
  :resource_controller => :controller,
52
52
  :scaffold_controller => :scaffold_controller,
53
- :singleton => false,
54
53
  :stylesheets => true,
55
54
  :test_framework => nil,
56
55
  :template_engine => :erb
@@ -327,11 +326,11 @@ module Rails
327
326
  paths = []
328
327
  namespaces.each do |namespace|
329
328
  pieces = namespace.split(":")
330
- paths << pieces.dup.push(pieces.last).join("/") unless pieces.uniq.size == 1
329
+ paths << pieces.dup.push(pieces.last).join("/")
331
330
  paths << pieces.join("/")
332
331
  end
333
332
  paths.uniq!
334
333
  paths
335
334
  end
336
335
  end
337
- end
336
+ end
@@ -40,7 +40,7 @@ module Rails
40
40
  end
41
41
  end
42
42
 
43
- # Adds an entry into config/environment.rb for the supplied gem. If env
43
+ # Adds an entry into Gemfile for the supplied gem. If env
44
44
  # is specified, add the gem to the given environment.
45
45
  #
46
46
  # ==== Example
@@ -100,7 +100,7 @@ module Rails
100
100
  end
101
101
  end
102
102
 
103
- # Adds a line inside the Initializer block for config/environment.rb.
103
+ # Adds a line inside the Application class for config/application.rb.
104
104
  #
105
105
  # If options :env is specified, the line is appended to the corresponding
106
106
  # file in config/environments.
@@ -267,7 +267,7 @@ module Rails
267
267
  ActiveSupport::Deprecation.warn "freeze! is deprecated since your rails app now comes bundled with Rails by default, please check your Gemfile"
268
268
  end
269
269
 
270
- # Make an entry in Rails routing file conifg/routes.rb
270
+ # Make an entry in Rails routing file config/routes.rb
271
271
  #
272
272
  # === Example
273
273
  #
@@ -275,7 +275,7 @@ module Rails
275
275
  #
276
276
  def route(routing_code)
277
277
  log :route, routing_code
278
- sentinel = "routes.draw do |map|"
278
+ sentinel = /\.routes\.draw do(\s*\|map\|)?\s*$/
279
279
 
280
280
  in_root do
281
281
  inject_into_file 'config/routes.rb', "\n #{routing_code}\n", { :after => sentinel, :verbose => false }
@@ -3,7 +3,7 @@ begin
3
3
  rescue LoadError
4
4
  puts "Thor is not available.\nIf you ran this command from a git checkout " \
5
5
  "of Rails, please make sure thor is installed,\nand run this command " \
6
- "as `ruby /path/to/rails myapp --dev`"
6
+ "as `ruby #{$0} #{ARGV.join(" ")} --dev`"
7
7
  exit
8
8
  end
9
9
 
@@ -8,17 +8,12 @@ module Erb
8
8
 
9
9
  argument :attributes, :type => :array, :default => [], :banner => "field:type field:type"
10
10
 
11
- class_option :singleton, :type => :boolean, :desc => "Supply to skip index view"
12
-
13
11
  def create_root_folder
14
12
  empty_directory File.join("app/views", controller_file_path)
15
13
  end
16
14
 
17
15
  def copy_view_files
18
- views = available_views
19
- views.delete("index") if options[:singleton]
20
-
21
- views.each do |view|
16
+ available_views.each do |view|
22
17
  filename = filename_with_extensions(view)
23
18
  template filename, File.join("app/views", controller_file_path, filename)
24
19
  end
@@ -1,10 +1,10 @@
1
- <%%= form_for(@<%= singular_name %>) do |f| %>
2
- <%% if @<%= singular_name %>.errors.any? %>
1
+ <%%= form_for(@<%= singular_table_name %>) do |f| %>
2
+ <%% if @<%= singular_table_name %>.errors.any? %>
3
3
  <div id="error_explanation">
4
- <h2><%%= pluralize(@<%= singular_name %>.errors.count, "error") %> prohibited this <%= singular_name %> from being saved:</h2>
4
+ <h2><%%= pluralize(@<%= singular_table_name %>.errors.count, "error") %> prohibited this <%= singular_table_name %> from being saved:</h2>
5
5
 
6
6
  <ul>
7
- <%% @<%= singular_name %>.errors.full_messages.each do |msg| %>
7
+ <%% @<%= singular_table_name %>.errors.full_messages.each do |msg| %>
8
8
  <li><%%= msg %></li>
9
9
  <%% end %>
10
10
  </ul>
@@ -1,6 +1,6 @@
1
- <h1>Editing <%= singular_name %></h1>
1
+ <h1>Editing <%= singular_table_name %></h1>
2
2
 
3
3
  <%%= render 'form' %>
4
4
 
5
- <%%= link_to 'Show', @<%= singular_name %> %> |
6
- <%%= link_to 'Back', <%= plural_name %>_path %>
5
+ <%%= link_to 'Show', @<%= singular_table_name %> %> |
6
+ <%%= link_to 'Back', <%= index_helper %>_path %>
@@ -1,4 +1,4 @@
1
- <h1>Listing <%= plural_name %></h1>
1
+ <h1>Listing <%= plural_table_name %></h1>
2
2
 
3
3
  <table>
4
4
  <tr>
@@ -10,18 +10,18 @@
10
10
  <th></th>
11
11
  </tr>
12
12
 
13
- <%% @<%= plural_name %>.each do |<%= singular_name %>| %>
13
+ <%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %>
14
14
  <tr>
15
15
  <% for attribute in attributes -%>
16
- <td><%%= <%= singular_name %>.<%= attribute.name %> %></td>
16
+ <td><%%= <%= singular_table_name %>.<%= attribute.name %> %></td>
17
17
  <% end -%>
18
- <td><%%= link_to 'Show', <%= singular_name %> %></td>
19
- <td><%%= link_to 'Edit', edit_<%= singular_name %>_path(<%= singular_name %>) %></td>
20
- <td><%%= link_to 'Destroy', <%= singular_name %>, :confirm => 'Are you sure?', :method => :delete %></td>
18
+ <td><%%= link_to 'Show', <%= singular_table_name %> %></td>
19
+ <td><%%= link_to 'Edit', edit_<%= singular_table_name %>_path(<%= singular_table_name %>) %></td>
20
+ <td><%%= link_to 'Destroy', <%= singular_table_name %>, :confirm => 'Are you sure?', :method => :delete %></td>
21
21
  </tr>
22
22
  <%% end %>
23
23
  </table>
24
24
 
25
25
  <br />
26
26
 
27
- <%%= link_to 'New <%= human_name %>', new_<%= singular_name %>_path %>
27
+ <%%= link_to 'New <%= human_name %>', new_<%= singular_table_name %>_path %>
@@ -1,5 +1,5 @@
1
- <h1>New <%= singular_name %></h1>
1
+ <h1>New <%= singular_table_name %></h1>
2
2
 
3
3
  <%%= render 'form' %>
4
4
 
5
- <%%= link_to 'Back', <%= plural_name %>_path %>
5
+ <%%= link_to 'Back', <%= index_helper %>_path %>
@@ -3,10 +3,10 @@
3
3
  <% for attribute in attributes -%>
4
4
  <p>
5
5
  <b><%= attribute.human_name %>:</b>
6
- <%%= @<%= singular_name %>.<%= attribute.name %> %>
6
+ <%%= @<%= singular_table_name %>.<%= attribute.name %> %>
7
7
  </p>
8
8
 
9
9
  <% end -%>
10
10
 
11
- <%%= link_to 'Edit', edit_<%= singular_name %>_path(@<%= singular_name %>) %> |
12
- <%%= link_to 'Back', <%= plural_name %>_path %>
11
+ <%%= link_to 'Edit', edit_<%= singular_table_name %>_path(@<%= singular_table_name %>) %> |
12
+ <%%= link_to 'Back', <%= index_helper %>_path %>
@@ -1,3 +1,5 @@
1
+ require 'active_support/time'
2
+
1
3
  module Rails
2
4
  module Generators
3
5
  class GeneratedAttribute
@@ -13,7 +15,6 @@ module Rails
13
15
  when :time then :time_select
14
16
  when :datetime, :timestamp then :datetime_select
15
17
  when :date then :date_select
16
- when :string then :text_field
17
18
  when :text then :text_area
18
19
  when :boolean then :check_box
19
20
  else
@@ -46,6 +46,30 @@ module Rails
46
46
  end
47
47
  end
48
48
 
49
+ def uncountable?
50
+ singular_name == plural_name
51
+ end
52
+
53
+ def index_helper
54
+ uncountable? ? "#{plural_table_name}_index" : plural_table_name
55
+ end
56
+
57
+ def singular_table_name
58
+ @singular_table_name ||= table_name.singularize
59
+ end
60
+
61
+ def plural_table_name
62
+ @plural_table_name ||= table_name.pluralize
63
+ end
64
+
65
+ def plural_file_name
66
+ @plural_file_name ||= file_name.pluralize
67
+ end
68
+
69
+ def route_url
70
+ @route_url ||= class_path.collect{|dname| "/" + dname }.join('') + "/" + plural_file_name
71
+ end
72
+
49
73
  # Tries to retrieve the application name or simple return application.
50
74
  def application_name
51
75
  if defined?(Rails) && Rails.application
@@ -115,6 +115,7 @@ module Rails
115
115
  directory "public/javascripts"
116
116
  else
117
117
  empty_directory_with_gitkeep "public/javascripts"
118
+ create_file "public/javascripts/application.js"
118
119
  end
119
120
  end
120
121
 
@@ -167,7 +168,7 @@ module Rails
167
168
  :desc => "Path to an application builder (can be a filesystem path or URL)"
168
169
 
169
170
  class_option :template, :type => :string, :aliases => "-m",
170
- :desc => "Path to an application template (can be a filesystem path or URL)."
171
+ :desc => "Path to an application template (can be a filesystem path or URL)"
171
172
 
172
173
  class_option :dev, :type => :boolean, :default => false,
173
174
  :desc => "Setup the application with Gemfile pointing to your Rails checkout"
@@ -178,11 +179,11 @@ module Rails
178
179
  class_option :skip_gemfile, :type => :boolean, :default => false,
179
180
  :desc => "Don't create a Gemfile"
180
181
 
181
- class_option :skip_activerecord, :type => :boolean, :aliases => "-O", :default => false,
182
- :desc => "Skip ActiveRecord files"
182
+ class_option :skip_active_record, :type => :boolean, :aliases => "-O", :default => false,
183
+ :desc => "Skip Active Record files"
183
184
 
184
- class_option :skip_testunit, :type => :boolean, :aliases => "-T", :default => false,
185
- :desc => "Skip TestUnit files"
185
+ class_option :skip_test_unit, :type => :boolean, :aliases => "-T", :default => false,
186
+ :desc => "Skip Test::Unit files"
186
187
 
187
188
  class_option :skip_prototype, :type => :boolean, :aliases => "-J", :default => false,
188
189
  :desc => "Skip Prototype files"
@@ -204,7 +205,7 @@ module Rails
204
205
 
205
206
  super
206
207
 
207
- if !options[:skip_activerecord] && !DATABASES.include?(options[:database])
208
+ if !options[:skip_active_record] && !DATABASES.include?(options[:database])
208
209
  raise Error, "Invalid value for --database option. Supported for preconfiguration are: #{DATABASES.join(", ")}."
209
210
  end
210
211
  end
@@ -238,8 +239,8 @@ module Rails
238
239
  template "config/boot.rb"
239
240
  end
240
241
 
241
- def create_activerecord_files
242
- return if options[:skip_activerecord]
242
+ def create_active_record_files
243
+ return if options[:skip_active_record]
243
244
  build(:database_yml)
244
245
  end
245
246
 
@@ -280,7 +281,7 @@ module Rails
280
281
  end
281
282
 
282
283
  def create_test_files
283
- build(:test) unless options[:skip_testunit]
284
+ build(:test) unless options[:skip_test_unit]
284
285
  end
285
286
 
286
287
  def create_tmp_files
@@ -32,8 +32,9 @@ gem '<%= gem_for_database %>'<% if require_for_database %>, :require => '<%= req
32
32
  # gem 'sqlite3-ruby', :require => 'sqlite3'
33
33
  # gem 'aws-s3', :require => 'aws/s3'
34
34
 
35
- # Bundle gems for certain environments:
36
- # gem 'rspec', :group => :test
37
- # group :test do
35
+ # Bundle gems for the local environment. Make sure to
36
+ # put test-only gems in this group so their generators
37
+ # and rake tasks are available in development mode:
38
+ # group :development, :test do
38
39
  # gem 'webrat'
39
40
  # end