Sha256: ecee1e8446bd40d03abe5bd75e167199ec0f78b76ea6df868f2ed48617bbee5a

Contents?: true

Size: 1.05 KB

Versions: 40

Compression:

Stored size: 1.05 KB

Contents

require "openssl"
require "open-uri"
require "multi_json"
require "nokogiri"
require "mustache"
require "ostruct"
require "moneta"
require "cgi"
require "net/http"
require "digest"

module Onebox
  DEFAULTS = {
    cache: Moneta.new(:Memory, expires: true, serializer: :json),
    connect_timeout: 5,
    timeout: 10,
    load_paths: [File.join(Gem::Specification.find_by_name("onebox").gem_dir, "templates")]
  }

  @@options = DEFAULTS

  def self.preview(url, options = Onebox.options)
    Preview.new(url, options)
  end

  def self.check(url, options = Onebox.options)
    StatusCheck.new(url, options)
  end

  def self.options
    OpenStruct.new(@@options)
  end

  def self.has_matcher?(url)
    result = Matcher.new(url).oneboxed
    !!result
  end

  def self.options=(options)
    @@options = DEFAULTS.merge(options)
  end
end

require_relative "onebox/version"
require_relative "onebox/preview"
require_relative "onebox/status_check"
require_relative "onebox/matcher"
require_relative "onebox/engine"
require_relative "onebox/layout"
require_relative "onebox/view"

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
onebox-1.5.40 lib/onebox.rb
onebox-1.5.39 lib/onebox.rb
onebox-1.5.38 lib/onebox.rb
onebox-1.5.37 lib/onebox.rb
onebox-1.5.36 lib/onebox.rb
onebox-1.5.35 lib/onebox.rb
onebox-1.5.34 lib/onebox.rb
onebox-1.5.33 lib/onebox.rb
onebox-1.5.32 lib/onebox.rb
onebox-1.5.31 lib/onebox.rb
onebox-1.5.30 lib/onebox.rb
onebox-1.5.29 lib/onebox.rb
onebox-1.5.28 lib/onebox.rb
onebox-1.5.27 lib/onebox.rb
onebox-1.5.26 lib/onebox.rb
onebox-1.5.25 lib/onebox.rb
onebox-1.5.24 lib/onebox.rb
onebox-1.5.23 lib/onebox.rb
onebox-1.5.22 lib/onebox.rb
onebox-1.5.21 lib/onebox.rb