lib/flame/generators/app.rb in flamerb-0.2.3 vs lib/flame/generators/app.rb in flamerb-0.3.0

- old
+ new

@@ -1,5 +1,6 @@ +require 'bundler' require "rails/generators" require "rails/generators/rails/app/app_generator" module Flame module Generators @@ -14,23 +15,28 @@ def custom_template build :configure_generators end def generators - run("spring stop > /dev/null 2>&1 || true") - run("bundle install") + run "spring stop > /dev/null 2>&1 || true" + template "Gemfile.erb", "Gemfile", force: true + Bundler.with_unbundled_env { run "bundle install" } invoke "flame:haml" rails_command "db:create" invoke "flame:testing" invoke "flame:cors" invoke "flame:devise" invoke "flame:vite" - generate("annotate:install") - run("bundle exec standardrb --fix-unsafely") - rails_command("db:migrate") if yes?("\nDo you want to run migrations? [y/n]") + if yes?("\nDo you want to run migrations? [y/n]") + rails_command("db:migrate") + generate("annotate:install") + end rails_command("db:seed") if yes?("\nDo you want to run seed? [y/n]") + template("rubocop.yml", ".rubocop.yml") + template("solargraph.yml", ".solargraph.yml") + run("bundle exec standardrb --fix-unsafely") welcome_message exit 0 end