class WebpackRails::InstallGenerator
Public Instance Methods
add_foreman_to_gemfile()
click to toggle source
# File lib/generators/webpack_rails/install_generator.rb, line 8 def add_foreman_to_gemfile gem 'foreman' end
add_to_gitignore()
click to toggle source
# File lib/generators/webpack_rails/install_generator.rb, line 33 def add_to_gitignore append_to_file ".gitignore" do " # Added by webpack-rails /node_modules /public/webpack ".strip_heredoc end end
copy_package_json()
click to toggle source
# File lib/generators/webpack_rails/install_generator.rb, line 16 def copy_package_json copy_file "package.json", "package.json" end
copy_procfile()
click to toggle source
# File lib/generators/webpack_rails/install_generator.rb, line 12 def copy_procfile copy_file "Procfile", "Procfile" end
copy_webpack_conf()
click to toggle source
# File lib/generators/webpack_rails/install_generator.rb, line 20 def copy_webpack_conf copy_file "webpack.config.js", "config/webpack.config.js" end
create_webpack_application_js()
click to toggle source
# File lib/generators/webpack_rails/install_generator.rb, line 24 def create_webpack_application_js empty_directory "webpack" create_file "webpack/application.js" do " console.log("Hello world!"); ".strip_heredoc end end
run_bundle_install()
click to toggle source
# File lib/generators/webpack_rails/install_generator.rb, line 47 def run_bundle_install run "bundle install" if yes?("Would you like us to run 'bundle install' for you?") end
run_npm_install()
click to toggle source
# File lib/generators/webpack_rails/install_generator.rb, line 43 def run_npm_install run "npm install" if yes?("Would you like us to run 'npm install' for you?") end
whats_next()
click to toggle source
# File lib/generators/webpack_rails/install_generator.rb, line 51 def whats_next puts " We've set up the basics of webpack-rails for you, but you'll still need to: 1. Add the 'application' entry point in to your layout, and 2. Run 'foreman start' to run the webpack-dev-server and rails server See the README.md for this gem at https://github.com/mipearson/webpack-rails/blob/master/README.md for more info. Thanks for using webpack-rails! ".strip_heredoc end