Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Generators load path now will be Ruby load path. If you want to use r…

…spec:install generator, you need generators/rspec/install_generator in your load path.
  • Loading branch information...
commit 9fffdc5cdb80b1824473a6d7ae1fedf9e74aa748 1 parent e75ea47
@josevalim josevalim authored
Showing with 77 additions and 95 deletions.
  1. +8 −0 {railties/lib/rails → activerecord/lib}/generators/active_record.rb
  2. +1 −1  {railties/lib/rails → activerecord/lib}/generators/active_record/migration/migration_generator.rb
  3. 0  {railties/lib/rails → activerecord/lib}/generators/active_record/migration/templates/migration.rb
  4. +1 −1  {railties/lib/rails → activerecord/lib}/generators/active_record/model/model_generator.rb
  5. 0  {railties/lib/rails → activerecord/lib}/generators/active_record/model/templates/migration.rb
  6. 0  {railties/lib/rails → activerecord/lib}/generators/active_record/model/templates/model.rb
  7. +1 −1  {railties/lib/rails → activerecord/lib}/generators/active_record/observer/observer_generator.rb
  8. 0  {railties/lib/rails → activerecord/lib}/generators/active_record/observer/templates/observer.rb
  9. +1 −1  ...ib/rails → activerecord/lib}/generators/active_record/session_migration/session_migration_generator.rb
  10. 0  {railties/lib/rails → activerecord/lib}/generators/active_record/session_migration/templates/migration.rb
  11. 0  railties/lib/{rails → }/generators/erb.rb
  12. +1 −1  railties/lib/{rails → }/generators/erb/controller/controller_generator.rb
  13. 0  railties/lib/{rails → }/generators/erb/controller/templates/view.html.erb
  14. +1 −1  railties/lib/{rails → }/generators/erb/mailer/mailer_generator.rb
  15. 0  railties/lib/{rails → }/generators/erb/mailer/templates/view.erb
  16. +1 −1  railties/lib/{rails → }/generators/erb/scaffold/scaffold_generator.rb
  17. 0  railties/lib/{rails → }/generators/erb/scaffold/templates/_form.html.erb
  18. 0  railties/lib/{rails → }/generators/erb/scaffold/templates/edit.html.erb
  19. 0  railties/lib/{rails → }/generators/erb/scaffold/templates/index.html.erb
  20. 0  railties/lib/{rails → }/generators/erb/scaffold/templates/layout.html.erb
  21. 0  railties/lib/{rails → }/generators/erb/scaffold/templates/new.html.erb
  22. 0  railties/lib/{rails → }/generators/erb/scaffold/templates/show.html.erb
  23. 0  railties/lib/{rails → }/generators/rails/app/USAGE
  24. +2 −2 railties/lib/{rails → }/generators/rails/app/app_generator.rb
  25. 0  railties/lib/{rails → }/generators/rails/app/templates/Gemfile
  26. 0  railties/lib/{rails → }/generators/rails/app/templates/README
  27. 0  railties/lib/{rails → }/generators/rails/app/templates/Rakefile
  28. 0  railties/lib/{rails → }/generators/rails/app/templates/app/controllers/application_controller.rb
  29. 0  railties/lib/{rails → }/generators/rails/app/templates/app/helpers/application_helper.rb
  30. 0  ...tors/rails/generator/templates/templates → generators/rails/app/templates/app/models}/.empty_directory
  31. 0  ...ors/rails/app/templates/test/unit → generators/rails/app/templates/app/views/layouts}/.empty_directory
  32. 0  railties/lib/{rails → }/generators/rails/app/templates/config.ru
  33. 0  railties/lib/{rails → }/generators/rails/app/templates/config/application.rb
  34. 0  railties/lib/{rails → }/generators/rails/app/templates/config/boot.rb
  35. 0  railties/lib/{rails → }/generators/rails/app/templates/config/databases/frontbase.yml
  36. 0  railties/lib/{rails → }/generators/rails/app/templates/config/databases/ibm_db.yml
  37. 0  railties/lib/{rails → }/generators/rails/app/templates/config/databases/mysql.yml
  38. 0  railties/lib/{rails → }/generators/rails/app/templates/config/databases/oracle.yml
  39. 0  railties/lib/{rails → }/generators/rails/app/templates/config/databases/postgresql.yml
  40. 0  railties/lib/{rails → }/generators/rails/app/templates/config/databases/sqlite3.yml
  41. 0  railties/lib/{rails → }/generators/rails/app/templates/config/environment.rb
  42. 0  railties/lib/{rails → }/generators/rails/app/templates/config/environments/development.rb.tt
  43. 0  railties/lib/{rails → }/generators/rails/app/templates/config/environments/production.rb.tt
  44. 0  railties/lib/{rails → }/generators/rails/app/templates/config/environments/test.rb.tt
  45. 0  railties/lib/{rails → }/generators/rails/app/templates/config/initializers/backtrace_silencers.rb
  46. 0  ...ies/lib/{rails → }/generators/rails/app/templates/config/initializers/cookie_verification_secret.rb.tt
  47. 0  railties/lib/{rails → }/generators/rails/app/templates/config/initializers/inflections.rb
  48. 0  railties/lib/{rails → }/generators/rails/app/templates/config/initializers/mime_types.rb
  49. 0  railties/lib/{rails → }/generators/rails/app/templates/config/initializers/session_store.rb.tt
  50. 0  railties/lib/{rails → }/generators/rails/app/templates/config/locales/en.yml
  51. 0  railties/lib/{rails → }/generators/rails/app/templates/config/routes.rb
  52. 0  railties/lib/{rails → }/generators/rails/app/templates/db/seeds.rb
  53. 0  railties/lib/{rails → }/generators/rails/app/templates/doc/README_FOR_APP
  54. 0  railties/lib/{rails → }/generators/rails/app/templates/gitignore
  55. 0  railties/lib/{rails → }/generators/rails/app/templates/public/404.html
  56. 0  railties/lib/{rails → }/generators/rails/app/templates/public/422.html
  57. 0  railties/lib/{rails → }/generators/rails/app/templates/public/500.html
  58. 0  railties/lib/{rails → }/generators/rails/app/templates/public/favicon.ico
  59. 0  railties/lib/{rails → }/generators/rails/app/templates/public/images/rails.png
  60. 0  railties/lib/{rails → }/generators/rails/app/templates/public/index.html
  61. 0  railties/lib/{rails → }/generators/rails/app/templates/public/javascripts/application.js
  62. 0  railties/lib/{rails → }/generators/rails/app/templates/public/javascripts/controls.js
  63. 0  railties/lib/{rails → }/generators/rails/app/templates/public/javascripts/dragdrop.js
  64. 0  railties/lib/{rails → }/generators/rails/app/templates/public/javascripts/effects.js
  65. 0  railties/lib/{rails → }/generators/rails/app/templates/public/javascripts/prototype.js
  66. 0  railties/lib/{rails → }/generators/rails/app/templates/public/robots.txt
  67. 0  ...s/app/templates/test/integration → generators/rails/app/templates/public/stylesheets}/.empty_directory
  68. 0  railties/lib/{rails → }/generators/rails/app/templates/script/about
  69. 0  railties/lib/{rails → }/generators/rails/app/templates/script/console.tt
  70. 0  railties/lib/{rails → }/generators/rails/app/templates/script/dbconsole.tt
  71. 0  railties/lib/{rails → }/generators/rails/app/templates/script/destroy
  72. 0  railties/lib/{rails → }/generators/rails/app/templates/script/generate
  73. 0  railties/lib/{rails → }/generators/rails/app/templates/script/performance/benchmarker
  74. 0  railties/lib/{rails → }/generators/rails/app/templates/script/performance/profiler
  75. 0  railties/lib/{rails → }/generators/rails/app/templates/script/plugin
  76. 0  railties/lib/{rails → }/generators/rails/app/templates/script/runner
  77. 0  railties/lib/{rails → }/generators/rails/app/templates/script/server.tt
  78. 0  ...s/rails/app/templates/test/functional → generators/rails/app/templates/test/fixtures}/.empty_directory
  79. 0  ...s/rails/app/templates/test/fixtures → generators/rails/app/templates/test/functional}/.empty_directory
  80. 0  ...s/app/templates/public/stylesheets → generators/rails/app/templates/test/integration}/.empty_directory
  81. 0  railties/lib/{rails → }/generators/rails/app/templates/test/performance/browsing_test.rb
  82. 0  railties/lib/{rails → }/generators/rails/app/templates/test/test_helper.rb
  83. 0  ...ors/rails/app/templates/app/views/layouts → generators/rails/app/templates/test/unit}/.empty_directory
  84. 0  railties/lib/{rails → }/generators/rails/controller/USAGE
  85. 0  railties/lib/{rails → }/generators/rails/controller/controller_generator.rb
  86. 0  railties/lib/{rails → }/generators/rails/controller/templates/controller.rb
  87. 0  railties/lib/{rails → }/generators/rails/generator/USAGE
  88. 0  railties/lib/{rails → }/generators/rails/generator/generator_generator.rb
  89. 0  railties/lib/{rails → }/generators/rails/generator/templates/%file_name%_generator.rb.tt
  90. 0  railties/lib/{rails → }/generators/rails/generator/templates/USAGE.tt
  91. 0  ...tors/rails/app/templates/app/models → generators/rails/generator/templates/templates}/.empty_directory
  92. 0  railties/lib/{rails → }/generators/rails/helper/USAGE
  93. 0  railties/lib/{rails → }/generators/rails/helper/helper_generator.rb
  94. 0  railties/lib/{rails → }/generators/rails/helper/templates/helper.rb
  95. 0  railties/lib/{rails → }/generators/rails/integration_test/USAGE
  96. 0  railties/lib/{rails → }/generators/rails/integration_test/integration_test_generator.rb
  97. 0  railties/lib/{rails → }/generators/rails/mailer/USAGE
  98. 0  railties/lib/{rails → }/generators/rails/mailer/mailer_generator.rb
  99. 0  railties/lib/{rails → }/generators/rails/mailer/templates/mailer.rb
  100. 0  railties/lib/{rails → }/generators/rails/metal/USAGE
  101. 0  railties/lib/{rails → }/generators/rails/metal/metal_generator.rb
  102. 0  railties/lib/{rails → }/generators/rails/metal/templates/metal.rb
  103. 0  railties/lib/{rails → }/generators/rails/migration/USAGE
  104. 0  railties/lib/{rails → }/generators/rails/migration/migration_generator.rb
  105. 0  railties/lib/{rails → }/generators/rails/model/USAGE
  106. 0  railties/lib/{rails → }/generators/rails/model/model_generator.rb
  107. +1 −0  railties/lib/{rails → }/generators/rails/model_subclass/model_subclass_generator.rb
  108. 0  railties/lib/{rails → }/generators/rails/observer/USAGE
  109. 0  railties/lib/{rails → }/generators/rails/observer/observer_generator.rb
  110. 0  railties/lib/{rails → }/generators/rails/performance_test/USAGE
  111. 0  railties/lib/{rails → }/generators/rails/performance_test/performance_test_generator.rb
  112. 0  railties/lib/{rails → }/generators/rails/plugin/USAGE
  113. +1 −1  railties/lib/{rails → }/generators/rails/plugin/plugin_generator.rb
  114. 0  railties/lib/{rails → }/generators/rails/plugin/templates/MIT-LICENSE.tt
  115. 0  railties/lib/{rails → }/generators/rails/plugin/templates/README.tt
  116. 0  railties/lib/{rails → }/generators/rails/plugin/templates/Rakefile.tt
  117. 0  railties/lib/{rails → }/generators/rails/plugin/templates/init.rb
  118. 0  railties/lib/{rails → }/generators/rails/plugin/templates/install.rb
  119. 0  railties/lib/{rails → }/generators/rails/plugin/templates/lib/%file_name%.rb.tt
  120. 0  railties/lib/{rails → }/generators/rails/plugin/templates/tasks/%file_name%_tasks.rake.tt
  121. 0  railties/lib/{rails → }/generators/rails/plugin/templates/uninstall.rb
  122. 0  railties/lib/{rails → }/generators/rails/resource/USAGE
  123. +1 −1  railties/lib/{rails → }/generators/rails/resource/resource_generator.rb
  124. 0  railties/lib/{rails → }/generators/rails/scaffold/USAGE
  125. +1 −1  railties/lib/{rails → }/generators/rails/scaffold/scaffold_generator.rb
  126. 0  railties/lib/{rails → }/generators/rails/scaffold_controller/USAGE
  127. 0  railties/lib/{rails → }/generators/rails/scaffold_controller/scaffold_controller_generator.rb
  128. 0  railties/lib/{rails → }/generators/rails/scaffold_controller/templates/controller.rb
  129. 0  railties/lib/{rails → }/generators/rails/session_migration/USAGE
  130. 0  railties/lib/{rails → }/generators/rails/session_migration/session_migration_generator.rb
  131. 0  railties/lib/{rails → }/generators/rails/stylesheets/USAGE
  132. 0  railties/lib/{rails → }/generators/rails/stylesheets/stylesheets_generator.rb
  133. 0  railties/lib/{rails → }/generators/rails/stylesheets/templates/scaffold.css
  134. 0  railties/lib/{rails → }/generators/test_unit.rb
  135. +1 −1  railties/lib/{rails → }/generators/test_unit/controller/controller_generator.rb
  136. 0  railties/lib/{rails → }/generators/test_unit/controller/templates/functional_test.rb
  137. +1 −1  railties/lib/{rails → }/generators/test_unit/helper/helper_generator.rb
  138. 0  railties/lib/{rails → }/generators/test_unit/helper/templates/helper_test.rb
  139. +1 −1  railties/lib/{rails → }/generators/test_unit/integration/integration_generator.rb
  140. 0  railties/lib/{rails → }/generators/test_unit/integration/templates/integration_test.rb
  141. +1 −1  railties/lib/{rails → }/generators/test_unit/mailer/mailer_generator.rb
  142. 0  railties/lib/{rails → }/generators/test_unit/mailer/templates/fixture
  143. 0  railties/lib/{rails → }/generators/test_unit/mailer/templates/unit_test.rb
  144. +1 −1  railties/lib/{rails → }/generators/test_unit/model/model_generator.rb
  145. 0  railties/lib/{rails → }/generators/test_unit/model/templates/fixtures.yml
  146. 0  railties/lib/{rails → }/generators/test_unit/model/templates/unit_test.rb
  147. +1 −1  railties/lib/{rails → }/generators/test_unit/observer/observer_generator.rb
  148. 0  railties/lib/{rails → }/generators/test_unit/observer/templates/unit_test.rb
  149. +1 −1  railties/lib/{rails → }/generators/test_unit/performance/performance_generator.rb
  150. 0  railties/lib/{rails → }/generators/test_unit/performance/templates/performance_test.rb
  151. +1 −1  railties/lib/{rails → }/generators/test_unit/plugin/plugin_generator.rb
  152. 0  railties/lib/{rails → }/generators/test_unit/plugin/templates/%file_name%_test.rb.tt
  153. 0  railties/lib/{rails → }/generators/test_unit/plugin/templates/test_helper.rb
  154. +1 −1  railties/lib/{rails → }/generators/test_unit/scaffold/scaffold_generator.rb
  155. 0  railties/lib/{rails → }/generators/test_unit/scaffold/templates/functional_test.rb
  156. +26 −52 railties/lib/rails/generators.rb
  157. +1 −1  railties/lib/rails/generators/base.rb
  158. +2 −2 railties/test/generators/actions_test.rb
  159. +1 −1  railties/test/generators/app_generator_test.rb
  160. +1 −1  railties/test/generators/controller_generator_test.rb
  161. +1 −1  railties/test/generators/generator_generator_test.rb
  162. +0 −1  railties/test/generators/generators_test_helper.rb
  163. +1 −1  railties/test/generators/helper_generator_test.rb
  164. +1 −1  railties/test/generators/integration_test_generator_test.rb
  165. +1 −1  railties/test/generators/mailer_generator_test.rb
  166. +1 −1  railties/test/generators/metal_generator_test.rb
  167. +1 −1  railties/test/generators/migration_generator_test.rb
  168. +1 −1  railties/test/generators/model_generator_test.rb
  169. +1 −1  railties/test/generators/named_base_test.rb
  170. +1 −1  railties/test/generators/observer_generator_test.rb
  171. +1 −1  railties/test/generators/performance_test_generator_test.rb
  172. +1 −1  railties/test/generators/plugin_generator_test.rb
  173. +1 −1  railties/test/generators/resource_generator_test.rb
  174. +1 −1  railties/test/generators/scaffold_controller_generator_test.rb
  175. +1 −1  railties/test/generators/scaffold_generator_test.rb
  176. +1 −1  railties/test/generators/session_migration_generator_test.rb
  177. +1 −1  railties/test/generators/stylesheets_generator_test.rb
View
8 ...ies/lib/rails/generators/active_record.rb → activerecord/lib/generators/active_record.rb
@@ -8,6 +8,14 @@ module Generators
class Base < Rails::Generators::NamedBase #:nodoc:
include Rails::Generators::Migration
+ def self.source_root
+ @_ar_source_root ||= begin
+ if base_name && generator_name
+ File.expand_path(File.join(base_name, generator_name, 'templates'), File.dirname(__FILE__))
+ end
+ end
+ end
+
protected
# Implement the required interface for Rails::Generators::Migration.
#
View
2  ...e_record/migration/migration_generator.rb → ...e_record/migration/migration_generator.rb
@@ -1,4 +1,4 @@
-require 'rails/generators/active_record'
+require 'generators/active_record'
module ActiveRecord
module Generators
View
0  ...e_record/migration/templates/migration.rb → ...e_record/migration/templates/migration.rb
File renamed without changes
View
2  ...rs/active_record/model/model_generator.rb → ...rs/active_record/model/model_generator.rb
@@ -1,4 +1,4 @@
-require 'rails/generators/active_record'
+require 'generators/active_record'
module ActiveRecord
module Generators
View
0  ...ctive_record/model/templates/migration.rb → ...ctive_record/model/templates/migration.rb
File renamed without changes
View
0  ...rs/active_record/model/templates/model.rb → ...rs/active_record/model/templates/model.rb
File renamed without changes
View
2  ...ive_record/observer/observer_generator.rb → ...ive_record/observer/observer_generator.rb
@@ -1,4 +1,4 @@
-require 'rails/generators/active_record'
+require 'generators/active_record'
module ActiveRecord
module Generators
View
0  ...ive_record/observer/templates/observer.rb → ...ive_record/observer/templates/observer.rb
File renamed without changes
View
2  ..._migration/session_migration_generator.rb → ..._migration/session_migration_generator.rb
@@ -1,4 +1,4 @@
-require 'rails/generators/active_record'
+require 'generators/active_record'
module ActiveRecord
module Generators
View
0  .../session_migration/templates/migration.rb → .../session_migration/templates/migration.rb
File renamed without changes
View
0  railties/lib/rails/generators/erb.rb → railties/lib/generators/erb.rb
File renamed without changes
View
2  ...rs/erb/controller/controller_generator.rb → ...rs/erb/controller/controller_generator.rb
@@ -1,4 +1,4 @@
-require 'rails/generators/erb'
+require 'generators/erb'
module Erb
module Generators
View
0  ...rs/erb/controller/templates/view.html.erb → ...rs/erb/controller/templates/view.html.erb
File renamed without changes
View
2  ...generators/erb/mailer/mailer_generator.rb → ...generators/erb/mailer/mailer_generator.rb
@@ -1,4 +1,4 @@
-require 'rails/generators/erb'
+require 'generators/erb'
module Erb
module Generators
View
0  .../generators/erb/mailer/templates/view.erb → .../generators/erb/mailer/templates/view.erb
File renamed without changes
View
2  ...rators/erb/scaffold/scaffold_generator.rb → ...rators/erb/scaffold/scaffold_generator.rb
@@ -1,4 +1,4 @@
-require 'rails/generators/erb'
+require 'generators/erb'
require 'rails/generators/resource_helpers'
module Erb
View
0  ...ors/erb/scaffold/templates/_form.html.erb → ...ors/erb/scaffold/templates/_form.html.erb
File renamed without changes
View
0  ...tors/erb/scaffold/templates/edit.html.erb → ...tors/erb/scaffold/templates/edit.html.erb
File renamed without changes
View
0  ...ors/erb/scaffold/templates/index.html.erb → ...ors/erb/scaffold/templates/index.html.erb
File renamed without changes
View
0  ...rs/erb/scaffold/templates/layout.html.erb → ...rs/erb/scaffold/templates/layout.html.erb
File renamed without changes
View
0  ...ators/erb/scaffold/templates/new.html.erb → ...ators/erb/scaffold/templates/new.html.erb
File renamed without changes
View
0  ...tors/erb/scaffold/templates/show.html.erb → ...tors/erb/scaffold/templates/show.html.erb
File renamed without changes
View
0  ...ties/lib/rails/generators/rails/app/USAGE → railties/lib/generators/rails/app/USAGE
File renamed without changes
View
4 ...ils/generators/rails/app/app_generator.rb → ...lib/generators/rails/app/app_generator.rb
@@ -5,7 +5,7 @@
module Rails::Generators
# We need to store the RAILS_DEV_PATH in a constant, otherwise the path
# can change in Ruby 1.8.7 when we FileUtils.cd.
- RAILS_DEV_PATH = File.expand_path("../../../../../..", File.dirname(__FILE__))
+ RAILS_DEV_PATH = File.expand_path("../../../../..", File.dirname(__FILE__))
class AppGenerator < Base
DATABASES = %w( mysql oracle postgresql sqlite3 frontbase ibm_db )
@@ -35,7 +35,7 @@ class AppGenerator < Base
:desc => "Skip Prototype files"
class_option :skip_git, :type => :boolean, :aliases => "-G", :default => false,
- :desc => "Skip Git ignores and keeps"
+ :desc => "Skip Git ignores and keeps"
# Add bin/rails options
class_option :version, :type => :boolean, :aliases => "-v", :group => :rails,
View
0  ...ls/generators/rails/app/templates/Gemfile → ...ib/generators/rails/app/templates/Gemfile
File renamed without changes
View
0  ...ils/generators/rails/app/templates/README → ...lib/generators/rails/app/templates/README
File renamed without changes
View
0  ...s/generators/rails/app/templates/Rakefile → ...b/generators/rails/app/templates/Rakefile
File renamed without changes
View
0  ...app/controllers/application_controller.rb → ...app/controllers/application_controller.rb
File renamed without changes
View
0  ...mplates/app/helpers/application_helper.rb → ...mplates/app/helpers/application_helper.rb
File renamed without changes
View
0  ...ator/templates/templates/.empty_directory → ...app/templates/app/models/.empty_directory
File renamed without changes
View
0  .../app/templates/test/unit/.empty_directory → ...plates/app/views/layouts/.empty_directory
File renamed without changes
View
0  .../generators/rails/app/templates/config.ru → .../generators/rails/app/templates/config.ru
File renamed without changes
View
0  ...rails/app/templates/config/application.rb → ...rails/app/templates/config/application.rb
File renamed without changes
View
0  ...rators/rails/app/templates/config/boot.rb → ...rators/rails/app/templates/config/boot.rb
File renamed without changes
View
0  .../templates/config/databases/frontbase.yml → .../templates/config/databases/frontbase.yml
File renamed without changes
View
0  ...app/templates/config/databases/ibm_db.yml → ...app/templates/config/databases/ibm_db.yml
File renamed without changes
View
0  .../app/templates/config/databases/mysql.yml → .../app/templates/config/databases/mysql.yml
File renamed without changes
View
0  ...app/templates/config/databases/oracle.yml → ...app/templates/config/databases/oracle.yml
File renamed without changes
View
0  ...templates/config/databases/postgresql.yml → ...templates/config/databases/postgresql.yml
File renamed without changes
View
0  ...pp/templates/config/databases/sqlite3.yml → ...pp/templates/config/databases/sqlite3.yml
File renamed without changes
View
0  ...rails/app/templates/config/environment.rb → ...rails/app/templates/config/environment.rb
File renamed without changes
View
0  ...tes/config/environments/development.rb.tt → ...tes/config/environments/development.rb.tt
File renamed without changes
View
0  ...ates/config/environments/production.rb.tt → ...ates/config/environments/production.rb.tt
File renamed without changes
View
0  .../templates/config/environments/test.rb.tt → .../templates/config/environments/test.rb.tt
File renamed without changes
View
0  ...onfig/initializers/backtrace_silencers.rb → ...onfig/initializers/backtrace_silencers.rb
File renamed without changes
View
0  ...ializers/cookie_verification_secret.rb.tt → ...ializers/cookie_verification_secret.rb.tt
File renamed without changes
View
0  ...plates/config/initializers/inflections.rb → ...plates/config/initializers/inflections.rb
File renamed without changes
View
0  ...mplates/config/initializers/mime_types.rb → ...mplates/config/initializers/mime_types.rb
File renamed without changes
View
0  ...s/config/initializers/session_store.rb.tt → ...s/config/initializers/session_store.rb.tt
File renamed without changes
View
0  ...rails/app/templates/config/locales/en.yml → ...rails/app/templates/config/locales/en.yml
File renamed without changes
View
0  ...tors/rails/app/templates/config/routes.rb → ...tors/rails/app/templates/config/routes.rb
File renamed without changes
View
0  ...enerators/rails/app/templates/db/seeds.rb → ...enerators/rails/app/templates/db/seeds.rb
File renamed without changes
View
0  ...rs/rails/app/templates/doc/README_FOR_APP → ...rs/rails/app/templates/doc/README_FOR_APP
File renamed without changes
View
0  .../generators/rails/app/templates/gitignore → .../generators/rails/app/templates/gitignore
File renamed without changes
View
0  ...ators/rails/app/templates/public/404.html → ...ators/rails/app/templates/public/404.html
File renamed without changes
View
0  ...ators/rails/app/templates/public/422.html → ...ators/rails/app/templates/public/422.html
File renamed without changes
View
0  ...ators/rails/app/templates/public/500.html → ...ators/rails/app/templates/public/500.html
File renamed without changes
View
0  ...rs/rails/app/templates/public/favicon.ico → ...rs/rails/app/templates/public/favicon.ico
File renamed without changes
View
0  ...ils/app/templates/public/images/rails.png → ...ils/app/templates/public/images/rails.png
File renamed without changes
View
0  ...ors/rails/app/templates/public/index.html → ...ors/rails/app/templates/public/index.html
File renamed without changes
View
0  ...mplates/public/javascripts/application.js → ...mplates/public/javascripts/application.js
File renamed without changes
View
0  .../templates/public/javascripts/controls.js → .../templates/public/javascripts/controls.js
File renamed without changes
View
0  .../templates/public/javascripts/dragdrop.js → .../templates/public/javascripts/dragdrop.js
File renamed without changes
View
0  ...p/templates/public/javascripts/effects.js → ...p/templates/public/javascripts/effects.js
File renamed without changes
View
0  ...templates/public/javascripts/prototype.js → ...templates/public/javascripts/prototype.js
File renamed without changes
View
0  ...ors/rails/app/templates/public/robots.txt → ...ors/rails/app/templates/public/robots.txt
File renamed without changes
View
0  ...mplates/test/integration/.empty_directory → ...lates/public/stylesheets/.empty_directory
File renamed without changes
View
0  ...nerators/rails/app/templates/script/about → ...nerators/rails/app/templates/script/about
File renamed without changes
View
0  ...ors/rails/app/templates/script/console.tt → ...ors/rails/app/templates/script/console.tt
File renamed without changes
View
0  ...s/rails/app/templates/script/dbconsole.tt → ...s/rails/app/templates/script/dbconsole.tt
File renamed without changes
View
0  ...rators/rails/app/templates/script/destroy → ...rators/rails/app/templates/script/destroy
File renamed without changes
View
0  ...ators/rails/app/templates/script/generate → ...ators/rails/app/templates/script/generate
File renamed without changes
View
0  .../templates/script/performance/benchmarker → .../templates/script/performance/benchmarker
File renamed without changes
View
0  ...app/templates/script/performance/profiler → ...app/templates/script/performance/profiler
File renamed without changes
View
0  ...erators/rails/app/templates/script/plugin → ...erators/rails/app/templates/script/plugin
File renamed without changes
View
0  ...erators/rails/app/templates/script/runner → ...erators/rails/app/templates/script/runner
File renamed without changes
View
0  ...tors/rails/app/templates/script/server.tt → ...tors/rails/app/templates/script/server.tt
File renamed without changes
View
0  ...emplates/test/functional/.empty_directory → .../templates/test/fixtures/.empty_directory
File renamed without changes
View
0  .../templates/test/fixtures/.empty_directory → ...emplates/test/functional/.empty_directory
File renamed without changes
View
0  ...lates/public/stylesheets/.empty_directory → ...mplates/test/integration/.empty_directory
File renamed without changes
View
0  ...mplates/test/performance/browsing_test.rb → ...mplates/test/performance/browsing_test.rb
File renamed without changes
View
0  ...s/rails/app/templates/test/test_helper.rb → ...s/rails/app/templates/test/test_helper.rb
File renamed without changes
View
0  ...plates/app/views/layouts/.empty_directory → .../app/templates/test/unit/.empty_directory
File renamed without changes
View
0  ...b/rails/generators/rails/controller/USAGE → ...ies/lib/generators/rails/controller/USAGE
File renamed without changes
View
0  .../rails/controller/controller_generator.rb → .../rails/controller/controller_generator.rb
File renamed without changes
View
0  .../rails/controller/templates/controller.rb → .../rails/controller/templates/controller.rb
File renamed without changes
View
0  ...ib/rails/generators/rails/generator/USAGE → ...ties/lib/generators/rails/generator/USAGE
File renamed without changes
View
0  ...rs/rails/generator/generator_generator.rb → ...rs/rails/generator/generator_generator.rb
File renamed without changes
View
0  ...tor/templates/%file_name%_generator.rb.tt → ...tor/templates/%file_name%_generator.rb.tt
File renamed without changes
View
0  ...rators/rails/generator/templates/USAGE.tt → ...rators/rails/generator/templates/USAGE.tt
File renamed without changes
View
0  ...app/templates/app/models/.empty_directory → ...ator/templates/templates/.empty_directory
File renamed without changes
View
0  ...s/lib/rails/generators/rails/helper/USAGE → railties/lib/generators/rails/helper/USAGE
File renamed without changes
View
0  ...nerators/rails/helper/helper_generator.rb → ...nerators/rails/helper/helper_generator.rb
File renamed without changes
View
0  ...nerators/rails/helper/templates/helper.rb → ...nerators/rails/helper/templates/helper.rb
File renamed without changes
View
0  ...s/generators/rails/integration_test/USAGE → ...b/generators/rails/integration_test/USAGE
File renamed without changes
View
0  ...ration_test/integration_test_generator.rb → ...ration_test/integration_test_generator.rb
File renamed without changes
View
0  ...s/lib/rails/generators/rails/mailer/USAGE → railties/lib/generators/rails/mailer/USAGE
File renamed without changes
View
0  ...nerators/rails/mailer/mailer_generator.rb → ...nerators/rails/mailer/mailer_generator.rb
File renamed without changes
View
0  ...nerators/rails/mailer/templates/mailer.rb → ...nerators/rails/mailer/templates/mailer.rb
File renamed without changes
View
0  ...es/lib/rails/generators/rails/metal/USAGE → railties/lib/generators/rails/metal/USAGE
File renamed without changes
View
0  ...generators/rails/metal/metal_generator.rb → ...generators/rails/metal/metal_generator.rb
File renamed without changes
View
0  ...generators/rails/metal/templates/metal.rb → ...generators/rails/metal/templates/metal.rb
File renamed without changes
View
0  ...ib/rails/generators/rails/migration/USAGE → ...ties/lib/generators/rails/migration/USAGE
File renamed without changes
View
0  ...rs/rails/migration/migration_generator.rb → ...rs/rails/migration/migration_generator.rb
File renamed without changes
View
0  ...es/lib/rails/generators/rails/model/USAGE → railties/lib/generators/rails/model/USAGE
File renamed without changes
View
0  ...generators/rails/model/model_generator.rb → ...generators/rails/model/model_generator.rb
File renamed without changes
View
1  ...odel_subclass/model_subclass_generator.rb → ...odel_subclass/model_subclass_generator.rb
@@ -1,5 +1,6 @@
module Rails
module Generators
+ # TODO Deprecate me in a release > Rails 3.0
class ModelSubclassGenerator < Base
desc "model_subclass is deprecated. Invoke model with --parent option instead."
View
0  ...lib/rails/generators/rails/observer/USAGE → railties/lib/generators/rails/observer/USAGE
File renamed without changes
View
0  ...tors/rails/observer/observer_generator.rb → ...tors/rails/observer/observer_generator.rb
File renamed without changes
View
0  ...s/generators/rails/performance_test/USAGE → ...b/generators/rails/performance_test/USAGE
File renamed without changes
View
0  ...rmance_test/performance_test_generator.rb → ...rmance_test/performance_test_generator.rb
File renamed without changes
View
0  ...s/lib/rails/generators/rails/plugin/USAGE → railties/lib/generators/rails/plugin/USAGE
File renamed without changes
View
2  ...nerators/rails/plugin/plugin_generator.rb → ...nerators/rails/plugin/plugin_generator.rb
@@ -1,4 +1,4 @@
-require 'rails/generators/rails/generator/generator_generator'
+require 'generators/rails/generator/generator_generator'
module Rails
module Generators
View
0  ...ors/rails/plugin/templates/MIT-LICENSE.tt → ...ors/rails/plugin/templates/MIT-LICENSE.tt
File renamed without changes
View
0  ...nerators/rails/plugin/templates/README.tt → ...nerators/rails/plugin/templates/README.tt
File renamed without changes
View
0  ...rators/rails/plugin/templates/Rakefile.tt → ...rators/rails/plugin/templates/Rakefile.tt
File renamed without changes
View
0  ...generators/rails/plugin/templates/init.rb → ...generators/rails/plugin/templates/init.rb
File renamed without changes
View
0  ...erators/rails/plugin/templates/install.rb → ...erators/rails/plugin/templates/install.rb
File renamed without changes
View
0  ...ls/plugin/templates/lib/%file_name%.rb.tt → ...ls/plugin/templates/lib/%file_name%.rb.tt
File renamed without changes
View
0  ...templates/tasks/%file_name%_tasks.rake.tt → ...templates/tasks/%file_name%_tasks.rake.tt
File renamed without changes
View
0  ...ators/rails/plugin/templates/uninstall.rb → ...ators/rails/plugin/templates/uninstall.rb
File renamed without changes
View
0  ...lib/rails/generators/rails/resource/USAGE → railties/lib/generators/rails/resource/USAGE
File renamed without changes
View
2  ...tors/rails/resource/resource_generator.rb → ...tors/rails/resource/resource_generator.rb
@@ -1,5 +1,5 @@
-require 'rails/generators/rails/model/model_generator'
require 'rails/generators/resource_helpers'
+require 'generators/rails/model/model_generator'
module Rails
module Generators
View
0  ...lib/rails/generators/rails/scaffold/USAGE → railties/lib/generators/rails/scaffold/USAGE
File renamed without changes
View
2  ...tors/rails/scaffold/scaffold_generator.rb → ...tors/rails/scaffold/scaffold_generator.rb
@@ -1,4 +1,4 @@
-require 'rails/generators/rails/resource/resource_generator'
+require 'generators/rails/resource/resource_generator'
module Rails
module Generators
View
0  ...enerators/rails/scaffold_controller/USAGE → ...enerators/rails/scaffold_controller/USAGE
File renamed without changes
View
0  ...ntroller/scaffold_controller_generator.rb → ...ntroller/scaffold_controller_generator.rb
File renamed without changes
View
0  ...affold_controller/templates/controller.rb → ...affold_controller/templates/controller.rb
File renamed without changes
View
0  .../generators/rails/session_migration/USAGE → .../generators/rails/session_migration/USAGE
File renamed without changes
View
0  ..._migration/session_migration_generator.rb → ..._migration/session_migration_generator.rb
File renamed without changes
View
0  .../rails/generators/rails/stylesheets/USAGE → ...es/lib/generators/rails/stylesheets/USAGE
File renamed without changes
View
0  ...ails/stylesheets/stylesheets_generator.rb → ...ails/stylesheets/stylesheets_generator.rb
File renamed without changes
View
0  .../rails/stylesheets/templates/scaffold.css → .../rails/stylesheets/templates/scaffold.css
File renamed without changes
View
0  railties/lib/rails/generators/test_unit.rb → railties/lib/generators/test_unit.rb
File renamed without changes
View
2  ...t_unit/controller/controller_generator.rb → ...t_unit/controller/controller_generator.rb
@@ -1,4 +1,4 @@
-require 'rails/generators/test_unit'
+require 'generators/test_unit'
module TestUnit
module Generators
View
0  ...t/controller/templates/functional_test.rb → ...t/controller/templates/functional_test.rb
File renamed without changes
View
2  ...tors/test_unit/helper/helper_generator.rb → ...tors/test_unit/helper/helper_generator.rb
@@ -1,4 +1,4 @@
-require 'rails/generators/test_unit'
+require 'generators/test_unit'
module TestUnit
module Generators
View
0  ...test_unit/helper/templates/helper_test.rb → ...test_unit/helper/templates/helper_test.rb
File renamed without changes
View
2  ...unit/integration/integration_generator.rb → ...unit/integration/integration_generator.rb
@@ -1,4 +1,4 @@
-require 'rails/generators/test_unit'
+require 'generators/test_unit'
module TestUnit
module Generators
View
0  ...integration/templates/integration_test.rb → ...integration/templates/integration_test.rb
File renamed without changes
View
2  ...tors/test_unit/mailer/mailer_generator.rb → ...tors/test_unit/mailer/mailer_generator.rb
@@ -1,4 +1,4 @@
-require 'rails/generators/test_unit'
+require 'generators/test_unit'
module TestUnit
module Generators
View
0  ...rators/test_unit/mailer/templates/fixture → ...rators/test_unit/mailer/templates/fixture
File renamed without changes
View
0  ...s/test_unit/mailer/templates/unit_test.rb → ...s/test_unit/mailer/templates/unit_test.rb
File renamed without changes
View
2  ...rators/test_unit/model/model_generator.rb → ...rators/test_unit/model/model_generator.rb
@@ -1,4 +1,4 @@
-require 'rails/generators/test_unit'
+require 'generators/test_unit'
module TestUnit
module Generators
View
0  ...rs/test_unit/model/templates/fixtures.yml → ...rs/test_unit/model/templates/fixtures.yml
File renamed without changes
View
0  ...rs/test_unit/model/templates/unit_test.rb → ...rs/test_unit/model/templates/unit_test.rb
File renamed without changes
View
2  .../test_unit/observer/observer_generator.rb → .../test_unit/observer/observer_generator.rb
@@ -1,4 +1,4 @@
-require 'rails/generators/test_unit'
+require 'generators/test_unit'
module TestUnit
module Generators
View
0  ...test_unit/observer/templates/unit_test.rb → ...test_unit/observer/templates/unit_test.rb
File renamed without changes
View
2  ...unit/performance/performance_generator.rb → ...unit/performance/performance_generator.rb
@@ -1,4 +1,4 @@
-require 'rails/generators/test_unit'
+require 'generators/test_unit'
module TestUnit
module Generators
View
0  ...performance/templates/performance_test.rb → ...performance/templates/performance_test.rb
File renamed without changes
View
2  ...tors/test_unit/plugin/plugin_generator.rb → ...tors/test_unit/plugin/plugin_generator.rb
@@ -1,4 +1,4 @@
-require 'rails/generators/test_unit'
+require 'generators/test_unit'
module TestUnit
module Generators
View
0  ...t/plugin/templates/%file_name%_test.rb.tt → ...t/plugin/templates/%file_name%_test.rb.tt
File renamed without changes
View
0  ...test_unit/plugin/templates/test_helper.rb → ...test_unit/plugin/templates/test_helper.rb
File renamed without changes
View
2  .../test_unit/scaffold/scaffold_generator.rb → .../test_unit/scaffold/scaffold_generator.rb
@@ -1,4 +1,4 @@
-require 'rails/generators/test_unit'
+require 'generators/test_unit'
require 'rails/generators/resource_helpers'
module TestUnit
View
0  ...nit/scaffold/templates/functional_test.rb → ...nit/scaffold/templates/functional_test.rb
File renamed without changes
View
78 railties/lib/rails/generators.rb
@@ -87,18 +87,6 @@ def self.options #:nodoc:
@options ||= DEFAULT_OPTIONS.dup
end
- def self.gems_generators_paths #:nodoc:
- return [] unless defined?(Gem) && Gem.respond_to?(:loaded_specs)
- Gem.loaded_specs.inject([]) do |paths, (name, spec)|
- paths += Dir[File.join(spec.full_gem_path, "lib/{generators,rails_generators}")]
- end
- end
-
- def self.plugins_generators_paths #:nodoc:
- return [] unless defined?(Rails.root) && Rails.root
- Dir[File.join(Rails.root, "vendor", "plugins", "*", "lib", "{generators,rails_generators}")]
- end
-
# Hold configured generators fallbacks. If a plugin developer wants a
# generator group to fallback to another group in case of missing generators,
# they can add a fallback.
@@ -126,31 +114,6 @@ def self.subclasses
@subclasses ||= []
end
- # Generators load paths used on lookup. The lookup happens as:
- #
- # 1) lib generators
- # 2) vendor/plugin generators
- # 3) vendor/gems generators
- # 4) ~/rails/generators
- # 5) rubygems generators
- # 6) builtin generators
- #
- # TODO Remove hardcoded paths for all, except (6).
- #
- def self.load_paths
- @load_paths ||= begin
- paths = []
- paths += Dir[File.join(Rails.root, "lib", "{generators,rails_generators}")] if defined?(Rails.root) && Rails.root
- paths += Dir[File.join(Thor::Util.user_home, ".rails", "{generators,rails_generators}")]
- paths += self.plugins_generators_paths
- paths += self.gems_generators_paths
- paths << File.expand_path(File.join(File.dirname(__FILE__), "generators"))
- paths.uniq!
- paths
- end
- end
- load_paths # Cache load paths. Needed to avoid __FILE__ pointing to wrong paths.
-
# Rails finds namespaces similar to thor, it only adds one rule:
#
# Generators names must end with "_generator.rb". This is required because Rails
@@ -170,6 +133,12 @@ def self.load_paths
def self.find_by_namespace(name, base=nil, context=nil) #:nodoc:
base = "rails" unless base || context || name.to_s.include?(?:)
+ lookups = []
+ lookups << "#{base}:#{name}" if base
+ lookups << "#{name}:#{context}" if context
+ lookups << "#{name}"
+ lookups << "rails:#{name}" unless base || context || name.to_s.include?(?:)
+
# Mount regexps to lookup
regexps = []
regexps << /^#{base}:[\w:]*#{name}$/ if base
@@ -183,7 +152,7 @@ def self.find_by_namespace(name, base=nil, context=nil) #:nodoc:
return klass if klass
# Try to require other generators by looking in load_paths
- lookup(name, context)
+ lookup(lookups)
unchecked = subclasses - checked
klass = find_by_regexps(regexps, unchecked)
return klass if klass
@@ -255,22 +224,27 @@ def self.invoke_fallbacks_for(name, base) #:nodoc:
# Receives namespaces in an array and tries to find matching generators
# in the load path.
- def self.lookup(*attempts) #:nodoc:
+ def self.lookup(attempts) #:nodoc:
attempts.compact!
attempts.uniq!
- attempts = "{#{attempts.join(',')}}_generator.rb"
-
- self.load_paths.each do |path|
- Dir[File.join(path, '**', attempts)].each do |file|
- begin
- require file
- rescue NameError => e
- raise unless e.message =~ /Rails::Generator/
- warn "[WARNING] Could not load generator at #{file.inspect} because it's a Rails 2.x generator, which is not supported anymore"
- rescue Exception => e
- warn "[WARNING] Could not load generator at #{file.inspect}. Error: #{e.message}"
- end
- end
+
+ attempts.each do |attempt|
+ last = attempt.split(':').last
+
+ # TODO Support rails_generators
+ require_generator "generators/#{attempt.gsub(':', '/')}/#{last}_generator"
+ require_generator "generators/#{attempt.gsub(':', '/')}_generator"
+ end
+ end
+
+ def self.require_generator(path)
+ begin
+ require path
+ rescue LoadError => e
+ raise unless e.message =~ /#{Regexp.escape(path)}$/
+ rescue NameError => e
+ raise unless e.message =~ /Rails::Generator/
+ warn "[WARNING] Could not load generator at #{path.inspect} because it's a Rails 2.x generator, which is not supported anymore. Error: #{e.message}"
end
end
View
2  railties/lib/rails/generators/base.rb
@@ -17,7 +17,7 @@ class Base < Thor::Group
def self.source_root
@_rails_source_root ||= begin
if base_name && generator_name
- File.expand_path(File.join(File.dirname(__FILE__), base_name, generator_name, 'templates'))
+ File.expand_path(File.join("../../generators", base_name, generator_name, 'templates'), File.dirname(__FILE__))
end
end
end
View
4 railties/test/generators/actions_test.rb
@@ -1,8 +1,8 @@
require 'generators/generators_test_helper'
-require 'rails/generators/rails/app/app_generator'
+require 'generators/rails/app/app_generator'
# TODO This line shouldn't be required
-require 'rails/generators/rails/model/model_generator'
+require 'generators/rails/model/model_generator'
class ActionsTest < GeneratorsTestCase
tests Rails::Generators::AppGenerator
View
2  railties/test/generators/app_generator_test.rb
@@ -1,6 +1,6 @@
require 'abstract_unit'
require 'generators/generators_test_helper'
-require 'rails/generators/rails/app/app_generator'
+require 'generators/rails/app/app_generator'
class AppGeneratorTest < GeneratorsTestCase
arguments [destination_root]
View
2  railties/test/generators/controller_generator_test.rb
@@ -1,5 +1,5 @@
require 'generators/generators_test_helper'
-require 'rails/generators/rails/controller/controller_generator'
+require 'generators/rails/controller/controller_generator'
class ControllerGeneratorTest < GeneratorsTestCase
arguments %w(Account foo bar)
View
2  railties/test/generators/generator_generator_test.rb
@@ -1,5 +1,5 @@
require 'generators/generators_test_helper'
-require 'rails/generators/rails/generator/generator_generator'
+require 'generators/rails/generator/generator_generator'
class GeneratorGeneratorTest < GeneratorsTestCase
arguments %w(awesome)
View
1  railties/test/generators/generators_test_helper.rb
@@ -10,7 +10,6 @@ def self.root
require 'rails/generators'
require 'rails/generators/test_case'
-require 'rubygems'
require 'active_record'
require 'action_dispatch'
View
2  railties/test/generators/helper_generator_test.rb
@@ -1,5 +1,5 @@
require 'generators/generators_test_helper'
-require 'rails/generators/rails/helper/helper_generator'
+require 'generators/rails/helper/helper_generator'
ObjectHelper = Class.new
AnotherObjectHelperTest = Class.new
View
2  railties/test/generators/integration_test_generator_test.rb
@@ -1,5 +1,5 @@
require 'generators/generators_test_helper'
-require 'rails/generators/rails/integration_test/integration_test_generator'
+require 'generators/rails/integration_test/integration_test_generator'
class IntegrationTestGeneratorTest < GeneratorsTestCase
arguments %w(integration)
View
2  railties/test/generators/mailer_generator_test.rb
@@ -1,5 +1,5 @@
require 'generators/generators_test_helper'
-require 'rails/generators/rails/mailer/mailer_generator'
+require 'generators/rails/mailer/mailer_generator'
class MailerGeneratorTest < GeneratorsTestCase
arguments %w(notifier foo bar)
View
2  railties/test/generators/metal_generator_test.rb
@@ -1,5 +1,5 @@
require 'generators/generators_test_helper'
-require 'rails/generators/rails/metal/metal_generator'
+require 'generators/rails/metal/metal_generator'
class MetalGeneratorTest < GeneratorsTestCase
arguments %w(foo)
View
2  railties/test/generators/migration_generator_test.rb
@@ -1,5 +1,5 @@
require 'generators/generators_test_helper'
-require 'rails/generators/rails/migration/migration_generator'
+require 'generators/rails/migration/migration_generator'
class MigrationGeneratorTest < GeneratorsTestCase
def test_migration
View
2  railties/test/generators/model_generator_test.rb
@@ -1,5 +1,5 @@
require 'generators/generators_test_helper'
-require 'rails/generators/rails/model/model_generator'
+require 'generators/rails/model/model_generator'
class ModelGeneratorTest < GeneratorsTestCase
arguments %w(Account name:string age:integer)
View
2  railties/test/generators/named_base_test.rb
@@ -1,5 +1,5 @@
require 'generators/generators_test_helper'
-require 'rails/generators/rails/scaffold_controller/scaffold_controller_generator'
+require 'generators/rails/scaffold_controller/scaffold_controller_generator'
# Mock out what we need from AR::Base.
module ActiveRecord
View
2  railties/test/generators/observer_generator_test.rb
@@ -1,5 +1,5 @@
require 'generators/generators_test_helper'
-require 'rails/generators/rails/observer/observer_generator'
+require 'generators/rails/observer/observer_generator'
class ObserverGeneratorTest < GeneratorsTestCase
arguments %w(account)
View
2  railties/test/generators/performance_test_generator_test.rb
@@ -1,5 +1,5 @@
require 'generators/generators_test_helper'
-require 'rails/generators/rails/performance_test/performance_test_generator'
+require 'generators/rails/performance_test/performance_test_generator'
class PerformanceTestGeneratorTest < GeneratorsTestCase
arguments %w(performance)
View
2  railties/test/generators/plugin_generator_test.rb
@@ -1,5 +1,5 @@
require 'generators/generators_test_helper'
-require 'rails/generators/rails/plugin/plugin_generator'
+require 'generators/rails/plugin/plugin_generator'
class PluginGeneratorTest < GeneratorsTestCase
arguments %w(plugin_fu)
View
2  railties/test/generators/resource_generator_test.rb
@@ -1,5 +1,5 @@
require 'generators/generators_test_helper'
-require 'rails/generators/rails/resource/resource_generator'
+require 'generators/rails/resource/resource_generator'
class ResourceGeneratorTest < GeneratorsTestCase
arguments %w(account)
View
2  railties/test/generators/scaffold_controller_generator_test.rb
@@ -1,5 +1,5 @@
require 'generators/generators_test_helper'
-require 'rails/generators/rails/scaffold_controller/scaffold_controller_generator'
+require 'generators/rails/scaffold_controller/scaffold_controller_generator'
module Unknown
module Generators
View
2  railties/test/generators/scaffold_generator_test.rb
@@ -1,5 +1,5 @@
require 'generators/generators_test_helper'
-require 'rails/generators/rails/scaffold/scaffold_generator'
+require 'generators/rails/scaffold/scaffold_generator'
class ScaffoldGeneratorTest < GeneratorsTestCase
arguments %w(product_line title:string price:integer)
View
2  railties/test/generators/session_migration_generator_test.rb
@@ -1,5 +1,5 @@
require 'generators/generators_test_helper'
-require 'rails/generators/rails/session_migration/session_migration_generator'
+require 'generators/rails/session_migration/session_migration_generator'
class SessionMigrationGeneratorTest < GeneratorsTestCase
def test_session_migration_with_default_name
View
2  railties/test/generators/stylesheets_generator_test.rb
@@ -1,5 +1,5 @@
require 'generators/generators_test_helper'
-require 'rails/generators/rails/stylesheets/stylesheets_generator'
+require 'generators/rails/stylesheets/stylesheets_generator'
class StylesheetsGeneratorTest < GeneratorsTestCase
def test_copy_stylesheets

2 comments on commit 9fffdc5

@jnicklas

This is an awesome change, good to reuse an existing system. Does this mean that generators in lib/generators/my_library in gems are pulled in automatically?

@josevalim
Owner

Yes, if you follow the conventions, for example:
If you have "lib/generators/awesome_generator.rb" with AwesomeGenerator defined, it can be invoked as script/generate awesome.
If you have "lib/generators/my_library/awesome_generator.rb" with MyLibrary::AwesomeGenerator, it can be invoked as script/generator my_library:awesome.

Please sign in to comment.
Something went wrong with that request. Please try again.