Class: OpsKit::OdinSon

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

Instance Method Summary collapse

Instance Method Details

#exportObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/opskit/cli.rb', line 10

def export
  conf = {}
  conf[:url] = ask "What is the dev url?"
  conf[:docroot] = ask "What is the docroot?"

  if yes?("Is it a custom template? y/n")
    conf[:template_path] = ask "What is the template path?"
  else
    conf[:template] = ask "What is the template?"
  end

  vhost = OpsKit::VHost.new( conf )

  system "echo '#{vhost.render}' | sudo tee #{ vhost.vhost_location }"
  system "echo '127.0.0.1\t#{ conf[:url]}' | sudo tee -a /etc/hosts"
end