copy files from original dir to other dir

namespace :ae do
  desc "Copies the ActiveExt javascripts, images and css to public.  HINT: use rake ae:symlink if you are unix based systems"

  task :copy_assets do
    puts "1. Creating /public/assets/activeext if it doesn't exist"
    FileUtils.mkdir_p(RAILS_ROOT + '/public/assets/activeext')

    ae_public_directory = RAILS_ROOT + '/public/assets/activeext'
    ae_plugin_dir = File.join(File.dirname(__FILE__), '..')
    ae_vendor_assets_files = Dir[ae_plugin_dir + '/public/assets/activeext/*']

    puts "2. Copying JS, CSS and images to " + ae_public_directory
    FileUtils.cp_r(ae_vendor_assets_files, ae_public_directory)

    puts "3. Creating a /config/activeext directory if it doesn't exist"
    FileUtils.mkdir_p(RAILS_ROOT + '/config/activeext')
  end
end

你可能感兴趣的:(css,unix,Rails)