require 'rails/generators' require 'rails/generators/migration' module BoilerplateEngine class InstallGenerator < Rails::Generators::Base source_root File.join(File.dirname(__FILE__), 'templates') def create_static_assets copy_file "apple-touch-icon-114x114-precomposed.png", "public/apple-touch-icon-114x114-precomposed.png" copy_file "apple-touch-icon-72x72-precomposed.png", "public/apple-touch-icon-72x72-precomposed.png" copy_file "apple-touch-icon.png", "public/apple-touch-icon.png" copy_file "apple-touch-icon-57x57-precomposed.png", "public/apple-touch-icon-57x57-precomposed.png" copy_file "apple-touch-icon-precomposed.png", "public/apple-touch-icon-precomposed.png" copy_file "crossdomain.xml", "public/crossdomain.xml" copy_file "robots.txt", "public/robots.txt" copy_file "humans.txt", "public/humans.txt" copy_file "javascripts/libs/dd_belatedpng.js", "public/boilerplate_engine/javascripts/libs/dd_belatedpng.js" copy_file "javascripts/libs/jquery-1.5.2.js", "public/boilerplate_engine/javascripts/libs/jquery-1.5.2.js" copy_file "javascripts/libs/jquery-1.5.2.min.js", "public/boilerplate_engine/javascripts/libs/jquery-1.5.2.min.js" copy_file "javascripts/libs/modernizr-1.7.min.js", "public/boilerplate_engine/javascripts/libs/modernizr-1.7.min.js" copy_file "javascripts/plugins.js", "public/boilerplate_engine/javascripts/plugins.js" copy_file "stylesheets/style.css", "public/boilerplate_engine/stylesheets/style.css" copy_file "stylesheets/handheld.css", "public/boilerplate_engine/stylesheets/handheld.css" end def create_view_overrides create_file "app/views/boilerplate/_css_addons.html.erb" create_file "app/views/boilerplate/_head_javascript_addons.html.erb" create_file "app/views/boilerplate/_asynch_javascript_addons.html.erb" create_file "app/views/boilerplate/_meta_tags_addons.html.erb" create_file "app/views/boilerplate/_layout.html.erb", "<%= yield %>" copy_file "../../../../../app/views/layouts/application.html.erb", "app/views/layouts/application.html.erb" copy_file "../../../../../app/views/home/index.html.erb", "app/views/home/index.html.erb" end def create_yettings copy_file "yettings/boilerplate.yml", "config/yettings/boilerplate.yml" end def delete_index_html remove_file "public/index.html" end end end