Class: TwbsSassRails::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- TwbsSassRails::Generators::InstallGenerator
- Defined in:
- lib/generators/twbs_sass_rails/install/install_generator.rb
Instance Method Summary collapse
Instance Method Details
#copy_assets ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/generators/twbs_sass_rails/install/install_generator.rb', line 8 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", before: " *= require_tree .\n" else copy_file 'application.css', css_manifest end end |
#copy_bootstrap ⇒ Object
24 25 26 27 28 |
# File 'lib/generators/twbs_sass_rails/install/install_generator.rb', line 24 def copy_bootstrap copy_file 'twbs.js.coffee', 'app/assets/javascripts/twbs.js.coffee' copy_file 'twbs-variables.scss', 'app/assets/stylesheets/twbs-variables.scss' copy_file 'twbs.scss', 'app/assets/stylesheets/twbs.scss' end |