Class: Builtins::Init
Constant Summary collapse
- OPS_YML =
"ops.yml"- TEMPLATE_DIR =
File.(File.join(File.dirname(__FILE__), "..", "..", "etc"))
- OPS_YML_TEMPLATE =
File.join(TEMPLATE_DIR, "%<template_name>s.template.yml")
- DEFAULT_TEMPLATE_NAME =
"ops"
Instance Method Summary collapse
Methods inherited from Builtin
Constructor Details
This class inherits a constructor from Builtin
Instance Method Details
#run ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/builtins/init.rb', line 15 def run if File.exist?(OPS_YML) Output.error("File '#{OPS_YML} exists; not initializing.") else Output.out("Creating '#{OPS_YML} from template...") FileUtils.cp(template_path, OPS_YML) end rescue SystemCallError Output.error() exit 1 end |