Sha256: e1cba20c62a5bf8fc1275cb0628e0e81a1ec09a82d6eb49cf8c509f26d8bad9c

Contents?: true

Size: 568 Bytes

Versions: 13

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

13 entries across 13 versions & 1 rubygems

Version Path
quilt_rails-3.5.5 lib/generators/quilt/react_app/react_app_generator.rb
quilt_rails-3.5.4 lib/generators/quilt/react_app/react_app_generator.rb
quilt_rails-3.5.2 lib/generators/quilt/react_app/react_app_generator.rb
quilt_rails-3.5.1 lib/generators/quilt/react_app/react_app_generator.rb
quilt_rails-3.5.0 lib/generators/quilt/react_app/react_app_generator.rb
quilt_rails-3.4.2 lib/generators/quilt/react_app/react_app_generator.rb
quilt_rails-3.4.1 lib/generators/quilt/react_app/react_app_generator.rb
quilt_rails-3.4.0 lib/generators/quilt/react_app/react_app_generator.rb
quilt_rails-3.3.1 lib/generators/quilt/react_app/react_app_generator.rb
quilt_rails-3.3.0 lib/generators/quilt/react_app/react_app_generator.rb
quilt_rails-3.2.1 lib/generators/quilt/react_app/react_app_generator.rb
quilt_rails-3.1.1 lib/generators/quilt/react_app/react_app_generator.rb
quilt_rails-3.1.0 lib/generators/quilt/react_app/react_app_generator.rb