random-port 0.5.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a0eff0b3b8395e2d245b309a7a15dd27362f0d983ce3b91587b66119a4e68a3f
4
- data.tar.gz: af26bb1c3daecaf2260fb2601870f2c4c2386f3359be714071c5790e90fad0ee
3
+ metadata.gz: b71762c94a8e91f18c8ad99635fccc5a1d970933383788e33ce5c7e727309bb5
4
+ data.tar.gz: 6615e680ca4ff3307658e32bc259068ec0d18b8855233f7f2f0e4f9677de59dc
5
5
  SHA512:
6
- metadata.gz: 4d25042a756ac83966d45085888b26c5fe95f3960967320d6a9e81ed9900f72769f745f4032320487e35c9d31d029250d1358425bffda91562372bc499c4fc52
7
- data.tar.gz: 503e22ad9b530666b290506936f20aeb69b5273a1ac36f550b9bd5cbd2c22ab0b593c50bd0005dab250a20040058080903894e1353a5e1323784f2a162f12d1b
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
@@ -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: codecov
22
+ on:
23
+ push:
24
+ branches:
25
+ - master
26
+ jobs:
27
+ codecov:
28
+ runs-on: ubuntu-20.04
29
+ steps:
30
+ - uses: actions/checkout@v4
31
+ - uses: ruby/setup-ruby@v1
32
+ with:
33
+ ruby-version: 2.7
34
+ - run: bundle update
35
+ - run: bundle exec rake
36
+ - uses: codecov/codecov-action@v3
37
+ with:
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
@@ -0,0 +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.
20
+ ---
21
+ name: pdd
22
+ on:
23
+ push:
24
+ branches:
25
+ - master
26
+ pull_request:
27
+ branches:
28
+ - master
29
+ jobs:
30
+ pdd:
31
+ runs-on: ubuntu-22.04
32
+ steps:
33
+ - uses: actions/checkout@v4
34
+ - uses: volodya-lombrozo/pdd-action@master
@@ -0,0 +1,43 @@
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: rake
22
+ on:
23
+ push:
24
+ branches:
25
+ - master
26
+ pull_request:
27
+ branches:
28
+ - master
29
+ jobs:
30
+ test:
31
+ name: test
32
+ strategy:
33
+ matrix:
34
+ os: [ubuntu-20.04, macos-12]
35
+ ruby: [2.7, 3.2]
36
+ runs-on: ${{ matrix.os }}
37
+ steps:
38
+ - uses: actions/checkout@v4
39
+ - uses: ruby/setup-ruby@v1
40
+ with:
41
+ ruby-version: ${{ matrix.ruby }}
42
+ - run: bundle update
43
+ - run: bundle exec rake
@@ -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: xcop
22
+ on:
23
+ push:
24
+ pull_request:
25
+ jobs:
26
+ xcop:
27
+ runs-on: ubuntu-20.04
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+ - uses: g4s8/xcop-action@master
data/.gitignore CHANGED
@@ -4,3 +4,5 @@ Gemfile.lock
4
4
  .DS_Store
5
5
  rdoc/
6
6
  coverage/
7
+ .yardoc/
8
+ doc/
data/.rubocop.yml CHANGED
@@ -1,7 +1,33 @@
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
24
+ NewCops: enable
25
+ SuggestExtensions: false
4
26
 
27
+ Layout/EmptyLineAfterGuardClause:
28
+ Enabled: false
29
+ Style/ClassAndModuleChildren:
30
+ Enabled: false
5
31
  Naming/FileName:
6
32
  Enabled: false
7
33
  Metrics/MethodLength:
data/.rultor.yml CHANGED
@@ -1,10 +1,32 @@
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
+ docker:
22
+ image: yegor256/rultor-image:1.23.1
1
23
  assets:
2
- rubygems.yml: zerocracy/home#assets/rubygems.yml
24
+ rubygems.yml: yegor256/home#assets/rubygems.yml
3
25
  install: |-
4
- export GEM_HOME=~/.ruby
5
- export GEM_PATH=$GEM_HOME:$GEM_PATH
6
- bundle install --no-color
26
+ pdd -f /dev/null
27
+ sudo bundle install --no-color "--gemfile=$(pwd)/Gemfile"
7
28
  release:
29
+ pre: false
8
30
  script: |-
9
31
  bundle exec rake
10
32
  rm -rf *.gem
@@ -17,7 +39,3 @@ release:
17
39
  merge:
18
40
  script: |-
19
41
  bundle exec rake
20
- deploy:
21
- script: |-
22
- echo Nothing to deploy
23
- exit -1
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
@@ -22,3 +22,11 @@
22
22
 
23
23
  source 'https://rubygems.org'
24
24
  gemspec
25
+
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
30
+ gem 'simplecov', '0.22.0', require: false
31
+ gem 'threads', '0.3.0', require: false
32
+ gem 'yard', '0.9.36', require: false
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2019 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
data/README.md CHANGED
@@ -1,12 +1,13 @@
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
 
4
- [![Build Status](https://travis-ci.org/yegor256/random-port.svg)](https://travis-ci.org/yegor256/random-port)
6
+ [![rake](https://github.com/yegor256/random-port/actions/workflows/rake.yml/badge.svg)](https://github.com/yegor256/random-port/actions/workflows/rake.yml)
5
7
  [![Gem Version](https://badge.fury.io/rb/random-port.svg)](http://badge.fury.io/rb/random-port)
6
8
  [![Maintainability](https://api.codeclimate.com/v1/badges/349b8c31884d3b34d926/maintainability)](https://codeclimate.com/github/yegor256/random-port/maintainability)
7
9
  [![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://rubydoc.info/github/yegor256/random-port/master/frames)
8
10
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/yegor256/random-port/blob/master/LICENSE.txt)
9
-
10
11
  [![Test Coverage](https://img.shields.io/codecov/c/github/yegor256/random-port.svg)](https://codecov.io/github/yegor256/random-port?branch=master)
11
12
  [![Hits-of-Code](https://hitsofcode.com/github/yegor256/random-port)](https://hitsofcode.com/view/github/random-port/mailanes)
12
13
 
@@ -15,7 +16,7 @@ It's a simple Ruby gem to get a random TCP port.
15
16
  First, install it:
16
17
 
17
18
  ```bash
18
- $ gem install random-port
19
+ gem install random-port
19
20
  ```
20
21
 
21
22
  Then, use it like this, to reserve a random TCP port:
@@ -57,14 +58,16 @@ not-thread-safe, using optional `sync` argument of the constructor.
57
58
 
58
59
  ## How to contribute
59
60
 
60
- Read [these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html).
61
+ Read
62
+ [these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html).
61
63
  Make sure you build is green before you contribute
62
- your pull request. You will need to have [Ruby](https://www.ruby-lang.org/en/) 2.3+ and
64
+ your pull request. You will need to have
65
+ [Ruby](https://www.ruby-lang.org/en/) 2.3+ and
63
66
  [Bundler](https://bundler.io/) installed. Then:
64
67
 
65
- ```
66
- $ bundle update
67
- $ bundle exec rake
68
+ ```bash
69
+ bundle update
70
+ bundle exec rake
68
71
  ```
69
72
 
70
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
@@ -24,7 +24,7 @@ require 'rubygems'
24
24
  require 'rake'
25
25
  require 'rake/clean'
26
26
 
27
- CLEAN = FileList['coverage']
27
+ CLEAN << 'coverage'
28
28
 
29
29
  def name
30
30
  @name ||= File.basename(Dir['*.gemspec'].first, '.*')
@@ -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
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ # (The MIT License)
4
+ #
5
+ # Copyright (c) 2018-2024 Yegor Bugayenko
6
+ #
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the 'Software'), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
13
+ #
14
+ # The above copyright notice and this permission notice shall be included in all
15
+ # copies or substantial portions of the Software.
16
+ #
17
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ # SOFTWARE.
24
+
25
+ # The module for all classes.
26
+ #
27
+ # Author:: Yegor Bugayenko (yegor256@gmail.com)
28
+ # Copyright:: Copyright (c) 2018-2024 Yegor Bugayenko
29
+ # License:: MIT
30
+ module RandomPort
31
+ end
@@ -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,121 +24,123 @@
24
24
 
25
25
  require 'socket'
26
26
  require 'monitor'
27
+ require_relative 'module'
27
28
 
28
- module RandomPort
29
- # Pool of TPC ports.
30
- #
31
- # Use it like this:
32
- #
33
- # RandomPort::Pool.new.acquire do |port|
34
- # # Use the TCP port. It will be returned back
35
- # # to the pool afterwards.
36
- # end
37
- #
38
- # You can specify the maximum amount of ports to acquire, using +limit+.
39
- # If more acquiring requests will arrive, an exception will be raised.
40
- #
41
- # The class is thread-safe, by default. You can configure it to be
42
- # not-thread-safe, using optional <tt>sync</tt> argument of the constructor.
43
- #
44
- # Author:: Yegor Bugayenko (yegor256@gmail.com)
45
- # Copyright:: Copyright (c) 2018 Yegor Bugayenko
46
- # License:: MIT
47
- class Pool
48
- # If can't acquire by time out.
49
- class Timeout < StandardError; end
29
+ # Pool of TPC ports.
30
+ #
31
+ # Use it like this:
32
+ #
33
+ # RandomPort::Pool.new.acquire do |port|
34
+ # # Use the TCP port. It will be returned back
35
+ # # to the pool afterwards.
36
+ # end
37
+ #
38
+ # You can specify the maximum amount of ports to acquire, using +limit+.
39
+ # If more acquiring requests will arrive, an exception will be raised.
40
+ #
41
+ # The class is thread-safe, by default. You can configure it to be
42
+ # not-thread-safe, using optional +sync+ argument of the constructor,
43
+ # passing <tt>FALSE</tt>.
44
+ #
45
+ # Author:: Yegor Bugayenko (yegor256@gmail.com)
46
+ # Copyright:: Copyright (c) 2018-2024 Yegor Bugayenko
47
+ # License:: MIT
48
+ class RandomPort::Pool
49
+ # If can't acquire by time out.
50
+ class Timeout < StandardError; end
50
51
 
51
- attr_reader :limit
52
+ attr_reader :limit
52
53
 
53
- # Ctor.
54
- def initialize(sync: false, limit: 65_536)
55
- @ports = []
56
- @sync = sync
57
- @monitor = Monitor.new
58
- @limit = limit
59
- end
54
+ # Ctor.
55
+ # @param [bool] Set it to FALSE if you want this pool to be NOT thread-safe
56
+ # @param [int] Set the maximum number of ports in the pool
57
+ def initialize(sync: true, limit: 65_536)
58
+ @ports = []
59
+ @sync = sync
60
+ @monitor = Monitor.new
61
+ @limit = limit
62
+ end
60
63
 
61
- # Application wide pool of ports
62
- SINGLETON = Pool.new
64
+ # Application wide pool of ports
65
+ SINGLETON = RandomPort::Pool.new
63
66
 
64
- # How many ports acquired now?
65
- def count
66
- @ports.count
67
- end
68
- alias size count
67
+ # How many ports acquired now?
68
+ def count
69
+ @ports.count
70
+ end
71
+ alias size count
69
72
 
70
- # Is it empty?
71
- def empty?
72
- @ports.empty?
73
- end
73
+ # Is it empty?
74
+ def empty?
75
+ @ports.empty?
76
+ end
74
77
 
75
- # Acquire a new random TCP port.
76
- #
77
- # You can specify the number of ports to acquire. If it's more than one,
78
- # an array will be returned.
79
- #
80
- # You can specify the amount of seconds to wait until a new port
81
- # is available.
82
- def acquire(total = 1, timeout: 4)
83
- start = Time.now
84
- loop do
85
- if Time.now > start + timeout
86
- raise Timeout, "Can't find a place in the pool of #{@limit} ports \
78
+ # Acquire a new random TCP port.
79
+ #
80
+ # You can specify the number of ports to acquire. If it's more than one,
81
+ # an array will be returned.
82
+ #
83
+ # You can specify the amount of seconds to wait until a new port
84
+ # is available.
85
+ def acquire(total = 1, timeout: 4)
86
+ start = Time.now
87
+ loop do
88
+ if Time.now > start + timeout
89
+ raise Timeout, "Can't find a place in the pool of #{@limit} ports \
87
90
  for #{total} port(s), in #{format('%.02f', Time.now - start)}s"
88
- end
89
- opts = safe do
90
- next if @ports.count + total > @limit
91
- opts = Array.new(0, total)
92
- begin
93
- (0..(total - 1)).each do |i|
94
- opts[i] = i.zero? ? take : take(opts[i - 1] + 1)
95
- end
96
- rescue Errno::EADDRINUSE, SocketError
97
- next
98
- end
99
- next if opts.any? { |p| @ports.include?(p) }
100
- d = total * (total - 1) / 2
101
- next unless opts.inject(&:+) - total * opts.min == d
102
- @ports += opts
103
- opts
104
- end
105
- next if opts.nil?
106
- opts = opts[0] if total == 1
107
- return opts unless block_given?
91
+ end
92
+ opts = safe do
93
+ next if @ports.count + total > @limit
94
+ opts = Array.new(0, total)
108
95
  begin
109
- return yield opts
110
- ensure
111
- release(opts)
96
+ (0..(total - 1)).each do |i|
97
+ opts[i] = i.zero? ? take : take(opts[i - 1] + 1)
98
+ end
99
+ rescue Errno::EADDRINUSE, SocketError
100
+ next
112
101
  end
102
+ next if opts.any? { |p| @ports.include?(p) }
103
+ d = total * (total - 1) / 2
104
+ next unless opts.inject(&:+) - (total * opts.min) == d
105
+ @ports += opts
106
+ opts
107
+ end
108
+ next if opts.nil?
109
+ opts = opts[0] if total == 1
110
+ return opts unless block_given?
111
+ begin
112
+ return yield opts
113
+ ensure
114
+ release(opts)
113
115
  end
114
116
  end
117
+ end
115
118
 
116
- # Return it/them back to the pool.
117
- def release(port)
118
- safe do
119
- if port.is_a?(Array)
120
- port.each { |p| @ports.delete(p) }
121
- else
122
- @ports.delete(port)
123
- end
119
+ # Return it/them back to the pool.
120
+ def release(port)
121
+ safe do
122
+ if port.is_a?(Array)
123
+ port.each { |p| @ports.delete(p) }
124
+ else
125
+ @ports.delete(port)
124
126
  end
125
127
  end
128
+ end
126
129
 
127
- private
130
+ private
128
131
 
129
- def take(opt = 0)
130
- server = TCPServer.new('127.0.0.1', opt)
131
- p = server.addr[1]
132
- server.close
133
- p
134
- end
132
+ def take(opt = 0)
133
+ server = TCPServer.new('127.0.0.1', opt)
134
+ p = server.addr[1]
135
+ server.close
136
+ p
137
+ end
135
138
 
136
- def safe
137
- if @sync
138
- @monitor.synchronize { yield }
139
- else
140
- yield
141
- end
139
+ def safe(&block)
140
+ if @sync
141
+ @monitor.synchronize(&block)
142
+ else
143
+ yield
142
144
  end
143
145
  end
144
146
  end
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
@@ -22,4 +22,5 @@
22
22
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
23
  # SOFTWARE.
24
24
 
25
- require 'random-port/pool'
25
+ require_relative 'random-port/module'
26
+ require_relative 'random-port/pool'
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
@@ -24,14 +24,10 @@
24
24
 
25
25
  require 'English'
26
26
  Gem::Specification.new do |s|
27
- s.specification_version = 2 if s.respond_to? :specification_version=
28
- if s.respond_to? :required_rubygems_version=
29
- s.required_rubygems_version = Gem::Requirement.new('>= 0')
30
- end
31
- s.rubygems_version = '2.3.3'
27
+ s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
32
28
  s.required_ruby_version = '>=2.3'
33
29
  s.name = 'random-port'
34
- s.version = '0.5.1'
30
+ s.version = '0.7.0'
35
31
  s.license = 'MIT'
36
32
  s.summary = 'Random TCP port'
37
33
  s.description = 'Reserves a random TCP port'
@@ -39,13 +35,7 @@ Gem::Specification.new do |s|
39
35
  s.email = 'yegor256@gmail.com'
40
36
  s.homepage = 'http://github.com/yegor256/random-port'
41
37
  s.files = `git ls-files`.split($RS)
42
- s.test_files = s.files.grep(%r{^(test)/})
43
38
  s.rdoc_options = ['--charset=UTF-8']
44
39
  s.extra_rdoc_files = ['README.md']
45
- s.add_development_dependency 'codecov', '0.1.10'
46
- s.add_development_dependency 'minitest', '5.11.3'
47
- s.add_development_dependency 'rake', '12.3.1'
48
- s.add_development_dependency 'rdoc', '4.3.0'
49
- s.add_development_dependency 'rubocop', '0.58.1'
50
- s.add_development_dependency 'rubocop-rspec', '1.27.0'
40
+ s.metadata['rubygems_mfa_required'] = 'true'
51
41
  end
data/renovate.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
+ "extends": [
4
+ "config:recommended"
5
+ ]
6
+ }
data/test/test__helper.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2018-2019 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
@@ -20,13 +20,8 @@
20
20
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  # SOFTWARE.
22
22
 
23
- STDOUT.sync = true
23
+ $stdout.sync = true
24
24
 
25
25
  require 'simplecov'
26
26
  SimpleCov.start
27
- if ENV['CI'] == 'true'
28
- require 'codecov'
29
- SimpleCov.formatter = SimpleCov::Formatter::Codecov
30
- end
31
-
32
27
  require 'minitest/autorun'
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
@@ -23,88 +23,110 @@
23
23
  # SOFTWARE.
24
24
 
25
25
  require 'minitest/autorun'
26
+ require 'threads'
27
+ require 'socket'
26
28
  require_relative '../lib/random-port/pool'
27
29
 
28
30
  # Pool test.
29
31
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
30
- # Copyright:: Copyright (c) 2018 Yegor Bugayenko
32
+ # Copyright:: Copyright (c) 2018-2024 Yegor Bugayenko
31
33
  # License:: MIT
32
- module RandomPort
33
- class TestAmount < Minitest::Test
34
- def test_acquires_and_releases
35
- pool = Pool.new
36
- port = pool.acquire
37
- assert(!port.nil?)
38
- assert(port.positive?)
39
- pool.release(port)
40
- end
34
+ class RandomPort::TestPool < Minitest::Test
35
+ def test_acquires_and_releases
36
+ pool = RandomPort::Pool.new
37
+ port = pool.acquire
38
+ server = TCPServer.new('localhost', port)
39
+ server.close
40
+ assert(!port.nil?)
41
+ assert(port.positive?)
42
+ pool.release(port)
43
+ end
41
44
 
42
- def test_acquires_and_releases_three_ports
43
- pool = Pool.new(limit: 3)
44
- assert_equal(0, pool.size)
45
- ports = pool.acquire(3, timeout: 16)
46
- assert_equal(3, pool.size)
47
- assert_equal(3, ports.count)
48
- pool.release(ports)
49
- assert_equal(0, pool.size)
45
+ def test_acquires_and_releases_three_ports
46
+ pool = RandomPort::Pool.new(limit: 3)
47
+ assert_equal(0, pool.size)
48
+ ports = pool.acquire(3, timeout: 16)
49
+ ports.each do |p|
50
+ server = TCPServer.new('localhost', p)
51
+ server.close
50
52
  end
53
+ assert_equal(3, pool.size)
54
+ assert_equal(3, ports.count)
55
+ pool.release(ports)
56
+ assert_equal(0, pool.size)
57
+ end
51
58
 
52
- def test_acquires_and_releases_three_ports_in_block
53
- pool = Pool.new(limit: 3)
54
- assert_equal(0, pool.size)
55
- pool.acquire(3, timeout: 16) do |ports|
56
- assert(ports.is_a?(Array))
57
- assert_equal(3, ports.count)
58
- assert_equal(3, pool.size)
59
+ def test_acquires_and_releases_three_ports_in_block
60
+ pool = RandomPort::Pool.new(limit: 3)
61
+ assert_equal(0, pool.size)
62
+ pool.acquire(3, timeout: 16) do |ports|
63
+ assert(ports.is_a?(Array))
64
+ assert_equal(3, ports.count)
65
+ assert_equal(3, pool.size)
66
+ ports.each do |p|
67
+ server = TCPServer.new('localhost', p)
68
+ server.close
59
69
  end
60
- assert_equal(0, pool.size)
61
70
  end
71
+ assert_equal(0, pool.size)
72
+ end
62
73
 
63
- def test_acquires_and_releases_in_block
64
- result = Pool.new.acquire do |port|
65
- assert(!port.nil?)
66
- assert(port.positive?)
67
- 123
68
- end
69
- assert_equal(123, result)
74
+ def test_acquires_and_releases_in_block
75
+ result = RandomPort::Pool.new.acquire do |port|
76
+ assert(!port.nil?)
77
+ assert(port.positive?)
78
+ 123
70
79
  end
80
+ assert_equal(123, result)
81
+ end
71
82
 
72
- def test_acquires_and_releases_safely
73
- pool = Pool.new
74
- assert_raises do
75
- pool.acquire do
76
- raise 'Itended'
83
+ def test_acquires_and_releases_in_threads
84
+ pool = RandomPort::Pool.new
85
+ Threads.new(100).assert do
86
+ pool.acquire(5) do |ports|
87
+ ports.each do |p|
88
+ server = TCPServer.new('localhost', p)
89
+ server.close
77
90
  end
78
91
  end
79
- assert(pool.count.zero?)
80
92
  end
93
+ end
81
94
 
82
- def test_acquires_and_releases_from_singleton
83
- Pool::SINGLETON.acquire do |port|
84
- assert(!port.nil?)
85
- assert(port.positive?)
95
+ def test_acquires_and_releases_safely
96
+ pool = RandomPort::Pool.new
97
+ assert_raises do
98
+ pool.acquire do
99
+ raise 'Itended'
86
100
  end
87
101
  end
102
+ assert(pool.count.zero?)
103
+ end
88
104
 
89
- def test_acquires_unique_numbers
90
- total = 25
91
- numbers = (0..total - 1).map { Pool::SINGLETON.acquire }
92
- assert_equal(total, numbers.uniq.count)
105
+ def test_acquires_and_releases_from_singleton
106
+ RandomPort::Pool::SINGLETON.acquire do |port|
107
+ assert(!port.nil?)
108
+ assert(port.positive?)
93
109
  end
110
+ end
94
111
 
95
- def test_raises_when_too_many
96
- pool = Pool.new(limit: 1)
97
- pool.acquire
98
- assert_raises Pool::Timeout do
99
- pool.acquire(timeout: 0.1)
100
- end
101
- end
112
+ def test_acquires_unique_numbers
113
+ total = 25
114
+ numbers = (0..total - 1).map { RandomPort::Pool::SINGLETON.acquire }
115
+ assert_equal(total, numbers.uniq.count)
116
+ end
102
117
 
103
- def test_acquires_unique_numbers_in_no_sync_mode
104
- total = 25
105
- pool = Pool.new(sync: false)
106
- numbers = (0..total - 1).map { pool.acquire }
107
- assert_equal(total, numbers.uniq.count)
118
+ def test_raises_when_too_many
119
+ pool = RandomPort::Pool.new(limit: 1)
120
+ pool.acquire
121
+ assert_raises RandomPort::Pool::Timeout do
122
+ pool.acquire(timeout: 0.1)
108
123
  end
109
124
  end
125
+
126
+ def test_acquires_unique_numbers_in_no_sync_mode
127
+ total = 25
128
+ pool = RandomPort::Pool.new(sync: false)
129
+ numbers = (0..total - 1).map { pool.acquire }
130
+ assert_equal(total, numbers.uniq.count)
131
+ end
110
132
  end
metadata CHANGED
@@ -1,99 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: random-port
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
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: 2019-09-10 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: codecov
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - '='
18
- - !ruby/object:Gem::Version
19
- version: 0.1.10
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - '='
25
- - !ruby/object:Gem::Version
26
- version: 0.1.10
27
- - !ruby/object:Gem::Dependency
28
- name: minitest
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - '='
32
- - !ruby/object:Gem::Version
33
- version: 5.11.3
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - '='
39
- - !ruby/object:Gem::Version
40
- version: 5.11.3
41
- - !ruby/object:Gem::Dependency
42
- name: rake
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - '='
46
- - !ruby/object:Gem::Version
47
- version: 12.3.1
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - '='
53
- - !ruby/object:Gem::Version
54
- version: 12.3.1
55
- - !ruby/object:Gem::Dependency
56
- name: rdoc
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - '='
60
- - !ruby/object:Gem::Version
61
- version: 4.3.0
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - '='
67
- - !ruby/object:Gem::Version
68
- version: 4.3.0
69
- - !ruby/object:Gem::Dependency
70
- name: rubocop
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - '='
74
- - !ruby/object:Gem::Version
75
- version: 0.58.1
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - '='
81
- - !ruby/object:Gem::Version
82
- version: 0.58.1
83
- - !ruby/object:Gem::Dependency
84
- name: rubocop-rspec
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - '='
88
- - !ruby/object:Gem::Version
89
- version: 1.27.0
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - '='
95
- - !ruby/object:Gem::Version
96
- version: 1.27.0
11
+ date: 2024-07-10 00:00:00.000000000 Z
12
+ dependencies: []
97
13
  description: Reserves a random TCP port
98
14
  email: yegor256@gmail.com
99
15
  executables: []
@@ -102,24 +18,33 @@ extra_rdoc_files:
102
18
  - README.md
103
19
  files:
104
20
  - ".0pdd.yml"
21
+ - ".github/workflows/actionlint.yml"
22
+ - ".github/workflows/codecov.yml"
23
+ - ".github/workflows/copyrights.yml"
24
+ - ".github/workflows/markdown-lint.yml"
25
+ - ".github/workflows/pdd.yml"
26
+ - ".github/workflows/rake.yml"
27
+ - ".github/workflows/xcop.yml"
105
28
  - ".gitignore"
106
29
  - ".pdd"
107
30
  - ".rubocop.yml"
108
31
  - ".rultor.yml"
109
- - ".travis.yml"
110
32
  - Gemfile
111
33
  - LICENSE.txt
112
34
  - README.md
113
35
  - Rakefile
114
36
  - lib/random-port.rb
37
+ - lib/random-port/module.rb
115
38
  - lib/random-port/pool.rb
116
39
  - random-port.gemspec
40
+ - renovate.json
117
41
  - test/test__helper.rb
118
42
  - test/test_pool.rb
119
43
  homepage: http://github.com/yegor256/random-port
120
44
  licenses:
121
45
  - MIT
122
- metadata: {}
46
+ metadata:
47
+ rubygems_mfa_required: 'true'
123
48
  post_install_message:
124
49
  rdoc_options:
125
50
  - "--charset=UTF-8"
@@ -136,10 +61,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
61
  - !ruby/object:Gem::Version
137
62
  version: '0'
138
63
  requirements: []
139
- rubygems_version: 3.0.1
64
+ rubygems_version: 3.4.10
140
65
  signing_key:
141
- specification_version: 2
66
+ specification_version: 4
142
67
  summary: Random TCP port
143
- test_files:
144
- - test/test__helper.rb
145
- - test/test_pool.rb
68
+ test_files: []
data/.travis.yml DELETED
@@ -1,13 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.6.0
4
- cache: bundler
5
- branches:
6
- only:
7
- - master
8
- install:
9
- - travis_retry bundle update
10
- script:
11
- - bundle exec rake
12
- after_success:
13
- - "bash <(curl -s https://codecov.io/bash)"