donce 0.1.0 → 0.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 77e8fc303600f62224be74352774a1d7d2a0e151cf4935316112874bf2b4c39f
4
- data.tar.gz: 220d2d7b9fcdcd4702fb594daf2211a0268f54a7fc21231bbf8e4a670f75d796
3
+ metadata.gz: '09901a711fba51137272827d67c175803769b4e3c019771c283d596d1d54b27a'
4
+ data.tar.gz: 59de5a9b21733ee965595d2ea500dcf5a2c55e32fdf6dd732871ae30d452de0d
5
5
  SHA512:
6
- metadata.gz: 5e70dc715fb1b8166a6bf0805639b7f384e5f346438fdd8c030444d02a7fee8bcfb042ccd1bf71ef095ca201f1dbb4f586a30fe50a102686eb5b4dff6e6e2ee8
7
- data.tar.gz: 2a4bf49df247f331a36dfaffb055a66f38e207dda78133c49d7db95e7178be4421253803d456e931cb40227802142c7f5d7363b11cb36345d85c662d79f00800
6
+ metadata.gz: 54cd3837888a7dc868381c839220acf271e5e823214838cfd59804c9fd4dfcd648f8748ec327669c4b78661a5ecb257c05c0117e537f353c9230d826e6d391ba
7
+ data.tar.gz: 5e1639092860793750a3066167898cee12b53116e139e33bb9db8f4685ca2911bd9de4261940599bb9c38f6e6c289bee9637af78c10bfeb5e4e2ac6bc0e3b550
data/.0pdd.yml CHANGED
@@ -1,22 +1,5 @@
1
- # Copyright (c) 2025 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
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
  ---
21
4
  errors:
22
5
  - yegor256@gmail.com
@@ -1,23 +1,7 @@
1
- # Copyright (c) 2025 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 NONINFINGEMENT. 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
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
  ---
4
+ # yamllint disable rule:line-length
21
5
  name: actionlint
22
6
  'on':
23
7
  push:
@@ -34,7 +18,6 @@ jobs:
34
18
  - uses: actions/checkout@v4
35
19
  - name: Download actionlint
36
20
  id: get_actionlint
37
- # yamllint disable-line rule:line-length
38
21
  run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
39
22
  shell: bash
40
23
  - name: Check workflow files
@@ -1,23 +1,7 @@
1
- # Copyright (c) 2025 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
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
  ---
4
+ # yamllint disable rule:line-length
21
5
  name: codecov
22
6
  'on':
23
7
  push:
@@ -34,7 +18,7 @@ jobs:
34
18
  ruby-version: 3.3
35
19
  bundler-cache: true
36
20
  - run: bundle config set --global path "$(pwd)/vendor/bundle"
37
- - run: bundle install
21
+ - run: bundle install --no-color
38
22
  - run: bundle exec rake
39
23
  - uses: codecov/codecov-action@v5
40
24
  with:
@@ -1,23 +1,7 @@
1
- # Copyright (c) 2025 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
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
  ---
4
+ # yamllint disable rule:line-length
21
5
  name: copyrights
22
6
  'on':
23
7
  push:
@@ -1,23 +1,7 @@
1
- # Copyright (c) 2025 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 NONINFINGEMENT. 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
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
  ---
4
+ # yamllint disable rule:line-length
21
5
  name: markdown-lint
22
6
  'on':
23
7
  push:
@@ -1,23 +1,7 @@
1
- # Copyright (c) 2025 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
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
  ---
4
+ # yamllint disable rule:line-length
21
5
  name: pdd
22
6
  'on':
23
7
  push:
@@ -1,23 +1,7 @@
1
- # Copyright (c) 2025 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
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
  ---
4
+ # yamllint disable rule:line-length
21
5
  name: rake
22
6
  'on':
23
7
  push:
@@ -41,5 +25,5 @@ jobs:
41
25
  ruby-version: ${{ matrix.ruby }}
42
26
  bundler-cache: true
43
27
  - run: bundle config set --global path "$(pwd)/vendor/bundle"
44
- - run: bundle install
28
+ - run: bundle install --no-color
45
29
  - run: bundle exec rake
@@ -0,0 +1,19 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
3
+ ---
4
+ # yamllint disable rule:line-length
5
+ name: reuse
6
+ 'on':
7
+ push:
8
+ branches:
9
+ - master
10
+ pull_request:
11
+ branches:
12
+ - master
13
+ jobs:
14
+ reuse:
15
+ timeout-minutes: 15
16
+ runs-on: ubuntu-24.04
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - uses: fsfe/reuse-action@v5
@@ -1,23 +1,7 @@
1
- # Copyright (c) 2025 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
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
  ---
4
+ # yamllint disable rule:line-length
21
5
  name: xcop
22
6
  'on':
23
7
  push:
@@ -1,23 +1,7 @@
1
- # Copyright (c) 2025 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 NONINFINGEMENT. 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
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
  ---
4
+ # yamllint disable rule:line-length
21
5
  name: yamllint
22
6
  'on':
23
7
  push:
data/.gitignore CHANGED
@@ -1,8 +1,10 @@
1
- coverage/
2
- .idea/
3
1
  *.gem
4
- .bundle/
5
2
  .DS_Store
6
- rdoc/
7
- doc/
3
+ .bundle/
4
+ .idea/
8
5
  .yardoc/
6
+ coverage/
7
+ doc/
8
+ node_modules/
9
+ rdoc/
10
+ vendor/
data/.rubocop.yml CHANGED
@@ -1,22 +1,5 @@
1
- # Copyright (c) 2025 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
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
  ---
21
4
  AllCops:
22
5
  Exclude:
@@ -27,7 +10,7 @@ AllCops:
27
10
  TargetRubyVersion: 3.2
28
11
  SuggestExtensions: false
29
12
  NewCops: enable
30
- require:
13
+ plugins:
31
14
  - rubocop-minitest
32
15
  - rubocop-performance
33
16
  - rubocop-rake
@@ -47,3 +30,4 @@ Metrics/PerceivedComplexity:
47
30
  Enabled: false
48
31
  Layout/EmptyLineAfterGuardClause:
49
32
  Enabled: false
33
+ require: []
data/.rultor.yml CHANGED
@@ -1,25 +1,9 @@
1
- # Copyright (c) 2025 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
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
  ---
4
+ # yamllint disable rule:line-length
21
5
  docker:
22
- image: yegor256/rultor-ruby
6
+ image: yegor256/ruby
23
7
  assets:
24
8
  rubygems.yml: yegor256/home#assets/rubygems.yml
25
9
  install: |
data/.yamllint.yml CHANGED
@@ -1,22 +1,5 @@
1
- # Copyright (c) 2025 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
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
  ---
21
4
  extends: default
22
5
  rules:
data/Gemfile CHANGED
@@ -1,39 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2025 Yegor Bugayenko
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the 'Software'), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
6
  source 'https://rubygems.org'
24
7
  gemspec
25
8
 
26
9
  gem 'loog', '>0', require: false
27
- gem 'minitest', '5.25.4', require: false
28
- gem 'minitest-reporters', '1.7.1', require: false
29
- gem 'minitest-retry', '0.2.5', require: false
30
- gem 'rake', '13.2.1', require: false
31
- gem 'rspec-rails', '7.1.1', require: false
32
- gem 'rubocop', '1.71.2', require: false
33
- gem 'rubocop-minitest', '0.36.0', require: false
34
- gem 'rubocop-performance', '1.23.1', require: false
10
+ gem 'minitest', '~>5.25', require: false
11
+ gem 'minitest-reporters', '~>1.7', require: false
12
+ gem 'minitest-retry', '~>0.2', require: false
13
+ gem 'rake', '~>13.2', require: false
14
+ gem 'rubocop', '~>1.75', require: false
15
+ gem 'rubocop-minitest', '>0', require: false
16
+ gem 'rubocop-performance', '>0', require: false
35
17
  gem 'rubocop-rake', '>0', require: false
36
- gem 'rubocop-rspec', '3.4.0', require: false
37
- gem 'simplecov', '0.22.0', require: false
38
- gem 'simplecov-cobertura', '2.1.0', require: false
39
- gem 'yard', '0.9.37', require: false
18
+ gem 'rubocop-rspec', '>0', require: false
19
+ gem 'simplecov', '~>0.22', require: false
20
+ gem 'simplecov-cobertura', '~>2.1', require: false
21
+ gem 'yard', '~>0.9', require: false
data/Gemfile.lock CHANGED
@@ -2,75 +2,26 @@ PATH
2
2
  remote: .
3
3
  specs:
4
4
  donce (0.0.0)
5
- backtrace (> 0)
6
- os (> 0)
7
- qbash (> 0)
5
+ backtrace (~> 0.3)
6
+ os (~> 1.1)
7
+ qbash (~> 0.3)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actionpack (8.0.1)
13
- actionview (= 8.0.1)
14
- activesupport (= 8.0.1)
15
- nokogiri (>= 1.8.5)
16
- rack (>= 2.2.4)
17
- rack-session (>= 1.0.1)
18
- rack-test (>= 0.6.3)
19
- rails-dom-testing (~> 2.2)
20
- rails-html-sanitizer (~> 1.6)
21
- useragent (~> 0.16)
22
- actionview (8.0.1)
23
- activesupport (= 8.0.1)
24
- builder (~> 3.1)
25
- erubi (~> 1.11)
26
- rails-dom-testing (~> 2.2)
27
- rails-html-sanitizer (~> 1.6)
28
- activesupport (8.0.1)
29
- base64
30
- benchmark (>= 0.3)
31
- bigdecimal
32
- concurrent-ruby (~> 1.0, >= 1.3.1)
33
- connection_pool (>= 2.2.5)
34
- drb
35
- i18n (>= 1.6, < 2)
36
- logger (>= 1.4.2)
37
- minitest (>= 5.1)
38
- securerandom (>= 0.3)
39
- tzinfo (~> 2.0, >= 2.0.5)
40
- uri (>= 0.13.1)
41
12
  ansi (1.5.0)
42
- ast (2.4.2)
13
+ ast (2.4.3)
43
14
  backtrace (0.4.0)
44
- base64 (0.2.0)
45
- benchmark (0.4.0)
46
- bigdecimal (3.1.9)
47
15
  builder (3.3.0)
48
- concurrent-ruby (1.3.5)
49
- connection_pool (2.5.0)
50
- crass (1.0.6)
51
- date (3.4.1)
52
- diff-lcs (1.5.1)
53
16
  docile (1.4.1)
54
- drb (2.2.1)
55
17
  elapsed (0.0.1)
56
18
  loog (> 0)
57
19
  tago (> 0)
58
- erubi (1.13.1)
59
- i18n (1.14.7)
60
- concurrent-ruby (~> 1.0)
61
- io-console (0.8.0)
62
- irb (1.15.1)
63
- pp (>= 0.6.0)
64
- rdoc (>= 4.0.0)
65
- reline (>= 0.4.2)
66
- json (2.9.1)
20
+ json (2.10.2)
67
21
  language_server-protocol (3.17.0.4)
68
- logger (1.6.5)
69
- loofah (2.24.0)
70
- crass (~> 1.0.2)
71
- nokogiri (>= 1.12.0)
22
+ lint_roller (1.1.0)
72
23
  loog (0.6.0)
73
- minitest (5.25.4)
24
+ minitest (5.25.5)
74
25
  minitest-reporters (1.7.1)
75
26
  ansi
76
27
  builder
@@ -78,103 +29,51 @@ GEM
78
29
  ruby-progressbar
79
30
  minitest-retry (0.2.5)
80
31
  minitest (>= 5.0)
81
- nokogiri (1.18.2-arm64-darwin)
82
- racc (~> 1.4)
83
- nokogiri (1.18.2-x64-mingw-ucrt)
84
- racc (~> 1.4)
85
- nokogiri (1.18.2-x86_64-darwin)
86
- racc (~> 1.4)
87
- nokogiri (1.18.2-x86_64-linux-gnu)
88
- racc (~> 1.4)
89
32
  os (1.1.4)
90
33
  parallel (1.26.3)
91
- parser (3.3.7.1)
34
+ parser (3.3.7.4)
92
35
  ast (~> 2.4.1)
93
36
  racc
94
- pp (0.6.2)
95
- prettyprint
96
- prettyprint (0.2.0)
97
- psych (5.2.3)
98
- date
99
- stringio
100
- qbash (0.3.2)
37
+ prism (1.4.0)
38
+ qbash (0.4.0)
101
39
  backtrace (> 0)
102
40
  elapsed (> 0)
103
41
  loog (> 0)
104
42
  tago (> 0)
105
43
  racc (1.8.1)
106
- rack (3.1.9)
107
- rack-session (2.1.0)
108
- base64 (>= 0.1.0)
109
- rack (>= 3.0.0)
110
- rack-test (2.2.0)
111
- rack (>= 1.3)
112
- rackup (2.2.1)
113
- rack (>= 3)
114
- rails-dom-testing (2.2.0)
115
- activesupport (>= 5.0.0)
116
- minitest
117
- nokogiri (>= 1.6)
118
- rails-html-sanitizer (1.6.2)
119
- loofah (~> 2.21)
120
- nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
121
- railties (8.0.1)
122
- actionpack (= 8.0.1)
123
- activesupport (= 8.0.1)
124
- irb (~> 1.13)
125
- rackup (>= 1.0.0)
126
- rake (>= 12.2)
127
- thor (~> 1.0, >= 1.2.2)
128
- zeitwerk (~> 2.6)
129
44
  rainbow (3.1.1)
130
45
  rake (13.2.1)
131
- rdoc (6.11.0)
132
- psych (>= 4.0.0)
133
46
  regexp_parser (2.10.0)
134
- reline (0.6.0)
135
- io-console (~> 0.5)
136
- rexml (3.4.0)
137
- rspec-core (3.13.3)
138
- rspec-support (~> 3.13.0)
139
- rspec-expectations (3.13.3)
140
- diff-lcs (>= 1.2.0, < 2.0)
141
- rspec-support (~> 3.13.0)
142
- rspec-mocks (3.13.2)
143
- diff-lcs (>= 1.2.0, < 2.0)
144
- rspec-support (~> 3.13.0)
145
- rspec-rails (7.1.1)
146
- actionpack (>= 7.0)
147
- activesupport (>= 7.0)
148
- railties (>= 7.0)
149
- rspec-core (~> 3.13)
150
- rspec-expectations (~> 3.13)
151
- rspec-mocks (~> 3.13)
152
- rspec-support (~> 3.13)
153
- rspec-support (3.13.2)
154
- rubocop (1.71.2)
47
+ rexml (3.4.1)
48
+ rubocop (1.75.2)
155
49
  json (~> 2.3)
156
- language_server-protocol (>= 3.17.0)
50
+ language_server-protocol (~> 3.17.0.2)
51
+ lint_roller (~> 1.1.0)
157
52
  parallel (~> 1.10)
158
53
  parser (>= 3.3.0.2)
159
54
  rainbow (>= 2.2.2, < 4.0)
160
55
  regexp_parser (>= 2.9.3, < 3.0)
161
- rubocop-ast (>= 1.38.0, < 2.0)
56
+ rubocop-ast (>= 1.44.0, < 2.0)
162
57
  ruby-progressbar (~> 1.7)
163
58
  unicode-display_width (>= 2.4.0, < 4.0)
164
- rubocop-ast (1.38.0)
165
- parser (>= 3.3.1.0)
166
- rubocop-minitest (0.36.0)
167
- rubocop (>= 1.61, < 2.0)
168
- rubocop-ast (>= 1.31.1, < 2.0)
169
- rubocop-performance (1.23.1)
170
- rubocop (>= 1.48.1, < 2.0)
171
- rubocop-ast (>= 1.31.1, < 2.0)
172
- rubocop-rake (0.6.0)
173
- rubocop (~> 1.0)
174
- rubocop-rspec (3.4.0)
175
- rubocop (~> 1.61)
59
+ rubocop-ast (1.44.0)
60
+ parser (>= 3.3.7.2)
61
+ prism (~> 1.4)
62
+ rubocop-minitest (0.38.0)
63
+ lint_roller (~> 1.1)
64
+ rubocop (>= 1.75.0, < 2.0)
65
+ rubocop-ast (>= 1.38.0, < 2.0)
66
+ rubocop-performance (1.25.0)
67
+ lint_roller (~> 1.1)
68
+ rubocop (>= 1.75.0, < 2.0)
69
+ rubocop-ast (>= 1.38.0, < 2.0)
70
+ rubocop-rake (0.7.1)
71
+ lint_roller (~> 1.1)
72
+ rubocop (>= 1.72.1)
73
+ rubocop-rspec (3.5.0)
74
+ lint_roller (~> 1.1)
75
+ rubocop (~> 1.72, >= 1.72.1)
176
76
  ruby-progressbar (1.13.0)
177
- securerandom (0.4.1)
178
77
  simplecov (0.22.0)
179
78
  docile (~> 1.1)
180
79
  simplecov-html (~> 0.11)
@@ -184,44 +83,33 @@ GEM
184
83
  simplecov (~> 0.19)
185
84
  simplecov-html (0.13.1)
186
85
  simplecov_json_formatter (0.1.4)
187
- stringio (3.1.2)
188
- tago (0.0.2)
189
- thor (1.3.2)
190
- tzinfo (2.0.6)
191
- concurrent-ruby (~> 1.0)
86
+ tago (0.1.0)
192
87
  unicode-display_width (3.1.4)
193
88
  unicode-emoji (~> 4.0, >= 4.0.4)
194
89
  unicode-emoji (4.0.4)
195
- uri (1.0.2)
196
- useragent (0.16.11)
197
90
  yard (0.9.37)
198
- zeitwerk (2.7.1)
199
91
 
200
92
  PLATFORMS
201
- arm64-darwin-22
202
93
  arm64-darwin-23
203
94
  arm64-darwin-24
95
+ ruby
204
96
  x64-mingw-ucrt
205
- x86_64-darwin-20
206
- x86_64-darwin-21
207
- x86_64-linux
208
97
 
209
98
  DEPENDENCIES
210
99
  donce!
211
100
  loog (> 0)
212
- minitest (= 5.25.4)
213
- minitest-reporters (= 1.7.1)
214
- minitest-retry (= 0.2.5)
215
- rake (= 13.2.1)
216
- rspec-rails (= 7.1.1)
217
- rubocop (= 1.71.2)
218
- rubocop-minitest (= 0.36.0)
219
- rubocop-performance (= 1.23.1)
101
+ minitest (~> 5.25)
102
+ minitest-reporters (~> 1.7)
103
+ minitest-retry (~> 0.2)
104
+ rake (~> 13.2)
105
+ rubocop (~> 1.75)
106
+ rubocop-minitest (> 0)
107
+ rubocop-performance (> 0)
220
108
  rubocop-rake (> 0)
221
- rubocop-rspec (= 3.4.0)
222
- simplecov (= 0.22.0)
223
- simplecov-cobertura (= 2.1.0)
224
- yard (= 0.9.37)
109
+ rubocop-rspec (> 0)
110
+ simplecov (~> 0.22)
111
+ simplecov-cobertura (~> 2.1)
112
+ yard (~> 0.9)
225
113
 
226
114
  BUNDLED WITH
227
115
  2.5.16
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2025 Yegor Bugayenko
3
+ Copyright (c) 2024-2025 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/LICENSES/MIT.txt ADDED
@@ -0,0 +1,21 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) 2024-2025 Yegor Bugayenko
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the 'Software'), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -11,7 +11,7 @@
11
11
  [![Hits-of-Code](https://hitsofcode.com/github/yegor256/donce)](https://hitsofcode.com/view/github/yegor256/donce)
12
12
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/yegor256/donce/blob/master/LICENSE.txt)
13
13
 
14
- This small Ruby library helps building temporary [Docker]
14
+ This small Ruby library helps to build temporary [Docker]
15
15
  images, runs Docker containers, and cleans up afterwards — it may be
16
16
  convenient for automated tests (for example, with [Minitest]):
17
17
 
@@ -38,15 +38,33 @@ stdout = donce(image: 'ubuntu', command: 'sleep 9999') do |id|
38
38
  end
39
39
  ```
40
40
 
41
- That's it.
41
+ ## Parameters
42
+
43
+ Here's a list of the available parameters for `donce`:
44
+
45
+ - `dockerfile`: Content of the Dockerfile (string or array of strings)
46
+ - `home`: Directory with Dockerfile and all other necessary files
47
+ - `image`: Name of a Docker image to use (e.g. "ubuntu:22.04")
48
+ - `log`: Logging destination (defaults to $stdout)
49
+ - `args`: Extra arguments for the docker command
50
+ - `env`: Environment variables mapping for the container
51
+ - `volumes`: Local to container volumes mapping
52
+ - `ports`: Local to container port mapping
53
+ - `build_args`: Arguments for docker build (--build-arg)
54
+ - `root`: Let user inside the container be "root" (default: false)
55
+ - `command`: The command to execute in the container
56
+ - `timeout`: Maximum seconds to spend on each docker call (default: 10)
57
+
58
+ The function `donce_host()` returns the hostname of the host machine that
59
+ can be used from within the container.
42
60
 
43
61
  ## How to contribute
44
62
 
45
63
  Read
46
64
  [these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html).
47
- Make sure you build is green before you contribute
65
+ Make sure your build is green before you contribute
48
66
  your pull request. You will need to have
49
- [Ruby](https://www.ruby-lang.org/en/) 3.2+ and
67
+ [Ruby](https://www.ruby-lang.org/en/) 3.0+ and
50
68
  [Bundler](https://bundler.io/) installed. Then:
51
69
 
52
70
  ```bash
data/REUSE.toml ADDED
@@ -0,0 +1,34 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
3
+
4
+ version = 1
5
+ [[annotations]]
6
+ path = [
7
+ "**.json",
8
+ "**.md",
9
+ "**.txt",
10
+ "**/*.csv",
11
+ "**/*.jpg",
12
+ "**/*.json",
13
+ "**/*.md",
14
+ "**/*.pdf",
15
+ "**/*.png",
16
+ "**/*.svg",
17
+ "**/*.txt",
18
+ "**/*.vm",
19
+ "**/.DS_Store",
20
+ "**/.gitignore",
21
+ "**/.pdd",
22
+ "**/CNAME",
23
+ "**/Gemfile.lock",
24
+ ".DS_Store",
25
+ ".gitattributes",
26
+ ".gitignore",
27
+ ".pdd",
28
+ "Gemfile.lock",
29
+ "README.md",
30
+ "renovate.json",
31
+ ]
32
+ precedence = "override"
33
+ SPDX-FileCopyrightText = "Copyright (c) 2024-2025 Yegor Bugayenko"
34
+ SPDX-License-Identifier = "MIT"
data/Rakefile CHANGED
@@ -1,24 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2025 Yegor Bugayenko
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the 'Software'), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
6
  require 'rubygems'
24
7
  require 'rake'
@@ -56,8 +39,3 @@ RuboCop::RakeTask.new(:rubocop) do |task|
56
39
  task.fail_on_error = true
57
40
  task.requires << 'rubocop-rspec'
58
41
  end
59
-
60
- desc 'Run benchmark script'
61
- task :benchmark do
62
- ruby 'benchmarks/simple.rb'
63
- end
data/donce.gemspec CHANGED
@@ -1,24 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2025 Yegor Bugayenko
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the 'Software'), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
6
  require 'English'
24
7
 
@@ -26,7 +9,7 @@ Gem::Specification.new do |s|
26
9
  s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
27
10
  s.required_ruby_version = '>=3.0'
28
11
  s.name = 'donce'
29
- s.version = '0.1.0'
12
+ s.version = '0.2.0'
30
13
  s.license = 'MIT'
31
14
  s.summary = 'Builds and starts temporary Docker containers'
32
15
  s.description =
@@ -35,15 +18,15 @@ Gem::Specification.new do |s|
35
18
  'up, deleting them both. This may be helpful for automated testing, ' \
36
19
  'when you test how your code might behave in an isolated environment. ' \
37
20
  'This may also be helpful when you need a custom Docker image with a ' \
38
- 'tool inside, but Testcontainers don\' have such an image.'
21
+ 'tool inside, but Testcontainers don\'t have such an image.'
39
22
  s.authors = ['Yegor Bugayenko']
40
23
  s.email = 'yegor256@gmail.com'
41
24
  s.homepage = 'http://github.com/yegor256/donce.rb'
42
25
  s.files = `git ls-files`.split($RS)
43
26
  s.rdoc_options = ['--charset=UTF-8']
44
27
  s.extra_rdoc_files = ['README.md', 'LICENSE.txt']
45
- s.add_dependency 'backtrace', '>0'
46
- s.add_dependency 'os', '>0'
47
- s.add_dependency 'qbash', '>0'
28
+ s.add_dependency 'backtrace', '~> 0.3'
29
+ s.add_dependency 'os', '~> 1.1'
30
+ s.add_dependency 'qbash', '~> 0.3'
48
31
  s.metadata['rubygems_mfa_required'] = 'true'
49
32
  end
data/lib/donce.rb CHANGED
@@ -1,30 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2025 Yegor Bugayenko
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the 'Software'), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
6
  require 'logger'
24
7
  require 'os'
25
8
  require 'qbash'
26
9
  require 'securerandom'
27
10
  require 'shellwords'
11
+ require 'timeout'
12
+ require 'tmpdir'
28
13
 
29
14
  # Execute Docker container and clean up afterwards.
30
15
  #
@@ -57,7 +42,7 @@ require 'shellwords'
57
42
  # variable to any value.
58
43
  #
59
44
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
60
- # Copyright:: Copyright (c) 2025 Yegor Bugayenko
45
+ # Copyright:: Copyright (c) 2024-2025 Yegor Bugayenko
61
46
  # License:: MIT
62
47
  module Kernel
63
48
  # The name of the localhost inside Docker container.
@@ -70,7 +55,7 @@ module Kernel
70
55
  #
71
56
  # @param [String] dockerfile The content of the +Dockerfile+ (if array is provided, it will be concatenated)
72
57
  # @param [String] home The directory with Dockerfile and all other necessary files
73
- # @param [String] image The name of Docker image, e.g. "ubuntu:24.04"
58
+ # @param [String] image The name of Docker image, e.g. "ubuntu:22.04"
74
59
  # @param [Logger] log The logging destination, can be +$stdout+
75
60
  # @param [String|Array<String>] args List of extra arguments for the +docker+ command
76
61
  # @param [Hash<String,String>] env Environment variables going into the container
@@ -82,11 +67,12 @@ module Kernel
82
67
  # @param [Integer] timeout Maximum seconds to spend on each +docker+ call
83
68
  # @return [String] The stdout of the container
84
69
  def donce(dockerfile: nil, image: nil, home: nil, log: $stdout, args: '', env: {}, root: false, command: '',
85
- timeout: 10, volumes: {}, ports: {}, build_args: {})
70
+ timeout: 60, volumes: {}, ports: {}, build_args: {})
86
71
  raise 'Either use "dockerfile" or "home"' if dockerfile && home
87
72
  raise 'Either use "dockerfile" or "image"' if dockerfile && image
88
73
  raise 'Either use "image" or "home"' if home && image
89
74
  raise 'Either "dockerfile", or "home", or "image" must be provided' if !dockerfile && !home && !image
75
+ raise 'The "timeout" must be an integer or nil' unless timeout.nil? || timeout.is_a?(Integer)
90
76
  docker = ENV['DONCE_SUDO'] ? 'sudo docker' : 'docker'
91
77
  img =
92
78
  if image
data/test/test__helper.rb CHANGED
@@ -1,36 +1,32 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2025 Yegor Bugayenko
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the 'Software'), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
6
  $stdout.sync = true
24
7
 
25
8
  require 'simplecov'
26
- SimpleCov.external_at_exit = true
27
- SimpleCov.start
28
-
29
9
  require 'simplecov-cobertura'
30
- SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter
10
+ unless SimpleCov.running
11
+ SimpleCov.command_name('test')
12
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
13
+ [
14
+ SimpleCov::Formatter::HTMLFormatter,
15
+ SimpleCov::Formatter::CoberturaFormatter
16
+ ]
17
+ )
18
+ SimpleCov.minimum_coverage 80
19
+ SimpleCov.minimum_coverage_by_file 80
20
+ SimpleCov.start do
21
+ add_filter 'test/'
22
+ add_filter 'vendor/'
23
+ add_filter 'target/'
24
+ track_files 'lib/**/*.rb'
25
+ track_files '*.rb'
26
+ end
27
+ end
31
28
 
32
29
  require 'minitest/autorun'
33
-
34
30
  require 'minitest/reporters'
35
31
  Minitest::Reporters.use! [Minitest::Reporters::SpecReporter.new]
36
32
 
data/test/test_donce.rb CHANGED
@@ -1,32 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2025 Yegor Bugayenko
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the 'Software'), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
- require 'minitest/autorun'
6
+ require 'logger'
24
7
  require 'loog'
8
+ require 'minitest/autorun'
25
9
  require_relative '../lib/donce'
26
10
 
27
11
  # Test.
28
12
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
29
- # Copyright:: Copyright (c) 2025 Yegor Bugayenko
13
+ # Copyright:: Copyright (c) 2024-2025 Yegor Bugayenko
30
14
  # License:: MIT
31
15
  class TestDonce < Minitest::Test
32
16
  def test_runs_simple_echo
@@ -49,7 +33,7 @@ class TestDonce < Minitest::Test
49
33
  end
50
34
 
51
35
  def test_runs_existing_image
52
- stdout = donce(image: 'ubuntu:24.04', command: 'echo hello', log: Loog::NULL)
36
+ stdout = donce(image: 'ubuntu:22.04', command: 'echo hello', log: Loog::NULL)
53
37
  assert_equal("hello\n", stdout)
54
38
  end
55
39
 
@@ -84,6 +68,7 @@ class TestDonce < Minitest::Test
84
68
  donce(dockerfile: "FROM ubuntu\nCMD while true; do sleep 1; echo sleeping; done", log: Loog::NULL) do |id|
85
69
  seen = true
86
70
  refute_empty(id)
71
+ sleep 1
87
72
  end
88
73
  assert(seen)
89
74
  end
metadata CHANGED
@@ -1,62 +1,61 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: donce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-02-10 00:00:00.000000000 Z
10
+ date: 2025-04-07 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: backtrace
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
- - - ">"
16
+ - - "~>"
18
17
  - !ruby/object:Gem::Version
19
- version: '0'
18
+ version: '0.3'
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
- - - ">"
23
+ - - "~>"
25
24
  - !ruby/object:Gem::Version
26
- version: '0'
25
+ version: '0.3'
27
26
  - !ruby/object:Gem::Dependency
28
27
  name: os
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
- - - ">"
30
+ - - "~>"
32
31
  - !ruby/object:Gem::Version
33
- version: '0'
32
+ version: '1.1'
34
33
  type: :runtime
35
34
  prerelease: false
36
35
  version_requirements: !ruby/object:Gem::Requirement
37
36
  requirements:
38
- - - ">"
37
+ - - "~>"
39
38
  - !ruby/object:Gem::Version
40
- version: '0'
39
+ version: '1.1'
41
40
  - !ruby/object:Gem::Dependency
42
41
  name: qbash
43
42
  requirement: !ruby/object:Gem::Requirement
44
43
  requirements:
45
- - - ">"
44
+ - - "~>"
46
45
  - !ruby/object:Gem::Version
47
- version: '0'
46
+ version: '0.3'
48
47
  type: :runtime
49
48
  prerelease: false
50
49
  version_requirements: !ruby/object:Gem::Requirement
51
50
  requirements:
52
- - - ">"
51
+ - - "~>"
53
52
  - !ruby/object:Gem::Version
54
- version: '0'
53
+ version: '0.3'
55
54
  description: A one-function library that helps you build a temporary Docker image,
56
55
  run a temporary Docker container from it, and then clean up, deleting them both.
57
56
  This may be helpful for automated testing, when you test how your code might behave
58
57
  in an isolated environment. This may also be helpful when you need a custom Docker
59
- image with a tool inside, but Testcontainers don' have such an image.
58
+ image with a tool inside, but Testcontainers don't have such an image.
60
59
  email: yegor256@gmail.com
61
60
  executables: []
62
61
  extensions: []
@@ -72,18 +71,20 @@ files:
72
71
  - ".github/workflows/markdown-lint.yml"
73
72
  - ".github/workflows/pdd.yml"
74
73
  - ".github/workflows/rake.yml"
74
+ - ".github/workflows/reuse.yml"
75
75
  - ".github/workflows/xcop.yml"
76
76
  - ".github/workflows/yamllint.yml"
77
77
  - ".gitignore"
78
78
  - ".pdd"
79
79
  - ".rubocop.yml"
80
80
  - ".rultor.yml"
81
- - ".simplecov"
82
81
  - ".yamllint.yml"
83
82
  - Gemfile
84
83
  - Gemfile.lock
85
84
  - LICENSE.txt
85
+ - LICENSES/MIT.txt
86
86
  - README.md
87
+ - REUSE.toml
87
88
  - Rakefile
88
89
  - donce.gemspec
89
90
  - lib/donce.rb
@@ -95,7 +96,6 @@ licenses:
95
96
  - MIT
96
97
  metadata:
97
98
  rubygems_mfa_required: 'true'
98
- post_install_message:
99
99
  rdoc_options:
100
100
  - "--charset=UTF-8"
101
101
  require_paths:
@@ -111,8 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  - !ruby/object:Gem::Version
112
112
  version: '0'
113
113
  requirements: []
114
- rubygems_version: 3.4.10
115
- signing_key:
114
+ rubygems_version: 3.6.2
116
115
  specification_version: 4
117
116
  summary: Builds and starts temporary Docker containers
118
117
  test_files: []
data/.simplecov DELETED
@@ -1,39 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- #
4
- # Copyright (c) 2025 Yegor Bugayenko
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the 'Software'), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in all
14
- # copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- # SOFTWARE.
23
-
24
- if Gem.win_platform?
25
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
26
- SimpleCov::Formatter::HTMLFormatter
27
- ]
28
- SimpleCov.start do
29
- add_filter '/test/'
30
- end
31
- else
32
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
33
- [SimpleCov::Formatter::HTMLFormatter]
34
- )
35
- SimpleCov.start do
36
- add_filter '/test/'
37
- minimum_coverage 20
38
- end
39
- end