Class: JasperCommandLine::CommandLine
- Inherits:
-
Object
- Object
- JasperCommandLine::CommandLine
- Defined in:
- lib/jasper-command-line/command_line.rb
Instance Method Summary collapse
-
#initialize(*args) ⇒ CommandLine
constructor
A new instance of CommandLine.
Constructor Details
#initialize(*args) ⇒ CommandLine
Returns a new instance of CommandLine.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/jasper-command-line/command_line.rb', line 3 def initialize(*args) begin = parse_arguments(args) if [:jasper_file] jasper_file = .delete :jasper_file data = .delete :data params = .delete :params if [:signature] if [:signature][:key_file] && ![:signature][:password] raise ArgumentError.new("Password not supplied for certificate") end end puts JasperCommandLine::Jasper::render_pdf(jasper_file, data, params, ) end exit 0 rescue OptionParser::InvalidOption => e puts "Error: #{e.}" exit 1 rescue => e puts "Error: #{e.}" exit 2 end end |