class NpmPipeline::Generators::BrunchGenerator
Public Instance Methods
create_brunch_config()
click to toggle source
# File lib/generators/npm_pipeline/brunch_generator.rb, line 13 def create_brunch_config template 'brunch-config.js', 'brunch-config.js' end
create_package_json()
click to toggle source
# File lib/generators/npm_pipeline/brunch_generator.rb, line 9 def create_package_json template 'package.json', 'package.json' end
create_sample_brunch_css()
click to toggle source
# File lib/generators/npm_pipeline/brunch_generator.rb, line 24 def create_sample_brunch_css create_file 'app/brunch/example.css', %(html:before { content: 'Brunch assets added successfully! Edit app/brunch/example.css or remove it.'; display: block; padding: 20px; background: #ffc; color: #111; position: fixed; top: 16px; right: 16px; max-width: 600px; z-index: 10000; font-family: sans-serif; font-size: 14px; line-height: 1.6; }\n) end
create_sample_brunch_js()
click to toggle source
# File lib/generators/npm_pipeline/brunch_generator.rb, line 29 def create_sample_brunch_js create_file 'app/brunch/example.js', "alert('Brunch works!')" end
update_assets()
click to toggle source
# File lib/generators/npm_pipeline/brunch_generator.rb, line 17 def update_assets append_to_file 'app/assets/stylesheets/application.css', "/*\n *= require brunch/app\n */\n" append_to_file 'app/assets/javascripts/application.js', "//= require brunch/app\n" end
update_gitignore()
click to toggle source
# File lib/generators/npm_pipeline/brunch_generator.rb, line 34 def update_gitignore append_to_file '.gitignore', "\n/node_modules" + "\n/vendor/assets/stylesheets/brunch" + "\n/vendor/assets/javascripts/brunch\n" end