Sha256: b67b4ac2bb0e2bf7a28f9e247f44bcc815cf66a2974328117b9b3d45a90bdc88

Contents?: true

Size: 765 Bytes

Versions: 8

Compression:

Stored size: 765 Bytes

Contents

require 'uri'
require 'kinu/configuration'
require 'kinu/version'
require 'kinu/resource'
require 'kinu/sandbox'

module Kinu
  USER_AGENT = "KinuRubyClient/#{Kinu::VERSION}".freeze

  def self.base_uri
    raise "Kinu.config.host is not set." unless config.host
    http_class.build(host: config.host, port: config.port)
  end

  def self.base_upload_uri
    host = config.upload_host || config.host
    raise "Kinu.config.upload_host and Kinu.config.upload_host is not set. Please set one or the other." unless host
    http_class.build(host: host, port: config.port)
  end

  def self.configure
    yield config
  end

  def self.config
    @config ||= Configuration.new
  end

  private

  def self.http_class
    config.ssl? ? URI::HTTPS : URI::HTTP
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
kinu-2.0.2 lib/kinu.rb
kinu-2.0.1 lib/kinu.rb
kinu-2.0.0 lib/kinu.rb
kinu-1.0.0.alpha7 lib/kinu.rb
kinu-1.0.0.alpha6 lib/kinu.rb
kinu-1.0.0.alpha5 lib/kinu.rb
kinu-1.0.0.alpha4 lib/kinu.rb
kinu-1.0.0.alpha3 lib/kinu.rb