Skip to content

Commit 2fbcdb7

Browse files
committed
Use LruRedux::Cache instead of RDF::Utils::Cache.
1 parent 30c11c5 commit 2fbcdb7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

json-ld.gemspec

100755100644
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Gem::Specification.new do |gem|
2828
gem.add_runtime_dependency 'rdf', '~> 3.1'
2929
gem.add_runtime_dependency 'multi_json', '~> 1.14'
3030
gem.add_runtime_dependency 'link_header', '~> 0.0', '>= 0.0.8'
31+
gem.add_runtime_dependency 'lru_redux', '~> 1.1'
3132
gem.add_runtime_dependency 'json-canonicalization', '~> 0.2'
3233
gem.add_runtime_dependency 'htmlentities', '~> 4.3'
3334
gem.add_runtime_dependency 'rack', '~> 2.0'

lib/json/ld/context.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require 'json'
44
require 'bigdecimal'
55
require 'set'
6-
require 'rdf/util/cache'
6+
require 'lru_redux'
77
begin
88
# Attempt to load this to avoid unnecessary context fetches
99
require 'json-ld-preloaded'
@@ -121,7 +121,7 @@ def self.parse(local_context, override_protected: false, propagate: true, **opti
121121
# @return [RDF::Util::Cache]
122122
# @private
123123
def self.cache
124-
@cache ||= RDF::Util::Cache.new(CACHE_SIZE)
124+
@cache ||= LruRedux::Cache.new(CACHE_SIZE)
125125
end
126126

127127
##
@@ -130,7 +130,7 @@ def self.cache
130130
# @return [RDF::Util::Cache]
131131
# @private
132132
def self.inverse_cache
133-
@inverse_cache ||= RDF::Util::Cache.new(CACHE_SIZE)
133+
@inverse_cache ||= LruRedux::Cache.new(CACHE_SIZE)
134134
end
135135

136136
##

0 commit comments

Comments
 (0)