Sha256: cc04d05c0cbd9a2bf221482253e5230e4af13abf94bace5387de0f09328eb7c1

Contents?: true

Size: 1.08 KB

Versions: 5

Compression:

Stored size: 1.08 KB

Contents

require 'fileutils'

desc "Copy the webshims to public/webshims so dynamic features will work."
task "webshims:update_public" do
  shim_root = Webshims::Rails::Engine.root.join('lib', 'assets', 'javascripts', 'webshims')
  FileUtils.cp_r(shim_root, Rails.root.join('public'))

  puts "Updated webshims files in /public/webshims"
end


desc "Copy the webshims to public/webshims/[version] for cache-busting."
task "webshims:update_public_versioned" do
  shim_root = Webshims::Rails::Engine.root.join('lib', 'assets', 'javascripts', 'webshims')
  FileUtils.rm_rf(Rails.root.join('public', 'webshims'))
  FileUtils.mkdir(Rails.root.join('public', 'webshims'))
  FileUtils.cp_r(shim_root, Rails.root.join('public', 'webshims', Webshims::Rails::WEBSHIMS_VERSION))

  puts "Updated webshims files in /public/webshims/#{Webshims::Rails::WEBSHIMS_VERSION}/"
  puts "\nBe sure your webshims options are set as follows:"
  puts %Q{    $.webshims.setOptions('basePath', '/webshims/#{Webshims::Rails::WEBSHIMS_VERSION}/shims/')}
  puts "\nYou can use ERB to dynamically set this path; See README for more information."
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
webshims-rails-1.16.0 lib/tasks/webshims.rake
webshims-rails-1.15.10 lib/tasks/webshims.rake
webshims-rails-1.15.9 lib/tasks/webshims.rake
webshims-rails-1.15.8 lib/tasks/webshims.rake
webshims-rails-1.15.6.4 lib/tasks/webshims.rake