Class: Hastie::ConfigGenerator
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Hastie::ConfigGenerator
- Includes:
- Thor::Actions
- Defined in:
- lib/hastie/config_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.banner ⇒ Object
8 9 10 |
# File 'lib/hastie/config_generator.rb', line 8 def self. "hastie config [SERVER_ROOT] <OPTIONS>" end |
.source_root ⇒ Object
18 19 20 |
# File 'lib/hastie/config_generator.rb', line 18 def self.source_root File.dirname(__FILE__) end |
Instance Method Details
#check_server_root ⇒ Object
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_file ⇒ Object
31 32 33 34 |
# File 'lib/hastie/config_generator.rb', line 31 def create_config_file output_file = File.join([:path], [:name]) template "templates/hastie_config.tt", output_file end |