Permalink
Browse files

Remove task for creating symlinks for railties

  • Loading branch information...
1 parent a2c52f1 commit 72545da09146ea84506b6e4a023df2453f137fa7 @drogus drogus committed with josevalim Oct 13, 2010
Showing with 0 additions and 76 deletions.
  1. +0 −19 railties/lib/rails/tasks/railties.rake
  2. +0 −57 railties/test/railties/engine_test.rb
@@ -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
@@ -568,63 +568,6 @@ def new
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

0 comments on commit 72545da

Please sign in to comment.