Class: Dupler::Cli
- Inherits:
-
Thor
- Object
- Thor
- Dupler::Cli
- Defined in:
- lib/dupler/cli.rb
Overview
CLI class for dupler command based Thor
Constant Summary collapse
- DEFAULT_CONF_PATH =
"./values.yaml"
Instance Method Summary collapse
Instance Method Details
#build(output_dir = "./output", *template_path) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/dupler/cli.rb', line 23 def build(output_dir = "./output", *template_path) if ["version"] puts "dupler #{Dupler::VERSION}" return end extracted_template_files = extract_template_files(template_path) values_file_path = ["conf"] || DEFAULT_CONF_PATH raise DuplerException, "No such conf file: #{values_file_path}" unless File.exist? values_file_path core = Dupler::Core.new begin core.build(values_file_path, output_dir, extracted_template_files) rescue Errno::EACCES => e raise DuplerException.new(e) end end |