ruby-rdf / rdf-rdfa

Ruby RDFa reader/writer for RDF.rb.
http://ruby-rdf.github.com/rdf-rdfa
The Unlicense
35 stars 11 forks source link

Fixes attempted loading of unavailable gems #16

Closed gareth closed 9 years ago

gareth commented 9 years ago

The begin/rescue/end block here seems to only exist to handle problems with the loading of RDF formats.

However, since LoadError is not a subclass of StandardError, the existing code wouldn't have caught cases where the JSON-LD gem wasn't available. And because json-ld is only a development dependency of rdf-rdfa and not a runtime one, this could bite unsuspecting users trying to parse a document with embedded JSON linked data - in my case it was http://www.businessweek.com/articles/2014-11-21/boeings-777-problem-delta-and-other-airlines-want-newer-planes.

> LoadError.ancestors
 => [LoadError, ScriptError, Exception, Object, Kernel]

I'm not sure how to write a test around gems not being available in the load path, otherwise I would have.

gkellogg commented 9 years ago

Not worth testing, thanks a lot.