random-port 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.0pdd.yml +20 -0
- data/.github/workflows/actionlint.yml +41 -0
- data/.github/workflows/codecov.yml +21 -3
- data/.github/workflows/copyrights.yml +30 -0
- data/.github/workflows/markdown-lint.yml +38 -0
- data/.github/workflows/pdd.yml +26 -3
- data/.github/workflows/rake.yml +20 -1
- data/.github/workflows/xcop.yml +20 -1
- data/.gitignore +2 -0
- data/.rubocop.yml +20 -0
- data/.rultor.yml +21 -1
- data/Gemfile +6 -6
- data/LICENSE.txt +1 -1
- data/README.md +10 -6
- data/Rakefile +8 -2
- data/lib/random-port/module.rb +2 -2
- data/lib/random-port/pool.rb +2 -2
- data/lib/random-port.rb +1 -1
- data/random-port.gemspec +2 -2
- data/renovate.json +6 -0
- data/test/test__helper.rb +1 -1
- data/test/test_pool.rb +7 -6
- metadata +7 -4
- data/.travis.yml +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b71762c94a8e91f18c8ad99635fccc5a1d970933383788e33ce5c7e727309bb5
|
4
|
+
data.tar.gz: 6615e680ca4ff3307658e32bc259068ec0d18b8855233f7f2f0e4f9677de59dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d682b677cbc3cd75ea175905f7329606deb6bf791e78d7bdad3b011c9c0c2ef2b020cbda389cd83ae6677d57d42cf5dfa3884f78a6e22fd2961abd1c808c04f
|
7
|
+
data.tar.gz: 273fd54dcd45d2acad27ec446eea6cb8570e79318cf92e20144f7dad46000a534a1ff958be7b347e0a20a9c1c8156b2a63e233013a5e064be0e5fa12ad576905
|
data/.0pdd.yml
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
# Copyright (c) 2018-2024 Yegor Bugayenko
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
# of this software and associated documentation files (the 'Software'), to deal
|
5
|
+
# in the Software without restriction, including without limitation the rights
|
6
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
# copies of the Software, and to permit persons to whom the Software is
|
8
|
+
# furnished to do so, subject to the following conditions:
|
9
|
+
#
|
10
|
+
# The above copyright notice and this permission notice shall be included in all
|
11
|
+
# copies or substantial portions of the Software.
|
12
|
+
#
|
13
|
+
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
+
# SOFTWARE.
|
20
|
+
---
|
1
21
|
errors:
|
2
22
|
- yegor256@gmail.com
|
3
23
|
# alerts:
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# Copyright (c) 2018-2024 Yegor Bugayenko
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
# of this software and associated documentation files (the 'Software'), to deal
|
5
|
+
# in the Software without restriction, including without limitation the rights
|
6
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
# copies of the Software, and to permit persons to whom the Software is
|
8
|
+
# furnished to do so, subject to the following conditions:
|
9
|
+
#
|
10
|
+
# The above copyright notice and this permission notice shall be included in all
|
11
|
+
# copies or substantial portions of the Software.
|
12
|
+
#
|
13
|
+
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
+
# SOFTWARE.
|
20
|
+
---
|
21
|
+
name: actionlint
|
22
|
+
'on':
|
23
|
+
push:
|
24
|
+
branches:
|
25
|
+
- master
|
26
|
+
pull_request:
|
27
|
+
branches:
|
28
|
+
- master
|
29
|
+
jobs:
|
30
|
+
actionlint:
|
31
|
+
runs-on: ubuntu-22.04
|
32
|
+
steps:
|
33
|
+
- uses: actions/checkout@v4
|
34
|
+
- name: Download actionlint
|
35
|
+
id: get_actionlint
|
36
|
+
# yamllint disable-line rule:line-length
|
37
|
+
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
|
38
|
+
shell: bash
|
39
|
+
- name: Check workflow files
|
40
|
+
run: ${{ steps.get_actionlint.outputs.executable }} -color
|
41
|
+
shell: bash
|
@@ -1,3 +1,22 @@
|
|
1
|
+
# Copyright (c) 2018-2024 Yegor Bugayenko
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
# of this software and associated documentation files (the 'Software'), to deal
|
5
|
+
# in the Software without restriction, including without limitation the rights
|
6
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
# copies of the Software, and to permit persons to whom the Software is
|
8
|
+
# furnished to do so, subject to the following conditions:
|
9
|
+
#
|
10
|
+
# The above copyright notice and this permission notice shall be included in all
|
11
|
+
# copies or substantial portions of the Software.
|
12
|
+
#
|
13
|
+
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
+
# SOFTWARE.
|
1
20
|
---
|
2
21
|
name: codecov
|
3
22
|
on:
|
@@ -8,7 +27,7 @@ jobs:
|
|
8
27
|
codecov:
|
9
28
|
runs-on: ubuntu-20.04
|
10
29
|
steps:
|
11
|
-
- uses: actions/checkout@
|
30
|
+
- uses: actions/checkout@v4
|
12
31
|
- uses: ruby/setup-ruby@v1
|
13
32
|
with:
|
14
33
|
ruby-version: 2.7
|
@@ -16,5 +35,4 @@ jobs:
|
|
16
35
|
- run: bundle exec rake
|
17
36
|
- uses: codecov/codecov-action@v3
|
18
37
|
with:
|
19
|
-
|
20
|
-
fail_ci_if_error: true
|
38
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# Copyright (c) 2018-2024 Yegor Bugayenko
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
# of this software and associated documentation files (the 'Software'), to deal
|
5
|
+
# in the Software without restriction, including without limitation the rights
|
6
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
# copies of the Software, and to permit persons to whom the Software is
|
8
|
+
# furnished to do so, subject to the following conditions:
|
9
|
+
#
|
10
|
+
# The above copyright notice and this permission notice shall be included in all
|
11
|
+
# copies or substantial portions of the Software.
|
12
|
+
#
|
13
|
+
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
+
# SOFTWARE.
|
20
|
+
---
|
21
|
+
name: copyrights
|
22
|
+
'on':
|
23
|
+
push:
|
24
|
+
pull_request:
|
25
|
+
jobs:
|
26
|
+
copyrights:
|
27
|
+
runs-on: ubuntu-22.04
|
28
|
+
steps:
|
29
|
+
- uses: actions/checkout@v4
|
30
|
+
- uses: yegor256/copyrights-action@0.0.4
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# Copyright (c) 2018-2024 Yegor Bugayenko
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
# of this software and associated documentation files (the 'Software'), to deal
|
5
|
+
# in the Software without restriction, including without limitation the rights
|
6
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
# copies of the Software, and to permit persons to whom the Software is
|
8
|
+
# furnished to do so, subject to the following conditions:
|
9
|
+
#
|
10
|
+
# The above copyright notice and this permission notice shall be included in all
|
11
|
+
# copies or substantial portions of the Software.
|
12
|
+
#
|
13
|
+
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
+
# SOFTWARE.
|
20
|
+
---
|
21
|
+
name: markdown-lint
|
22
|
+
'on':
|
23
|
+
push:
|
24
|
+
branches:
|
25
|
+
- master
|
26
|
+
pull_request:
|
27
|
+
branches:
|
28
|
+
- master
|
29
|
+
paths-ignore: ['paper/**', 'sandbox/**']
|
30
|
+
concurrency:
|
31
|
+
group: markdown-lint-${{ github.ref }}
|
32
|
+
cancel-in-progress: true
|
33
|
+
jobs:
|
34
|
+
markdown-lint:
|
35
|
+
runs-on: ubuntu-22.04
|
36
|
+
steps:
|
37
|
+
- uses: actions/checkout@v4
|
38
|
+
- uses: articulate/actions-markdownlint@v1
|
data/.github/workflows/pdd.yml
CHANGED
@@ -1,11 +1,34 @@
|
|
1
|
+
# Copyright (c) 2018-2024 Yegor Bugayenko
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
# of this software and associated documentation files (the 'Software'), to deal
|
5
|
+
# in the Software without restriction, including without limitation the rights
|
6
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
# copies of the Software, and to permit persons to whom the Software is
|
8
|
+
# furnished to do so, subject to the following conditions:
|
9
|
+
#
|
10
|
+
# The above copyright notice and this permission notice shall be included in all
|
11
|
+
# copies or substantial portions of the Software.
|
12
|
+
#
|
13
|
+
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
+
# SOFTWARE.
|
1
20
|
---
|
2
21
|
name: pdd
|
3
22
|
on:
|
4
23
|
push:
|
24
|
+
branches:
|
25
|
+
- master
|
5
26
|
pull_request:
|
27
|
+
branches:
|
28
|
+
- master
|
6
29
|
jobs:
|
7
30
|
pdd:
|
8
|
-
runs-on: ubuntu-
|
31
|
+
runs-on: ubuntu-22.04
|
9
32
|
steps:
|
10
|
-
- uses: actions/checkout@
|
11
|
-
- uses:
|
33
|
+
- uses: actions/checkout@v4
|
34
|
+
- uses: volodya-lombrozo/pdd-action@master
|
data/.github/workflows/rake.yml
CHANGED
@@ -1,3 +1,22 @@
|
|
1
|
+
# Copyright (c) 2018-2024 Yegor Bugayenko
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
# of this software and associated documentation files (the 'Software'), to deal
|
5
|
+
# in the Software without restriction, including without limitation the rights
|
6
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
# copies of the Software, and to permit persons to whom the Software is
|
8
|
+
# furnished to do so, subject to the following conditions:
|
9
|
+
#
|
10
|
+
# The above copyright notice and this permission notice shall be included in all
|
11
|
+
# copies or substantial portions of the Software.
|
12
|
+
#
|
13
|
+
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
+
# SOFTWARE.
|
1
20
|
---
|
2
21
|
name: rake
|
3
22
|
on:
|
@@ -16,7 +35,7 @@ jobs:
|
|
16
35
|
ruby: [2.7, 3.2]
|
17
36
|
runs-on: ${{ matrix.os }}
|
18
37
|
steps:
|
19
|
-
- uses: actions/checkout@
|
38
|
+
- uses: actions/checkout@v4
|
20
39
|
- uses: ruby/setup-ruby@v1
|
21
40
|
with:
|
22
41
|
ruby-version: ${{ matrix.ruby }}
|
data/.github/workflows/xcop.yml
CHANGED
@@ -1,3 +1,22 @@
|
|
1
|
+
# Copyright (c) 2018-2024 Yegor Bugayenko
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
# of this software and associated documentation files (the 'Software'), to deal
|
5
|
+
# in the Software without restriction, including without limitation the rights
|
6
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
# copies of the Software, and to permit persons to whom the Software is
|
8
|
+
# furnished to do so, subject to the following conditions:
|
9
|
+
#
|
10
|
+
# The above copyright notice and this permission notice shall be included in all
|
11
|
+
# copies or substantial portions of the Software.
|
12
|
+
#
|
13
|
+
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
+
# SOFTWARE.
|
1
20
|
---
|
2
21
|
name: xcop
|
3
22
|
on:
|
@@ -7,5 +26,5 @@ jobs:
|
|
7
26
|
xcop:
|
8
27
|
runs-on: ubuntu-20.04
|
9
28
|
steps:
|
10
|
-
- uses: actions/checkout@
|
29
|
+
- uses: actions/checkout@v4
|
11
30
|
- uses: g4s8/xcop-action@master
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
# Copyright (c) 2018-2024 Yegor Bugayenko
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
# of this software and associated documentation files (the 'Software'), to deal
|
5
|
+
# in the Software without restriction, including without limitation the rights
|
6
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
# copies of the Software, and to permit persons to whom the Software is
|
8
|
+
# furnished to do so, subject to the following conditions:
|
9
|
+
#
|
10
|
+
# The above copyright notice and this permission notice shall be included in all
|
11
|
+
# copies or substantial portions of the Software.
|
12
|
+
#
|
13
|
+
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
+
# SOFTWARE.
|
20
|
+
---
|
1
21
|
AllCops:
|
2
22
|
DisplayCopNames: true
|
3
23
|
TargetRubyVersion: 2.3.3
|
data/.rultor.yml
CHANGED
@@ -1,5 +1,25 @@
|
|
1
|
+
# Copyright (c) 2018-2024 Yegor Bugayenko
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
# of this software and associated documentation files (the 'Software'), to deal
|
5
|
+
# in the Software without restriction, including without limitation the rights
|
6
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
# copies of the Software, and to permit persons to whom the Software is
|
8
|
+
# furnished to do so, subject to the following conditions:
|
9
|
+
#
|
10
|
+
# The above copyright notice and this permission notice shall be included in all
|
11
|
+
# copies or substantial portions of the Software.
|
12
|
+
#
|
13
|
+
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
+
# SOFTWARE.
|
20
|
+
---
|
1
21
|
docker:
|
2
|
-
image: yegor256/rultor-image:1.
|
22
|
+
image: yegor256/rultor-image:1.23.1
|
3
23
|
assets:
|
4
24
|
rubygems.yml: yegor256/home#assets/rubygems.yml
|
5
25
|
install: |-
|
data/Gemfile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2018-2024 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -23,10 +23,10 @@
|
|
23
23
|
source 'https://rubygems.org'
|
24
24
|
gemspec
|
25
25
|
|
26
|
-
gem 'minitest', '5.
|
27
|
-
gem 'rake', '13.
|
28
|
-
gem '
|
29
|
-
gem 'rubocop', '
|
30
|
-
gem 'rubocop-rspec', '2.22.0', require: false
|
26
|
+
gem 'minitest', '5.24.1', require: false
|
27
|
+
gem 'rake', '13.2.1', require: false
|
28
|
+
gem 'rubocop', '1.64.1', require: false
|
29
|
+
gem 'rubocop-rspec', '3.0.2', require: false
|
31
30
|
gem 'simplecov', '0.22.0', require: false
|
32
31
|
gem 'threads', '0.3.0', require: false
|
32
|
+
gem 'yard', '0.9.36', require: false
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# Random TCP Port Generator for Ruby
|
2
|
+
|
1
3
|
[![DevOps By Rultor.com](http://www.rultor.com/b/yegor256/random-port)](http://www.rultor.com/p/yegor256/random-port)
|
2
4
|
[![We recommend RubyMine](http://www.elegantobjects.org/rubymine.svg)](https://www.jetbrains.com/ruby/)
|
3
5
|
|
@@ -14,7 +16,7 @@ It's a simple Ruby gem to get a random TCP port.
|
|
14
16
|
First, install it:
|
15
17
|
|
16
18
|
```bash
|
17
|
-
|
19
|
+
gem install random-port
|
18
20
|
```
|
19
21
|
|
20
22
|
Then, use it like this, to reserve a random TCP port:
|
@@ -56,14 +58,16 @@ not-thread-safe, using optional `sync` argument of the constructor.
|
|
56
58
|
|
57
59
|
## How to contribute
|
58
60
|
|
59
|
-
Read
|
61
|
+
Read
|
62
|
+
[these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html).
|
60
63
|
Make sure you build is green before you contribute
|
61
|
-
your pull request. You will need to have
|
64
|
+
your pull request. You will need to have
|
65
|
+
[Ruby](https://www.ruby-lang.org/en/) 2.3+ and
|
62
66
|
[Bundler](https://bundler.io/) installed. Then:
|
63
67
|
|
64
|
-
```
|
65
|
-
|
66
|
-
|
68
|
+
```bash
|
69
|
+
bundle update
|
70
|
+
bundle exec rake
|
67
71
|
```
|
68
72
|
|
69
73
|
If it's clean and you don't see any error messages, submit your pull request.
|
data/Rakefile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2018-2024 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -34,7 +34,7 @@ def version
|
|
34
34
|
Gem::Specification.load(Dir['*.gemspec'].first).version
|
35
35
|
end
|
36
36
|
|
37
|
-
task default: %i[clean test rubocop]
|
37
|
+
task default: %i[clean test yard rubocop]
|
38
38
|
|
39
39
|
require 'rake/testtask'
|
40
40
|
desc 'Run all unit tests'
|
@@ -50,3 +50,9 @@ RuboCop::RakeTask.new(:rubocop) do |task|
|
|
50
50
|
task.fail_on_error = true
|
51
51
|
task.requires << 'rubocop-rspec'
|
52
52
|
end
|
53
|
+
|
54
|
+
require 'yard'
|
55
|
+
desc 'Build Yard documentation'
|
56
|
+
YARD::Rake::YardocTask.new do |t|
|
57
|
+
t.files = ['lib/**/*.rb']
|
58
|
+
end
|
data/lib/random-port/module.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# (The MIT License)
|
4
4
|
#
|
5
|
-
# Copyright (c) 2018 Yegor Bugayenko
|
5
|
+
# Copyright (c) 2018-2024 Yegor Bugayenko
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -25,7 +25,7 @@
|
|
25
25
|
# The module for all classes.
|
26
26
|
#
|
27
27
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
28
|
-
# Copyright:: Copyright (c) 2018 Yegor Bugayenko
|
28
|
+
# Copyright:: Copyright (c) 2018-2024 Yegor Bugayenko
|
29
29
|
# License:: MIT
|
30
30
|
module RandomPort
|
31
31
|
end
|
data/lib/random-port/pool.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# (The MIT License)
|
4
4
|
#
|
5
|
-
# Copyright (c) 2018 Yegor Bugayenko
|
5
|
+
# Copyright (c) 2018-2024 Yegor Bugayenko
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -43,7 +43,7 @@ require_relative 'module'
|
|
43
43
|
# passing <tt>FALSE</tt>.
|
44
44
|
#
|
45
45
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
46
|
-
# Copyright:: Copyright (c) 2018 Yegor Bugayenko
|
46
|
+
# Copyright:: Copyright (c) 2018-2024 Yegor Bugayenko
|
47
47
|
# License:: MIT
|
48
48
|
class RandomPort::Pool
|
49
49
|
# If can't acquire by time out.
|
data/lib/random-port.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# (The MIT License)
|
4
4
|
#
|
5
|
-
# Copyright (c) 2018 Yegor Bugayenko
|
5
|
+
# Copyright (c) 2018-2024 Yegor Bugayenko
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/random-port.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# (The MIT License)
|
4
4
|
#
|
5
|
-
# Copyright (c) 2018 Yegor Bugayenko
|
5
|
+
# Copyright (c) 2018-2024 Yegor Bugayenko
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -27,7 +27,7 @@ Gem::Specification.new do |s|
|
|
27
27
|
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
|
28
28
|
s.required_ruby_version = '>=2.3'
|
29
29
|
s.name = 'random-port'
|
30
|
-
s.version = '0.
|
30
|
+
s.version = '0.7.0'
|
31
31
|
s.license = 'MIT'
|
32
32
|
s.summary = 'Random TCP port'
|
33
33
|
s.description = 'Reserves a random TCP port'
|
data/renovate.json
ADDED
data/test/test__helper.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018-
|
3
|
+
# Copyright (c) 2018-2024 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/test/test_pool.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# (The MIT License)
|
4
4
|
#
|
5
|
-
# Copyright (c) 2018 Yegor Bugayenko
|
5
|
+
# Copyright (c) 2018-2024 Yegor Bugayenko
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -24,17 +24,18 @@
|
|
24
24
|
|
25
25
|
require 'minitest/autorun'
|
26
26
|
require 'threads'
|
27
|
+
require 'socket'
|
27
28
|
require_relative '../lib/random-port/pool'
|
28
29
|
|
29
30
|
# Pool test.
|
30
31
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
31
|
-
# Copyright:: Copyright (c) 2018 Yegor Bugayenko
|
32
|
+
# Copyright:: Copyright (c) 2018-2024 Yegor Bugayenko
|
32
33
|
# License:: MIT
|
33
34
|
class RandomPort::TestPool < Minitest::Test
|
34
35
|
def test_acquires_and_releases
|
35
36
|
pool = RandomPort::Pool.new
|
36
37
|
port = pool.acquire
|
37
|
-
server = TCPServer.new(port)
|
38
|
+
server = TCPServer.new('localhost', port)
|
38
39
|
server.close
|
39
40
|
assert(!port.nil?)
|
40
41
|
assert(port.positive?)
|
@@ -46,7 +47,7 @@ class RandomPort::TestPool < Minitest::Test
|
|
46
47
|
assert_equal(0, pool.size)
|
47
48
|
ports = pool.acquire(3, timeout: 16)
|
48
49
|
ports.each do |p|
|
49
|
-
server = TCPServer.new(p)
|
50
|
+
server = TCPServer.new('localhost', p)
|
50
51
|
server.close
|
51
52
|
end
|
52
53
|
assert_equal(3, pool.size)
|
@@ -63,7 +64,7 @@ class RandomPort::TestPool < Minitest::Test
|
|
63
64
|
assert_equal(3, ports.count)
|
64
65
|
assert_equal(3, pool.size)
|
65
66
|
ports.each do |p|
|
66
|
-
server = TCPServer.new(p)
|
67
|
+
server = TCPServer.new('localhost', p)
|
67
68
|
server.close
|
68
69
|
end
|
69
70
|
end
|
@@ -84,7 +85,7 @@ class RandomPort::TestPool < Minitest::Test
|
|
84
85
|
Threads.new(100).assert do
|
85
86
|
pool.acquire(5) do |ports|
|
86
87
|
ports.each do |p|
|
87
|
-
server = TCPServer.new(p)
|
88
|
+
server = TCPServer.new('localhost', p)
|
88
89
|
server.close
|
89
90
|
end
|
90
91
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: random-port
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Reserves a random TCP port
|
14
14
|
email: yegor256@gmail.com
|
@@ -18,7 +18,10 @@ extra_rdoc_files:
|
|
18
18
|
- README.md
|
19
19
|
files:
|
20
20
|
- ".0pdd.yml"
|
21
|
+
- ".github/workflows/actionlint.yml"
|
21
22
|
- ".github/workflows/codecov.yml"
|
23
|
+
- ".github/workflows/copyrights.yml"
|
24
|
+
- ".github/workflows/markdown-lint.yml"
|
22
25
|
- ".github/workflows/pdd.yml"
|
23
26
|
- ".github/workflows/rake.yml"
|
24
27
|
- ".github/workflows/xcop.yml"
|
@@ -26,7 +29,6 @@ files:
|
|
26
29
|
- ".pdd"
|
27
30
|
- ".rubocop.yml"
|
28
31
|
- ".rultor.yml"
|
29
|
-
- ".travis.yml"
|
30
32
|
- Gemfile
|
31
33
|
- LICENSE.txt
|
32
34
|
- README.md
|
@@ -35,6 +37,7 @@ files:
|
|
35
37
|
- lib/random-port/module.rb
|
36
38
|
- lib/random-port/pool.rb
|
37
39
|
- random-port.gemspec
|
40
|
+
- renovate.json
|
38
41
|
- test/test__helper.rb
|
39
42
|
- test/test_pool.rb
|
40
43
|
homepage: http://github.com/yegor256/random-port
|
@@ -58,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
58
61
|
- !ruby/object:Gem::Version
|
59
62
|
version: '0'
|
60
63
|
requirements: []
|
61
|
-
rubygems_version: 3.
|
64
|
+
rubygems_version: 3.4.10
|
62
65
|
signing_key:
|
63
66
|
specification_version: 4
|
64
67
|
summary: Random TCP port
|