Sha256: 73e35a26509ed08f311070e80a191a8c481fd2ced05cf8b7cc8e6ff70499d7c9

Contents?: true

Size: 1.26 KB

Versions: 99

Compression:

Stored size: 1.26 KB

Contents

# 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_p(destination) unless File.exist?(destination)
  FileUtils.cp_r(Dir.glob(source+'/*.*'), destination)
end

directory = File.dirname(__FILE__)

copy_files("/public", "/public", directory)

available_frontends = Dir[File.join(directory, 'frontends', '*')].collect { |d| File.basename d }
[ :stylesheets, :javascripts, :images].each do |asset_type|
  path = "/public/#{asset_type}/active_scaffold"
  copy_files(path, path, directory)
  
  File.open(File.join(Rails.root, path, 'DO_NOT_EDIT'), 'w') do |f|
    f.puts "Any changes made to files in sub-folders will be lost."
    f.puts "See http://activescaffold.com/tutorials/faq#custom-css."
  end

  available_frontends.each do |frontend|
    source = "/frontends/#{frontend}/#{asset_type}/"
    destination = "/public/#{asset_type}/active_scaffold/#{frontend}"
    copy_files(source, destination, directory)
  end
end

end

Version data entries

99 entries across 99 versions & 3 rubygems

Version Path
brisk-bills-0.8.2 vendor/plugins/active_scaffold/install_assets.rb
brisk-bills-0.8.1 vendor/plugins/active_scaffold/install_assets.rb
six-updater-web-0.24.15 lib/six-updater-web/vendor/plugins/active_scaffold/install_assets.rb
six-updater-web-0.24.14 lib/six-updater-web/vendor/plugins/active_scaffold/install_assets.rb
six-updater-web-0.24.13 lib/six-updater-web/vendor/plugins/active_scaffold/install_assets.rb
six-updater-web-0.24.12 lib/six-updater-web/vendor/plugins/active_scaffold/install_assets.rb
six-updater-web-0.24.11 lib/six-updater-web/vendor/plugins/active_scaffold/install_assets.rb
six-updater-web-0.24.10 lib/six-updater-web/vendor/plugins/active_scaffold/install_assets.rb
six-updater-web-0.24.9 lib/six-updater-web/vendor/plugins/active_scaffold/install_assets.rb
six-updater-web-0.24.8 lib/six-updater-web/vendor/plugins/active_scaffold/install_assets.rb
six-updater-web-0.24.7 lib/six-updater-web/vendor/plugins/active_scaffold/install_assets.rb
six-updater-web-0.24.6 lib/six-updater-web/vendor/plugins/active_scaffold/install_assets.rb
six-updater-web-0.24.5 lib/six-updater-web/vendor/plugins/active_scaffold/install_assets.rb
six-updater-web-0.24.4 lib/six-updater-web/vendor/plugins/active_scaffold/install_assets.rb
six-updater-web-0.24.3 lib/six-updater-web/vendor/plugins/active_scaffold/install_assets.rb
six-updater-web-0.24.2 lib/six-updater-web/vendor/plugins/active_scaffold/install_assets.rb
six-updater-web-0.24.1 lib/six-updater-web/vendor/plugins/active_scaffold/install_assets.rb
six-updater-web-0.24.0 lib/six-updater-web/vendor/plugins/active_scaffold/install_assets.rb
six-updater-web-0.23.7 lib/six-updater-web/vendor/plugins/active_scaffold/install_assets.rb
six-updater-web-0.23.6 lib/six-updater-web/vendor/plugins/active_scaffold/install_assets.rb