Module: Stationed::Generators::Plugins::Styles
- Included in:
- AppGenerator
- Defined in:
- lib/stationed/generators/plugins/styles.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.prepended(base) ⇒ Object
5 6 7 8 9 10 |
# File 'lib/stationed/generators/plugins/styles.rb', line 5 def self.prepended(base) base.class_option :styles, type: :boolean, default: true, desc: 'Include Bourbon, Neat, Bitters and Normalize.css' end |
Instance Method Details
#finish_template ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/stationed/generators/plugins/styles.rb', line 12 def finish_template return super unless [:styles] gem 'bourbon' gem 'neat' gem 'bitters' remove_file 'app/assets/stylesheets/application.css' copy_file 'application.scss', 'app/assets/stylesheets/application.scss' copy_file 'layout.scss', 'app/assets/stylesheets/_layout.scss' copy_file '_input_wrapper_default.scss', 'app/assets/stylesheets/modules/_input_wrapper_default.scss' copy_file '_error_notification.scss', 'app/assets/stylesheets/modules/_error_notification.scss' copy_file 'normalize.css', 'vendor/assets/stylesheets/normalize.css' super end |
#run_bundle ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/stationed/generators/plugins/styles.rb', line 26 def run_bundle super return unless [:styles] run 'bitters install' FileUtils.mv 'base', 'app/assets/stylesheets/base' gsub_file 'app/assets/stylesheets/base/_base.scss', %r{// @import}, '@import' end |