diff options
-rw-r--r-- | railties/lib/rails/tasks/railties.rake | 19 | ||||
-rw-r--r-- | railties/test/railties/engine_test.rb | 57 |
2 files changed, 0 insertions, 76 deletions
diff --git a/railties/lib/rails/tasks/railties.rake b/railties/lib/rails/tasks/railties.rake index 23d81e6671..77cf2b7707 100644 --- a/railties/lib/rails/tasks/railties.rake +++ b/railties/lib/rails/tasks/railties.rake @@ -1,23 +1,4 @@ namespace :railties do - # desc "Create symlinks to railties public directories in application's public directory." - task :create_symlinks => :environment do - paths = Rails.application.config.static_asset_paths.dup - app_public_path = Rails.application.paths["public"].first - - paths.each do |mount_path, path| - symlink_path = File.join(app_public_path, mount_path) - if File.exist?(symlink_path) - File.symlink?(symlink_path) ? FileUtils.rm(symlink_path) : next - end - - next unless File.exist?(path) - - File.symlink(path, symlink_path) - - puts "Created symlink #{symlink_path} -> #{path}" - end - end - namespace :install do desc "Copies missing assets from Railties (e.g. plugins, engines). You can specify Railties to use with FROM=railtie1,railtie2" task :assets => :rails_env do diff --git a/railties/test/railties/engine_test.rb b/railties/test/railties/engine_test.rb index db74e41472..4b52260ecc 100644 --- a/railties/test/railties/engine_test.rb +++ b/railties/test/railties/engine_test.rb @@ -568,63 +568,6 @@ module RailtiesTest assert rack_body(response[2]) =~ /name="post\[title\]"/ end - test "creating symlinks" do - @plugin.write "lib/bukkits.rb", <<-RUBY - module Bukkits - class Engine < ::Rails::Engine - isolate_namespace(Bukkits) - end - end - RUBY - - @plugin.write "public/hello.txt", "foo" - @plugin.write "alternate_public/hello.txt", "bar" - - Dir.chdir(app_path) do - output = `rake railties:create_symlinks` - - assert_match /Created symlink/, output - assert_match /#{app_path}\/public\/bukkits/, output - assert_match /#{@plugin.path}\/public/, output - - assert File.symlink?(File.join(app_path, 'public/bukkits')) - assert_equal "foo\n", File.read(File.join(app_path, 'public/bukkits/hello.txt')) - - @plugin.write "lib/bukkits.rb", <<-RUBY - module Bukkits - class Engine < ::Rails::Engine - isolate_namespace(Bukkits) - paths["public"] = "#{File.join(@plugin.path, "alternate_public")}" - end - end - RUBY - - output = `rake railties:create_symlinks` - - assert_match /Created symlink/, output - assert_match /#{app_path}\/public\/bukkits/, output - assert_match /#{@plugin.path}\/alternate_public/, output - - assert File.symlink?(File.join(app_path, 'public/bukkits')) - assert_equal "bar\n", File.read(File.join(app_path, 'public/bukkits/hello.txt')) - - @plugin.write "lib/bukkits.rb", <<-RUBY - module Bukkits - class Engine < ::Rails::Engine - isolate_namespace(Bukkits) - paths["public"] = "#{File.join(@plugin.path, "not_existing")}" - end - end - RUBY - - FileUtils.rm File.join(app_path, 'public/bukkits') - - output = `rake railties:create_symlinks` - assert_no_match /Created symlink/, output - assert !File.exist?(File.join(app_path, 'public/bukkits')) - end - end - test "loading seed data" do @plugin.write "db/seeds.rb", <<-RUBY Bukkits::Engine.config.bukkits_seeds_loaded = true |