Class: PDFMeta::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/pdf_meta/command.rb

Instance Method Summary collapse

Constructor Details

#initialize(path = '', options = {}) ⇒ Command

Returns a new instance of Command.

Raises:

  • (ArgumentError)


4
5
6
7
8
9
# File 'lib/pdf_meta/command.rb', line 4

def initialize(path='', options={})
  raise ArgumentError  if path.empty?

  @path    = path
  @options = default_options.merge(options)
end

Instance Method Details

#run!Object



11
12
13
14
15
16
17
18
# File 'lib/pdf_meta/command.rb', line 11

def run!
  runner = PDFMeta::Runner.new(command)
  if runner.success?
    PDFMeta::Parser.new(runner.output).results
  else
    raise runner.error
  end
end