Skip to content
This repository
tree: 0fc30eeb0d
Fetching contributors…

Cannot retrieve contributors at this time

file 31 lines (24 sloc) 0.703 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
require 'tentd/version'
require 'tent-client'

module TentD
  autoload :API, 'tentd/api'
  autoload :Action, 'tentd/action'
  autoload :JsonPatch, 'tentd/json_patch'
  autoload :TentVersion, 'tentd/tent_version'
  autoload :TentType, 'tentd/tent_type'

  def self.new(options={})
    if options[:database] || ENV['DATABASE_URL']
      DataMapper.setup(:default, options[:database] || ENV['DATABASE_URL'])
    end

    require "tentd/notifications/#{options[:job_backend] || 'girl_friday'}"

    @faraday_adapter = options[:faraday_adapter]
    API.new
  end

  def self.faraday_adapter
    @faraday_adapter
  end

  def self.faraday_adapter=(a)
    @faraday_adapter = a
  end
end

require 'tentd/model'
Something went wrong with that request. Please try again.