random-port 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/lib/random-port/pool.rb +3 -0
- data/random-port.gemspec +1 -1
- data/test/test_pool.rb +7 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a3960a47566f1625908e17fe12c37553c20e431
|
4
|
+
data.tar.gz: a7533bbd55eb0e11ba25e9477634889eeca20168
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78f107699b64c07926eb503c8a3253aa8756adcc5436abb76e3661b78251f9a50ce3fd21c39e73d299000e68679132c173bdca575a5b7d2ca0561fddaff3984a
|
7
|
+
data.tar.gz: 669969cd33c4523be191195e983245acce4e24ba25b912ba577d4c4708812f10ebb69a75e7e70c38a1af346e35c059c3b09b3c8c9f23d8b622262b5a1f53c271
|
data/README.md
CHANGED
@@ -38,6 +38,14 @@ port = pool.acquire
|
|
38
38
|
pool.release(port)
|
39
39
|
```
|
40
40
|
|
41
|
+
You can also use a pre-defined `Pool::SINGLETON` singleton:
|
42
|
+
|
43
|
+
```ruby
|
44
|
+
RandomPort::Pool::SINGLETON.acquire do |port|
|
45
|
+
# Use it here...
|
46
|
+
end
|
47
|
+
```
|
48
|
+
|
41
49
|
The pool is thread-safe.
|
42
50
|
|
43
51
|
# License
|
data/lib/random-port/pool.rb
CHANGED
data/random-port.gemspec
CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
|
|
31
31
|
s.rubygems_version = '2.3.3'
|
32
32
|
s.required_ruby_version = '>=2.3'
|
33
33
|
s.name = 'random-port'
|
34
|
-
s.version = '0.
|
34
|
+
s.version = '0.2.0'
|
35
35
|
s.license = 'MIT'
|
36
36
|
s.summary = 'Random TCP port'
|
37
37
|
s.description = 'Reserves a random TCP port'
|
data/test/test_pool.rb
CHANGED