2010-03-04 06:22:45 +00:00
|
|
|
namespace :jrails do
|
2010-03-15 15:47:32 +00:00
|
|
|
|
|
|
|
namespace :js do
|
2010-03-04 06:22:45 +00:00
|
|
|
desc "Copies the jQuery and jRails javascripts to public/javascripts"
|
2010-03-15 15:47:32 +00:00
|
|
|
task :install do
|
2010-03-04 06:22:45 +00:00
|
|
|
puts "Copying files..."
|
|
|
|
project_dir = RAILS_ROOT + '/public/javascripts/'
|
2010-03-15 15:47:32 +00:00
|
|
|
scripts = Dir[File.join(File.dirname(__FILE__), '..', '/javascripts/', '*.js')]
|
2010-03-04 06:22:45 +00:00
|
|
|
FileUtils.cp(scripts, project_dir)
|
|
|
|
puts "files copied successfully."
|
|
|
|
end
|
2010-03-15 15:47:32 +00:00
|
|
|
|
|
|
|
desc 'Remove the prototype / script.aculo.us javascript files'
|
|
|
|
task :scrub do
|
|
|
|
puts "Removing files..."
|
|
|
|
files = %W[controls.js dragdrop.js effects.js prototype.js]
|
|
|
|
project_dir = File.join(RAILS_ROOT, 'public', 'javascripts')
|
|
|
|
files.each do |fname|
|
|
|
|
FileUtils.rm(File.join(project_dir, fname)) if File.exists?(File.join(project_dir, fname))
|
|
|
|
end
|
|
|
|
puts "files removed successfully."
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2010-03-04 06:22:45 +00:00
|
|
|
end
|