class ReactWebpackRails::InstallGenerator
Public Instance Methods
cleanup()
click to toggle source
# File lib/generators/react_webpack_rails/install_generator.rb, line 71 def cleanup remove_file('tmp/package.json') end
copy_package()
click to toggle source
# File lib/generators/react_webpack_rails/install_generator.rb, line 67 def copy_package create_file 'package.json', File.read(Rails.root.join('tmp', 'package.json')) end
generate_core()
click to toggle source
# File lib/generators/react_webpack_rails/install_generator.rb, line 31 def generate_core generate 'react_webpack_rails:install:core --tmp-package' end
generate_example()
click to toggle source
# File lib/generators/react_webpack_rails/install_generator.rb, line 35 def generate_example return unless options.example example_generator = 'react_webpack_rails:install:example' example_generator += ' --server-side' if options.server_side generate example_generator end
generate_hot_reload()
click to toggle source
# File lib/generators/react_webpack_rails/install_generator.rb, line 47 def generate_hot_reload return unless options.hot_reload generate 'react_webpack_rails:install:hot_reload --tmp-package' end
generate_karma_setup()
click to toggle source
# File lib/generators/react_webpack_rails/install_generator.rb, line 52 def generate_karma_setup return unless options.karma_setup generate 'react_webpack_rails:install:karma_setup --tmp-package' end
generate_redux()
click to toggle source
# File lib/generators/react_webpack_rails/install_generator.rb, line 57 def generate_redux return unless options.redux generate 'react_webpack_rails:install:redux --tmp_package' end
generate_server_side()
click to toggle source
# File lib/generators/react_webpack_rails/install_generator.rb, line 42 def generate_server_side return unless options.server_side generate 'react_webpack_rails:install:server_side --tmp-package' end
generate_view_helpers()
click to toggle source
# File lib/generators/react_webpack_rails/install_generator.rb, line 62 def generate_view_helpers return unless options.view_helpers generate 'react_webpack_rails:install:view_helpers --tmp_package' end
install_gems()
click to toggle source
# File lib/generators/react_webpack_rails/install_generator.rb, line 75 def install_gems Bundler.with_clean_env do run 'bundle install' end end
install_packages()
click to toggle source
# File lib/generators/react_webpack_rails/install_generator.rb, line 81 def install_packages run 'npm install' end
Private Instance Methods
deprecation_warning()
click to toggle source
# File lib/generators/react_webpack_rails/install_generator.rb, line 87 def deprecation_warning message = [ "\nDEPRECATION WARNING - since v0.3.0:", "current integration with react-router was extracted and moved to external plugin.", "Use https://github.com/netguru/rwr-react_router instead.\n\n", ] warn message.join("\n") end