aboutsummaryrefslogtreecommitdiffstats
path: root/railties/bin
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-02-03 18:49:47 +0100
committerJosé Valim <jose.valim@gmail.com>2010-02-03 18:49:47 +0100
commitefa850558facf2fbaaf226f1444802da83924b82 (patch)
tree236380296b0d0f54f5d2e6d8523930d72e9ff645 /railties/bin
parent391f2543c96a9b3de4e44f4ea6aeee2f53ad9e5c (diff)
downloadrails-efa850558facf2fbaaf226f1444802da83924b82.tar.gz
rails-efa850558facf2fbaaf226f1444802da83924b82.tar.bz2
rails-efa850558facf2fbaaf226f1444802da83924b82.zip
Make bin/rails call rails/commands/application, fix generators usage and update .gitignores.
Diffstat (limited to 'railties/bin')
-rwxr-xr-xrailties/bin/rails27
1 files changed, 4 insertions, 23 deletions
diff --git a/railties/bin/rails b/railties/bin/rails
index 44842e2234..72c47b533f 100755
--- a/railties/bin/rails
+++ b/railties/bin/rails
@@ -1,30 +1,11 @@
if File.exists?(Dir.getwd + '/script/rails')
exec(Dir.getwd + '/script/rails', *ARGV)
else
- 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
+ railties_path = File.expand_path('../../lib', __FILE__)
+ $:.unshift(railties_path) if File.directory?(railties_path) && !$:.include?(railties_path)
+ require 'rails/ruby_version_check'
Signal.trap("INT") { puts; exit }
- require 'rails/version'
- if %w(--version -v).include? ARGV.first
- puts "Rails #{Rails::VERSION::STRING}"
- exit(0)
- end
-
- ARGV << "--help" if ARGV.empty?
-
- require 'rails/generators'
- require 'generators/rails/app/app_generator'
-
- Rails::Generators::AppGenerator.start
+ require 'rails/commands/application'
end \ No newline at end of file