class StartGenerator
Public Instance Methods
create_base_files()
click to toggle source
# File lib/generators/start_generator.rb, line 8 def create_base_files generate(:scaffold, "page --skip-template-engine --no-view-specs --no-jbuilder --no-stylesheets" ) rails_command("db:migrate") route "root 'pages#index'" end
create_registration()
click to toggle source
# File lib/generators/start_generator.rb, line 22 def create_registration copy_file "registration.jsx", "client/app/registration.jsx" copy_file "Index.jsx", "client/app/Index.jsx" copy_file "App.jsx", "client/app/App.jsx" copy_file "reducers/index.js", "client/app/reducers/index.js" copy_file "package.json", "client/package.json", force: true copy_file "webpack.config.js", "client/webpack.config.js", force: true system("gem install foreman") system("bundle && npm install") end
delete_bundles_folder()
click to toggle source
# File lib/generators/start_generator.rb, line 4 def delete_bundles_folder system("rm -rf client/app/bundles") end
install_views()
click to toggle source
# File lib/generators/start_generator.rb, line 14 def install_views create_file "app/views/pages/index.html.erb", "<%= react_component('Index', {prerender: false}) %>" create_file "app/assets/stylesheets/App.scss", ".App { text-align: center }" end
start_server()
click to toggle source
# File lib/generators/start_generator.rb, line 33 def start_server system("foreman start -f Procfile.dev") end