Skip to content
Browse files

copy over assets on plugin installation

  • Loading branch information...
1 parent 19f0b72 commit 6757a86000a0e96a6ea3afdd55e0a90288fb8dac @dfl dfl committed
Showing with 17 additions and 1 deletion.
  1. 0 assets/{ → javascripts}/swfobject.js
  2. +17 −1 install.rb
View
0 assets/swfobject.js → assets/javascripts/swfobject.js
File renamed without changes.
View
18 install.rb
@@ -1 +1,17 @@
-# Install hook code here
+# Workaround a problem with script/plugin and http-based repos.
+# See http://dev.rubyonrails.org/ticket/8189
+Dir.chdir(Dir.getwd.sub(/vendor.*/, '')) do
+
+ ##
+ ## Copy over asset files (javascript/css/images) from the plugin directory to public/
+ ##
+
+ def copy_files(source_path, destination_path, directory)
+ source, destination = File.join(directory, source_path), File.join(RAILS_ROOT, destination_path)
+ # FileUtils.mkdir(destination) unless File.exist?(destination)
+ FileUtils.cp_r(Dir.glob(source+'/*.*'), destination)
+ end
+
+ directory = File.dirname(__FILE__)
+ copy_files("/assets", "/public", directory)
+end

0 comments on commit 6757a86

Please sign in to comment.
Something went wrong with that request. Please try again.