Class: MOSAIK::Commands::Init
- Inherits:
-
MOSAIK::Command
- Object
- MOSAIK::Command
- MOSAIK::Commands::Init
- Defined in:
- lib/mosaik/commands/init.rb
Overview
Initialize a new configuration file
Instance Method Summary collapse
Methods inherited from MOSAIK::Command
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/mosaik/commands/init.rb', line 11 def call configuration_file = File.join([:directory], "mosaik.yml") raise ConfigurationError, "Configuration file already exists at #{configuration_file}" if File.exist?(configuration_file) FileUtils.cp(MOSAIK.root.join("config/mosaik.yml"), configuration_file) info "Configuration written to #{configuration_file}" end |