boutons 0.3.4 → 0.3.5
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/boutons/uri.rb +7 -7
- data/lib/boutons/version.rb +1 -1
- 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: 395a488c36000d58f046a462efd3c3f99e948c38
|
4
|
+
data.tar.gz: eed04265d3dce468adacfaa3689e8890d93305e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ad7ce5ff7eeee4004a73fbd9f2283d13f05383cd94980af99ed70a27e929ac31b4b255205130727f84253e9d408fdfbeb9bb039219eb104db4d3eac181b9131
|
7
|
+
data.tar.gz: 6f7d5c886d71329a31e353742d3288273f2dae1bac14b8aca8e385c05b62045e8d86dbeed12e774b598e8c9716caa9bed6be7d8122d9cfd4e8a9a777be5c279c
|
data/lib/boutons/uri.rb
CHANGED
@@ -11,12 +11,12 @@ module Boutons
|
|
11
11
|
@uri.scheme
|
12
12
|
end
|
13
13
|
def zk_hosts
|
14
|
-
|
14
|
+
Config.registry.send(service).hosts
|
15
15
|
end
|
16
16
|
def zk
|
17
17
|
begin
|
18
18
|
# return existing, working zookeeper connection
|
19
|
-
|
19
|
+
Resource.zk
|
20
20
|
rescue
|
21
21
|
queue = Queue.new
|
22
22
|
threads = []
|
@@ -28,16 +28,16 @@ module Boutons
|
|
28
28
|
end
|
29
29
|
host,zk = queue.pop
|
30
30
|
# set first working host as host arrays
|
31
|
-
|
31
|
+
Config.registry.zookeeper.hosts = [host]
|
32
32
|
# register connection
|
33
|
-
|
33
|
+
Resource.add :zk, zk
|
34
34
|
# Add later connections if there are any
|
35
35
|
Thread.new do
|
36
36
|
threads.each{|t|t.join}
|
37
37
|
host,zk = queue.pop
|
38
38
|
begin
|
39
39
|
zk.ping?
|
40
|
-
|
40
|
+
Config.registry.zookeeper.hosts << host
|
41
41
|
rescue Zookeeper::Exceptions::ContinuationTimeoutError
|
42
42
|
nil
|
43
43
|
end
|
@@ -51,8 +51,8 @@ module Boutons
|
|
51
51
|
paths << "nerve"
|
52
52
|
paths += @uri.path.split("/")[1..-1].join("/#{@uri.host}/").split("/")
|
53
53
|
paths << "services"
|
54
|
-
paths.inject([Pathname.new("/")]) do |
|
55
|
-
|
54
|
+
paths.inject([Pathname.new("/")]) do |path,dir|
|
55
|
+
path << path.last.join(dir)
|
56
56
|
end.map{|p|p.to_s}.reverse.each do |path|
|
57
57
|
return @zk_path = path unless zk.children(path).empty?
|
58
58
|
end
|
data/lib/boutons/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: boutons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mathias Kaufmann
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: synapse
|