Sha256: 831a12e7f603c3d2eaf7b4c10c7c1dfc1e8f6ccdfaa65cd07c720fff0f251728
Contents?: true
Size: 1.16 KB
Versions: 19
Compression:
Stored size: 1.16 KB
Contents
module TwbsLessRails module Generators class InstallGenerator < ::Rails::Generators::Base source_root File.expand_path(File.join(File.dirname(__FILE__), 'templates')) desc "This generator installs Bootstrap to Asset Pipeline" def copy_assets js_manifest = 'app/assets/javascripts/application.js' if File.exist?(File.join(destination_root, js_manifest)) insert_into_file js_manifest, "//= require twbs/bootstrap\n", after: "jquery_ujs\n" else copy_file 'application.js', js_manifest end css_manifest = 'app/assets/stylesheets/application.css' if File.exist?(File.join(destination_root, css_manifest)) insert_into_file css_manifest, " *= stub twbs-variables\n *= require twbs\n", after: "require_self\n" else copy_file 'application.css', css_manifest end end def copy_bootstrap copy_file 'twbs.js.coffee', 'app/assets/javascripts/twbs.js.coffee' copy_file 'twbs-variables.css.less', 'app/assets/stylesheets/twbs-variables.css.less' copy_file 'twbs.css.less', 'app/assets/stylesheets/twbs.css.less' end end end end
Version data entries
19 entries across 19 versions & 1 rubygems