Ticket #1689: 1.9_case_file_exist_compat.diff
| File 1.9_case_file_exist_compat.diff, 4.8 kB (added by chuyeow, 7 months ago) |
|---|
-
railties/test/boot_test.rb
old new 36 36 37 37 def test_boot_vendor_rails_by_default 38 38 Rails.expects(:booted?).returns(false) 39 Rails.expects(:preinitialize) 39 40 File.expects(:exist?).with("#{RAILS_ROOT}/vendor/rails").returns(true) 40 41 Rails::VendorBoot.any_instance.expects(:run).returns('result') 41 42 assert_equal 'result', Rails.boot! … … 43 44 44 45 def test_boot_gem_rails_otherwise 45 46 Rails.expects(:booted?).returns(false) 47 Rails.expects(:preinitialize) 46 48 File.expects(:exist?).with("#{RAILS_ROOT}/vendor/rails").returns(false) 47 49 Rails::GemBoot.any_instance.expects(:run).returns('result') 48 50 assert_equal 'result', Rails.boot! -
railties/environments/boot.rb
old new 24 24 File.exist?("#{RAILS_ROOT}/vendor/rails") 25 25 end 26 26 27 # FIXME : Ruby 1.928 27 def preinitialize 29 load(preinitializer_path) if File.exist s?(preinitializer_path)28 load(preinitializer_path) if File.exist?(preinitializer_path) 30 29 end 31 30 32 31 def preinitializer_path -
railties/dispatches/gateway.cgi
old new 31 31 File.expand_path(File.join(File.dirname(__FILE__), "../log/drb_gateway/listener_#{number}.sock")) 32 32 end 33 33 34 unless File.exist s? TrackerSocket34 unless File.exist? TrackerSocket 35 35 message "Starting tracker and #{Listeners} listeners" 36 36 fork do 37 37 Process.setsid … … 62 62 ready = false 63 63 10.times do 64 64 sleep 0.5 65 break if (ready = File.exist s?(TrackerSocket) && File.exists?(listener_socket(0)))65 break if (ready = File.exist?(TrackerSocket) && File.exist?(listener_socket(0))) 66 66 end 67 67 68 68 if ready -
railties/lib/tasks/documentation.rake
old new 65 65 options << '-T html' 66 66 67 67 files.include("#{plugin_base}/lib/**/*.rb") 68 if File.exist s?("#{plugin_base}/README")68 if File.exist?("#{plugin_base}/README") 69 69 files.include("#{plugin_base}/README") 70 70 options << "--main '#{plugin_base}/README'" 71 71 end 72 files.include("#{plugin_base}/CHANGELOG") if File.exist s?("#{plugin_base}/CHANGELOG")72 files.include("#{plugin_base}/CHANGELOG") if File.exist?("#{plugin_base}/CHANGELOG") 73 73 74 74 options << files.to_s 75 75 -
railties/lib/tasks/framework.rake
old new 105 105 require 'railties_path' 106 106 project_dir = RAILS_ROOT + '/public/javascripts/' 107 107 scripts = Dir[RAILTIES_PATH + '/html/javascripts/*.js'] 108 scripts.reject!{|s| File.basename(s) == 'application.js'} if File.exist s?(project_dir + 'application.js')108 scripts.reject!{|s| File.basename(s) == 'application.js'} if File.exist?(project_dir + 'application.js') 109 109 FileUtils.cp(scripts, project_dir) 110 110 end 111 111 -
railties/lib/tasks/testing.rake
old new 13 13 14 14 # For modified files in app/ run the tests for it. ex. /test/functional/account_controller.rb 15 15 test = "#{modified_test_path}/#{source_file}_test.rb" 16 tests.push test if File.exist s?(test)16 tests.push test if File.exist?(test) 17 17 18 18 # For modified files in app, run tests in subdirs too. ex. /test/functional/account/*_test.rb 19 19 test = "#{modified_test_path}/#{File.basename(path, '.rb').sub("_controller","")}" 20 FileList["#{test}/*_test.rb"].each { |f| tests.push f } if File.exist s?(test)20 FileList["#{test}/*_test.rb"].each { |f| tests.push f } if File.exist?(test) 21 21 22 22 return tests 23 23 -
railties/lib/commands/console.rb
old new 16 16 libs << " -r console_with_helpers" 17 17 18 18 ENV['RAILS_ENV'] = case ARGV.first 19 when "p" :"production"20 when "d" :"development"21 when "t" :"test"19 when "p"; "production" 20 when "d"; "development" 21 when "t"; "test" 22 22 else 23 23 ARGV.first || ENV['RAILS_ENV'] || 'development' 24 24 end