Sha256: a77b00fe9112e35dd880fe2ef77b8e0a20efe759b02e2ecd319c5a43e4e9e292

Contents?: true

Size: 1.23 KB

Versions: 3

Compression:

Stored size: 1.23 KB

Contents

require "rails/generators"
require "rails/generators/rails/app/app_generator"

module Flame
  module Generators
    class App < Rails::Generators::AppGenerator
      hide!
      def finish_template
        invoke :custom_template
        invoke :generators
        super
      end

      def custom_template
        build :configure_generators
      end

      def generators
        run("spring stop > /dev/null 2>&1 || true")
        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")
        run("bundle exec haml-lint app/views -A -a")
        rails_command("db:migrate") if yes?("\nDo you want to run migrations? [y/n]")
        rails_command("db:seed") if yes?("\nDo you want to run seed? [y/n]")
        welcome_message

        exit 0
      end

      protected

      def welcome_message
        say "Flame app successfully created!", :green
        say "Run `foreman start -f Procfile.dev` to start the server", :green
      end

      def get_builder_class
        Flame::AppBuilder
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
flamerb-0.1.3 lib/flame/generators/app.rb
flamerb-0.1.2 lib/flame/generators/app.rb
flamerb-0.1.1 lib/flame/generators/app.rb