diff --git a/lib/atlasq/cache.rb b/lib/atlasq/cache.rb index 8fbf2cc..0e1abc8 100644 --- a/lib/atlasq/cache.rb +++ b/lib/atlasq/cache.rb @@ -13,14 +13,11 @@ def self.get(full_name) @get ||= {} @get.fetch(full_name) do path = "#{CACHE_DIR}/#{full_name}" + content = File.read(path) + content = JSON.parse(content) if full_name.end_with?(".json") - case full_name - when /\.json$/ - JSON.parse(content) - else - content - end + @get[full_name] = content end end end