Method: Waxx::Init#init

Defined in:
lib/waxx/init.rb

#init(x, opts, input = nil) ⇒ Object

Start the init process. Fired when ‘waxx init folder` is called



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/waxx/init.rb', line 97

def init(x, opts, input=nil)
  puts ""
  puts ascii_art
  puts ""
  # Set defaults
  input ||= YAML.load(default_input(x, opts))
  make_dir(x, opts/:sub_command)
  # Ask a few questions
  input = ask(x, input)
  puts ""
  puts "Here is your config..."
  puts ""
  puts input.to_yaml
  puts ""
  puts ""
  puts "Does this look right? You can edit this YAML file later in #{opts/:sub_command}/opt/dev/config.yaml."
  print "Install? (y|n) [y]: "
  proceed = $stdin.gets.chomp
  if proceed == '' or (proceed =~ /[yY]/) == 0
    install_waxx(x, input, opts)
  else
    init(x, opts, input)
  end
end