Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ruby 1.9 compatibility. References #1689.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8431 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit ab9e4c0eaacba34c9f1d16cf34c82e0e906edad5 1 parent 0f6c86f
@jeremy jeremy authored
View
5 railties/CHANGELOG
@@ -1,3 +1,8 @@
+*SVN*
+
+* Ruby 1.9 compatibility. #1689 [Cheah Chu Yeow]
+
+
*2.0.2* (December 16th, 2007)
* Changed the default database from mysql to sqlite3, so now running "rails myapp" will have a config/database.yml that's setup for SQLite3 (which in OS X Leopard is installed by default, so is the gem, so everything Just Works with no database configuration at all). To get a Rails application preconfigured for MySQL, just run "rails -d mysql myapp" [DHH]
View
4 railties/dispatches/gateway.cgi
@@ -31,7 +31,7 @@ def listener_socket(number)
File.expand_path(File.join(File.dirname(__FILE__), "../log/drb_gateway/listener_#{number}.sock"))
end
-unless File.exists? TrackerSocket
+unless File.exist? TrackerSocket
message "Starting tracker and #{Listeners} listeners"
fork do
Process.setsid
@@ -62,7 +62,7 @@ unless File.exists? TrackerSocket
ready = false
10.times do
sleep 0.5
- break if (ready = File.exists?(TrackerSocket) && File.exists?(listener_socket(0)))
+ break if (ready = File.exist?(TrackerSocket) && File.exist?(listener_socket(0)))
end
if ready
View
3  railties/environments/boot.rb
@@ -24,9 +24,8 @@ def vendor_rails?
File.exist?("#{RAILS_ROOT}/vendor/rails")
end
- # FIXME : Ruby 1.9
def preinitialize
- load(preinitializer_path) if File.exists?(preinitializer_path)
+ load(preinitializer_path) if File.exist?(preinitializer_path)
end
def preinitializer_path
View
6 railties/lib/commands/console.rb
@@ -16,9 +16,9 @@
libs << " -r console_with_helpers"
ENV['RAILS_ENV'] = case ARGV.first
- when "p": "production"
- when "d": "development"
- when "t": "test"
+ when "p"; "production"
+ when "d"; "development"
+ when "t"; "test"
else
ARGV.first || ENV['RAILS_ENV'] || 'development'
end
View
4 railties/lib/tasks/documentation.rake
@@ -65,11 +65,11 @@ namespace :doc do
options << '-T html'
files.include("#{plugin_base}/lib/**/*.rb")
- if File.exists?("#{plugin_base}/README")
+ if File.exist?("#{plugin_base}/README")
files.include("#{plugin_base}/README")
options << "--main '#{plugin_base}/README'"
end
- files.include("#{plugin_base}/CHANGELOG") if File.exists?("#{plugin_base}/CHANGELOG")
+ files.include("#{plugin_base}/CHANGELOG") if File.exist?("#{plugin_base}/CHANGELOG")
options << files.to_s
View
2  railties/lib/tasks/framework.rake
@@ -105,7 +105,7 @@ namespace :rails do
require 'railties_path'
project_dir = RAILS_ROOT + '/public/javascripts/'
scripts = Dir[RAILTIES_PATH + '/html/javascripts/*.js']
- scripts.reject!{|s| File.basename(s) == 'application.js'} if File.exists?(project_dir + 'application.js')
+ scripts.reject!{|s| File.basename(s) == 'application.js'} if File.exist?(project_dir + 'application.js')
FileUtils.cp(scripts, project_dir)
end
View
4 railties/lib/tasks/testing.rake
@@ -13,11 +13,11 @@ def recent_tests(source_pattern, test_path, touched_since = 10.minutes.ago)
# For modified files in app/ run the tests for it. ex. /test/functional/account_controller.rb
test = "#{modified_test_path}/#{source_file}_test.rb"
- tests.push test if File.exists?(test)
+ tests.push test if File.exist?(test)
# For modified files in app, run tests in subdirs too. ex. /test/functional/account/*_test.rb
test = "#{modified_test_path}/#{File.basename(path, '.rb').sub("_controller","")}"
- FileList["#{test}/*_test.rb"].each { |f| tests.push f } if File.exists?(test)
+ FileList["#{test}/*_test.rb"].each { |f| tests.push f } if File.exist?(test)
return tests
View
2  railties/test/boot_test.rb
@@ -36,6 +36,7 @@ def test_load_preinitializer_loads_preinitializer_file
def test_boot_vendor_rails_by_default
Rails.expects(:booted?).returns(false)
+ Rails.expects(:preinitialize)
File.expects(:exist?).with("#{RAILS_ROOT}/vendor/rails").returns(true)
Rails::VendorBoot.any_instance.expects(:run).returns('result')
assert_equal 'result', Rails.boot!
@@ -43,6 +44,7 @@ def test_boot_vendor_rails_by_default
def test_boot_gem_rails_otherwise
Rails.expects(:booted?).returns(false)
+ Rails.expects(:preinitialize)
File.expects(:exist?).with("#{RAILS_ROOT}/vendor/rails").returns(false)
Rails::GemBoot.any_instance.expects(:run).returns('result')
assert_equal 'result', Rails.boot!
Please sign in to comment.
Something went wrong with that request. Please try again.