diff options
Diffstat (limited to 'railties/bin/rails')
-rwxr-xr-x | railties/bin/rails | 34 |
1 files changed, 9 insertions, 25 deletions
diff --git a/railties/bin/rails b/railties/bin/rails index afcd9fd0be..72c47b533f 100755 --- a/railties/bin/rails +++ b/railties/bin/rails @@ -1,27 +1,11 @@ -begin - require 'rails/ruby_version_check' -rescue LoadError - # If people are not using gems, the load path must still - # be correct. - # TODO: Remove the begin / rescue block somehow - $:.unshift File.expand_path('../../lib', __FILE__) - $:.unshift File.expand_path('../../../activesupport/lib', __FILE__) - $:.unshift File.expand_path('../../../actionpack/lib', __FILE__) - require 'rails/ruby_version_check' -end - -Signal.trap("INT") { puts; exit } - -require 'rails/version' -if %w(--version -v).include? ARGV.first - puts "Rails #{Rails::VERSION::STRING}" - exit(0) -end +if File.exists?(Dir.getwd + '/script/rails') + exec(Dir.getwd + '/script/rails', *ARGV) +else + railties_path = File.expand_path('../../lib', __FILE__) + $:.unshift(railties_path) if File.directory?(railties_path) && !$:.include?(railties_path) -ARGV << "--help" if ARGV.empty? - - -require 'rails/generators' -require 'generators/rails/app/app_generator' + require 'rails/ruby_version_check' + Signal.trap("INT") { puts; exit } -Rails::Generators::AppGenerator.start + require 'rails/commands/application' +end
\ No newline at end of file |