random-port 0.8.1 → 0.8.2
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/Gemfile.lock +1 -1
- data/README.md +13 -11
- data/REUSE.toml +0 -2
- data/lib/random-port/pool.rb +0 -1
- data/random-port.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 165b26f62adb64a8b809949e3082e272bad1b6c91b724a90ae95dd9d8c20b41f
|
|
4
|
+
data.tar.gz: b7a5cbc43e59e72712008bba02a045d788e160bb1b464c261c6b12b8b26da56e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 47163bd973670922d0dc4d85210670d95a50af2e2fcf6c50ed5a19cf14c55b394929fafb55b511f22762cccda36a66f74b4ccc695628ec2b16768d043772ee80
|
|
7
|
+
data.tar.gz: a469ec037ab1bc015672beb7edcd68a6a6a401e16b0ece0086a41b8103245418d37bc8eddf1d4fad241f622f6c68fcdb564d39e38434a254c0501025c3f1a29f
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -25,8 +25,8 @@ require 'random-port'
|
|
|
25
25
|
port = RandomPort::Pool.new.acquire
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
The `Pool` guarantees that the port
|
|
29
|
-
the port back to the pool after usage:
|
|
28
|
+
The `Pool` guarantees that the port isn't used again.
|
|
29
|
+
You can put the port back to the pool after usage:
|
|
30
30
|
|
|
31
31
|
```ruby
|
|
32
32
|
RandomPort::Pool.new.acquire do |port|
|
|
@@ -52,7 +52,7 @@ end
|
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
Or use shortened version, all methods called in `RandomPort`
|
|
55
|
-
|
|
55
|
+
are delegated to `Pool::SINGLETON`:
|
|
56
56
|
|
|
57
57
|
```ruby
|
|
58
58
|
RandomPort.acquire do |port|
|
|
@@ -61,17 +61,15 @@ end
|
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
The pool is thread-safe by default.
|
|
64
|
-
You can configure it to be
|
|
65
|
-
|
|
64
|
+
You can configure it to be not-thread-safe,
|
|
65
|
+
using optional `sync` argument of the constructor.
|
|
66
66
|
|
|
67
67
|
## How to contribute
|
|
68
68
|
|
|
69
|
-
Read
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
[Ruby](https://www.ruby-lang.org/en/) 3.3+ and
|
|
74
|
-
[Bundler](https://bundler.io/) installed. Then:
|
|
69
|
+
Read these [guidelines].
|
|
70
|
+
Make sure your build is green before you contribute your pull request.
|
|
71
|
+
You need to have [Ruby] 3.3+ and [Bundler] installed.
|
|
72
|
+
Then:
|
|
75
73
|
|
|
76
74
|
```bash
|
|
77
75
|
bundle update
|
|
@@ -79,3 +77,7 @@ bundle exec rake
|
|
|
79
77
|
```
|
|
80
78
|
|
|
81
79
|
If it's clean and you don't see any error messages, submit your pull request.
|
|
80
|
+
|
|
81
|
+
[guidelines]: https://www.yegor256.com/2014/04/15/github-guidelines.html
|
|
82
|
+
[Ruby]: https://www.ruby-lang.org/en/
|
|
83
|
+
[Bundler]: https://bundler.io/
|
data/REUSE.toml
CHANGED
data/lib/random-port/pool.rb
CHANGED
data/random-port.gemspec
CHANGED
|
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
|
|
9
9
|
s.required_ruby_version = '>=3.3'
|
|
10
10
|
s.name = 'random-port'
|
|
11
|
-
s.version = '0.8.
|
|
11
|
+
s.version = '0.8.2'
|
|
12
12
|
s.license = 'MIT'
|
|
13
13
|
s.summary = 'Random TCP port'
|
|
14
14
|
s.description = 'Reserves a random TCP port'
|