lib/onebox/preview.rb in onebox-1.9.20 vs lib/onebox/preview.rb in onebox-1.9.21

- old
+ new

@@ -1,19 +1,17 @@ # frozen_string_literal: true module Onebox class Preview - attr_reader :cache # see https://bugs.ruby-lang.org/issues/14688 client_exception = defined?(Net::HTTPClientException) ? Net::HTTPClientException : Net::HTTPServerException WEB_EXCEPTIONS ||= [client_exception, OpenURI::HTTPError, Timeout::Error, Net::HTTPError, Errno::ECONNREFUSED] def initialize(link, parameters = Onebox.options) @url = link @options = parameters - @cache = options.cache @engine_class = Matcher.new(@url).oneboxed end def to_s return "" unless engine @@ -70,10 +68,10 @@ def engine return nil unless @engine_class return @engine if @engine - @engine = @engine_class.new(@url, cache) + @engine = @engine_class.new(@url) @engine.options = @options @engine end class InvalidURI < StandardError; end