Class: Cli::Commands::NewApp::Files::Routes

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

Class Method Summary collapse

Class Method Details

.base_controllerObject



24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/cli/commands/new_app/files/routes.rb', line 24

def self.base_controller
  <<~RUBY
    # typed: strict
    # frozen_string_literal: true

    module Controllers
      class Base < Kirei::Controller
        extend T::Sig
      end
    end
  RUBY
end

.call(_app_name) ⇒ Object



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

def self.call(_app_name)
  File.write("config/routes.rb", router)
  File.write("app/controllers/base.rb", base_controller)
end

.routerObject



13
14
15
16
17
18
19
20
21
22
# File 'lib/cli/commands/new_app/files/routes.rb', line 13

def self.router
  <<~RUBY
    # typed: strict
    # frozen_string_literal: true

    module Kirei::Routing
      Router.add_health_routes!
    end
  RUBY
end