I am just getting started with Rake. I am trying to create a rake task
from within a rails plugin to copy some asset files (inside /assets in
my plugin folder) to my rails application /public folder.
How can I achieve this?

I am not sure whether to use FileUtils or File. Where AM I in rake
terms. No matter what I do it keeps saying it can't find the file. Do
I need to use File.join or is there a better rake way? Any resources
out there on how to use rake for file oriented tasks like this? Should
I use a generator instead?

---
require 'ftools' #file tools

desc "Installs famfam icons and stylesheets in application"
namespace :famfam do
  desc "famfam icons and stylesheets in application"
  task :install => :environment do
    puts "Copying famfam icons from ../assets/icons to " + RAILS_ROOT
+ "/public/styles"
    FileUtils.cd '..'
    puts FileUtils.pwd
    puts File.dirname(__FILE__)
    File.cp "/assets/icons", RAILS_ROOT + "/public/styles"
  end
end
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to