Sha256: 094cba71e364ce83f4571aaa6aacfba7777f1ecd7005641136a3e7b6ad48bbef

Contents?: true

Size: 913 Bytes

Versions: 1

Compression:

Stored size: 913 Bytes

Contents

require 'ldp/version'
require 'linkeddata'
require 'logger'

module Ldp
  RDF::Graph.send(:include, RDF::Isomorphic)

  require 'ldp/client'
  require 'ldp/uri'

  extend Uri

  autoload :Response, 'ldp/response'
  autoload :Resource, 'ldp/resource'
  autoload :Container, 'ldp/container'

  autoload :Orm, 'ldp/orm'

  class HttpError < RuntimeError; end
  class NotFound < HttpError; end # 404
  class Gone < HttpError; end # 410
  class EtagMismatch < HttpError; end # 412

  class UnexpectedContentType < RuntimeError; end

  class << self
    def logger
      @logger ||= Logger.new(STDOUT).tap do |log|
        log.level = Logger::WARN
      end
    end

    def instrument *args, &block
      if defined?(::ActiveSupport) && defined?(::ActiveSupport::Notifications)
        ActiveSupport::Notifications.instrument *args, &block
      else
        yield
      end
    end

    attr_writer :logger
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ldp-0.1.0 lib/ldp.rb