#!/usr/bin/env ruby # cp ../environment.rb config/environment.rb require 'fileutils' install_from = File.join(File.dirname(__FILE__), "..", "install") install_to = Dir.pwd FileUtils.mkdir_p(File.join(install_to, "public", "css_push")) FileUtils.mkdir_p(File.join(install_to, "public", "javascripts", "css_push")) puts "Installing CSS-Push..." FileUtils.cp(File.join(install_from, "swfobject.js") , File.join(install_to, "public", "javascripts", "css_push")) FileUtils.cp(File.join(install_from, "juggernaut.js") , File.join(install_to, "public", "javascripts", "css_push")) FileUtils.cp(File.join(install_from, "css_push.js") , File.join(install_to, "public", "javascripts", "css_push")) FileUtils.cp(File.join(install_from, "juggernaut.swf") , File.join(install_to, "public", "css_push")) FileUtils.cp(File.join(install_from, "expressinstall.swf"), File.join(install_to, "public", "css_push")) FileUtils.cp(File.join(install_from, "juggernaut_hosts.yml"), File.join(install_to, "config")) unless File.exist?(File.join(install_to, "config", "juggernaut_hosts.yml")) FileUtils.cp(File.join(install_from, "juggernaut.yml"), File.join(install_to, "config")) unless File.exist?(File.join(install_to, "config", "juggernaut.yml")) File.open('config/environments/development.rb', 'a') do |f| f.write("\n\nconfig.gem 'CSS-Push', :lib => 'css_push'\n") end FileUtils.cp(File.join(install_from, "css_push_initializer.rb"), File.join(install_to, "config", "initializers")) puts "CSS-Push has been successfully installed." puts "" puts IO.read(File.join(File.dirname(__FILE__), "..", 'README')) puts ""