Changeset 570

Show
Ignore:
Timestamp:
10/26/07 15:27:54 (10 months ago)
Author:
seancribbs
Message:

Update Reorder extension update:public task to match generated task. Closes #511.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/extensions/reorder/lib/tasks/reorder_extension_tasks.rake

    r530 r570  
    1616        desc "Copies the public assets of the Reorder extension into the instance's public directory" 
    1717        task :public => :environment do 
    18           root = File.expand_path(ReorderExtension.root) 
    19           sources = Dir.glob(File.join(root, 'public', '*')) 
    20           radiant_root = File.expand_path(RAILS_ROOT) 
    21           destination = File.join(radiant_root, 'public') 
    22           cp_r sources, destination 
     18          is_svn_or_dir = proc {|path| path =~ /\.svn/ || File.directory?(path) } 
     19          Dir[ReorderExtension.root + "/public/**/*"].reject(&is_svn_or_dir).each do |file| 
     20            path = file.sub(ReorderExtension.root, '') 
     21            directory = File.dirname(path) 
     22            puts "Copying #{path}..." 
     23            mkdir_p RAILS_ROOT + directory 
     24            cp file, RAILS_ROOT + path 
     25          end 
    2326        end 
    2427      end