lib/onebox.rb in onebox-1.9.20 vs lib/onebox.rb in onebox-1.9.21
- old
+ new
@@ -4,20 +4,18 @@
require "open-uri"
require "multi_json"
require "nokogiri"
require "mustache"
require "ostruct"
-require "moneta"
require "cgi"
require "net/http"
require "digest"
require "sanitize"
require_relative "onebox/sanitize_config"
module Onebox
DEFAULTS = {
- cache: Moneta.new(:Memory, expires: true, serializer: :json),
connect_timeout: 5,
timeout: 10,
max_download_kb: (10 * 1024), # 10MB
load_paths: [File.join(Gem::Specification.find_by_name("onebox").gem_dir, "templates")],
allowed_ports: [80, 443],
@@ -27,9 +25,14 @@
}
@@options = DEFAULTS
def self.preview(url, options = Onebox.options)
+ # onebox does not have native caching
+ unless Onebox::Helpers.blank?(options[:cache])
+ warn "Onebox no longer has inbuilt caching so `cache` option will be ignored."
+ end
+
Preview.new(url, options)
end
def self.check(url, options = Onebox.options)
StatusCheck.new(url, options)