synapse-easy 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
  SHA1:
3
- metadata.gz: 1e1e2d69ec6052e36312f5185f1e0fcb2a840453
4
- data.tar.gz: 5bd0bf94d56a7f72c08e08b3a2d2f93414b2d022
3
+ metadata.gz: d2630252dfaab4dcfff47b93334d950df0a00723
4
+ data.tar.gz: 585be6f8f0aafb55818fa59484f047bab2b43234
5
5
  SHA512:
6
- metadata.gz: 0aee89b855b28bbef73a474c84bc5b318b792cc37623872338bafee692a5221af33cd556011c8f8ba965e0d235506f1f5c165ef262d966b630370c9ca144b3e3
7
- data.tar.gz: a8c8aaf05000ec5590142f082a83ead86ca0ef398d5ede6709d82b481a40702987296036857c8820279eb8c8814911df0eda167cd6aaff2381ade4faafb8b4c7
6
+ metadata.gz: a9dfdca7428ca4bc8dddd7fa565e150494c7d5f4f8d6bdf9d38fbb00feba8355c3d3a729ad587388e653cc65c2f23702a0f6d642d8faaa6b21afadbb93826303
7
+ data.tar.gz: 959c41b0b24ee0702c59c60ca6da329184a9d0cd95d6b30bd3e4d4da0aad6c262e0a83f4120abdedabdcd8f8aca34a206c6e8b0388783891c385527b2ec5dce2
@@ -2,6 +2,7 @@ require "freeport"
2
2
  require "resolv/consul"
3
3
  require "active_support/core_ext/hash/indifferent_access"
4
4
  require "fake/hash"
5
+ require "socket"
5
6
 
6
7
  module Synapse
7
8
  module Easy
@@ -123,6 +124,18 @@ module Synapse
123
124
  def to_uri
124
125
  URI to_s()
125
126
  end
127
+ def check
128
+ begin
129
+ socket = TCPSocket.new(host.to_s,port.to_i)
130
+ rescue Errno::ECONNREFUSED
131
+ sleep 0.1
132
+ retry
133
+ ensure
134
+ socket.close
135
+ return true
136
+ end
137
+ return false
138
+ end
126
139
  end
127
140
  end
128
141
  end
@@ -1,5 +1,5 @@
1
1
  module Synapse
2
2
  module Easy
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: synapse-easy
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
  - Mathias Kaufmann
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-04-14 00:00:00.000000000 Z
11
+ date: 2015-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: resolv-consul
@@ -128,3 +128,4 @@ signing_key:
128
128
  specification_version: 4
129
129
  summary: Synapse Config Generator for HAProxy and Services.
130
130
  test_files: []
131
+ has_rdoc: