Sha256: 9e3b537c8d9ba309f4a4d13c0662af94df6612344bf52c974e734e9937e86290
Contents?: true
Size: 1.17 KB
Versions: 25
Compression:
Stored size: 1.17 KB
Contents
require 'rails/generators' module Umlaut class AssetHooks < Rails::Generators::Base def add_to_stylesheet_manifest existing = IO.read("app/assets/stylesheets/application.css") unless existing.include?('Umlaut') after = if existing.include?("require_self") "require_self" else "/*" end insert_into_file "app/assets/stylesheets/application.css", :after => after do %q{ * * The base Umlaut styles: *= require 'umlaut' *} end else say_status("skipped", "Your application.css already references Umlaut", :yellow) end end def add_to_javascript_manifest unless IO.read("app/assets/javascripts/application.js").include?('Umlaut') prepend_to_file "app/assets/javascripts/application.js" do %q{ // Umlaut javascript required for proper functionality. The 'umlaut' file // also forces require of jquery and jquery-ui, dependencies. //= require 'umlaut' } end else say_status("skipped", "Your application.js already references Umlaut", :yellow) end end end end
Version data entries
25 entries across 25 versions & 1 rubygems