dfl / open_flash_chart forked from pullmonkey/open_flash_chart

The ruby on rails plugin for teethgrinder's Open Flash Chart (version 2)

This URL has Read+Write access

open_flash_chart / install.rb
100644 18 lines (14 sloc) 0.631 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# 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