qbash 0.4.0 → 0.4.1

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: 0b0f67b4e45883bc237c70115187e6ab211f6fdd29da3f9f891720153ad26569
4
- data.tar.gz: a12f5e499c7f756d71c59b52467454346c455e72d291d2bae7891f05c7e8610b
3
+ metadata.gz: 5bcb7505bb5d037e9270a685ccc8c2b55fffe4ba0de40744a71e67261d176c65
4
+ data.tar.gz: 5cf3716ada0456b85887c95f09d653441ee903c5a8146ff7aef5f9e04989fd1c
5
5
  SHA512:
6
- metadata.gz: eb17f8adf645e156986fcf7d08b27ee3b049fa29910b1f7b9154c51339530481167419d2a68af21b9dafae51613f81971b3e6e30f5eb175416ddafb82c87ea6b
7
- data.tar.gz: 55c6932d3ff9a02474c33d69b3fa05f0b3ae83bf36a911468c155ef3944b603a9dceb29b13ba04eea3e9f3bd8748e90101952b0586d0e82001229a398d80c555
6
+ metadata.gz: 3221e4ce357d1bc544ef9bd9235f975576442f0f6ae390f9e62845f49856629b74921b26ef28254a2c795990a105096fed31f86e7532f4b240994643b5d71e12
7
+ data.tar.gz: 731fc1acd072b6087947895431d40e8dd44c1cc635a59ce9e0aac900c8e670b7cb7a9a2ef99da570f204d07eab5004dfeaf48b818f3bc1f0b67367dc3d66fbc7
data/.0pdd.yml CHANGED
@@ -1,22 +1,5 @@
1
- # Copyright (c) 2024-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) 2024-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: 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) 2024-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) 2024-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) 2024-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: markdown-lint
22
6
  'on':
23
7
  push:
@@ -1,23 +1,7 @@
1
- # Copyright (c) 2024-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) 2024-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:
@@ -40,5 +24,5 @@ jobs:
40
24
  ruby-version: ${{ matrix.ruby }}
41
25
  bundler-cache: true
42
26
  - run: bundle config set --global path "$(pwd)/vendor/bundle"
43
- - run: bundle install
27
+ - run: bundle install --no-color
44
28
  - 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
@@ -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: typos
6
+ 'on':
7
+ push:
8
+ branches:
9
+ - master
10
+ pull_request:
11
+ branches:
12
+ - master
13
+ jobs:
14
+ typos:
15
+ timeout-minutes: 15
16
+ runs-on: ubuntu-24.04
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - uses: crate-ci/typos@v1.32.0
@@ -1,23 +1,7 @@
1
- # Copyright (c) 2024-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) 2024-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: yamllint
22
6
  'on':
23
7
  push:
data/.gitignore CHANGED
@@ -1,9 +1,11 @@
1
- coverage/
2
- .idea/
3
- *.gem
4
1
  .bundle/
5
2
  .DS_Store
6
- rdoc/
7
- doc/
3
+ .idea/
8
4
  .yardoc/
5
+ *.gem
6
+ coverage/
7
+ doc/
8
+ node_modules/
9
+ rdoc/
9
10
  temp/
11
+ vendor/
data/.rubocop.yml CHANGED
@@ -1,22 +1,5 @@
1
- # Copyright (c) 2024-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
data/.rultor.yml CHANGED
@@ -1,25 +1,9 @@
1
- # Copyright (c) 2024-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/Gemfile CHANGED
@@ -1,42 +1,23 @@
1
1
  # frozen_string_literal: true
2
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.
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
- gem 'cucumber', '9.2.1', require: false
27
- gem 'minitest', '5.25.4', require: false
28
- gem 'minitest-reporters', '1.7.1', require: false
29
- gem 'net-ping', '2.0.8', require: false
30
- gem 'rake', '13.2.1', require: false
9
+ gem 'cucumber', '~>9.2', require: false
10
+ gem 'minitest', '~>5.25', require: false
11
+ gem 'minitest-reporters', '~>1.7', require: false
12
+ gem 'net-ping', '~>2.0', require: false
13
+ gem 'rake', '~>13.2', require: false
31
14
  gem 'random-port', '~>0.0', require: false
32
- gem 'rspec-rails', '7.1.1', require: false
33
- gem 'rubocop', '1.71.2', require: false
34
- gem 'rubocop-minitest', '0.36.0', require: false
35
- gem 'rubocop-performance', '1.23.1', require: false
36
- gem 'rubocop-rake', '0.6.0', require: false
37
- gem 'rubocop-rspec', '3.4.0', require: false
38
- gem 'simplecov', '0.22.0', require: false
39
- gem 'simplecov-cobertura', '2.1.0', require: false
40
- gem 'w3c_validators', '1.3.7', require: false
41
- gem 'webmock', '3.25.0', require: false
42
- gem 'yard', '0.9.37', require: false
15
+ gem 'rubocop', '~>1.73', require: false
16
+ gem 'rubocop-minitest', '>0', require: false
17
+ gem 'rubocop-performance', '>0', require: false
18
+ gem 'rubocop-rake', '>0', require: false
19
+ gem 'simplecov', '~>0.22', require: false
20
+ gem 'simplecov-cobertura', '~>2.1', require: false
21
+ gem 'w3c_validators', '~>1.3', require: false
22
+ gem 'webmock', '~>3.25', require: false
23
+ gem 'yard', '~>0.9', require: false
data/Gemfile.lock CHANGED
@@ -10,50 +10,16 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- actionpack (8.0.1)
14
- actionview (= 8.0.1)
15
- activesupport (= 8.0.1)
16
- nokogiri (>= 1.8.5)
17
- rack (>= 2.2.4)
18
- rack-session (>= 1.0.1)
19
- rack-test (>= 0.6.3)
20
- rails-dom-testing (~> 2.2)
21
- rails-html-sanitizer (~> 1.6)
22
- useragent (~> 0.16)
23
- actionview (8.0.1)
24
- activesupport (= 8.0.1)
25
- builder (~> 3.1)
26
- erubi (~> 1.11)
27
- rails-dom-testing (~> 2.2)
28
- rails-html-sanitizer (~> 1.6)
29
- activesupport (8.0.1)
30
- base64
31
- benchmark (>= 0.3)
32
- bigdecimal
33
- concurrent-ruby (~> 1.0, >= 1.3.1)
34
- connection_pool (>= 2.2.5)
35
- drb
36
- i18n (>= 1.6, < 2)
37
- logger (>= 1.4.2)
38
- minitest (>= 5.1)
39
- securerandom (>= 0.3)
40
- tzinfo (~> 2.0, >= 2.0.5)
41
- uri (>= 0.13.1)
42
13
  addressable (2.8.7)
43
14
  public_suffix (>= 2.0.2, < 7.0)
44
15
  ansi (1.5.0)
45
- ast (2.4.2)
16
+ ast (2.4.3)
46
17
  backtrace (0.4.0)
47
- base64 (0.2.0)
48
- benchmark (0.4.0)
49
18
  bigdecimal (3.1.9)
50
19
  builder (3.3.0)
51
- concurrent-ruby (1.3.5)
52
- connection_pool (2.5.0)
53
20
  crack (1.0.0)
54
21
  bigdecimal
55
22
  rexml
56
- crass (1.0.6)
57
23
  cucumber (9.2.1)
58
24
  builder (~> 3.2)
59
25
  cucumber-ci-environment (> 9, < 11)
@@ -79,39 +45,28 @@ GEM
79
45
  cucumber-messages (> 19, < 28)
80
46
  cucumber-messages (22.0.0)
81
47
  cucumber-tag-expressions (6.1.2)
82
- date (3.4.1)
83
- diff-lcs (1.5.1)
48
+ diff-lcs (1.6.1)
84
49
  docile (1.4.1)
85
- drb (2.2.1)
86
50
  elapsed (0.0.1)
87
51
  loog (> 0)
88
52
  tago (> 0)
89
- erubi (1.13.1)
90
- ffi (1.17.1-aarch64-linux-gnu)
91
- ffi (1.17.1-arm-linux-gnu)
92
- ffi (1.17.1-arm64-darwin)
93
- ffi (1.17.1-x64-mingw-ucrt)
94
- ffi (1.17.1-x86-linux-gnu)
95
- ffi (1.17.1-x86_64-darwin)
96
- ffi (1.17.1-x86_64-linux-gnu)
53
+ ffi (1.17.2-aarch64-linux-gnu)
54
+ ffi (1.17.2-arm-linux-gnu)
55
+ ffi (1.17.2-arm64-darwin)
56
+ ffi (1.17.2-x64-mingw-ucrt)
57
+ ffi (1.17.2-x86-linux-gnu)
58
+ ffi (1.17.2-x86_64-darwin)
59
+ ffi (1.17.2-x86_64-linux-gnu)
97
60
  hashdiff (1.1.2)
98
- i18n (1.14.7)
99
- concurrent-ruby (~> 1.0)
100
- io-console (0.8.0)
101
- irb (1.15.1)
102
- pp (>= 0.6.0)
103
- rdoc (>= 4.0.0)
104
- reline (>= 0.4.2)
105
- json (2.9.1)
61
+ json (2.11.3)
106
62
  language_server-protocol (3.17.0.4)
107
- logger (1.6.5)
108
- loofah (2.24.0)
109
- crass (~> 1.0.2)
110
- nokogiri (>= 1.12.0)
111
- loog (0.6.0)
63
+ lint_roller (1.1.0)
64
+ logger (1.7.0)
65
+ loog (0.6.1)
66
+ logger (~> 1.0)
112
67
  mini_mime (1.1.5)
113
68
  mini_portile2 (2.8.8)
114
- minitest (5.25.4)
69
+ minitest (5.25.5)
115
70
  minitest-reporters (1.7.1)
116
71
  ansi
117
72
  builder
@@ -119,107 +74,60 @@ GEM
119
74
  ruby-progressbar
120
75
  multi_test (1.1.0)
121
76
  net-ping (2.0.8)
122
- nokogiri (1.18.2)
77
+ nokogiri (1.18.8)
123
78
  mini_portile2 (~> 2.8.2)
124
79
  racc (~> 1.4)
125
- nokogiri (1.18.2-aarch64-linux-gnu)
80
+ nokogiri (1.18.8-aarch64-linux-gnu)
126
81
  racc (~> 1.4)
127
- nokogiri (1.18.2-arm-linux-gnu)
82
+ nokogiri (1.18.8-arm-linux-gnu)
128
83
  racc (~> 1.4)
129
- nokogiri (1.18.2-arm64-darwin)
84
+ nokogiri (1.18.8-arm64-darwin)
130
85
  racc (~> 1.4)
131
- nokogiri (1.18.2-x64-mingw-ucrt)
86
+ nokogiri (1.18.8-x64-mingw-ucrt)
132
87
  racc (~> 1.4)
133
- nokogiri (1.18.2-x86_64-darwin)
88
+ nokogiri (1.18.8-x86_64-darwin)
134
89
  racc (~> 1.4)
135
- nokogiri (1.18.2-x86_64-linux-gnu)
90
+ nokogiri (1.18.8-x86_64-linux-gnu)
136
91
  racc (~> 1.4)
137
- parallel (1.26.3)
138
- parser (3.3.7.0)
92
+ parallel (1.27.0)
93
+ parser (3.3.8.0)
139
94
  ast (~> 2.4.1)
140
95
  racc
141
- pp (0.6.2)
142
- prettyprint
143
- prettyprint (0.2.0)
144
- psych (5.2.3)
145
- date
146
- stringio
147
- public_suffix (6.0.1)
96
+ prism (1.4.0)
97
+ public_suffix (6.0.2)
148
98
  racc (1.8.1)
149
- rack (3.1.9)
150
- rack-session (2.1.0)
151
- base64 (>= 0.1.0)
152
- rack (>= 3.0.0)
153
- rack-test (2.2.0)
154
- rack (>= 1.3)
155
- rackup (2.2.1)
156
- rack (>= 3)
157
- rails-dom-testing (2.2.0)
158
- activesupport (>= 5.0.0)
159
- minitest
160
- nokogiri (>= 1.6)
161
- rails-html-sanitizer (1.6.2)
162
- loofah (~> 2.21)
163
- 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)
164
- railties (8.0.1)
165
- actionpack (= 8.0.1)
166
- activesupport (= 8.0.1)
167
- irb (~> 1.13)
168
- rackup (>= 1.0.0)
169
- rake (>= 12.2)
170
- thor (~> 1.0, >= 1.2.2)
171
- zeitwerk (~> 2.6)
172
99
  rainbow (3.1.1)
173
100
  rake (13.2.1)
174
101
  random-port (0.7.5)
175
102
  tago (> 0)
176
- rdoc (6.11.0)
177
- psych (>= 4.0.0)
178
103
  regexp_parser (2.10.0)
179
- reline (0.6.0)
180
- io-console (~> 0.5)
181
- rexml (3.4.0)
182
- rspec-core (3.13.3)
183
- rspec-support (~> 3.13.0)
184
- rspec-expectations (3.13.3)
185
- diff-lcs (>= 1.2.0, < 2.0)
186
- rspec-support (~> 3.13.0)
187
- rspec-mocks (3.13.2)
188
- diff-lcs (>= 1.2.0, < 2.0)
189
- rspec-support (~> 3.13.0)
190
- rspec-rails (7.1.1)
191
- actionpack (>= 7.0)
192
- activesupport (>= 7.0)
193
- railties (>= 7.0)
194
- rspec-core (~> 3.13)
195
- rspec-expectations (~> 3.13)
196
- rspec-mocks (~> 3.13)
197
- rspec-support (~> 3.13)
198
- rspec-support (3.13.2)
199
- rubocop (1.71.2)
104
+ rexml (3.4.1)
105
+ rubocop (1.75.5)
200
106
  json (~> 2.3)
201
- language_server-protocol (>= 3.17.0)
107
+ language_server-protocol (~> 3.17.0.2)
108
+ lint_roller (~> 1.1.0)
202
109
  parallel (~> 1.10)
203
110
  parser (>= 3.3.0.2)
204
111
  rainbow (>= 2.2.2, < 4.0)
205
112
  regexp_parser (>= 2.9.3, < 3.0)
206
- rubocop-ast (>= 1.38.0, < 2.0)
113
+ rubocop-ast (>= 1.44.0, < 2.0)
207
114
  ruby-progressbar (~> 1.7)
208
115
  unicode-display_width (>= 2.4.0, < 4.0)
209
- rubocop-ast (1.38.0)
210
- parser (>= 3.3.1.0)
211
- rubocop-minitest (0.36.0)
212
- rubocop (>= 1.61, < 2.0)
213
- rubocop-ast (>= 1.31.1, < 2.0)
214
- rubocop-performance (1.23.1)
215
- rubocop (>= 1.48.1, < 2.0)
216
- rubocop-ast (>= 1.31.1, < 2.0)
217
- rubocop-rake (0.6.0)
218
- rubocop (~> 1.0)
219
- rubocop-rspec (3.4.0)
220
- rubocop (~> 1.61)
116
+ rubocop-ast (1.44.1)
117
+ parser (>= 3.3.7.2)
118
+ prism (~> 1.4)
119
+ rubocop-minitest (0.38.0)
120
+ lint_roller (~> 1.1)
121
+ rubocop (>= 1.75.0, < 2.0)
122
+ rubocop-ast (>= 1.38.0, < 2.0)
123
+ rubocop-performance (1.25.0)
124
+ lint_roller (~> 1.1)
125
+ rubocop (>= 1.75.0, < 2.0)
126
+ rubocop-ast (>= 1.38.0, < 2.0)
127
+ rubocop-rake (0.7.1)
128
+ lint_roller (~> 1.1)
129
+ rubocop (>= 1.72.1)
221
130
  ruby-progressbar (1.13.0)
222
- securerandom (0.4.1)
223
131
  simplecov (0.22.0)
224
132
  docile (~> 1.1)
225
133
  simplecov-html (~> 0.11)
@@ -229,28 +137,21 @@ GEM
229
137
  simplecov (~> 0.19)
230
138
  simplecov-html (0.13.1)
231
139
  simplecov_json_formatter (0.1.4)
232
- stringio (3.1.2)
233
140
  sys-uname (1.3.1)
234
141
  ffi (~> 1.1)
235
- tago (0.0.2)
236
- thor (1.3.2)
237
- tzinfo (2.0.6)
238
- concurrent-ruby (~> 1.0)
142
+ tago (0.1.0)
239
143
  unicode-display_width (3.1.4)
240
144
  unicode-emoji (~> 4.0, >= 4.0.4)
241
145
  unicode-emoji (4.0.4)
242
- uri (1.0.2)
243
- useragent (0.16.11)
244
146
  w3c_validators (1.3.7)
245
147
  json (>= 1.8)
246
148
  nokogiri (~> 1.6)
247
149
  rexml (~> 3.2)
248
- webmock (3.25.0)
150
+ webmock (3.25.1)
249
151
  addressable (>= 2.8.0)
250
152
  crack (>= 0.3.2)
251
153
  hashdiff (>= 0.4.0, < 2.0.0)
252
154
  yard (0.9.37)
253
- zeitwerk (2.7.1)
254
155
 
255
156
  PLATFORMS
256
157
  aarch64-linux
@@ -263,24 +164,22 @@ PLATFORMS
263
164
  x86_64-linux
264
165
 
265
166
  DEPENDENCIES
266
- cucumber (= 9.2.1)
267
- minitest (= 5.25.4)
268
- minitest-reporters (= 1.7.1)
269
- net-ping (= 2.0.8)
167
+ cucumber (~> 9.2)
168
+ minitest (~> 5.25)
169
+ minitest-reporters (~> 1.7)
170
+ net-ping (~> 2.0)
270
171
  qbash!
271
- rake (= 13.2.1)
172
+ rake (~> 13.2)
272
173
  random-port (~> 0.0)
273
- rspec-rails (= 7.1.1)
274
- rubocop (= 1.71.2)
275
- rubocop-minitest (= 0.36.0)
276
- rubocop-performance (= 1.23.1)
277
- rubocop-rake (= 0.6.0)
278
- rubocop-rspec (= 3.4.0)
279
- simplecov (= 0.22.0)
280
- simplecov-cobertura (= 2.1.0)
281
- w3c_validators (= 1.3.7)
282
- webmock (= 3.25.0)
283
- yard (= 0.9.37)
174
+ rubocop (~> 1.73)
175
+ rubocop-minitest (> 0)
176
+ rubocop-performance (> 0)
177
+ rubocop-rake (> 0)
178
+ simplecov (~> 0.22)
179
+ simplecov-cobertura (~> 2.1)
180
+ w3c_validators (~> 1.3)
181
+ webmock (~> 3.25)
182
+ yard (~> 0.9)
284
183
 
285
184
  BUNDLED WITH
286
185
  2.5.16
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
@@ -1,18 +1,18 @@
1
1
  # Quick and Simple Executor of Bash Commands
2
2
 
3
- [![DevOps By Rultor.com](http://www.rultor.com/b/yegor256/qbash)](http://www.rultor.com/p/yegor256/qbash)
3
+ [![DevOps By Rultor.com](https://www.rultor.com/b/yegor256/qbash)](https://www.rultor.com/p/yegor256/qbash)
4
4
  [![We recommend RubyMine](https://www.elegantobjects.org/rubymine.svg)](https://www.jetbrains.com/ruby/)
5
5
 
6
6
  [![rake](https://github.com/yegor256/qbash/actions/workflows/rake.yml/badge.svg)](https://github.com/yegor256/qbash/actions/workflows/rake.yml)
7
- [![PDD status](http://www.0pdd.com/svg?name=yegor256/qbash)](http://www.0pdd.com/p?name=yegor256/qbash)
8
- [![Gem Version](https://badge.fury.io/rb/qbash.svg)](http://badge.fury.io/rb/qbash)
7
+ [![PDD status](https://www.0pdd.com/svg?name=yegor256/qbash)](https://www.0pdd.com/p?name=yegor256/qbash)
8
+ [![Gem Version](https://badge.fury.io/rb/qbash.svg)](https://badge.fury.io/rb/qbash)
9
9
  [![Test Coverage](https://img.shields.io/codecov/c/github/yegor256/qbash.svg)](https://codecov.io/github/yegor256/qbash?branch=master)
10
- [![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://rubydoc.info/github/yegor256/qbash/master/frames)
10
+ [![Yard Docs](https://img.shields.io/badge/yard-docs-blue.svg)](https://rubydoc.info/github/yegor256/qbash/master/frames)
11
11
  [![Hits-of-Code](https://hitsofcode.com/github/yegor256/qbash)](https://hitsofcode.com/view/github/yegor256/qbash)
12
12
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/yegor256/qbash/blob/master/LICENSE.txt)
13
13
 
14
14
  How do you execute a new shell command from Ruby?
15
- There are [many ways](https://stackoverflow.com/questions/2232).
15
+ There are [many ways][so-question].
16
16
  None of them offers a one-liner that would execute a command, print
17
17
  its output to the console or a logger, and then raise an exception if
18
18
  the exit code is not zero. This small gem offers exactly this one-liner.
@@ -67,7 +67,7 @@ converted to a string by joining all items with spaces between them.
67
67
  ```ruby
68
68
  qbash(
69
69
  [
70
- 'echo "Hello, world!"'
70
+ 'echo "Hello, world!"',
71
71
  '&& echo "How are you?"',
72
72
  '&& cat /etc/passwd'
73
73
  ]
@@ -93,7 +93,7 @@ qbash("cat #{Shellwords.escape(file)}")
93
93
  ```
94
94
 
95
95
  Without such an escaping, in this example, a space inside the `file`
96
- will lead to an unpredicatable result of the execution.
96
+ will lead to an unpredictable result of the execution.
97
97
 
98
98
  If you want to stop sooner than the command finishes, use
99
99
  [timeout] gem:
@@ -112,7 +112,7 @@ of waiting for the `sleep` to finish.
112
112
 
113
113
  Read
114
114
  [these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html).
115
- Make sure you build is green before you contribute
115
+ Make sure your build is green before you contribute
116
116
  your pull request. You will need to have
117
117
  [Ruby](https://www.ruby-lang.org/en/) 3.0+ and
118
118
  [Bundler](https://bundler.io/) installed. Then:
@@ -128,3 +128,4 @@ If it's clean and you don't see any error messages, submit your pull request.
128
128
  [qbash]: https://rubydoc.info/github/yegor256/qbash/master/Kernel#qbash-instance_method
129
129
  [signal]: https://en.wikipedia.org/wiki/Signal_(IPC)
130
130
  [timeout]: https://github.com/ruby/timeout
131
+ [so-question]: https://stackoverflow.com/questions/2232/
data/REUSE.toml ADDED
@@ -0,0 +1,34 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
3
+
4
+ version = 1
5
+ [[annotations]]
6
+ path = [
7
+ ".DS_Store",
8
+ ".gitattributes",
9
+ ".gitignore",
10
+ ".pdd",
11
+ "**.json",
12
+ "**.md",
13
+ "**.txt",
14
+ "**/.DS_Store",
15
+ "**/.gitignore",
16
+ "**/.pdd",
17
+ "**/*.csv",
18
+ "**/*.jpg",
19
+ "**/*.json",
20
+ "**/*.md",
21
+ "**/*.pdf",
22
+ "**/*.png",
23
+ "**/*.svg",
24
+ "**/*.txt",
25
+ "**/*.vm",
26
+ "**/CNAME",
27
+ "**/Gemfile.lock",
28
+ "Gemfile.lock",
29
+ "README.md",
30
+ "renovate.json",
31
+ ]
32
+ precedence = "override"
33
+ SPDX-FileCopyrightText = "Copyright (c) 2025 Yegor Bugayenko"
34
+ SPDX-License-Identifier = "MIT"
data/Rakefile CHANGED
@@ -1,28 +1,10 @@
1
1
  # frozen_string_literal: true
2
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.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
6
  require 'rubygems'
24
7
  require 'rake'
25
- require 'rdoc'
26
8
  require 'rake/clean'
27
9
 
28
10
  def name
@@ -57,5 +39,4 @@ require 'rubocop/rake_task'
57
39
  desc 'Run RuboCop on all directories'
58
40
  RuboCop::RakeTask.new(:rubocop) do |task|
59
41
  task.fail_on_error = true
60
- task.requires << 'rubocop-rspec'
61
42
  end
data/lib/qbash.rb CHANGED
@@ -1,24 +1,7 @@
1
1
  # frozen_string_literal: true
2
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.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
6
  require 'backtrace'
24
7
  require 'logger'
@@ -33,25 +16,64 @@ require 'tago'
33
16
  # Copyright:: Copyright (c) 2024-2025 Yegor Bugayenko
34
17
  # License:: MIT
35
18
  module Kernel
36
- # Execute a single bash command.
19
+ # Execute a single bash command safely with proper error handling.
20
+ #
21
+ # QBash provides a safe way to execute shell commands with proper error handling,
22
+ # logging, and stdin/stdout management. It's designed to be simple for basic use
23
+ # cases while offering powerful options for advanced scenarios.
24
+ #
25
+ # == Basic Usage
26
+ #
27
+ # # Execute a command and get its output
28
+ # year = qbash('date +%Y')
29
+ # puts "Current year: #{year}"
30
+ #
31
+ # # Execute a command that might fail
32
+ # files = qbash('find /tmp -name "*.log"')
33
+ #
34
+ # == Working with Exit Codes
35
+ #
36
+ # # Get both output and exit code
37
+ # output, code = qbash('grep "error" /var/log/system.log', both: true)
38
+ # puts "Command succeeded" if code.zero?
39
+ #
40
+ # # Accept multiple exit codes as valid
41
+ # result = qbash('grep "pattern" file.txt', accept: [0, 1])
42
+ #
43
+ # == Providing Input via STDIN
44
+ #
45
+ # # Pass data to command's stdin
46
+ # result = qbash('wc -l', stdin: "line 1\nline 2\nline 3")
47
+ #
48
+ # == Environment Variables
49
+ #
50
+ # # Set environment variables for the command
51
+ # output = qbash('echo $NAME', env: { 'NAME' => 'Ruby' })
37
52
  #
38
- # For example:
53
+ # == Logging
39
54
  #
40
- # year = qbash('date +%Y')
55
+ # # Enable detailed logging to stdout
56
+ # qbash('ls -la', log: $stdout)
41
57
  #
42
- # If exit code is not zero, an exception will be raised.
58
+ # # Use custom logger with specific level
59
+ # logger = Logger.new($stdout)
60
+ # qbash('make all', log: logger, level: Logger::INFO)
43
61
  #
44
- # To escape arguments, use +Shellwords.escape()+ method.
62
+ # == Process Control
45
63
  #
46
- # Stderr automatically merges with stdout.
64
+ # # Get control over long-running process
65
+ # qbash('sleep 30') do |pid|
66
+ # puts "Process #{pid} is running..."
67
+ # # Do something while process is running
68
+ # # Process will be terminated when block exits
69
+ # end
47
70
  #
48
- # If you need full control over the process started, provide
49
- # a block, which will receive process ID (integer) once the process
50
- # is started.
71
+ # For command with multiple arguments, you can use +Shellwords.escape()+ to
72
+ # properly escape each argument. Stderr automatically merges with stdout.
51
73
  #
52
74
  # Read this <a href="https://github.com/yegor256/qbash">README</a> file for more details.
53
75
  #
54
- # @param [String] cmd The command to run, for example +echo "Hello, world!"+
76
+ # @param [String, Array] cmd The command to run (String or Array of arguments)
55
77
  # @param [String] stdin The +stdin+ to provide to the command
56
78
  # @param [Hash] env Hash of environment variables
57
79
  # @param [Loog|IO] log Logging facility with +.debug()+ method (or +$stdout+, or nil if should go to +/dev/null+)
@@ -85,7 +107,7 @@ module Kernel
85
107
  buf = ''
86
108
  e = 1
87
109
  start = Time.now
88
- Open3.popen2e(env, "/bin/bash -c #{Shellwords.escape(cmd)}") do |sin, sout, thr|
110
+ Open3.popen2e(env, "/bin/bash -c #{Shellwords.escape(cmd)}") do |sin, sout, ctrl|
89
111
  sin.write(stdin)
90
112
  sin.close
91
113
  if block_given?
@@ -98,7 +120,9 @@ module Kernel
98
120
  rescue IOError => e
99
121
  ln = Backtrace.new(e).to_s
100
122
  end
101
- ln = "##{thr.pid}: #{ln}"
123
+ next if ln.nil?
124
+ next if ln.empty?
125
+ ln = "##{ctrl.pid}: #{ln}"
102
126
  if log.nil?
103
127
  # no logging
104
128
  elsif log.respond_to?(mtd)
@@ -109,7 +133,7 @@ module Kernel
109
133
  buf += ln
110
134
  end
111
135
  end
112
- pid = thr.pid
136
+ pid = ctrl.pid
113
137
  yield pid
114
138
  begin
115
139
  Process.kill('TERM', pid)
@@ -134,7 +158,7 @@ module Kernel
134
158
  end
135
159
  buf += ln
136
160
  end
137
- e = thr.value.to_i
161
+ e = ctrl.value.to_i
138
162
  if !accept.nil? && !accept.include?(e)
139
163
  raise "The command '#{cmd}' failed with exit code ##{e} in #{start.ago}\n#{buf}"
140
164
  end
data/qbash.gemspec CHANGED
@@ -1,24 +1,7 @@
1
1
  # frozen_string_literal: true
2
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.
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.2'
28
11
  s.name = 'qbash'
29
- s.version = '0.4.0'
12
+ s.version = '0.4.1'
30
13
  s.license = 'MIT'
31
14
  s.summary = 'Quick Executor of a BASH Command'
32
15
  s.description =
data/test/test__helper.rb CHANGED
@@ -1,34 +1,31 @@
1
1
  # frozen_string_literal: true
2
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.
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.start
27
-
28
9
  require 'simplecov-cobertura'
29
- SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter
10
+ unless SimpleCov.running || ENV['PICKS']
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 90
19
+ SimpleCov.minimum_coverage_by_file 90
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
30
28
 
31
29
  require 'minitest/autorun'
32
-
33
30
  require 'minitest/reporters'
34
31
  Minitest::Reporters.use! [Minitest::Reporters::SpecReporter.new]
data/test/test_qbash.rb CHANGED
@@ -1,24 +1,7 @@
1
1
  # frozen_string_literal: true
2
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.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
6
  require 'minitest/autorun'
24
7
  require 'tmpdir'
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qbash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
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-07 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: backtrace
@@ -72,8 +71,8 @@ email: yegor256@gmail.com
72
71
  executables: []
73
72
  extensions: []
74
73
  extra_rdoc_files:
75
- - README.md
76
74
  - LICENSE.txt
75
+ - README.md
77
76
  files:
78
77
  - ".0pdd.yml"
79
78
  - ".gitattributes"
@@ -83,17 +82,20 @@ files:
83
82
  - ".github/workflows/markdown-lint.yml"
84
83
  - ".github/workflows/pdd.yml"
85
84
  - ".github/workflows/rake.yml"
85
+ - ".github/workflows/reuse.yml"
86
+ - ".github/workflows/typos.yml"
86
87
  - ".github/workflows/xcop.yml"
87
88
  - ".github/workflows/yamllint.yml"
88
89
  - ".gitignore"
89
90
  - ".pdd"
90
91
  - ".rubocop.yml"
91
92
  - ".rultor.yml"
92
- - ".simplecov"
93
93
  - Gemfile
94
94
  - Gemfile.lock
95
95
  - LICENSE.txt
96
+ - LICENSES/MIT.txt
96
97
  - README.md
98
+ - REUSE.toml
97
99
  - Rakefile
98
100
  - lib/qbash.rb
99
101
  - qbash.gemspec
@@ -105,7 +107,6 @@ licenses:
105
107
  - MIT
106
108
  metadata:
107
109
  rubygems_mfa_required: 'true'
108
- post_install_message:
109
110
  rdoc_options:
110
111
  - "--charset=UTF-8"
111
112
  require_paths:
@@ -121,8 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
122
  - !ruby/object:Gem::Version
122
123
  version: '0'
123
124
  requirements: []
124
- rubygems_version: 3.4.10
125
- signing_key:
125
+ rubygems_version: 3.6.7
126
126
  specification_version: 4
127
127
  summary: Quick Executor of a BASH Command
128
128
  test_files: []
data/.simplecov DELETED
@@ -1,41 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- #
4
- # Copyright (c) 2024-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 NONINFRINGEMENT. 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
- add_filter '/features/'
31
- end
32
- else
33
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
34
- [SimpleCov::Formatter::HTMLFormatter]
35
- )
36
- SimpleCov.start do
37
- add_filter '/test/'
38
- add_filter '/features/'
39
- minimum_coverage 10
40
- end
41
- end