Sha256: d6d9c2cf88be2efc5e5e98994765086eea059367b06f157b85e6900e75d431ad

Contents?: true

Size: 1.14 KB

Versions: 6

Compression:

Stored size: 1.14 KB

Contents

require 'generators/boilerplate/resource_helpers'

module Boilerplate
  module Generators
    class InstallGenerator < Rails::Generators::Base
      include ResourceHelpers

      source_root File.expand_path("../templates", __FILE__)

      desc 'This generator installs an application.html.erb file conforming to the html5 boilerplate'

      def copy_application
        template 'index.html', "app/views/layouts/application.html.erb"
      end

      def inject_reset_css
        inject_into_file "app/assets/stylesheets/application.css", :before => " *= require_self" do
          " *= require reset\n"
        end
      end
      def inject_plugins_css
        inject_into_file "app/assets/javascripts/application.js", :before => "//= require jquery\n" do
          "//= require plugins\n"
        end
      end
      def copies_files
        %w{robots.txt crossdomain.xml humans.txt favicon.ico apple-touch-icon-114x114-precomposed.png apple-touch-icon-57x57-precomposed.png apple-touch-icon-72x72-precomposed.png apple-touch-icon-precomposed.png apple-touch-icon.png}.each do |f|
          copy_file f, "public/#{f}"
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rails-boilerplate-0.1.5 lib/generators/boilerplate/install/install_generator.rb
rails-boilerplate-0.1.4 lib/generators/boilerplate/install/install_generator.rb
rails-boilerplate-0.1.3 lib/generators/boilerplate/install/install_generator.rb
rails-boilerplate-0.1.2 lib/generators/boilerplate/install/install_generator.rb
rails-boilerplate-0.1.1 lib/generators/boilerplate/install/install_generator.rb
rails-boilerplate-0.1.0 lib/generators/boilerplate/install/install_generator.rb