Sha256: 66e1e81bef04256b43981ddca2be66d5da8d7d8bb25cae7c3bd4568e17536e47

Contents?: true

Size: 568 Bytes

Versions: 2

Compression:

Stored size: 568 Bytes

Contents

# frozen_string_literal: true

module Quilt
  class ReactAppGenerator < Rails::Generators::Base
    source_root File.expand_path("templates", __dir__)

    desc "This generator adds a React app."

    def set_app_config_javascript_path
      config_path = "config/application.rb"

      unless File.exist?(config_path)
        inject_into_file(
          config_path,
          "\n    config.javascript_path = \"ui\"\n",
          before: /^  end$/,
        )
      end
    end

    def create_app_file
      copy_file("App.tsx", "app/ui/index.tsx")
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
quilt_rails-3.6.0 lib/generators/quilt/react_app/react_app_generator.rb
quilt_rails-3.5.6 lib/generators/quilt/react_app/react_app_generator.rb