rails 0.13.1 → 0.14.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rails might be problematic. Click here for more details.

Files changed (86) hide show
  1. data/CHANGELOG +105 -0
  2. data/Rakefile +39 -17
  3. data/bin/breakpointer +2 -2
  4. data/bin/console +2 -22
  5. data/bin/destroy +2 -6
  6. data/bin/generate +2 -6
  7. data/bin/performance/benchmarker +3 -0
  8. data/bin/performance/profiler +3 -0
  9. data/bin/process/reaper +3 -0
  10. data/bin/process/spawner +3 -0
  11. data/bin/process/spinner +3 -0
  12. data/bin/rails +4 -0
  13. data/bin/runner +2 -27
  14. data/bin/server +2 -48
  15. data/configs/apache.conf +8 -0
  16. data/configs/database.yml +8 -8
  17. data/environments/boot.rb +17 -0
  18. data/environments/development.rb +10 -7
  19. data/environments/environment.rb +37 -73
  20. data/environments/production.rb +15 -6
  21. data/environments/test.rb +12 -6
  22. data/fresh_rakefile +6 -198
  23. data/helpers/application.rb +2 -2
  24. data/helpers/application_helper.rb +1 -1
  25. data/helpers/test_helper.rb +6 -19
  26. data/html/javascripts/controls.js +427 -165
  27. data/html/javascripts/dragdrop.js +256 -277
  28. data/html/javascripts/effects.js +766 -277
  29. data/html/javascripts/prototype.js +903 -217
  30. data/html/javascripts/scriptaculous.js +47 -0
  31. data/html/javascripts/slider.js +258 -0
  32. data/html/robots.txt +1 -0
  33. data/lib/binding_of_caller.rb +3 -1
  34. data/lib/breakpoint.rb +5 -5
  35. data/lib/breakpoint_client.rb +1 -1
  36. data/lib/code_statistics.rb +7 -4
  37. data/lib/commands.rb +17 -0
  38. data/lib/commands/breakpointer.rb +1 -0
  39. data/lib/commands/console.rb +22 -0
  40. data/lib/commands/destroy.rb +6 -0
  41. data/lib/commands/generate.rb +6 -0
  42. data/{bin → lib/commands/ncgi}/listener +0 -0
  43. data/{bin → lib/commands/ncgi}/tracker +0 -0
  44. data/lib/commands/performance/benchmarker.rb +26 -0
  45. data/{bin/profiler → lib/commands/performance/profiler.rb} +3 -2
  46. data/lib/commands/process/reaper.rb +130 -0
  47. data/lib/commands/process/spawner.rb +52 -0
  48. data/lib/commands/process/spinner.rb +57 -0
  49. data/lib/commands/runner.rb +27 -0
  50. data/lib/commands/server.rb +59 -0
  51. data/{bin/update → lib/commands/update.rb} +1 -2
  52. data/lib/dispatcher.rb +20 -3
  53. data/lib/fcgi_handler.rb +59 -41
  54. data/lib/initializer.rb +479 -0
  55. data/lib/rails_generator/base.rb +2 -2
  56. data/lib/rails_generator/commands.rb +59 -7
  57. data/lib/rails_generator/generators/applications/app/app_generator.rb +26 -15
  58. data/lib/rails_generator/generators/components/controller/controller_generator.rb +3 -2
  59. data/lib/rails_generator/generators/components/controller/templates/view.rhtml +1 -1
  60. data/lib/rails_generator/generators/components/mailer/USAGE +2 -3
  61. data/lib/rails_generator/generators/components/mailer/templates/unit_test.rb +1 -1
  62. data/lib/rails_generator/generators/components/migration/migration_generator.rb +3 -1
  63. data/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb +32 -31
  64. data/lib/rails_generator/generators/components/scaffold/templates/view_edit.rhtml +1 -1
  65. data/lib/rails_generator/generators/components/scaffold/templates/view_list.rhtml +1 -1
  66. data/lib/rails_generator/generators/components/scaffold/templates/view_new.rhtml +1 -1
  67. data/lib/rails_generator/lookup.rb +3 -3
  68. data/lib/rails_generator/options.rb +1 -0
  69. data/lib/rails_generator/scripts.rb +1 -1
  70. data/lib/rails_version.rb +9 -0
  71. data/lib/railties_path.rb +1 -0
  72. data/lib/rubyprof_ext.rb +1 -1
  73. data/lib/tasks/databases.rake +152 -0
  74. data/lib/tasks/documentation.rake +44 -0
  75. data/lib/tasks/framework.rake +33 -0
  76. data/lib/tasks/javascripts.rake +6 -0
  77. data/lib/tasks/misc.rake +15 -0
  78. data/lib/tasks/rails.rb +7 -0
  79. data/lib/tasks/statistics.rake +16 -0
  80. data/lib/tasks/testing.rake +37 -0
  81. data/lib/test_help.rb +13 -0
  82. data/lib/webrick_server.rb +31 -9
  83. metadata +121 -85
  84. data/bin/benchmarker +0 -19
  85. data/bin/breakpointer_for_gem +0 -4
  86. data/bin/console_sandbox +0 -0
@@ -144,10 +144,9 @@ module Rails
144
144
  #
145
145
  # See Rails::Generator::Base for a discussion of Manifests and Commands.
146
146
  class NamedBase < Base
147
- attr_reader :name, :class_name, :singular_name, :plural_name
147
+ attr_reader :name, :class_name, :singular_name, :plural_name, :table_name
148
148
  attr_reader :class_path, :file_path, :class_nesting, :class_nesting_depth
149
149
  alias_method :file_name, :singular_name
150
- alias_method :table_name, :plural_name
151
150
  alias_method :actions, :args
152
151
 
153
152
  def initialize(runtime_args, runtime_options = {})
@@ -172,6 +171,7 @@ module Rails
172
171
  @name = name
173
172
  base_name, @class_path, @file_path, @class_nesting, @class_nesting_depth = extract_modules(@name)
174
173
  @class_name_without_nesting, @singular_name, @plural_name = inflect_names(base_name)
174
+ @table_name = ActiveRecord::Base.pluralize_table_names ? plural_name : singular_name
175
175
  if @class_nesting.empty?
176
176
  @class_name = @class_name_without_nesting
177
177
  else
@@ -144,13 +144,19 @@ module Rails
144
144
  # Collisions are handled by checking whether the destination file
145
145
  # exists and either skipping the file, forcing overwrite, or asking
146
146
  # the user what to do.
147
- def file(relative_source, relative_destination, file_options = {})
147
+ def file(relative_source, relative_destination, file_options = {}, &block)
148
148
  # Determine full paths for source and destination files.
149
- source = source_path(relative_source)
150
- destination = destination_path(relative_destination)
149
+ source = source_path(relative_source)
150
+ destination = destination_path(relative_destination)
151
+ destination_exists = File.exists?(destination)
152
+
153
+ # If source and destination are identical then we're done.
154
+ if destination_exists and identical?(source, destination, &block)
155
+ return logger.identical(relative_destination)
156
+ end
151
157
 
152
158
  # Check for and resolve file collisions.
153
- if File.exists?(destination)
159
+ if destination_exists
154
160
 
155
161
  # Make a choice whether to overwrite the file. :force and
156
162
  # :skip already have their mind made up, but give :ask a shot.
@@ -202,6 +208,19 @@ module Rails
202
208
  if file_options[:chmod]
203
209
  FileUtils.chmod(file_options[:chmod], destination)
204
210
  end
211
+
212
+ # Optionally add file to subversion
213
+ system("svn add #{destination}") if options[:svn]
214
+ end
215
+
216
+ # Checks if the source and the destination file are identical. If
217
+ # passed a block then the source file is a template that needs to first
218
+ # be evaluated before being compared to the destination.
219
+ def identical?(source, destination, &block)
220
+ return false if File.directory? destination
221
+ source = block_given? ? File.open(source) {|sf| yield(sf)} : IO.read(source)
222
+ destination = IO.read(destination)
223
+ source == destination
205
224
  end
206
225
 
207
226
  # Generate a file for a Rails application using an ERuby template.
@@ -246,6 +265,9 @@ module Rails
246
265
  else
247
266
  logger.create relative_path
248
267
  FileUtils.mkdir_p(path) unless options[:pretend]
268
+
269
+ # Optionally add file to subversion
270
+ system("svn add #{path}") if options[:svn]
249
271
  end
250
272
  end
251
273
 
@@ -294,11 +316,26 @@ end_message
294
316
  # manifest and attempt to completely erase the results of each action.
295
317
  class Destroy < RewindBase
296
318
  # Remove a file if it exists and is a file.
297
- def file(relative_source, relative_destination, options = {})
319
+ def file(relative_source, relative_destination, file_options = {})
298
320
  destination = destination_path(relative_destination)
299
321
  if File.exists?(destination)
300
322
  logger.rm relative_destination
301
- FileUtils.rm(destination) unless options[:pretend]
323
+ unless options[:pretend]
324
+ if options[:svn]
325
+ # If the file has been marked to be added
326
+ # but has not yet been checked in, revert and delete
327
+ if options[:svn][relative_destination]
328
+ system("svn revert #{destination}")
329
+ FileUtils.rm(destination)
330
+ else
331
+ # If the directory is not in the status list, it
332
+ # has no modifications so we can simply remove it
333
+ system("svn rm #{destination}")
334
+ end
335
+ else
336
+ FileUtils.rm(destination)
337
+ end
338
+ end
302
339
  else
303
340
  logger.missing relative_destination
304
341
  return
@@ -319,7 +356,22 @@ end_message
319
356
  if File.exists?(path)
320
357
  if Dir[File.join(path, '*')].empty?
321
358
  logger.rmdir partial
322
- FileUtils.rmdir(path) unless options[:pretend]
359
+ unless options[:pretend]
360
+ if options[:svn]
361
+ # If the directory has been marked to be added
362
+ # but has not yet been checked in, revert and delete
363
+ if options[:svn][relative_path]
364
+ system("svn revert #{path}")
365
+ FileUtils.rmdir(path)
366
+ else
367
+ # If the directory is not in the status list, it
368
+ # has no modifications so we can simply remove it
369
+ system("svn rm #{path}")
370
+ end
371
+ else
372
+ FileUtils.rmdir(path)
373
+ end
374
+ end
323
375
  else
324
376
  logger.notempty partial
325
377
  end
@@ -3,7 +3,7 @@ require 'rbconfig'
3
3
  class AppGenerator < Rails::Generator::Base
4
4
  DEFAULT_SHEBANG = File.join(Config::CONFIG['bindir'],
5
5
  Config::CONFIG['ruby_install_name'])
6
-
6
+
7
7
  default_options :gem => true, :shebang => DEFAULT_SHEBANG
8
8
  mandatory_options :source => "#{File.dirname(__FILE__)}/../../../../.."
9
9
 
@@ -11,6 +11,8 @@ class AppGenerator < Rails::Generator::Base
11
11
  super
12
12
  usage if args.empty?
13
13
  @destination_root = args.shift
14
+ @socket = MYSQL_SOCKET_LOCATIONS.find {|f| File.exists?(f) }
15
+ @socket = '/path/to/your/mysql.sock' if @socket.blank?
14
16
  end
15
17
 
16
18
  def manifest
@@ -32,31 +34,29 @@ class AppGenerator < Rails::Generator::Base
32
34
  m.template "helpers/test_helper.rb", "test/test_helper.rb"
33
35
 
34
36
  # database.yml and .htaccess
35
- m.template "configs/database.yml", "config/database.yml"
37
+ m.template "configs/database.yml", "config/database.yml", :assigns => {
38
+ :app_name => File.basename(File.expand_path(@destination_root)),
39
+ :socket => @socket
40
+ }
36
41
  m.template "configs/routes.rb", "config/routes.rb"
37
42
  m.template "configs/apache.conf", "public/.htaccess"
38
43
 
39
44
  # Environments
45
+ m.file "environments/boot.rb", "config/boot.rb"
40
46
  m.file "environments/environment.rb", "config/environment.rb"
41
47
  m.file "environments/production.rb", "config/environments/production.rb"
42
48
  m.file "environments/development.rb", "config/environments/development.rb"
43
49
  m.file "environments/test.rb", "config/environments/test.rb"
44
50
 
45
- # Scripts (tracker listener)
46
- %w(console destroy generate server runner benchmarker profiler ).each do |file|
51
+ # Scripts
52
+ %w( breakpointer console destroy generate performance/benchmarker performance/profiler process/reaper process/spawner process/spinner runner server ).each do |file|
47
53
  m.file "bin/#{file}", "script/#{file}", script_options
48
54
  end
49
- if options[:gem]
50
- m.file "bin/breakpointer_for_gem", "script/breakpointer", script_options
51
- else
52
- m.file "bin/breakpointer", "script/breakpointer", script_options
53
- end
54
55
 
55
56
  # Dispatches
56
57
  m.file "dispatches/dispatch.rb", "public/dispatch.rb", script_options
57
58
  m.file "dispatches/dispatch.rb", "public/dispatch.cgi", script_options
58
59
  m.file "dispatches/dispatch.fcgi", "public/dispatch.fcgi", script_options
59
- # m.file "dispatches/gateway.cgi", "public/gateway.cgi", script_options
60
60
 
61
61
  # HTML files
62
62
  %w(404 500 index).each do |file|
@@ -64,12 +64,15 @@ class AppGenerator < Rails::Generator::Base
64
64
  end
65
65
 
66
66
  m.template "html/favicon.ico", "public/favicon.ico"
67
+ m.template "html/robots.txt", "public/robots.txt"
67
68
 
68
69
  # Javascripts
69
- m.file "html/javascripts/prototype.js", "public/javascripts/prototype.js"
70
- m.file "html/javascripts/effects.js", "public/javascripts/effects.js"
71
- m.file "html/javascripts/dragdrop.js", "public/javascripts/dragdrop.js"
72
- m.file "html/javascripts/controls.js", "public/javascripts/controls.js"
70
+ m.file "html/javascripts/prototype.js", "public/javascripts/prototype.js"
71
+ m.file "html/javascripts/scriptaculous.js", "public/javascripts/scriptaculous.js"
72
+ m.file "html/javascripts/effects.js", "public/javascripts/effects.js"
73
+ m.file "html/javascripts/dragdrop.js", "public/javascripts/dragdrop.js"
74
+ m.file "html/javascripts/controls.js", "public/javascripts/controls.js"
75
+ m.file "html/javascripts/slider.js", "public/javascripts/slider.js"
73
76
 
74
77
  # Docs
75
78
  m.file "doc/README_FOR_APP", "doc/README_FOR_APP"
@@ -110,16 +113,24 @@ class AppGenerator < Rails::Generator::Base
110
113
  db
111
114
  doc
112
115
  lib
116
+ lib/tasks
113
117
  log
114
118
  public/images
115
119
  public/javascripts
116
120
  public/stylesheets
117
- script
121
+ script/performance
122
+ script/process
118
123
  test/fixtures
119
124
  test/functional
120
125
  test/mocks/development
121
126
  test/mocks/test
122
127
  test/unit
123
128
  vendor
129
+ vendor/plugins
124
130
  )
131
+
132
+ MYSQL_SOCKET_LOCATIONS = [ "/tmp/mysql.sock", #default
133
+ "/var/run/mysqld/mysqld.sock", #debian
134
+ "/var/tmp/mysql.sock", # freebsd
135
+ "/var/lib/mysql/mysql.sock" ] #fedora
125
136
  end
@@ -28,9 +28,10 @@ class ControllerGenerator < Rails::Generator::NamedBase
28
28
 
29
29
  # View template for each action.
30
30
  actions.each do |action|
31
+ path = File.join('app/views', class_path, file_name, "#{action}.rhtml")
31
32
  m.template 'view.rhtml',
32
- File.join('app/views', class_path, file_name, "#{action}.rhtml"),
33
- :assigns => { :action => action }
33
+ path,
34
+ :assigns => { :action => action, :path => path }
34
35
  end
35
36
  end
36
37
  end
@@ -1,2 +1,2 @@
1
1
  <h1><%= class_name %>#<%= action %></h1>
2
- <p>Find me in app/views/<%= file_name %>/<%= action %>.rhtml</p>
2
+ <p>Find me in <%= path %></p>
@@ -2,8 +2,7 @@ Description:
2
2
  The mailer generator creates stubs for a new mailer and its views.
3
3
 
4
4
  The generator takes a mailer name and a list of views as arguments.
5
- The mailer name may be given in CamelCase or under_score and should
6
- not be suffixed with 'Mailer'.
5
+ The mailer name may be given in CamelCase or under_score.
7
6
 
8
7
  The generator creates a mailer class in app/models with view templates
9
8
  in app/views/mailer_name, and a test suite with fixtures in test/unit.
@@ -11,7 +10,7 @@ Description:
11
10
  Example:
12
11
  ./script/generate mailer Notifications signup forgot_password invoice
13
12
 
14
- This will create a NotificationsMailer:
13
+ This will create a Notifications mailer class:
15
14
  Mailer: app/models/notifications.rb
16
15
  Views: app/views/notifications/signup.rhtml [...]
17
16
  Test: test/unit/credit_card_controller_test.rb
@@ -18,7 +18,7 @@ class <%= class_name %>Test < Test::Unit::TestCase
18
18
 
19
19
  <% for action in actions -%>
20
20
  def test_<%= action %>
21
- @expected.subject = encode '<%= class_name %>#<%= action %>'
21
+ @expected.subject = '<%= class_name %>#<%= action %>'
22
22
  @expected.body = read_fixture('<%= action %>')
23
23
  @expected.date = Time.now
24
24
 
@@ -2,7 +2,9 @@ class MigrationGenerator < Rails::Generator::NamedBase
2
2
  def manifest
3
3
  record do |m|
4
4
  m.directory File.join('db/migrate')
5
- next_migration_number = Dir.glob("db/migrate/[0-9]*.*").size + 1
5
+ existing_migrations = Dir.glob("db/migrate/[0-9]*_#{file_name}.rb")
6
+ raise "Another migration already exists with the same name" unless existing_migrations.empty?
7
+ next_migration_number = Dir.glob("db/migrate/[0-9]*.rb").size + 1
6
8
  m.template 'migration.rb', File.join('db/migrate', "#{next_migration_number}_#{file_name}.rb")
7
9
  end
8
10
  end
@@ -46,7 +46,7 @@ class ScaffoldGenerator < Rails::Generator::NamedBase
46
46
 
47
47
  def initialize(runtime_args, runtime_options = {})
48
48
  super
49
- @controller_name = args.shift || @name.pluralize
49
+ @controller_name = args.shift || ActiveRecord::Base.pluralize_table_names ? @name.pluralize : @name
50
50
  base_name, @controller_class_path, @controller_file_path, @controller_class_nesting, @controller_class_nesting_depth = extract_modules(@controller_name)
51
51
  @controller_class_name_without_nesting, @controller_singular_name, @controller_plural_name = inflect_names(base_name)
52
52
  if @controller_class_nesting.empty?
@@ -58,9 +58,6 @@ class ScaffoldGenerator < Rails::Generator::NamedBase
58
58
 
59
59
  def manifest
60
60
  record do |m|
61
- # Depend on model generator but skip if the model exists.
62
- m.dependency 'model', [singular_name], :collision => :skip
63
-
64
61
  # Check for class naming collisions.
65
62
  m.class_collisions controller_class_path, "#{controller_class_name}Controller", "#{controller_class_name}ControllerTest", "#{controller_class_name}Helper"
66
63
 
@@ -70,6 +67,31 @@ class ScaffoldGenerator < Rails::Generator::NamedBase
70
67
  m.directory File.join('app/views', controller_class_path, controller_file_name)
71
68
  m.directory File.join('test/functional', controller_class_path)
72
69
 
70
+ # Depend on model generator but skip if the model exists.
71
+ m.dependency 'model', [singular_name], :collision => :skip
72
+
73
+ # Scaffolded forms.
74
+ m.complex_template "form.rhtml",
75
+ File.join('app/views',
76
+ controller_class_path,
77
+ controller_file_name,
78
+ "_form.rhtml"),
79
+ :insert => 'form_scaffolding.rhtml',
80
+ :sandbox => lambda { create_sandbox },
81
+ :begin_mark => 'form',
82
+ :end_mark => 'eoform',
83
+ :mark_id => singular_name
84
+
85
+
86
+ # Scaffolded views.
87
+ scaffold_views.each do |action|
88
+ m.template "view_#{action}.rhtml",
89
+ File.join('app/views',
90
+ controller_class_path,
91
+ controller_file_name,
92
+ "#{action}.rhtml"),
93
+ :assigns => { :action => action }
94
+ end
73
95
 
74
96
  # Controller class, functional test, helper, and views.
75
97
  m.template 'controller.rb',
@@ -91,36 +113,15 @@ class ScaffoldGenerator < Rails::Generator::NamedBase
91
113
  m.template 'layout.rhtml', "app/views/layouts/#{controller_file_name}.rhtml"
92
114
  m.template 'style.css', 'public/stylesheets/scaffold.css'
93
115
 
94
- # Scaffolded views.
95
- scaffold_views.each do |action|
96
- m.template "view_#{action}.rhtml",
97
- File.join('app/views',
98
- controller_class_path,
99
- controller_file_name,
100
- "#{action}.rhtml"),
101
- :assigns => { :action => action }
102
- end
103
-
104
- # Scaffolded forms.
105
- m.complex_template "form.rhtml",
106
- File.join('app/views',
107
- controller_class_path,
108
- controller_file_name,
109
- "_form.rhtml"),
110
- :insert => 'form_scaffolding.rhtml',
111
- :sandbox => lambda { create_sandbox },
112
- :begin_mark => 'form',
113
- :end_mark => 'eoform',
114
- :mark_id => singular_name
115
116
 
116
117
  # Unscaffolded views.
117
118
  unscaffolded_actions.each do |action|
118
- m.template "controller:view.rhtml",
119
- File.join('app/views',
120
- controller_class_path,
121
- controller_file_name,
122
- "#{action}.rhtml"),
123
- :assigns => { :action => action }
119
+ path = File.join('app/views',
120
+ controller_class_path,
121
+ controller_file_name,
122
+ "#{action}.rhtml")
123
+ m.template "controller:view.rhtml", path,
124
+ :assigns => { :action => action, :path => path}
124
125
  end
125
126
  end
126
127
  end
@@ -1,7 +1,7 @@
1
1
  <h1>Editing <%= singular_name %></h1>
2
2
 
3
3
  <%%= start_form_tag :action => 'update<%= @suffix %>', :id => @<%= singular_name %> %>
4
- <%%= render_partial 'form' %>
4
+ <%%= render :partial => 'form' %>
5
5
  <%%= submit_tag 'Edit' %>
6
6
  <%%= end_form_tag %>
7
7
 
@@ -14,7 +14,7 @@
14
14
  <%% end %>
15
15
  <td><%%= link_to 'Show', :action => 'show<%= suffix %>', :id => <%= singular_name %> %></td>
16
16
  <td><%%= link_to 'Edit', :action => 'edit<%= suffix %>', :id => <%= singular_name %> %></td>
17
- <td><%%= link_to 'Destroy', {:action => 'destroy<%= suffix %>', :id => <%= singular_name %>}, :confirm => 'Are you sure?' %></td>
17
+ <td><%%= link_to 'Destroy', { :action => 'destroy<%= suffix %>', :id => <%= singular_name %> }, :confirm => 'Are you sure?' %></td>
18
18
  </tr>
19
19
  <%% end %>
20
20
  </table>
@@ -1,7 +1,7 @@
1
1
  <h1>New <%= singular_name %></h1>
2
2
 
3
3
  <%%= start_form_tag :action => 'create<%= @suffix %>' %>
4
- <%%= render_partial 'form' %>
4
+ <%%= render :partial => 'form' %>
5
5
  <%%= submit_tag "Create" %>
6
6
  <%%= end_form_tag %>
7
7
 
@@ -4,7 +4,7 @@ class Object
4
4
  class << self
5
5
  # Lookup missing generators using const_missing. This allows any
6
6
  # generator to reference another without having to know its location:
7
- # RubyGems, ~/.rails/generators, and RAILS_ROOT/script/generators.
7
+ # RubyGems, ~/.rails/generators, and RAILS_ROOT/generators.
8
8
  def lookup_missing_generator(class_id)
9
9
  if md = /(.+)Generator$/.match(class_id.to_s)
10
10
  name = md.captures.first.demodulize.underscore
@@ -92,13 +92,13 @@ module Rails
92
92
  # Use component generators (model, controller, etc).
93
93
  # 1. Rails application. If RAILS_ROOT is defined we know we're
94
94
  # generating in the context of a Rails application, so search
95
- # RAILS_ROOT/script/generators.
95
+ # RAILS_ROOT/generators.
96
96
  # 2. User home directory. Search ~/.rails/generators.
97
97
  # 3. RubyGems. Search for gems named *_generator.
98
98
  # 4. Builtins. Model, controller, mailer, scaffold.
99
99
  def use_component_sources!
100
100
  reset_sources
101
- sources << PathSource.new(:app, "#{::RAILS_ROOT}/script/generators") if defined? ::RAILS_ROOT
101
+ sources << PathSource.new(:app, "#{::RAILS_ROOT}/lib/generators") if defined? ::RAILS_ROOT
102
102
  sources << PathSource.new(:user, "#{Dir.user_home}/.rails/generators")
103
103
  sources << GemSource.new if Object.const_defined?(:Gem)
104
104
  sources << PathSource.new(:builtin, "#{File.dirname(__FILE__)}/generators/components")
@@ -127,6 +127,7 @@ module Rails
127
127
  opt.on('-q', '--quiet', 'Suppress normal output.') { |options[:quiet]| }
128
128
  opt.on('-t', '--backtrace', 'Debugging: show backtrace on errors.') { |options[:backtrace]| }
129
129
  opt.on('-h', '--help', 'Show this help message.') { |options[:help]| }
130
+ opt.on('-c', '--svn', 'Modify files with subversion. (Note: svn must be in path)') { options[:svn] = Hash[*`svn status`.collect { |e| e.chop.split.reverse unless e.chop.split.size != 2 }.flatten] }
130
131
  end
131
132
 
132
133
  end
@@ -59,7 +59,7 @@ end_blurb
59
59
 
60
60
  if Object.const_defined?(:RAILS_ROOT)
61
61
  usage << <<end_blurb
62
- or to #{File.expand_path(RAILS_ROOT)}/script/generators/login
62
+ or to #{File.expand_path(RAILS_ROOT)}/generators/login
63
63
  to use with this app only.
64
64
  end_blurb
65
65
  end