RGhost is a document creation and conversion API. It uses the Ghostscript framework for the format conversion, utilizes EPS templates and is optimized to work with larger documents. Support(PDF,PS,GIF,TIF,PNG,JPG,etc)
[3] pry(main)> RGhost::Convert.new(nil).to :jpeg
NoMethodError: undefined method `empty?' for nil:NilClass
from /Users/atton/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rghost-141a28abb655/lib/rghost/ruby_ghost_engine.rb:156:in `shellescape'
[5] pry(main)> RGhost::Convert.new(true).to :jpeg
NoMethodError: undefined method `empty?' for nil:NilClass
from /Users/atton/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rghost-141a28abb655/lib/rghost/ruby_ghost_engine.rb:156:in `shellescape'
RGhost::Enginechecks document class when render .
However, this case statement not has else block.
So If I try to convert irregular file, class validation is passed and go to crash the program.
I added else block which throw RuntimeError with rspec.
and fix rspecs for my ruby version.
I get results like it
2 deprecation warnings total
Finished in 0.81987 seconds (files took 0.26971 seconds to load)
69 examples, 0 failures
I encountered this error message using RGhost.
RGhost::Engine
checks document class whenrender
. However, this case statement not has else block. So If I try to convert irregular file, class validation is passed and go to crash the program.I added else block which throw
RuntimeError
with rspec. and fix rspecs for my ruby version. I get results like it