Class: Monolith::CLI

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/monolith/cli.rb

Constant Summary collapse

DEFAULT_PATH =
"server".freeze

Instance Method Summary collapse

Instance Method Details

#devObject



25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/monolith/cli.rb', line 25

def dev
  procfile = "Procfile.dev"

  unless File.exist?(procfile)
    puts "Error: #{procfile} not found in current directory"
    exit 1
  end

  engine = Foreman::Engine::CLI.new(procfile: procfile)
  engine.load_procfile(procfile)
  engine.start
rescue Interrupt
  puts "\nShutting down..."
end

#new(path = DEFAULT_PATH) ⇒ Object



14
15
16
17
# File 'lib/monolith/cli.rb', line 14

def new(path = DEFAULT_PATH)
  template_path = File.join File.expand_path(__dir__), "cli/template.rb"
  run "rails new #{path} --template #{template_path} --css tailwind --skip-test --skip-system-test --skip-solid"
end

#versionObject



20
21
22
# File 'lib/monolith/cli.rb', line 20

def version
  puts Monolith::VERSION
end