Class: Flame::Generators::App

Inherits:
Rails::Generators::AppGenerator
  • Object
show all
Defined in:
lib/flame/generators/app.rb

Instance Method Summary collapse

Instance Method Details

#custom_templateObject



15
16
17
# File 'lib/flame/generators/app.rb', line 15

def custom_template
  build :configure_generators
end

#finish_templateObject



9
10
11
12
13
# File 'lib/flame/generators/app.rb', line 9

def finish_template
  invoke :custom_template
  invoke :generators
  super
end

#generatorsObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/flame/generators/app.rb', line 19

def generators
  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"

  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