Class: Hastie::ConfigGenerator

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/hastie/config_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details



8
9
10
# File 'lib/hastie/config_generator.rb', line 8

def self.banner
  "hastie config [SERVER_ROOT] <OPTIONS>"
end

.source_rootObject



18
19
20
# File 'lib/hastie/config_generator.rb', line 18

def self.source_root
  File.dirname(__FILE__)
end

Instance Method Details

#check_server_rootObject



23
24
25
26
27
28
29
# File 'lib/hastie/config_generator.rb', line 23

def check_server_root
  if !File.directory? server_root
    say_status "error", "#{server_root} is not a directory", :red
    say_status "error", "Please use full path to server directory", :red
    exit(1)
  end
end

#create_config_fileObject



31
32
33
34
# File 'lib/hastie/config_generator.rb', line 31

def create_config_file
  output_file = File.join(options[:path], options[:name])
  template "templates/hastie_config.tt", output_file
end