waitutil 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +13 -5
  2. data/README.md +8 -2
  3. data/VERSION +1 -1
  4. data/lib/waitutil.rb +1 -1
  5. metadata +30 -28
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 0f139cee6a8804a8beddc4adb4adfe9cf1c2e8d8
4
- data.tar.gz: ef6a331a094e72d2b7b877a75d1cd38ff6962c1e
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NjVmNzgxMTljZTVmMzQ2NGNkMWI1ZWMxOTg1MDA0MzU3MjZjZTFmMQ==
5
+ data.tar.gz: !binary |-
6
+ YjRmMDg4NDE4MjkwMjQ5YWE2NTI1OTJlYzZhZDE1OWQyNmY5ZjgxNA==
5
7
  SHA512:
6
- metadata.gz: 2af4abd0f7f6f8b115cf6dd6058bb93496dbd686eba63530106d84c9a571420709339220c9e2857dca00f4af4b2a111b59ece159a4288ea46cd98cfcfd23ee9b
7
- data.tar.gz: 2e437fd465f552294ad4698359d58e24c15d2970215a7e24224acd7f4512684cd7578654d1658ac909bc85ae65c941fc9a2d2efbdc67da317576dcf3324e68c3
8
+ metadata.gz: !binary |-
9
+ OTMzZjFkODBjNmMzNjQ1Y2NlMGNlOTk0MGJkZjQwZWU2ZTRiMmY5OTQ3NmU5
10
+ YzdiY2ZmODlmNDQ5NGQ4ZGE2OWQ1M2E1YmZmY2NjNzllOTVkNzcxZGFkZTc2
11
+ MDI0ZDcxM2I2OWZmNGY4MTNkZWZlYmYwZjFjYzlmMDcyZDUwMDE=
12
+ data.tar.gz: !binary |-
13
+ OTZjMzNmNzljOWQ4ZjBjNGJjNWUxN2I2ZjkxMDQxNjRlOWU0MmRiODIxMjRj
14
+ ZGNkY2ExNTJlNjk3YTg0YTM2ZWIwNTNhNWNlMTM3YzlkZDAzMWFjZGVhM2M4
15
+ Mzk3YTA1YjRmZjE2NzcwYjA0OWNiOGFlMDRkYzc0MTgyZDIyM2I=
data/README.md CHANGED
@@ -17,7 +17,13 @@ Wait methods take a block that returns `true` or `false`.
17
17
 
18
18
  #### Waiting for conditions
19
19
 
20
- Maximum wait time is one minute by default, and the delay time is one second.
20
+ [`wait_for_condition`](http://rubytools.github.io/waitutil/WaitUtil.html#wait_for_condition-instance_method)
21
+ waits for a condition computed by the given function. It takes two optional
22
+ parameters, `:timeout_sec` and `:delay_sec`, that control how long the function
23
+ waits before raising a timeout exception, and how frequently it checks for the
24
+ condition. The time the condition block takes to evaluate is subtracted from
25
+ the sleep time between successive checks. The timeout is one minute by
26
+ default, and the delay time is one second.
21
27
 
22
28
  ```ruby
23
29
  WaitUtil.wait_for_condition("my_event to happen") do
@@ -69,7 +75,7 @@ WaitUtil::TimeoutError: Timed out waiting for my event (3 seconds elapsed): atte
69
75
 
70
76
  #### Waiting for service availability
71
77
 
72
- Wait for a TCP server to be available using [wait_for_service](http://rubytools.github.io/waitutil/WaitUtil.html#wait_for_service-instance_method):
78
+ Wait for a TCP server to be available using [`wait_for_service`](http://rubytools.github.io/waitutil/WaitUtil.html#wait_for_service-instance_method):
73
79
 
74
80
  ```ruby
75
81
  WaitUtil.wait_for_service('my service', 'example.com', 80)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -127,7 +127,7 @@ module WaitUtil
127
127
  begin
128
128
  writer[0].write_nonblock("\x0")
129
129
  true
130
- rescue Errno::ECONNREFUSED
130
+ rescue Errno::ECONNREFUSED, Errno::EPIPE
131
131
  false
132
132
  end
133
133
  end
metadata CHANGED
@@ -1,71 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: waitutil
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikhail Bautin
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-06 00:00:00.000000000 Z
11
+ date: 2014-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
15
- version_requirements: !ruby/object:Gem::Requirement
15
+ requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '10.1'
20
- requirement: !ruby/object:Gem::Requirement
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
21
23
  requirements:
22
24
  - - ~>
23
25
  - !ruby/object:Gem::Version
24
26
  version: '10.1'
25
- prerelease: false
26
- type: :development
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
- version_requirements: !ruby/object:Gem::Requirement
29
+ requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '2.14'
34
- requirement: !ruby/object:Gem::Requirement
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
35
37
  requirements:
36
38
  - - ~>
37
39
  - !ruby/object:Gem::Version
38
40
  version: '2.14'
39
- prerelease: false
40
- type: :development
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rubygems-tasks
43
- version_requirements: !ruby/object:Gem::Requirement
43
+ requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0.2'
48
- requirement: !ruby/object:Gem::Requirement
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
49
51
  requirements:
50
52
  - - ~>
51
53
  - !ruby/object:Gem::Version
52
54
  version: '0.2'
53
- prerelease: false
54
- type: :development
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: webrick
57
- version_requirements: !ruby/object:Gem::Requirement
57
+ requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
- requirement: !ruby/object:Gem::Requirement
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
63
65
  requirements:
64
- - - '>='
66
+ - - ! '>='
65
67
  - !ruby/object:Gem::Version
66
68
  version: '0'
67
- prerelease: false
68
- type: :development
69
69
  description: Utilities for waiting for various conditions
70
70
  email:
71
71
  - mbautin@gmail.com
@@ -88,24 +88,26 @@ files:
88
88
  homepage: http://github.com/rubytools/waitutil
89
89
  licenses: []
90
90
  metadata: {}
91
- post_install_message:
91
+ post_install_message:
92
92
  rdoc_options: []
93
93
  require_paths:
94
94
  - lib
95
95
  required_ruby_version: !ruby/object:Gem::Requirement
96
96
  requirements:
97
- - - '>='
97
+ - - ! '>='
98
98
  - !ruby/object:Gem::Version
99
99
  version: '0'
100
100
  required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - '>='
102
+ - - ! '>='
103
103
  - !ruby/object:Gem::Version
104
104
  version: '0'
105
105
  requirements: []
106
- rubyforge_project:
107
- rubygems_version: 2.2.2
108
- signing_key:
106
+ rubyforge_project:
107
+ rubygems_version: 2.1.11
108
+ signing_key:
109
109
  specification_version: 4
110
110
  summary: Utilities for waiting for various conditions
111
- test_files: []
111
+ test_files:
112
+ - spec/Rakefile
113
+ - spec/waitutil_spec.rb