mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user