diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2014-06-24 10:09:10 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2014-06-24 10:09:10 -0700 |
commit | 86b123e52e59a00f7a48da7479a40df72e1cfbd7 (patch) | |
tree | 8d7122e47a53ef4823b9adb60262bf01bcf0dadc /lib/ohai/hints.rb | |
parent | 0fa02ae5849f51f6caafdf422aa79409251458aa (diff) | |
download | ohai-86b123e52e59a00f7a48da7479a40df72e1cfbd7.tar.gz |
convert to using ffi-yajl
Diffstat (limited to 'lib/ohai/hints.rb')
-rw-r--r-- | lib/ohai/hints.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/ohai/hints.rb b/lib/ohai/hints.rb index 1bab22ea..c8b0bc1b 100644 --- a/lib/ohai/hints.rb +++ b/lib/ohai/hints.rb @@ -17,6 +17,8 @@ # limitations under the License. # +require 'ffi_yajl' + module Ohai module Hints def self.refresh_hints @@ -31,12 +33,12 @@ module Ohai filename = File.join(path, "#{name}.json") if File.exist?(filename) begin - json_parser = Yajl::Parser.new + json_parser = FFI_Yajl::Parser.new hash = json_parser.parse(File.read(filename)) @hints[name] = hash || Hash.new # hint # should exist because the file did, even if it didn't # contain anything - rescue Yajl::ParseError => e + rescue FFI_Yajl::ParseError => e Ohai::Log.error("Could not parse hint file at #{filename}: #{e.message}") end end |