aboutsummaryrefslogtreecommitdiffstats
path: root/railties/bin
diff options
context:
space:
mode:
Diffstat (limited to 'railties/bin')
-rwxr-xr-xrailties/bin/gen6
-rwxr-xr-xrailties/bin/rails4
2 files changed, 7 insertions, 3 deletions
diff --git a/railties/bin/gen b/railties/bin/gen
index 0567ab6058..f054d4e853 100755
--- a/railties/bin/gen
+++ b/railties/bin/gen
@@ -14,8 +14,10 @@ else ARGV.size == 1
ARGV << "--help"
end
-Dir[File.dirname(__FILE__) + '/../lib/generator/generators/*/*_generator.rb'].each do |file|
- require file
+require File.dirname(__FILE__) + '/../lib/generator'
+
+Rails::Generators.builtin.each do |name|
+ require "generator/generators/#{name}/#{name}_generator"
end
name = ARGV.shift
diff --git a/railties/bin/rails b/railties/bin/rails
index 4d08ca392d..57eb8809ed 100755
--- a/railties/bin/rails
+++ b/railties/bin/rails
@@ -9,5 +9,7 @@ end
ARGV << "--help" if ARGV.empty?
-require File.dirname(__FILE__) + '/../lib/generator/generators/app/app_generator'
+require File.dirname(__FILE__) + '/../lib/generator'
+require 'generator/generators/app/app_generator'
+
Rails::Generators::AppGenerator.start