lib/onebox.rb in onebox-1.0.1 vs lib/onebox.rb in onebox-1.1.0

- old
+ new

@@ -1,31 +1,34 @@ require "open-uri" require "multi_json" require "nokogiri" require "mustache" require "opengraph_parser" -require "verbal_expressions" +require "hexpress" +require "hexpress/web" require "ostruct" require "moneta" require_relative "onebox/version" require_relative "onebox/preview" require_relative "onebox/matcher" require_relative "onebox/engine" +require_relative "onebox/view" module Onebox DEFAULTS = { - cache: Moneta.new(:Memory, expires: true, serializer: :json) + cache: Moneta.new(:Memory, expires: true, serializer: :json), + timeout: 10 } @@defaults = DEFAULTS def self.preview(url, options = Onebox.defaults) Preview.new(url, options) end def self.defaults - @@defaults + OpenStruct.new(@@defaults) end def self.defaults=(options) @@defaults = DEFAULTS.merge(options) end