Class: Develoz::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/develoz/cli.rb

Constant Summary collapse

OPT_IN_FLAGS =
%i[api auth pwa push active_resource admin ui kamal docker db_backup].freeze
FLAG_LABELS =
{
  api: "API layer", auth: "authentication", pwa: "PWA support",
  push: "push notifications", active_resource: "ActiveResource",
  admin: "admin dashboard", ui: "develoz-ui", kamal: "Kamal deployment",
  docker: "Docker setup", db_backup: "database backups"
}.freeze
RAILS_NEW_SKIPS =
%w[--skip-test --skip-ci --skip-bundle].freeze

Instance Method Summary collapse

Instance Method Details

#new(app_name) ⇒ Object



38
39
40
41
42
43
44
45
46
# File 'lib/develoz/cli.rb', line 38

def new(app_name)
  resolved = resolve_flags
  resolver = Develoz::VersionResolver.new
  versions = resolver.resolve(ruby: options[:ruby], rails: options[:rails])
  run_rails_new(app_name, versions[:rails])
  write_version_files(app_name, versions, resolver)
  invoke_install(app_name, resolved)
  puts "Created #{app_name} with Develoz Rails template."
end

#versionObject



19
20
21
# File 'lib/develoz/cli.rb', line 19

def version
  puts "develoz #{Develoz::VERSION}"
end