Sha256: 70df356126d1f412bf0799981ed8d4ebb22731a29d9ffe64c8ee70eb36461714

Contents?: true

Size: 698 Bytes

Versions: 5

Compression:

Stored size: 698 Bytes

Contents

module Bootstrap
  module Generators
    class InstallGenerator < Rails::Generators::Base
      #source_root File.expand_path("../../templates", __FILE__)

      desc "Install bootstrap support to your application."

      def install_stylesheets
        line = " *= require_tree ."
        gsub_file 'app/assets/stylesheets/application.css', /(#{Regexp.escape(line)})/mi do |match|
          " *= require bootstrap\n#{match}"
        end
      end

      def install_javascript
        line = "//= require_tree ."
        gsub_file 'app/assets/javascripts/application.js', /(#{Regexp.escape(line)})/mi do |match|
          "//= require bootstrap\n#{match}"
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rails-bootstrap-3.0.0.4 lib/generators/bootstrap/install_generator.rb
rails-bootstrap-3.0.0.3 lib/generators/bootstrap/install_generator.rb
rails-bootstrap-3.0.0.2 lib/generators/bootstrap/install_generator.rb
rails-bootstrap-2.3.2.0 lib/generators/bootstrap/install_generator.rb
rails-bootstrap-3.0.0.1 lib/generators/bootstrap/install_generator.rb