Class: Quilt::ReactAppGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/quilt/react_app/react_app_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_app_fileObject



21
22
23
# File 'lib/generators/quilt/react_app/react_app_generator.rb', line 21

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

#set_app_config_javascript_pathObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/generators/quilt/react_app/react_app_generator.rb', line 9

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