Class: Ymlbill::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/ymlbill/cli.rb

Instance Method Summary collapse

Instance Method Details

#generate(input_file) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/ymlbill/cli.rb', line 13

def generate(input_file)
  @input_file = input_file
  run_pipeline
rescue InputFileNotFoundError, InvalidYamlError => e
  warn "Error: #{e.message}"
  exit 3
rescue TemplateNotFoundError, TemplateRenderError => e
  warn "Error: #{e.message}"
  exit 4
rescue PdfGenerationError => e
  warn "Error: #{e.message}"
  exit 5
end

#versionObject



28
29
30
# File 'lib/ymlbill/cli.rb', line 28

def version
  puts "ymlbill #{Ymlbill::VERSION}"
end