dryad-consul 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c7ed3e76062a2b13385dfa1b93280032c1a2e4aa0147445b5d96caeb0ebbaa82
4
- data.tar.gz: d4a8f9df580993a60d5780798feb2001bea85b0778878f1c721724a8f9e73eb6
3
+ metadata.gz: f90d5b5fad7da7535c53c480e9bfaadb8833ee2d50d7e7eb01f489c75a0e4a93
4
+ data.tar.gz: 24035df45576e6aadbaae41716cd3b1e010c952f30c79730a5247c9cb561168d
5
5
  SHA512:
6
- metadata.gz: e414e663aa743ada8df13450fc9dcef4053791647358dce1270f3f624f2b9d96ccaebe5e69ebe6f4ca8da0176999a311e8261798b446e53c0f3dd120d1b64616
7
- data.tar.gz: 40519c5de6ee81d8c28a35e17525e6159ad347490aafd2f70ea41e9b0f0394e70f80a76e1707aefa89e0cd7ae0134b02c5ff657c8c09656206ecff827dcc4c80
6
+ metadata.gz: 53b99aabe4027bb678f3a1cd3201f817cfffebf7b9801279e9c74ee5b0dcd8df154e1f1b2260a7d78d85eca606d03295a8a76feac6b4ff4780e350446b982e4f
7
+ data.tar.gz: df04d80075f510e7743ef98de2ae292d85701e9d0fc5bd0af4c6c35495ca6802d6c9cfaf467ae82dfbbabc6ff258efde7d894f9eba7dbb06adb94d15e5f037b9
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dryad-consul (0.2.5)
4
+ dryad-consul (0.2.6)
5
5
  diplomat (~> 2.2, >= 2.2.4)
6
- dryad-core (= 0.2.5)
6
+ dryad-core (= 0.2.6)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
@@ -13,7 +13,7 @@ GEM
13
13
  diplomat (2.2.5)
14
14
  deep_merge (~> 1.0, >= 1.0.1)
15
15
  faraday (~> 0.9)
16
- dryad-core (0.2.5)
16
+ dryad-core (0.2.6)
17
17
  faraday (0.15.4)
18
18
  multipart-post (>= 1.2, < 3)
19
19
  multipart-post (2.1.1)
data/lib/dryad/consul.rb CHANGED
@@ -13,9 +13,14 @@ module Dryad
13
13
  class Error < StandardError; end
14
14
  class << self
15
15
  def configure_consul(configuration)
16
+ consul = configuration.consul
17
+ if consul[:username].nil? || consul[:password].nil?
18
+ url = "http://#{consul[:host]}:#{consul[:port]}"
19
+ else
20
+ url = "http://#{consul[:username]}:#{consul[:password]}@#{consul[:host]}:#{consul[:port]}"
21
+ end
16
22
  ::Diplomat.configure do |config|
17
- config.url = "http://#{configuration.consul[:host]}:#{configuration.consul[:port]}"
18
- config.options = { headers: { "X-Consul-Token" => configuration.consul[:token] } } if configuration.consul[:token]
23
+ config.url = url
19
24
  end
20
25
  end
21
26
  end
@@ -1,5 +1,5 @@
1
1
  module Dryad
2
2
  module Consul
3
- VERSION = '0.2.5'
3
+ VERSION = '0.2.6'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dryad-consul
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pan Jie
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-04 00:00:00.000000000 Z
11
+ date: 2019-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dryad-core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.2.5
19
+ version: 0.2.6
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.2.5
26
+ version: 0.2.6
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: diplomat
29
29
  requirement: !ruby/object:Gem::Requirement