haproxy-cluster 0.0.3 → 0.0.4

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.
@@ -41,11 +41,11 @@ class HAProxyCluster
41
41
  # This block would not return until every member of the cluster is available
42
42
  # to serve requests.
43
43
  #
44
- # wait_for(1!=1){false} #=> true
45
- # wait_for(1==1){true} #=> true
46
- # wait_for(1..3){2} #=> true
47
- # wait_for(true){sleep} #=> Timeout
48
- def wait_for (condition, &code)
44
+ # wait_until(1!=1){false} #=> true
45
+ # wait_until(1==1){true} #=> true
46
+ # wait_until(1..3){2} #=> true
47
+ # wait_until(true){sleep} #=> Timeout
48
+ def wait_until (condition, &code)
49
49
  results = map(&code)
50
50
  delay = 1.5
51
51
  loop do
@@ -24,7 +24,7 @@ OptionParser.new do |opts|
24
24
  options.timeout = o.to_f
25
25
  end
26
26
  opts.on_tail("--version", "Show version") do
27
- puts HAProxyCluster::Version
27
+ puts HAProxyCluster::VERSION
28
28
  exit
29
29
  end
30
30
  opts.on_tail "URL should be the root of an HA Proxy status page, either http:// or https://"
@@ -29,17 +29,6 @@ class HAProxyCluster
29
29
  modify! :disable
30
30
  end
31
31
 
32
- def wait_until_ok
33
- return true if self.ok?
34
- start = Time.now
35
- until self.ok?
36
- raise Timeout if Time.now > start + 10
37
- sleep 1
38
- @member.poll!
39
- end
40
- return true
41
- end
42
-
43
32
  private
44
33
 
45
34
  def modify! (how)
@@ -1,3 +1,3 @@
1
1
  class HAProxyCluster
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haproxy-cluster
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-23 00:00:00.000000000 Z
12
+ date: 2012-07-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
16
- requirement: &70365478448260 !ruby/object:Gem::Requirement
16
+ requirement: &70257308044560 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70365478448260
24
+ version_requirements: *70257308044560
25
25
  description: ! " Ruby Gem and command line tool for quickly answering questions like,
26
26
  \"Can we\n survive a rolling restart?\", \"How many transactions per second am
27
27
  I seeing?\",\n \"What's my session backlog?\". Intended for use within continuous