Use yajl since it is already a dependency

Both JSON and Yajl were listed as dependencies. Pygments.rb already requires yajl, so let's just use that instead of using both.
This commit is contained in:
Brandon Keepers
2014-10-17 14:14:02 -04:00
parent 4232b04571
commit cd743332f4
5 changed files with 14 additions and 19 deletions

View File

@@ -1,5 +1,5 @@
begin
require 'json'
require 'yajl'
rescue LoadError
require 'yaml'
end
@@ -19,7 +19,7 @@ module Linguist
# Hash of serialized samples object
def self.cache
@cache ||= begin
serializer = defined?(JSON) ? JSON : YAML
serializer = defined?(Yajl) ? Yajl : YAML
serializer.load(File.read(PATH))
end
end