Permalink
Browse files

FileUtils error fixed

  • Loading branch information...
1 parent 61e04d2 commit ad9029ddf22201690d296a23d378116294df9dee @xedin xedin committed Dec 8, 2009
Showing with 6 additions and 3 deletions.
  1. +6 −3 install.rb
View
@@ -1,3 +1,5 @@
+require 'rubygems'
+
puts 'Copying files...'
public_path = File.join(RAILS_ROOT, 'public')
@@ -11,22 +13,23 @@
['facebox.js', 'facebox.pack.js'].each do |js_file|
dest_file = File.join(javascripts_path, js_file)
src_file = File.join(current_path, 'javascripts', js_file)
- FileUtils.cp_r(src_file, path_file)
+ FileUtils.cp_r(src_file, dest_file)
end
# copying CSS
FileUtils.cp_r(File.join(current_path, 'stylesheets', 'facebox.css'), File.join(stylesheets_path, 'facebox.css'))
# copying images
-Dir.mkdir images_path
+Dir.mkdir(images_path) unless File.exists?(images_path)
+
plugin_images_path = File.join(current_path, 'images')
Dir.foreach(plugin_images_path) do |image|
src_image = File.join(plugin_images_path, image)
if File.file?(src_image)
dest_image = File.join(images_path, image)
- FileUtils.cp_r(src_image, desc_image)
+ FileUtils.cp_r(src_image, dest_image)
end
end

0 comments on commit ad9029d

Please sign in to comment.