Class: Cli::Commands::NewApp::Files::ConfigRu

Inherits:
Object
  • Object
show all
Defined in:
lib/cli/commands/new_app/files/config_ru.rb

Class Method Summary collapse

Class Method Details

.call(app_name) ⇒ Object



8
9
10
# File 'lib/cli/commands/new_app/files/config_ru.rb', line 8

def self.call(app_name)
  File.write("config.ru", content(app_name))
end

.content(app_name) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/cli/commands/new_app/files/config_ru.rb', line 12

def self.content(app_name)
  "    # typed: false\n    # frozen_string_literal: true\n\n    require_relative(\"app\")\n\n    # Load middlewares here\n    use(Rack::Reloader, 0) if \#{app_name}.environment == \"development\"\n\n    # Launch the app\n    run(\#{app_name}.new)\n\n    # \"use\" all controllers\n    # store all routes in a global variable to render (localhost only)\n    # put \"booted\" statement\n  RUBY\nend\n"