class WebpackIntegrator::InstallGenerator
Public Instance Methods
add_client_route()
click to toggle source
# File lib/generators/webpack_integrator/install_generator.rb, line 24 def add_client_route route "match '*path/', to: 'client#index', format: false, via: :get" route "root 'client#index'" end
add_gems()
click to toggle source
# File lib/generators/webpack_integrator/install_generator.rb, line 20 def add_gems gem "foreman", group: :development run "bundle" end
add_public_webpack_dir_to_gitignore()
click to toggle source
# File lib/generators/webpack_integrator/install_generator.rb, line 28 def add_public_webpack_dir_to_gitignore system 'echo "public/webpack" >> .gitignore' end
add_yarn_dependencies()
click to toggle source
# File lib/generators/webpack_integrator/install_generator.rb, line 17 def add_yarn_dependencies run "cd client && yarn add webpack webpack-cli babel-loader babel-preset-es2015" end
copy_install_file()
click to toggle source
# File lib/generators/webpack_integrator/install_generator.rb, line 7 def copy_install_file files = %w[client/webpack.config.js client/package.json client/.babelrc client/src/index.js app/controllers/client_controller.rb app/views/client/index.html.erb Procfile.dev] files.each {|file| copy_file(file,file)} end
print_message()
click to toggle source
# File lib/generators/webpack_integrator/install_generator.rb, line 31 def print_message puts " ++++++++++++++++++++++++++++++++++++++" puts " Thank you for using webpack_integrator!" puts " Please add the following line to your app/views/layouts/application.html.erb header:" puts " <%= javascript_include_tag '/webpack/index-bundle.js' %>" puts " ++++++++++++++++++++++++++++++++++++++" end