Changeset 8365
- Timestamp:
- 12/10/07 05:54:46 (7 months ago)
- Files:
-
- trunk/actionpack/lib/action_controller/caching.rb (modified) (2 diffs)
- trunk/actionpack/lib/action_controller/rescue.rb (modified) (1 diff)
- trunk/actionpack/test/template/asset_tag_helper_test.rb (modified) (9 diffs)
- trunk/activerecord/test/aaa_create_tables_test.rb (modified) (1 diff)
- trunk/activerecord/test/associations_test.rb (modified) (1 diff)
- trunk/activesupport/test/multibyte_conformance.rb (modified) (2 diffs)
- trunk/railties/builtin/rails_info/rails/info.rb (modified) (1 diff)
- trunk/railties/environments/boot.rb (modified) (1 diff)
- trunk/railties/lib/commands/plugin.rb (modified) (1 diff)
- trunk/railties/lib/commands/runner.rb (modified) (1 diff)
- trunk/railties/lib/rails_generator/commands.rb (modified) (4 diffs)
- trunk/railties/lib/rails_generator/generators/applications/app/app_generator.rb (modified) (1 diff)
- trunk/railties/lib/rails_generator/secret_key_generator.rb (modified) (1 diff)
- trunk/railties/test/generators/generator_test_helper.rb (modified) (2 diffs)
- trunk/railties/test/generators/rails_model_generator_test.rb (modified) (2 diffs)
- trunk/railties/test/generators/rails_resource_generator_test.rb (modified) (2 diffs)
- trunk/railties/test/generators/rails_scaffold_generator_test.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/lib/action_controller/caching.rb
r8307 r8365 82 82 83 83 benchmark "Expired page: #{page_cache_file(path)}" do 84 File.delete(page_cache_path(path)) if File.exist s?(page_cache_path(path))84 File.delete(page_cache_path(path)) if File.exist?(page_cache_path(path)) 85 85 end 86 86 end … … 553 553 554 554 def ensure_cache_path(path) 555 FileUtils.makedirs(path) unless File.exist s?(path)555 FileUtils.makedirs(path) unless File.exist?(path) 556 556 end 557 557 trunk/actionpack/lib/action_controller/rescue.rb
r8301 r8365 155 155 status = interpret_status(status_code) 156 156 path = "#{RAILS_ROOT}/public/#{status[0,3]}.html" 157 if File.exist s?(path)157 if File.exist?(path) 158 158 render :file => path, :status => status 159 159 else trunk/actionpack/test/template/asset_tag_helper_test.rb
r8110 r8365 235 235 ) 236 236 237 assert File.exist s?(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'all.js'))237 assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'all.js')) 238 238 239 239 assert_dom_equal( … … 242 242 ) 243 243 244 assert File.exist s?(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'money.js'))244 assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'money.js')) 245 245 246 246 ensure … … 259 259 ) 260 260 261 assert File.exist s?(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'cache', 'money.js'))261 assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'cache', 'money.js')) 262 262 ensure 263 263 File.delete(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'cache', 'money.js')) … … 273 273 ) 274 274 275 assert !File.exist s?(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'all.js'))275 assert !File.exist?(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'all.js')) 276 276 277 277 assert_dom_equal( … … 280 280 ) 281 281 282 assert !File.exist s?(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'money.js'))282 assert !File.exist?(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'money.js')) 283 283 end 284 284 … … 293 293 ) 294 294 295 assert File.exist s?(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'all.css'))295 assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'all.css')) 296 296 297 297 assert_dom_equal( … … 300 300 ) 301 301 302 assert File.exist s?(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'money.css'))302 assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'money.css')) 303 303 ensure 304 304 File.delete(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'all.css')) … … 315 315 ) 316 316 317 assert !File.exist s?(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'all.css'))317 assert !File.exist?(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'all.css')) 318 318 319 319 assert_dom_equal( … … 322 322 ) 323 323 324 assert !File.exist s?(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'money.css'))324 assert !File.exist?(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'money.css')) 325 325 end 326 326 end trunk/activerecord/test/aaa_create_tables_test.rb
r7972 r8365 34 34 def use_migrations? 35 35 unittest_sql_filename = ActiveRecord::Base.connection.adapter_name.downcase + ".sql" 36 not File.exist s? "#{@base_path}/#{unittest_sql_filename}"36 not File.exist? "#{@base_path}/#{unittest_sql_filename}" 37 37 end 38 38 39 39 def use_migrations_for_courses? 40 40 unittest2_sql_filename = ActiveRecord::Base.connection.adapter_name.downcase + "2.sql" 41 not File.exist s? "#{@base_path}/#{unittest2_sql_filename}"41 not File.exist? "#{@base_path}/#{unittest2_sql_filename}" 42 42 end 43 43 trunk/activerecord/test/associations_test.rb
r8347 r8365 56 56 require "tmpdir" 57 57 store_filename = File.join(Dir.tmpdir, "ar-pstore-association-test") 58 File.delete(store_filename) if File.exist s?(store_filename)58 File.delete(store_filename) if File.exist?(store_filename) 59 59 require "pstore" 60 60 apple = Firm.create("name" => "Apple") trunk/activesupport/test/multibyte_conformance.rb
r5223 r8365 11 11 unless File.exist?(to) 12 12 $stderr.puts "Downloading #{from} to #{to}" 13 unless File.exist s?(File.dirname(to))13 unless File.exist?(File.dirname(to)) 14 14 system "mkdir -p #{File.dirname(to)}" 15 15 end … … 32 32 end 33 33 34 Dir.mkdir(CACHE_DIR) unless File.exist s?(CACHE_DIR)34 Dir.mkdir(CACHE_DIR) unless File.exist?(CACHE_DIR) 35 35 Downloader.download(UNIDATA_URL + UNIDATA_FILE, CACHE_DIR + UNIDATA_FILE) 36 36 trunk/railties/builtin/rails_info/rails/info.rb
r7914 r8365 33 33 34 34 def freeze_edge_version 35 if File.exist s?(rails_vendor_root)35 if File.exist?(rails_vendor_root) 36 36 begin 37 37 Dir[File.join(rails_vendor_root, 'REVISION_*')].first.scan(/_(\d+)$/).first.first trunk/railties/environments/boot.rb
r8358 r8365 25 25 end 26 26 27 # FIXME : Ruby 1.9 27 28 def preinitialize 28 29 load(preinitializer_path) if File.exists?(preinitializer_path) trunk/railties/lib/commands/plugin.rb
r8175 r8365 215 215 def run_install_hook 216 216 install_hook_file = "#{rails_env.root}/vendor/plugins/#{name}/install.rb" 217 load install_hook_file if File.exist s? install_hook_file217 load install_hook_file if File.exist? install_hook_file 218 218 end 219 219 220 220 def run_uninstall_hook 221 221 uninstall_hook_file = "#{rails_env.root}/vendor/plugins/#{name}/uninstall.rb" 222 load uninstall_hook_file if File.exist s? uninstall_hook_file222 load uninstall_hook_file if File.exist? uninstall_hook_file 223 223 end 224 224 trunk/railties/lib/commands/runner.rb
r5203 r8365 42 42 $stderr.puts "Run '#{$0} -h' for help." 43 43 exit 1 44 elsif File.exist s?(code_or_file)44 elsif File.exist?(code_or_file) 45 45 eval(File.read(code_or_file)) 46 46 else trunk/railties/lib/rails_generator/commands.rb
r7963 r8365 208 208 source = source_path(relative_source) 209 209 destination = destination_path(relative_destination) 210 destination_exists = File.exist s?(destination)210 destination_exists = File.exist?(destination) 211 211 212 212 # If source and destination are identical then we're done. … … 307 307 def directory(relative_path) 308 308 path = destination_path(relative_path) 309 if File.exist s?(path)309 if File.exist?(path) 310 310 logger.exists relative_path 311 311 else … … 416 416 def file(relative_source, relative_destination, file_options = {}) 417 417 destination = destination_path(relative_destination) 418 if File.exist s?(destination)418 if File.exist?(destination) 419 419 logger.rm relative_destination 420 420 unless options[:pretend] … … 451 451 partial = File.join(parts) 452 452 path = destination_path(partial) 453 if File.exist s?(path)453 if File.exist?(path) 454 454 if Dir[File.join(path, '*')].empty? 455 455 logger.rmdir partial trunk/railties/lib/rails_generator/generators/applications/app/app_generator.rb
r8229 r8365 129 129 130 130 def mysql_socket_location 131 MYSQL_SOCKET_LOCATIONS.find { |f| File.exist s?(f) } unless RUBY_PLATFORM =~ /(:?mswin|mingw)/131 MYSQL_SOCKET_LOCATIONS.find { |f| File.exist?(f) } unless RUBY_PLATFORM =~ /(:?mswin|mingw)/ 132 132 end 133 133 trunk/railties/lib/rails_generator/secret_key_generator.rb
r8229 r8365 142 142 143 143 def self.supports_urandom? 144 File.exist s?('/dev/urandom')144 File.exist?('/dev/urandom') 145 145 end 146 146 trunk/railties/test/generators/generator_test_helper.rb
r8301 r8365 78 78 # asserts that the given file exists 79 79 def assert_file_exists(path) 80 assert File.exist s?("#{RAILS_ROOT}/#{path}"),"The file '#{path}' should exist"80 assert File.exist?("#{RAILS_ROOT}/#{path}"),"The file '#{path}' should exist" 81 81 end 82 82 … … 159 159 def assert_skipped_migration(name) 160 160 migration_file = "#{RAILS_ROOT}/db/migrate/001_#{name.to_s.underscore}.rb" 161 assert !File.exist s?(migration_file), "should not create migration #{migration_file}"161 assert !File.exist?(migration_file), "should not create migration #{migration_file}" 162 162 end 163 163 trunk/railties/test/generators/rails_model_generator_test.rb
r7840 r8365 47 47 RAILS_ROOT=tmp_dir 48 48 end 49 Dir.mkdir(RAILS_ROOT) unless File.exist s?(RAILS_ROOT)49 Dir.mkdir(RAILS_ROOT) unless File.exist?(RAILS_ROOT) 50 50 51 51 $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../../lib" … … 58 58 def setup 59 59 ActiveRecord::Base.pluralize_table_names = true 60 Dir.mkdir("#{RAILS_ROOT}/app") unless File.exist s?("#{RAILS_ROOT}/app")61 Dir.mkdir("#{RAILS_ROOT}/app/views") unless File.exist s?("#{RAILS_ROOT}/app/views")62 Dir.mkdir("#{RAILS_ROOT}/app/views/layouts") unless File.exist s?("#{RAILS_ROOT}/app/views/layouts")63 Dir.mkdir("#{RAILS_ROOT}/config") unless File.exist s?("#{RAILS_ROOT}/config")64 Dir.mkdir("#{RAILS_ROOT}/db") unless File.exist s?("#{RAILS_ROOT}/db")65 Dir.mkdir("#{RAILS_ROOT}/test") unless File.exist s?("#{RAILS_ROOT}/test")66 Dir.mkdir("#{RAILS_ROOT}/test/fixtures") unless File.exist s?("#{RAILS_ROOT}/test/fixtures")67 Dir.mkdir("#{RAILS_ROOT}/public") unless File.exist s?("#{RAILS_ROOT}/public")68 Dir.mkdir("#{RAILS_ROOT}/public/stylesheets") unless File.exist s?("#{RAILS_ROOT}/public/stylesheets")60 Dir.mkdir("#{RAILS_ROOT}/app") unless File.exist?("#{RAILS_ROOT}/app") 61 Dir.mkdir("#{RAILS_ROOT}/app/views") unless File.exist?("#{RAILS_ROOT}/app/views") 62 Dir.mkdir("#{RAILS_ROOT}/app/views/layouts") unless File.exist?("#{RAILS_ROOT}/app/views/layouts") 63 Dir.mkdir("#{RAILS_ROOT}/config") unless File.exist?("#{RAILS_ROOT}/config") 64 Dir.mkdir("#{RAILS_ROOT}/db") unless File.exist?("#{RAILS_ROOT}/db") 65 Dir.mkdir("#{RAILS_ROOT}/test") unless File.exist?("#{RAILS_ROOT}/test") 66 Dir.mkdir("#{RAILS_ROOT}/test/fixtures") unless File.exist?("#{RAILS_ROOT}/test/fixtures") 67 Dir.mkdir("#{RAILS_ROOT}/public") unless File.exist?("#{RAILS_ROOT}/public") 68 Dir.mkdir("#{RAILS_ROOT}/public/stylesheets") unless File.exist?("#{RAILS_ROOT}/public/stylesheets") 69 69 File.open("#{RAILS_ROOT}/config/routes.rb", 'w') do |f| 70 70 f<<"ActionController::Routing::Routes.draw do |map|\n\nend\n" trunk/railties/test/generators/rails_resource_generator_test.rb
r7839 r8365 47 47 RAILS_ROOT=tmp_dir 48 48 end 49 Dir.mkdir(RAILS_ROOT) unless File.exist s?(RAILS_ROOT)49 Dir.mkdir(RAILS_ROOT) unless File.exist?(RAILS_ROOT) 50 50 51 51 $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../../lib" … … 58 58 def setup 59 59 ActiveRecord::Base.pluralize_table_names = true 60 Dir.mkdir("#{RAILS_ROOT}/app") unless File.exist s?("#{RAILS_ROOT}/app")61 Dir.mkdir("#{RAILS_ROOT}/app/views") unless File.exist s?("#{RAILS_ROOT}/app/views")62 Dir.mkdir("#{RAILS_ROOT}/app/views/layouts") unless File.exist s?("#{RAILS_ROOT}/app/views/layouts")63 Dir.mkdir("#{RAILS_ROOT}/config") unless File.exist s?("#{RAILS_ROOT}/config")64 Dir.mkdir("#{RAILS_ROOT}/db") unless File.exist s?("#{RAILS_ROOT}/db")65 Dir.mkdir("#{RAILS_ROOT}/test") unless File.exist s?("#{RAILS_ROOT}/test")66 Dir.mkdir("#{RAILS_ROOT}/test/fixtures") unless File.exist s?("#{RAILS_ROOT}/test/fixtures")67 Dir.mkdir("#{RAILS_ROOT}/public") unless File.exist s?("#{RAILS_ROOT}/public")68 Dir.mkdir("#{RAILS_ROOT}/public/stylesheets") unless File.exist s?("#{RAILS_ROOT}/public/stylesheets")60 Dir.mkdir("#{RAILS_ROOT}/app") unless File.exist?("#{RAILS_ROOT}/app") 61 Dir.mkdir("#{RAILS_ROOT}/app/views") unless File.exist?("#{RAILS_ROOT}/app/views") 62 Dir.mkdir("#{RAILS_ROOT}/app/views/layouts") unless File.exist?("#{RAILS_ROOT}/app/views/layouts") 63 Dir.mkdir("#{RAILS_ROOT}/config") unless File.exist?("#{RAILS_ROOT}/config") 64 Dir.mkdir("#{RAILS_ROOT}/db") unless File.exist?("#{RAILS_ROOT}/db") 65 Dir.mkdir("#{RAILS_ROOT}/test") unless File.exist?("#{RAILS_ROOT}/test") 66 Dir.mkdir("#{RAILS_ROOT}/test/fixtures") unless File.exist?("#{RAILS_ROOT}/test/fixtures") 67 Dir.mkdir("#{RAILS_ROOT}/public") unless File.exist?("#{RAILS_ROOT}/public") 68 Dir.mkdir("#{RAILS_ROOT}/public/stylesheets") unless File.exist?("#{RAILS_ROOT}/public/stylesheets") 69 69 File.open("#{RAILS_ROOT}/config/routes.rb", 'w') do |f| 70 70 f<<"ActionController::Routing::Routes.draw do |map|\n\nend\n" trunk/railties/test/generators/rails_scaffold_generator_test.rb
r7108 r8365 49 49 RAILS_ROOT=tmp_dir 50 50 end 51 Dir.mkdir(RAILS_ROOT) unless File.exist s?(RAILS_ROOT)51 Dir.mkdir(RAILS_ROOT) unless File.exist?(RAILS_ROOT) 52 52 53 53 $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../../lib" … … 61 61 def setup 62 62 ActiveRecord::Base.pluralize_table_names = true 63 Dir.mkdir("#{RAILS_ROOT}/app") unless File.exist s?("#{RAILS_ROOT}/app")64 Dir.mkdir("#{RAILS_ROOT}/app/views") unless File.exist s?("#{RAILS_ROOT}/app/views")65 Dir.mkdir("#{RAILS_ROOT}/app/views/layouts") unless File.exist s?("#{RAILS_ROOT}/app/views/layouts")66 Dir.mkdir("#{RAILS_ROOT}/config") unless File.exist s?("#{RAILS_ROOT}/config")67 Dir.mkdir("#{RAILS_ROOT}/db") unless File.exist s?("#{RAILS_ROOT}/db")68 Dir.mkdir("#{RAILS_ROOT}/test") unless File.exist s?("#{RAILS_ROOT}/test")69 Dir.mkdir("#{RAILS_ROOT}/test/fixtures") unless File.exist s?("#{RAILS_ROOT}/test/fixtures")70 Dir.mkdir("#{RAILS_ROOT}/public") unless File.exist s?("#{RAILS_ROOT}/public")71 Dir.mkdir("#{RAILS_ROOT}/public/stylesheets") unless File.exist s?("#{RAILS_ROOT}/public/stylesheets")63 Dir.mkdir("#{RAILS_ROOT}/app") unless File.exist?("#{RAILS_ROOT}/app") 64 Dir.mkdir("#{RAILS_ROOT}/app/views") unless File.exist?("#{RAILS_ROOT}/app/views") 65 Dir.mkdir("#{RAILS_ROOT}/app/views/layouts") unless File.exist?("#{RAILS_ROOT}/app/views/layouts") 66 Dir.mkdir("#{RAILS_ROOT}/config") unless File.exist?("#{RAILS_ROOT}/config") 67 Dir.mkdir("#{RAILS_ROOT}/db") unless File.exist?("#{RAILS_ROOT}/db") 68 Dir.mkdir("#{RAILS_ROOT}/test") unless File.exist?("#{RAILS_ROOT}/test") 69 Dir.mkdir("#{RAILS_ROOT}/test/fixtures") unless File.exist?("#{RAILS_ROOT}/test/fixtures") 70 Dir.mkdir("#{RAILS_ROOT}/public") unless File.exist?("#{RAILS_ROOT}/public") 71 Dir.mkdir("#{RAILS_ROOT}/public/stylesheets") unless File.exist?("#{RAILS_ROOT}/public/stylesheets") 72 72 File.open("#{RAILS_ROOT}/config/routes.rb", 'w') do |f| 73 73 f<<"ActionController::Routing::Routes.draw do |map|\n\nend\n"