Yes, I would suggest a simple text requirement in spec.requirements . I would also recommend some kind of load snapping when the ground is first loaded:
# in init.rb and/or rails/init.rb: unless Object.const_defined?(:JSON) begin require 'json_pure' rescue LoadError begin require 'json-ruby' rescue LoadError require 'json' end end end unless Object.const_defined?(:JSON) raise "Could not load gem MyGem; did you install one of json_pur, json-ruby, or the C-based json library?" end
James A. Rosen
source share