verbose 0.0.2 → 0.1.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: a3c1132a2ab497379701fe1b67eb32e6c320c8e368b6e7fee89cd4e00f62f1f0
4
- data.tar.gz: 07dadf0f32ac2c28bc428cca0236fc4e73f0b800dee4bbe56f86c62a4a7f5df0
3
+ metadata.gz: 26cc962c23d3292e69b6d3befe12f602ef0f764fdfceac0ad1953256fa510412
4
+ data.tar.gz: 247be06f918bb1f172c736c98de1e623f9450f45a33998c7e67951d54966fc76
5
5
  SHA512:
6
- metadata.gz: 10f19a5ffc0a370c197b38ad20d8f63dd65c1c4f05a98cc9f898749e2ccb1e7cbafa60a0482ed13bff45b1250844bc90ad19665f343657f54a1643dc467050ee
7
- data.tar.gz: 17cbd5f2d4251cbf99ccddf02eaac576abf5004d672f56098db04bcab56ff84d650b132b8fd678a206bc36f133c3ca64370b500892186515958a898f72cb2d92
6
+ metadata.gz: ce2f8b165107072620c998c79f512960fda34f252b95fb17aee09eb647a3267e5d5c561f90acfa7526e0e4bc9489b2d2e98ecfc7b934e3b8615a2ceb99d23b64
7
+ data.tar.gz: a86001d3032ca302bb75d72e31b4124316c040ee3f51d1f74202bf4c72f6a9b5f488260d53bd255041dbf81c4638e8c3477c0ae70ea5c3adb3fcd6b96bd52ff7
data/.0pdd.yml CHANGED
@@ -1,22 +1,5 @@
1
- # Copyright (c) 2024 Yegor Bugayenko
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the 'Software'), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in all
11
- # copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
- # SOFTWARE.
1
+ # 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 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:
@@ -28,12 +12,12 @@ name: actionlint
28
12
  - master
29
13
  jobs:
30
14
  actionlint:
31
- runs-on: ubuntu-22.04
15
+ timeout-minutes: 15
16
+ runs-on: ubuntu-24.04
32
17
  steps:
33
18
  - uses: actions/checkout@v4
34
19
  - name: Download actionlint
35
20
  id: get_actionlint
36
- # yamllint disable-line rule:line-length
37
21
  run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
38
22
  shell: bash
39
23
  - name: Check workflow files
@@ -1,23 +1,7 @@
1
- # Copyright (c) 2024 Yegor Bugayenko
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the 'Software'), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in all
11
- # copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
- # SOFTWARE.
1
+ # 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:
@@ -25,15 +9,17 @@ name: codecov
25
9
  - master
26
10
  jobs:
27
11
  codecov:
28
- runs-on: ubuntu-22.04
12
+ timeout-minutes: 15
13
+ runs-on: ubuntu-24.04
29
14
  steps:
30
15
  - uses: actions/checkout@v4
31
16
  - uses: ruby/setup-ruby@v1
32
17
  with:
33
- ruby-version: 3.2
18
+ ruby-version: 3.3
34
19
  bundler-cache: true
35
- - run: bundle install
20
+ - run: bundle config set --global path "$(pwd)/vendor/bundle"
21
+ - run: bundle install --no-color
36
22
  - run: bundle exec rake
37
- - uses: codecov/codecov-action@v4.0.0-beta.3
23
+ - uses: codecov/codecov-action@v5
38
24
  with:
39
25
  token: ${{ secrets.CODECOV_TOKEN }}
@@ -1,30 +1,15 @@
1
- # Copyright (c) 2024 Yegor Bugayenko
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the 'Software'), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in all
11
- # copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
- # SOFTWARE.
1
+ # 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:
24
8
  pull_request:
25
9
  jobs:
26
10
  copyrights:
27
- runs-on: ubuntu-22.04
11
+ timeout-minutes: 15
12
+ runs-on: ubuntu-24.04
28
13
  steps:
29
14
  - uses: actions/checkout@v4
30
- - uses: yegor256/copyrights-action@0.0.4
15
+ - uses: yegor256/copyrights-action@0.0.12
@@ -1,23 +1,7 @@
1
- # Copyright (c) 2024 Yegor Bugayenko
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the 'Software'), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in all
11
- # copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND 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:
@@ -32,7 +16,8 @@ concurrency:
32
16
  cancel-in-progress: true
33
17
  jobs:
34
18
  markdown-lint:
35
- runs-on: ubuntu-22.04
19
+ timeout-minutes: 15
20
+ runs-on: ubuntu-24.04
36
21
  steps:
37
22
  - uses: actions/checkout@v4
38
- - uses: articulate/actions-markdownlint@v1
23
+ - uses: DavidAnson/markdownlint-cli2-action@v20.0.0
@@ -1,23 +1,7 @@
1
- # Copyright (c) 2024 Yegor Bugayenko
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the 'Software'), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in all
11
- # copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
- # SOFTWARE.
1
+ # 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:
@@ -28,7 +12,8 @@ name: pdd
28
12
  - master
29
13
  jobs:
30
14
  pdd:
31
- runs-on: ubuntu-22.04
15
+ timeout-minutes: 15
16
+ runs-on: ubuntu-24.04
32
17
  steps:
33
18
  - uses: actions/checkout@v4
34
19
  - uses: volodya-lombrozo/pdd-action@master
@@ -1,23 +1,7 @@
1
- # Copyright (c) 2024 Yegor Bugayenko
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the 'Software'), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in all
11
- # copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
- # SOFTWARE.
1
+ # 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:
@@ -28,11 +12,10 @@ name: rake
28
12
  - master
29
13
  jobs:
30
14
  rake:
31
- name: test
32
15
  strategy:
33
16
  matrix:
34
- os: [ubuntu-20.04, macos-12, windows-2022]
35
- ruby: [3.2, 3.3]
17
+ os: [ubuntu-24.04, macos-15, windows-2022]
18
+ ruby: [3.3]
36
19
  runs-on: ${{ matrix.os }}
37
20
  steps:
38
21
  - uses: actions/checkout@v4
@@ -40,5 +23,6 @@ jobs:
40
23
  with:
41
24
  ruby-version: ${{ matrix.ruby }}
42
25
  bundler-cache: true
43
- - run: bundle install
26
+ - run: bundle config set --global path "$(pwd)/vendor/bundle"
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.35.4
@@ -1,30 +1,15 @@
1
- # Copyright (c) 2024 Yegor Bugayenko
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the 'Software'), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in all
11
- # copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
- # SOFTWARE.
1
+ # 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:
24
8
  pull_request:
25
9
  jobs:
26
10
  xcop:
27
- runs-on: ubuntu-22.04
11
+ timeout-minutes: 15
12
+ runs-on: ubuntu-24.04
28
13
  steps:
29
14
  - uses: actions/checkout@v4
30
15
  - uses: g4s8/xcop-action@master
@@ -1,23 +1,7 @@
1
- # Copyright (c) 2024 Yegor Bugayenko
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the 'Software'), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in all
11
- # copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND 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:
@@ -28,7 +12,8 @@ name: yamllint
28
12
  - master
29
13
  jobs:
30
14
  yamllint:
31
- runs-on: ubuntu-22.04
15
+ timeout-minutes: 15
16
+ runs-on: ubuntu-24.04
32
17
  steps:
33
18
  - uses: actions/checkout@v4
34
19
  - uses: ibiqlik/action-yamllint@v3
data/.gitignore CHANGED
@@ -1,8 +1,11 @@
1
- coverage/
2
- .idea/
3
1
  *.gem
4
2
  .bundle/
3
+ .claude/
5
4
  .DS_Store
6
- rdoc/
5
+ .idea/
6
+ .yardoc/
7
+ coverage/
7
8
  doc/
8
- .yardoc/
9
+ node_modules/
10
+ rdoc/
11
+ vendor/
data/.rubocop.yml CHANGED
@@ -1,22 +1,5 @@
1
- # Copyright (c) 2024 Yegor Bugayenko
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the 'Software'), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in all
11
- # copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
- # SOFTWARE.
1
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
  ---
21
4
  AllCops:
22
5
  Exclude:
@@ -27,7 +10,10 @@ AllCops:
27
10
  TargetRubyVersion: 3.2
28
11
  SuggestExtensions: false
29
12
  NewCops: enable
30
-
13
+ plugins:
14
+ - rubocop-rake
15
+ - rubocop-minitest
16
+ - rubocop-performance
31
17
  Gemspec/RequiredRubyVersion:
32
18
  Enabled: false
33
19
  Metrics/AbcSize:
@@ -42,3 +28,5 @@ Metrics/PerceivedComplexity:
42
28
  Enabled: false
43
29
  Style/OptionalBooleanParameter:
44
30
  Enabled: false
31
+ Minitest/EmptyLineBeforeAssertionMethods:
32
+ Enabled: false
data/.rultor.yml CHANGED
@@ -1,25 +1,9 @@
1
- # Copyright (c) 2024 Yegor Bugayenko
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the 'Software'), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in all
11
- # copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
- # SOFTWARE.
1
+ # 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-image:1.23.1
6
+ image: yegor256/ruby
23
7
  assets:
24
8
  rubygems.yml: yegor256/home#assets/rubygems.yml
25
9
  install: |
data/.simplecov CHANGED
@@ -1,25 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  #
4
- # Copyright (c) 2024 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.
4
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
5
+ # SPDX-License-Identifier: MIT
23
6
 
24
7
  if Gem.win_platform?
25
8
  SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
data/.yamllint.yml CHANGED
@@ -1,22 +1,5 @@
1
- # Copyright (c) 2024 Yegor Bugayenko
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the 'Software'), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in all
11
- # copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
- # SOFTWARE.
1
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
  ---
21
4
  rules:
22
5
  line-length:
data/Gemfile CHANGED
@@ -1,32 +1,18 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2024 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 'minitest', '5.23.1', require: false
27
- gem 'rake', '13.2.1', require: false
28
- gem 'rubocop', '1.64.1', require: false
29
- gem 'rubocop-rspec', '3.0.1', require: false
30
- gem 'simplecov', '0.22.0', require: false
31
- gem 'simplecov-cobertura', '2.1.0', require: false
32
- gem 'yard', '0.9.36', require: false
9
+ gem 'minitest', '~>5.25', require: false
10
+ gem 'minitest-reporters', '~>1.7', require: false
11
+ gem 'rake', '~>13.2', require: false
12
+ gem 'rubocop', '~>1.64', require: false
13
+ gem 'rubocop-minitest', '~>0.38', require: false
14
+ gem 'rubocop-performance', '~>1.25', require: false
15
+ gem 'rubocop-rake', '~>0.7', require: false
16
+ gem 'simplecov', '~>0.22', require: false
17
+ gem 'simplecov-cobertura', '~>3.0', require: false
18
+ gem 'yard', '~>0.9', require: false
data/Gemfile.lock CHANGED
@@ -8,68 +8,93 @@ PATH
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- ast (2.4.2)
12
- docile (1.4.0)
13
- json (2.7.2)
14
- language_server-protocol (3.17.0.3)
15
- loog (0.5.1)
16
- minitest (5.23.1)
17
- parallel (1.25.1)
18
- parser (3.3.3.0)
11
+ ansi (1.5.0)
12
+ ast (2.4.3)
13
+ builder (3.3.0)
14
+ docile (1.4.1)
15
+ json (2.13.2)
16
+ language_server-protocol (3.17.0.5)
17
+ lint_roller (1.1.0)
18
+ logger (1.7.0)
19
+ loog (0.6.1)
20
+ logger (~> 1.0)
21
+ minitest (5.25.5)
22
+ minitest-reporters (1.7.1)
23
+ ansi
24
+ builder
25
+ minitest (>= 5.0)
26
+ ruby-progressbar
27
+ parallel (1.27.0)
28
+ parser (3.3.9.0)
19
29
  ast (~> 2.4.1)
20
30
  racc
21
- racc (1.8.0)
31
+ prism (1.4.0)
32
+ racc (1.8.1)
22
33
  rainbow (3.1.1)
23
- rake (13.2.1)
24
- regexp_parser (2.9.2)
25
- rexml (3.3.0)
26
- strscan
27
- rubocop (1.64.1)
34
+ rake (13.3.0)
35
+ regexp_parser (2.11.2)
36
+ rexml (3.4.1)
37
+ rubocop (1.79.2)
28
38
  json (~> 2.3)
29
- language_server-protocol (>= 3.17.0)
39
+ language_server-protocol (~> 3.17.0.2)
40
+ lint_roller (~> 1.1.0)
30
41
  parallel (~> 1.10)
31
42
  parser (>= 3.3.0.2)
32
43
  rainbow (>= 2.2.2, < 4.0)
33
- regexp_parser (>= 1.8, < 3.0)
34
- rexml (>= 3.2.5, < 4.0)
35
- rubocop-ast (>= 1.31.1, < 2.0)
44
+ regexp_parser (>= 2.9.3, < 3.0)
45
+ rubocop-ast (>= 1.46.0, < 2.0)
36
46
  ruby-progressbar (~> 1.7)
37
- unicode-display_width (>= 2.4.0, < 3.0)
38
- rubocop-ast (1.31.3)
39
- parser (>= 3.3.1.0)
40
- rubocop-rspec (3.0.1)
41
- rubocop (~> 1.61)
47
+ unicode-display_width (>= 2.4.0, < 4.0)
48
+ rubocop-ast (1.46.0)
49
+ parser (>= 3.3.7.2)
50
+ prism (~> 1.4)
51
+ rubocop-minitest (0.38.1)
52
+ lint_roller (~> 1.1)
53
+ rubocop (>= 1.75.0, < 2.0)
54
+ rubocop-ast (>= 1.38.0, < 2.0)
55
+ rubocop-performance (1.25.0)
56
+ lint_roller (~> 1.1)
57
+ rubocop (>= 1.75.0, < 2.0)
58
+ rubocop-ast (>= 1.38.0, < 2.0)
59
+ rubocop-rake (0.7.1)
60
+ lint_roller (~> 1.1)
61
+ rubocop (>= 1.72.1)
42
62
  ruby-progressbar (1.13.0)
43
63
  simplecov (0.22.0)
44
64
  docile (~> 1.1)
45
65
  simplecov-html (~> 0.11)
46
66
  simplecov_json_formatter (~> 0.1)
47
- simplecov-cobertura (2.1.0)
67
+ simplecov-cobertura (3.0.0)
48
68
  rexml
49
69
  simplecov (~> 0.19)
50
- simplecov-html (0.12.3)
70
+ simplecov-html (0.13.2)
51
71
  simplecov_json_formatter (0.1.4)
52
- strscan (3.1.0)
53
- tago (0.0.2)
54
- unicode-display_width (2.5.0)
55
- yard (0.9.36)
72
+ tago (0.1.0)
73
+ unicode-display_width (3.1.4)
74
+ unicode-emoji (~> 4.0, >= 4.0.4)
75
+ unicode-emoji (4.0.4)
76
+ yard (0.9.37)
56
77
 
57
78
  PLATFORMS
58
79
  arm64-darwin-22
80
+ arm64-darwin-23
59
81
  ruby
60
82
  x64-mingw-ucrt
61
83
  x86_64-darwin-20
62
84
  x86_64-linux
63
85
 
64
86
  DEPENDENCIES
65
- minitest (= 5.23.1)
66
- rake (= 13.2.1)
67
- rubocop (= 1.64.1)
68
- rubocop-rspec (= 3.0.1)
69
- simplecov (= 0.22.0)
70
- simplecov-cobertura (= 2.1.0)
87
+ minitest (~> 5.25)
88
+ minitest-reporters (~> 1.7)
89
+ rake (~> 13.2)
90
+ rubocop (~> 1.64)
91
+ rubocop-minitest (~> 0.38)
92
+ rubocop-performance (~> 1.25)
93
+ rubocop-rake (~> 0.7)
94
+ simplecov (~> 0.22)
95
+ simplecov-cobertura (~> 3.0)
71
96
  verbose!
72
- yard (= 0.9.36)
97
+ yard (~> 0.9)
73
98
 
74
99
  BUNDLED WITH
75
- 2.5.6
100
+ 2.5.16
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2024 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
@@ -1,13 +1,13 @@
1
1
  # A Decorator that Logs Every Method Call of a Decoratee
2
2
 
3
- [![DevOps By Rultor.com](http://www.rultor.com/b/yegor256/verbose)](http://www.rultor.com/p/yegor256/verbose)
3
+ [![DevOps By Rultor.com](https://www.rultor.com/b/yegor256/verbose)](https://www.rultor.com/p/yegor256/verbose)
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/verbose/actions/workflows/rake.yml/badge.svg)](https://github.com/yegor256/verbose/actions/workflows/rake.yml)
7
- [![PDD status](http://www.0pdd.com/svg?name=yegor256/verbose)](http://www.0pdd.com/p?name=yegor256/verbose)
8
- [![Gem Version](https://badge.fury.io/rb/verbose.svg)](http://badge.fury.io/rb/verbose)
7
+ [![PDD status](https://www.0pdd.com/svg?name=yegor256/verbose)](https://www.0pdd.com/p?name=yegor256/verbose)
8
+ [![Gem Version](https://badge.fury.io/rb/verbose.svg)](https://badge.fury.io/rb/verbose)
9
9
  [![Test Coverage](https://img.shields.io/codecov/c/github/yegor256/verbose.svg)](https://codecov.io/github/yegor256/verbose?branch=master)
10
- [![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://rubydoc.info/github/yegor256/verbose/master/frames)
10
+ [![Yard Docs](https://img.shields.io/badge/yard-docs-blue.svg)](https://rubydoc.info/github/yegor256/verbose/master/frames)
11
11
  [![Hits-of-Code](https://hitsofcode.com/github/yegor256/verbose)](https://hitsofcode.com/view/github/yegor256/verbose)
12
12
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/yegor256/verbose/blob/master/LICENSE.txt)
13
13
 
@@ -17,14 +17,29 @@ Here is how you use it:
17
17
  require 'verbose'
18
18
  x = MyObject.new
19
19
  v = Verbose.new(x)
20
- v.foo() # check the log
20
+ v.foo # see the logging line in the console
21
21
  ```
22
22
 
23
+ Instead of printing to the console, you can pass an instance
24
+ of the [Logger][logger] class to the `Verbose` constructor:
25
+
26
+ ```ruby
27
+ require 'verbose'
28
+ require 'logger'
29
+ x = MyObject.new
30
+ v = Verbose.new(x, log: Logger.new(STDOUT))
31
+ v.foo
32
+ ```
33
+
34
+ I also recommend checking the
35
+ [`loog`](https://github.com/yegor256/loog) gem
36
+ for more object-oriented logging.
37
+
23
38
  ## How to contribute
24
39
 
25
40
  Read
26
41
  [these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html).
27
- Make sure you build is green before you contribute
42
+ Make sure your build is green before you contribute
28
43
  your pull request. You will need to have
29
44
  [Ruby](https://www.ruby-lang.org/en/) 3.2+ and
30
45
  [Bundler](https://bundler.io/) installed. Then:
@@ -35,3 +50,5 @@ bundle exec rake
35
50
  ```
36
51
 
37
52
  If it's clean and you don't see any error messages, submit your pull request.
53
+
54
+ [logger]: https://ruby-doc.org/stdlib-2.7.0/libdoc/logger/rdoc/Logger.html
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,24 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2024 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'
@@ -32,7 +15,7 @@ def version
32
15
  Gem::Specification.load(Dir['*.gemspec'].first).version
33
16
  end
34
17
 
35
- task default: %i[clean test rubocop yard copyright]
18
+ task default: %i[clean test rubocop yard]
36
19
 
37
20
  require 'rake/testtask'
38
21
  desc 'Run all unit tests'
@@ -54,13 +37,4 @@ require 'rubocop/rake_task'
54
37
  desc 'Run RuboCop on all directories'
55
38
  RuboCop::RakeTask.new(:rubocop) do |task|
56
39
  task.fail_on_error = true
57
- task.requires << 'rubocop-rspec'
58
- end
59
-
60
- task :copyright do
61
- sh "grep -q -r '#{Date.today.strftime('%Y')}' \
62
- --include '*.rb' \
63
- --include '*.txt' \
64
- --include 'Rakefile' \
65
- ."
66
40
  end
data/lib/verbose.rb CHANGED
@@ -1,32 +1,47 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2024 Yegor Bugayenko
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software ansassociatesdocumentation 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, ansto permit persons to whom the Software is
10
- # furnishesto do so, subject to the following conditions:
11
- #
12
- # The above copyright notice ansthis permission notice shall be includesin 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 'time'
24
7
  require 'tago'
25
8
 
26
- # Decorator.
9
+ # Decorator that logs method calls to any object, providing transparency
10
+ # into the execution flow by recording method names, parameters, and execution time.
11
+ # This class wraps any Ruby object and intercepts method calls, logging each
12
+ # invocation with its arguments and the time taken to execute.
13
+ #
14
+ # The decorator uses method_missing to intercept all method calls on the wrapped
15
+ # object, logs them with parameter details, and then delegates to the original
16
+ # object. String parameters are truncated for readability, complex objects are
17
+ # shown as their class names, and primitive values are displayed as-is.
18
+ #
19
+ # @example Basic usage with standard output
20
+ # repository = Verbose.new(Repository.new)
21
+ # repository.fetch('main')
22
+ # # Output: Repository.fetch("main") in 23ms
23
+ #
24
+ # @example Using with a custom logger
25
+ # require 'logger'
26
+ # logger = Logger.new('app.log')
27
+ # service = Verbose.new(Service.new, log: logger)
28
+ # service.process(data: { id: 42 })
29
+ # # Logs to app.log: Service.process(Hash) in 150ms
30
+ #
31
+ # @example Wrapping objects with blocks
32
+ # file = Verbose.new(File)
33
+ # file.open('data.txt', 'r') do |f|
34
+ # f.read
35
+ # end
36
+ # # Output: File.open("data.txt", "r") in 5ms
37
+ #
38
+ # @example Parameter truncation for long strings
39
+ # parser = Verbose.new(Parser.new)
40
+ # parser.parse('very long text that exceeds maximum display length...')
41
+ # # Output: Parser.parse("very long t...lay length...") in 10ms
27
42
  #
28
43
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
29
- # Copyright:: Copyright (c) 2024 Yegor Bugayenko
44
+ # Copyright:: Copyright (c) 2024-2025 Yegor Bugayenko
30
45
  # License:: MIT
31
46
  class Verbose
32
47
  def initialize(origin, log: nil)
@@ -50,7 +65,7 @@ class Verbose
50
65
  end
51
66
  end
52
67
  else
53
- super
68
+ super(mtd, *args)
54
69
  end
55
70
  ensure
56
71
  params = args.map do |a|
@@ -58,7 +73,7 @@ class Verbose
58
73
  max = 32
59
74
  a = a.inspect
60
75
  if a.length > max
61
- "#{a[0..(max / 2) - 2]}...#{a[(max / 2) + 1..]}"
76
+ "#{a[0..((max / 2) - 2)]}...#{a[((max / 2) + 1)..]}"
62
77
  else
63
78
  a
64
79
  end
data/test/test__helper.rb CHANGED
@@ -1,31 +1,32 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2024 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
- require 'simplecov'
26
- SimpleCov.start
8
+ ENV['RACK_ENV'] = 'test'
27
9
 
10
+ require 'simplecov'
28
11
  require 'simplecov-cobertura'
29
- SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter
12
+ unless SimpleCov.running || ARGV.include?('--no-cov')
13
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
14
+ [
15
+ SimpleCov::Formatter::HTMLFormatter,
16
+ SimpleCov::Formatter::CoberturaFormatter
17
+ ]
18
+ )
19
+ SimpleCov.minimum_coverage 80
20
+ SimpleCov.minimum_coverage_by_file 80
21
+ SimpleCov.start do
22
+ add_filter 'vendor/'
23
+ add_filter 'target/'
24
+ add_filter 'test/'
25
+ add_filter 'lib/fbe/github_graph.rb'
26
+ track_files 'lib/**/*.rb'
27
+ track_files '*.rb'
28
+ end
29
+ end
30
30
 
31
- require 'minitest/autorun'
31
+ require 'minitest/reporters'
32
+ Minitest::Reporters.use! [Minitest::Reporters::SpecReporter.new]
data/test/test_verbose.rb CHANGED
@@ -1,24 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2024 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 'minitest/autorun'
24
7
  require 'loog'
@@ -26,7 +9,7 @@ require_relative '../lib/verbose'
26
9
 
27
10
  # Main test.
28
11
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
29
- # Copyright:: Copyright (c) 2024 Yegor Bugayenko
12
+ # Copyright:: Copyright (c) 2024-2025 Yegor Bugayenko
30
13
  # License:: MIT
31
14
  class TestVerbose < Minitest::Test
32
15
  def test_simple
@@ -38,7 +21,7 @@ class TestVerbose < Minitest::Test
38
21
  obj = Verbose.new(obj, log:)
39
22
  assert_equal(42, obj.read(42))
40
23
  assert_equal(42, obj.read(42))
41
- assert(log.to_s.include?('(42) in'), log)
24
+ assert_includes(log.to_s, '(42) in', log)
42
25
  end
43
26
 
44
27
  def test_simple_to_stdout
@@ -72,4 +55,18 @@ class TestVerbose < Minitest::Test
72
55
  assert_equal(15, v.foo(7, 8))
73
56
  assert_equal(43, v.foo(1))
74
57
  end
58
+
59
+ def test_raises_on_undefined_method
60
+ obj = Object.new
61
+ def obj.existing_method
62
+ 42
63
+ end
64
+ log = Loog::Buffer.new
65
+ v = Verbose.new(obj, log:)
66
+ assert_equal(42, v.existing_method)
67
+ error = assert_raises(NoMethodError) do
68
+ v.nonexistent_method('some', 'args')
69
+ end
70
+ assert_match(/undefined method/, error.message)
71
+ end
75
72
  end
data/verbose.gemspec CHANGED
@@ -1,24 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2024 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 = 'verbose'
29
- s.version = '0.0.2'
12
+ s.version = '0.1.0'
30
13
  s.license = 'MIT'
31
14
  s.summary = 'A Decorator that Logs Every Method Call of a Decoratee'
32
15
  s.description =
@@ -34,11 +17,11 @@ Gem::Specification.new do |s|
34
17
  'usually when it is a slow-moving object'
35
18
  s.authors = ['Yegor Bugayenko']
36
19
  s.email = 'yegor256@gmail.com'
37
- s.homepage = 'http://github.com/yegor256/verbose.rb'
20
+ s.homepage = 'https://github.com/yegor256/verbose.rb'
38
21
  s.files = `git ls-files`.split($RS)
39
22
  s.rdoc_options = ['--charset=UTF-8']
40
23
  s.extra_rdoc_files = ['README.md', 'LICENSE.txt']
41
- s.add_runtime_dependency 'loog', '~>0.2'
42
- s.add_runtime_dependency 'tago', '~>0.0'
24
+ s.add_dependency 'loog', '~>0.2'
25
+ s.add_dependency 'tago', '~>0.0'
43
26
  s.metadata['rubygems_mfa_required'] = 'true'
44
27
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: verbose
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-06-13 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: loog
@@ -44,8 +43,8 @@ email: yegor256@gmail.com
44
43
  executables: []
45
44
  extensions: []
46
45
  extra_rdoc_files:
47
- - README.md
48
46
  - LICENSE.txt
47
+ - README.md
49
48
  files:
50
49
  - ".0pdd.yml"
51
50
  - ".gitattributes"
@@ -55,6 +54,8 @@ files:
55
54
  - ".github/workflows/markdown-lint.yml"
56
55
  - ".github/workflows/pdd.yml"
57
56
  - ".github/workflows/rake.yml"
57
+ - ".github/workflows/reuse.yml"
58
+ - ".github/workflows/typos.yml"
58
59
  - ".github/workflows/xcop.yml"
59
60
  - ".github/workflows/yamllint.yml"
60
61
  - ".gitignore"
@@ -66,19 +67,20 @@ files:
66
67
  - Gemfile
67
68
  - Gemfile.lock
68
69
  - LICENSE.txt
70
+ - LICENSES/MIT.txt
69
71
  - README.md
72
+ - REUSE.toml
70
73
  - Rakefile
71
74
  - lib/verbose.rb
72
75
  - renovate.json
73
76
  - test/test__helper.rb
74
77
  - test/test_verbose.rb
75
78
  - verbose.gemspec
76
- homepage: http://github.com/yegor256/verbose.rb
79
+ homepage: https://github.com/yegor256/verbose.rb
77
80
  licenses:
78
81
  - MIT
79
82
  metadata:
80
83
  rubygems_mfa_required: 'true'
81
- post_install_message:
82
84
  rdoc_options:
83
85
  - "--charset=UTF-8"
84
86
  require_paths:
@@ -94,8 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
96
  - !ruby/object:Gem::Version
95
97
  version: '0'
96
98
  requirements: []
97
- rubygems_version: 3.4.10
98
- signing_key:
99
+ rubygems_version: 3.6.9
99
100
  specification_version: 4
100
101
  summary: A Decorator that Logs Every Method Call of a Decoratee
101
102
  test_files: []