class NpmPipeline::Generators::GulpGenerator
Public Instance Methods
create_gulpfile()
click to toggle source
# File lib/generators/npm_pipeline/gulp_generator.rb, line 13 def create_gulpfile template 'gulpfile.js', 'gulpfile.js' end
create_package_json()
click to toggle source
# File lib/generators/npm_pipeline/gulp_generator.rb, line 9 def create_package_json template 'package.json', 'package.json' end
create_sample_css()
click to toggle source
# File lib/generators/npm_pipeline/gulp_generator.rb, line 24 def create_sample_css create_file 'app/gulp/css/example.css', %(html:before { content: 'Gulp assets added successfully! Edit app/gulp/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_js()
click to toggle source
# File lib/generators/npm_pipeline/gulp_generator.rb, line 29 def create_sample_js create_file 'app/gulp/js/example.js', "alert('Gulp works!')" end
update_assets()
click to toggle source
# File lib/generators/npm_pipeline/gulp_generator.rb, line 17 def update_assets append_to_file 'app/assets/stylesheets/application.css', "/*\n *= require gulp/app\n */\n" append_to_file 'app/assets/javascripts/application.js', "//= require gulp/app\n" end
update_gitignore()
click to toggle source
# File lib/generators/npm_pipeline/gulp_generator.rb, line 34 def update_gitignore append_to_file '.gitignore', "\n/node_modules" + "\n/vendor/assets/stylesheets/gulp" + "\n/vendor/assets/javascripts/gulp\n" end