Skip to content
Browse files

Added compatibility to Ruby 1.9.2.

  • Loading branch information...
1 parent ac7b5a2 commit 157c1808b9365cfc6a32e4dad9797c87aef3d83f @josevalim josevalim committed Mar 26, 2010
Showing with 11 additions and 7 deletions.
  1. +6 −5 railties/bin/rails
  2. +5 −2 railties/lib/rails_generator.rb
View
11 railties/bin/rails
@@ -1,19 +1,20 @@
-require File.dirname(__FILE__) + '/../lib/ruby_version_check'
+$:.unshift File.expand_path("../../lib", __FILE__)
+
+require 'ruby_version_check'
Signal.trap("INT") { puts; exit }
-require File.dirname(__FILE__) + '/../lib/rails/version'
+require 'rails/version'
if %w(--version -v).include? ARGV.first
puts "Rails #{Rails::VERSION::STRING}"
exit(0)
end
freeze = ARGV.any? { |option| %w(--freeze -f).include?(option) }
-
app_path = ARGV.first
-require File.dirname(__FILE__) + '/../lib/rails_generator'
-
+require 'rails_generator'
require 'rails_generator/scripts/generate'
+
Rails::Generator::Base.use_application_sources!
Rails::Generator::Scripts::Generate.new.run(ARGV, :generator => 'app')
View
7 railties/lib/rails_generator.rb
@@ -21,8 +21,11 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#++
-$:.unshift(File.dirname(__FILE__))
-$:.unshift(File.dirname(__FILE__) + "/../../activesupport/lib")
+railties = File.expand_path("..", __FILE__)
+$:.unshift(railties) unless $:.include?(railties)
+
+activesupport = File.expand_path("../../../activesupport/lib", __FILE__)
+$:.unshift(activesupport) unless $:.include?(activesupport)
begin
require 'active_support'

0 comments on commit 157c180

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