Class: Propaganda::Fop::Shell
- Inherits:
-
Object
- Object
- Propaganda::Fop::Shell
- Defined in:
- lib/propaganda/fop/shell.rb
Instance Method Summary collapse
-
#initialize(verbose = false) ⇒ Shell
constructor
A new instance of Shell.
- #invoke(*args) ⇒ Object
Constructor Details
#initialize(verbose = false) ⇒ Shell
Returns a new instance of Shell.
6 7 8 |
# File 'lib/propaganda/fop/shell.rb', line 6 def initialize(verbose=false) @verbose = verbose end |
Instance Method Details
#invoke(*args) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/propaganda/fop/shell.rb', line 10 def invoke(*args) command = "java -Djava.awt.headless=true -jar #{jarpath} #{args.join(' ')}" if @verbose `#{command}` else stdin, stdout, stderr = Open3.popen3(command) @errors = stderr.read @output = stdout.read @output end end |