Class: Orats::Commands::New

Inherits:
Orats::Common show all
Defined in:
lib/orats/commands/new.rb

Constant Summary collapse

AVAILABLE_TEMPLATES =
{
  base: 'dockerized production ready application'
}.freeze

Instance Method Summary collapse

Methods inherited from Orats::Common

#base_path, #exit_if_path_exists, #file_to_string

Methods included from UI

#error, #log, #results, #task

Constructor Details

#initialize(target_path = '', options = {}) ⇒ New

Returns a new instance of New.



15
16
17
# File 'lib/orats/commands/new.rb', line 15

def initialize(target_path = '', options = {})
  super
end

Instance Method Details

#available_templatesObject



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/orats/commands/new.rb', line 27

def available_templates
  puts
  log 'templates',
      'Add `-t TEMPLATE` to the new command to use a template',
      :magenta
  puts

  AVAILABLE_TEMPLATES.each_pair do |key, value|
    log key, value, :cyan
  end
end

#initObject



19
20
21
22
23
24
25
# File 'lib/orats/commands/new.rb', line 19

def init
  check_exit_conditions
  create_template
  personalize_template
  rename_env_file
  what_to_do_next
end