etcd-discovery 0.0.10 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/etcd-discovery/host.rb +5 -6
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 960dc0430e6a20341f0fef6abf70a983809ac5d5
|
|
4
|
+
data.tar.gz: cec0aeba3b3d129be5f8e39cedd8c7e72803a914
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 955d3be4ffaabf4e733a940a7e5defa90f1dd4e688477595bd4b2bf67840b416cafe369492af8dd74efa5940234ecdb0757e61db247c7a951f5d103e88e60ee4
|
|
7
|
+
data.tar.gz: acd4e8b4d6ba5e228064174c379ace5aec37ffdc6080a46b27f65d948e8ff83acc1f981825b391e570f83d732f4be424d5bcec6502887da3964fccf78de37e04
|
data/lib/etcd-discovery/host.rb
CHANGED
|
@@ -13,24 +13,23 @@ module EtcdDiscovery
|
|
|
13
13
|
else
|
|
14
14
|
raise TypeError, "requires a Etcd::Node or a Hash, not a #{arg.class}"
|
|
15
15
|
end
|
|
16
|
-
if !attributes.has_key?('name') or !attributes.has_key?('
|
|
17
|
-
raise InvalidHost, "attributes 'name' and '
|
|
16
|
+
if !attributes.has_key?('name') or !attributes.has_key?('ports')
|
|
17
|
+
raise InvalidHost, "attributes 'name' and 'ports' should be defined"
|
|
18
18
|
end
|
|
19
19
|
attributes['user'] = "" if attributes['user'].nil?
|
|
20
20
|
attributes['password'] = "" if attributes['password'].nil?
|
|
21
|
-
attributes['scheme'] = "http" if attributes['scheme'].nil?
|
|
22
21
|
end
|
|
23
22
|
|
|
24
23
|
def to_json
|
|
25
24
|
attributes.to_json
|
|
26
25
|
end
|
|
27
26
|
|
|
28
|
-
def to_uri
|
|
27
|
+
def to_uri(scheme = "http")
|
|
29
28
|
a = attributes # Shorten name
|
|
30
29
|
if a['user'].empty?
|
|
31
|
-
URI("#{
|
|
30
|
+
URI("#{scheme}://#{a['name']}:#{a['ports'][scheme]}")
|
|
32
31
|
else
|
|
33
|
-
URI("#{
|
|
32
|
+
URI("#{scheme}://#{a['user']}:#{a['password']}@#{a['name']}:#{a['ports'][scheme]}")
|
|
34
33
|
end
|
|
35
34
|
end
|
|
36
35
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: etcd-discovery
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.11
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Léo Unbekandt
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-
|
|
11
|
+
date: 2014-08-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: etcd
|