Sha256: bb2f23777b5ea2894517b99fddca87bb47819421339230f40fdf8c6c40bb7a71

Contents?: true

Size: 789 Bytes

Versions: 1

Compression:

Stored size: 789 Bytes

Contents

require "diplomat"
require "dryad/core"
require "dryad/consul/railtie" if defined?(Rails)
require "dryad/consul/version"
require "dryad/consul/service_registry"
require "dryad/consul/service"
require "dryad/consul/key_value_client"
require "dryad/consul/config_provider"

module Dryad
  module Consul
    class Error < StandardError; end
    class << self
      def configure_consul(configuration)
        consul = configuration.consul
        if consul[:username].nil? || consul[:password].nil?
          url = "http://#{consul[:host]}:#{consul[:port]}"
        else
          url = "http://#{consul[:username]}:#{consul[:password]}@#{consul[:host]}:#{consul[:port]}"
        end
        ::Diplomat.configure do |config|
          config.url = url
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dryad-consul-0.2.7 lib/dryad/consul.rb