verbose 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.0pdd.yml +25 -0
- data/.gitattributes +7 -0
- data/.github/workflows/actionlint.yml +41 -0
- data/.github/workflows/codecov.yml +39 -0
- data/.github/workflows/copyrights.yml +30 -0
- data/.github/workflows/markdown-lint.yml +38 -0
- data/.github/workflows/pdd.yml +34 -0
- data/.github/workflows/rake.yml +44 -0
- data/.github/workflows/xcop.yml +30 -0
- data/.github/workflows/yamllint.yml +36 -0
- data/.gitignore +8 -0
- data/.pdd +7 -0
- data/.rubocop.yml +44 -0
- data/.rultor.yml +42 -0
- data/.simplecov +41 -0
- data/.yamllint.yml +24 -0
- data/Gemfile +32 -0
- data/Gemfile.lock +75 -0
- data/LICENSE.txt +21 -0
- data/README.md +37 -0
- data/Rakefile +66 -0
- data/lib/verbose.rb +72 -0
- data/renovate.json +6 -0
- data/test/test__helper.rb +31 -0
- data/test/test_verbose.rb +66 -0
- data/verbose.gemspec +44 -0
- metadata +101 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1e2bf7069e8349328cc1ff15e871233e462e21e6db4e9d8701178c7ff8fdc396
|
4
|
+
data.tar.gz: 844b9594ec446dfec61416954691e4a21fcd662b5c5e9f96de891595d650087d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d0c9462b86d14c86725eae347bb2bd63f6b0a86cac04a3654611bcf12343c14978e509ea07c38f7364909f962eac3745c8d6859e4e7d12c1ee69559900916b05
|
7
|
+
data.tar.gz: 5794a696441ccea364d26a4626abf5d93b8ec1212661b1d6866ff99a195dc34330771374f9941ffd4a1b76b88dabc55f5fb69430685fffd46a9bd11267c7d157
|
data/.0pdd.yml
ADDED
@@ -0,0 +1,25 @@
|
|
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.
|
20
|
+
---
|
21
|
+
errors:
|
22
|
+
- yegor256@gmail.com
|
23
|
+
# alerts:
|
24
|
+
# github:
|
25
|
+
# - yegor256
|
data/.gitattributes
ADDED
@@ -0,0 +1,41 @@
|
|
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.
|
20
|
+
---
|
21
|
+
name: actionlint
|
22
|
+
'on':
|
23
|
+
push:
|
24
|
+
branches:
|
25
|
+
- master
|
26
|
+
pull_request:
|
27
|
+
branches:
|
28
|
+
- master
|
29
|
+
jobs:
|
30
|
+
actionlint:
|
31
|
+
runs-on: ubuntu-22.04
|
32
|
+
steps:
|
33
|
+
- uses: actions/checkout@v4
|
34
|
+
- name: Download actionlint
|
35
|
+
id: get_actionlint
|
36
|
+
# yamllint disable-line rule:line-length
|
37
|
+
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
|
38
|
+
shell: bash
|
39
|
+
- name: Check workflow files
|
40
|
+
run: ${{ steps.get_actionlint.outputs.executable }} -color
|
41
|
+
shell: bash
|
@@ -0,0 +1,39 @@
|
|
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.
|
20
|
+
---
|
21
|
+
name: codecov
|
22
|
+
'on':
|
23
|
+
push:
|
24
|
+
branches:
|
25
|
+
- master
|
26
|
+
jobs:
|
27
|
+
codecov:
|
28
|
+
runs-on: ubuntu-22.04
|
29
|
+
steps:
|
30
|
+
- uses: actions/checkout@v4
|
31
|
+
- uses: ruby/setup-ruby@v1
|
32
|
+
with:
|
33
|
+
ruby-version: 3.2
|
34
|
+
bundler-cache: true
|
35
|
+
- run: bundle install
|
36
|
+
- run: bundle exec rake
|
37
|
+
- uses: codecov/codecov-action@v4.0.0-beta.3
|
38
|
+
with:
|
39
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
@@ -0,0 +1,30 @@
|
|
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.
|
20
|
+
---
|
21
|
+
name: copyrights
|
22
|
+
'on':
|
23
|
+
push:
|
24
|
+
pull_request:
|
25
|
+
jobs:
|
26
|
+
copyrights:
|
27
|
+
runs-on: ubuntu-22.04
|
28
|
+
steps:
|
29
|
+
- uses: actions/checkout@v4
|
30
|
+
- uses: yegor256/copyrights-action@0.0.4
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# Copyright (c) 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.
|
20
|
+
---
|
21
|
+
name: markdown-lint
|
22
|
+
'on':
|
23
|
+
push:
|
24
|
+
branches:
|
25
|
+
- master
|
26
|
+
pull_request:
|
27
|
+
branches:
|
28
|
+
- master
|
29
|
+
paths-ignore: ['paper/**', 'sandbox/**']
|
30
|
+
concurrency:
|
31
|
+
group: markdown-lint-${{ github.ref }}
|
32
|
+
cancel-in-progress: true
|
33
|
+
jobs:
|
34
|
+
markdown-lint:
|
35
|
+
runs-on: ubuntu-22.04
|
36
|
+
steps:
|
37
|
+
- uses: actions/checkout@v4
|
38
|
+
- uses: articulate/actions-markdownlint@v1
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# Copyright (c) 2024 Yegor Bugayenko
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
# of this software and associated documentation files (the 'Software'), to deal
|
5
|
+
# in the Software without restriction, including without limitation the rights
|
6
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
# copies of the Software, and to permit persons to whom the Software is
|
8
|
+
# furnished to do so, subject to the following conditions:
|
9
|
+
#
|
10
|
+
# The above copyright notice and this permission notice shall be included in all
|
11
|
+
# copies or substantial portions of the Software.
|
12
|
+
#
|
13
|
+
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
+
# SOFTWARE.
|
20
|
+
---
|
21
|
+
name: pdd
|
22
|
+
'on':
|
23
|
+
push:
|
24
|
+
branches:
|
25
|
+
- master
|
26
|
+
pull_request:
|
27
|
+
branches:
|
28
|
+
- master
|
29
|
+
jobs:
|
30
|
+
pdd:
|
31
|
+
runs-on: ubuntu-22.04
|
32
|
+
steps:
|
33
|
+
- uses: actions/checkout@v4
|
34
|
+
- uses: volodya-lombrozo/pdd-action@master
|
@@ -0,0 +1,44 @@
|
|
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.
|
20
|
+
---
|
21
|
+
name: rake
|
22
|
+
'on':
|
23
|
+
push:
|
24
|
+
branches:
|
25
|
+
- master
|
26
|
+
pull_request:
|
27
|
+
branches:
|
28
|
+
- master
|
29
|
+
jobs:
|
30
|
+
rake:
|
31
|
+
name: test
|
32
|
+
strategy:
|
33
|
+
matrix:
|
34
|
+
os: [ubuntu-20.04, macos-12, windows-2022]
|
35
|
+
ruby: [3.2, 3.3]
|
36
|
+
runs-on: ${{ matrix.os }}
|
37
|
+
steps:
|
38
|
+
- uses: actions/checkout@v4
|
39
|
+
- uses: ruby/setup-ruby@v1
|
40
|
+
with:
|
41
|
+
ruby-version: ${{ matrix.ruby }}
|
42
|
+
bundler-cache: true
|
43
|
+
- run: bundle install
|
44
|
+
- run: bundle exec rake
|
@@ -0,0 +1,30 @@
|
|
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.
|
20
|
+
---
|
21
|
+
name: xcop
|
22
|
+
'on':
|
23
|
+
push:
|
24
|
+
pull_request:
|
25
|
+
jobs:
|
26
|
+
xcop:
|
27
|
+
runs-on: ubuntu-22.04
|
28
|
+
steps:
|
29
|
+
- uses: actions/checkout@v4
|
30
|
+
- uses: g4s8/xcop-action@master
|
@@ -0,0 +1,36 @@
|
|
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.
|
20
|
+
---
|
21
|
+
name: yamllint
|
22
|
+
'on':
|
23
|
+
push:
|
24
|
+
branches:
|
25
|
+
- master
|
26
|
+
pull_request:
|
27
|
+
branches:
|
28
|
+
- master
|
29
|
+
jobs:
|
30
|
+
yamllint:
|
31
|
+
runs-on: ubuntu-22.04
|
32
|
+
steps:
|
33
|
+
- uses: actions/checkout@v4
|
34
|
+
- uses: ibiqlik/action-yamllint@v3
|
35
|
+
with:
|
36
|
+
config_file: .yamllint.yml
|
data/.gitignore
ADDED
data/.pdd
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,44 @@
|
|
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.
|
20
|
+
---
|
21
|
+
AllCops:
|
22
|
+
Exclude:
|
23
|
+
- 'bin/**/*'
|
24
|
+
- 'assets/**/*'
|
25
|
+
- 'vendor/**/**'
|
26
|
+
DisplayCopNames: true
|
27
|
+
TargetRubyVersion: 3.2
|
28
|
+
SuggestExtensions: false
|
29
|
+
NewCops: enable
|
30
|
+
|
31
|
+
Gemspec/RequiredRubyVersion:
|
32
|
+
Enabled: false
|
33
|
+
Metrics/AbcSize:
|
34
|
+
Enabled: false
|
35
|
+
Metrics/MethodLength:
|
36
|
+
Enabled: false
|
37
|
+
Layout/EndOfLine:
|
38
|
+
EnforcedStyle: lf
|
39
|
+
Metrics/CyclomaticComplexity:
|
40
|
+
Enabled: false
|
41
|
+
Metrics/PerceivedComplexity:
|
42
|
+
Enabled: false
|
43
|
+
Style/OptionalBooleanParameter:
|
44
|
+
Enabled: false
|
data/.rultor.yml
ADDED
@@ -0,0 +1,42 @@
|
|
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.
|
20
|
+
---
|
21
|
+
docker:
|
22
|
+
image: yegor256/rultor-image:1.23.1
|
23
|
+
assets:
|
24
|
+
rubygems.yml: yegor256/home#assets/rubygems.yml
|
25
|
+
install: |
|
26
|
+
pdd -f /dev/null
|
27
|
+
bundle install --no-color
|
28
|
+
release:
|
29
|
+
pre: false
|
30
|
+
script: |-
|
31
|
+
[[ "${tag}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || exit -1
|
32
|
+
bundle exec rake
|
33
|
+
rm -rf *.gem
|
34
|
+
sed -i "s/0\.0\.0/${tag}/g" verbose.gemspec
|
35
|
+
git add verbose.gemspec
|
36
|
+
git commit -m "version set to ${tag}"
|
37
|
+
gem build verbose.gemspec
|
38
|
+
chmod 0600 ../rubygems.yml
|
39
|
+
gem push *.gem --config-file ../rubygems.yml
|
40
|
+
merge:
|
41
|
+
script: |-
|
42
|
+
bundle exec rake
|
data/.simplecov
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
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.
|
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 20
|
40
|
+
end
|
41
|
+
end
|
data/.yamllint.yml
ADDED
@@ -0,0 +1,24 @@
|
|
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.
|
20
|
+
---
|
21
|
+
rules:
|
22
|
+
line-length:
|
23
|
+
max: 80
|
24
|
+
allow-non-breakable-words: true
|
data/Gemfile
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
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.
|
22
|
+
|
23
|
+
source 'https://rubygems.org'
|
24
|
+
gemspec
|
25
|
+
|
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
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
verbose (0.0.0)
|
5
|
+
loog (~> 0.2)
|
6
|
+
tago (~> 0.0)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
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)
|
19
|
+
ast (~> 2.4.1)
|
20
|
+
racc
|
21
|
+
racc (1.8.0)
|
22
|
+
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)
|
28
|
+
json (~> 2.3)
|
29
|
+
language_server-protocol (>= 3.17.0)
|
30
|
+
parallel (~> 1.10)
|
31
|
+
parser (>= 3.3.0.2)
|
32
|
+
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)
|
36
|
+
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)
|
42
|
+
ruby-progressbar (1.13.0)
|
43
|
+
simplecov (0.22.0)
|
44
|
+
docile (~> 1.1)
|
45
|
+
simplecov-html (~> 0.11)
|
46
|
+
simplecov_json_formatter (~> 0.1)
|
47
|
+
simplecov-cobertura (2.1.0)
|
48
|
+
rexml
|
49
|
+
simplecov (~> 0.19)
|
50
|
+
simplecov-html (0.12.3)
|
51
|
+
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)
|
56
|
+
|
57
|
+
PLATFORMS
|
58
|
+
arm64-darwin-22
|
59
|
+
ruby
|
60
|
+
x64-mingw-ucrt
|
61
|
+
x86_64-darwin-20
|
62
|
+
x86_64-linux
|
63
|
+
|
64
|
+
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)
|
71
|
+
verbose!
|
72
|
+
yard (= 0.9.36)
|
73
|
+
|
74
|
+
BUNDLED WITH
|
75
|
+
2.5.6
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
(The MIT License)
|
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.
|
data/README.md
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# A Decorator that Logs Every Method Call of a Decoratee
|
2
|
+
|
3
|
+
[![DevOps By Rultor.com](http://www.rultor.com/b/yegor256/verbose)](http://www.rultor.com/p/yegor256/verbose)
|
4
|
+
[![We recommend RubyMine](https://www.elegantobjects.org/rubymine.svg)](https://www.jetbrains.com/ruby/)
|
5
|
+
|
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)
|
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)
|
11
|
+
[![Hits-of-Code](https://hitsofcode.com/github/yegor256/verbose)](https://hitsofcode.com/view/github/yegor256/verbose)
|
12
|
+
[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/yegor256/verbose/blob/master/LICENSE.txt)
|
13
|
+
|
14
|
+
Here is how you use it:
|
15
|
+
|
16
|
+
```ruby
|
17
|
+
require 'verbose'
|
18
|
+
x = MyObject.new
|
19
|
+
v = Verbose.new(x)
|
20
|
+
v.foo() # check the log
|
21
|
+
```
|
22
|
+
|
23
|
+
## How to contribute
|
24
|
+
|
25
|
+
Read
|
26
|
+
[these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html).
|
27
|
+
Make sure you build is green before you contribute
|
28
|
+
your pull request. You will need to have
|
29
|
+
[Ruby](https://www.ruby-lang.org/en/) 3.2+ and
|
30
|
+
[Bundler](https://bundler.io/) installed. Then:
|
31
|
+
|
32
|
+
```bash
|
33
|
+
bundle update
|
34
|
+
bundle exec rake
|
35
|
+
```
|
36
|
+
|
37
|
+
If it's clean and you don't see any error messages, submit your pull request.
|
data/Rakefile
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
# frozen_string_literal: true
|
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.
|
22
|
+
|
23
|
+
require 'rubygems'
|
24
|
+
require 'rake'
|
25
|
+
require 'rake/clean'
|
26
|
+
|
27
|
+
def name
|
28
|
+
@name ||= File.basename(Dir['*.gemspec'].first, '.*')
|
29
|
+
end
|
30
|
+
|
31
|
+
def version
|
32
|
+
Gem::Specification.load(Dir['*.gemspec'].first).version
|
33
|
+
end
|
34
|
+
|
35
|
+
task default: %i[clean test rubocop yard copyright]
|
36
|
+
|
37
|
+
require 'rake/testtask'
|
38
|
+
desc 'Run all unit tests'
|
39
|
+
Rake::TestTask.new(:test) do |test|
|
40
|
+
Rake::Cleaner.cleanup_files(['coverage'])
|
41
|
+
test.libs << 'lib' << 'test'
|
42
|
+
test.pattern = 'test/**/test_*.rb'
|
43
|
+
test.warning = true
|
44
|
+
test.verbose = false
|
45
|
+
end
|
46
|
+
|
47
|
+
require 'yard'
|
48
|
+
desc 'Build Yard documentation'
|
49
|
+
YARD::Rake::YardocTask.new do |t|
|
50
|
+
t.files = ['lib/**/*.rb']
|
51
|
+
end
|
52
|
+
|
53
|
+
require 'rubocop/rake_task'
|
54
|
+
desc 'Run RuboCop on all directories'
|
55
|
+
RuboCop::RakeTask.new(:rubocop) do |task|
|
56
|
+
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
|
+
end
|
data/lib/verbose.rb
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
# frozen_string_literal: true
|
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.
|
22
|
+
|
23
|
+
require 'time'
|
24
|
+
require 'tago'
|
25
|
+
|
26
|
+
# Decorator.
|
27
|
+
#
|
28
|
+
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
29
|
+
# Copyright:: Copyright (c) 2024 Yegor Bugayenko
|
30
|
+
# License:: MIT
|
31
|
+
class Verbose
|
32
|
+
def initialize(origin, log: $stdout)
|
33
|
+
@origin = origin
|
34
|
+
@log = log
|
35
|
+
end
|
36
|
+
|
37
|
+
def method_missing(*args)
|
38
|
+
start = Time.now
|
39
|
+
mtd = args.shift
|
40
|
+
begin
|
41
|
+
result =
|
42
|
+
if @origin.respond_to?(mtd)
|
43
|
+
params = @origin.method(mtd).parameters
|
44
|
+
reqs = params.count { |p| p[0] == :req }
|
45
|
+
if params.any? { |p| p[0] == :key } && args.size > reqs
|
46
|
+
@origin.__send__(mtd, *args[0...-1], **args.last) do |*a|
|
47
|
+
yield(*a) if block_given?
|
48
|
+
end
|
49
|
+
else
|
50
|
+
@origin.__send__(mtd, *args) do |*a|
|
51
|
+
yield(*a) if block_given?
|
52
|
+
end
|
53
|
+
end
|
54
|
+
else
|
55
|
+
super
|
56
|
+
end
|
57
|
+
@log.debug("#{@origin.class}.#{mtd}(): finished in #{start.ago}")
|
58
|
+
result
|
59
|
+
rescue StandardError => e
|
60
|
+
@log.debug("#{@origin.class}.#{mtd}(): thrown #{e.class} in #{start.ago}")
|
61
|
+
raise e
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
def respond_to?(method, include_private = false)
|
66
|
+
@origin.respond_to?(method, include_private)
|
67
|
+
end
|
68
|
+
|
69
|
+
def respond_to_missing?(_method, _include_private = false)
|
70
|
+
true
|
71
|
+
end
|
72
|
+
end
|
data/renovate.json
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
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.
|
22
|
+
|
23
|
+
$stdout.sync = true
|
24
|
+
|
25
|
+
require 'simplecov'
|
26
|
+
SimpleCov.start
|
27
|
+
|
28
|
+
require 'simplecov-cobertura'
|
29
|
+
SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter
|
30
|
+
|
31
|
+
require 'minitest/autorun'
|
@@ -0,0 +1,66 @@
|
|
1
|
+
# frozen_string_literal: true
|
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.
|
22
|
+
|
23
|
+
require 'minitest/autorun'
|
24
|
+
require 'loog'
|
25
|
+
require_relative '../lib/verbose'
|
26
|
+
|
27
|
+
# Main test.
|
28
|
+
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
29
|
+
# Copyright:: Copyright (c) 2024 Yegor Bugayenko
|
30
|
+
# License:: MIT
|
31
|
+
class TestVerbose < Minitest::Test
|
32
|
+
def test_simple
|
33
|
+
obj = Object.new
|
34
|
+
def obj.read(foo)
|
35
|
+
foo
|
36
|
+
end
|
37
|
+
log = Loog::Buffer.new
|
38
|
+
obj = Verbose.new(obj, log:)
|
39
|
+
assert_equal(42, obj.read(42))
|
40
|
+
assert_equal(42, obj.read(42))
|
41
|
+
assert(log.to_s.include?('finished in'), log)
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_works_with_optional_arguments
|
45
|
+
obj = Object.new
|
46
|
+
def obj.foo(first, _second, ext1: 'a', ext2: 'b')
|
47
|
+
first + ext1 + ext2
|
48
|
+
end
|
49
|
+
log = Loog::Buffer.new
|
50
|
+
v = Verbose.new(obj, log:)
|
51
|
+
assert_equal('.xy', v.foo('.', {}, ext1: 'x', ext2: 'y'))
|
52
|
+
assert_equal('fzb', v.foo('f', {}, ext1: 'z'))
|
53
|
+
assert_equal('-ab', v.foo('-', {}))
|
54
|
+
end
|
55
|
+
|
56
|
+
def test_works_with_default_value
|
57
|
+
obj = Object.new
|
58
|
+
def obj.foo(first, second = 42)
|
59
|
+
first + second
|
60
|
+
end
|
61
|
+
log = Loog::Buffer.new
|
62
|
+
v = Verbose.new(obj, log:)
|
63
|
+
assert_equal(15, v.foo(7, 8))
|
64
|
+
assert_equal(43, v.foo(1))
|
65
|
+
end
|
66
|
+
end
|
data/verbose.gemspec
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
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.
|
22
|
+
|
23
|
+
require 'English'
|
24
|
+
|
25
|
+
Gem::Specification.new do |s|
|
26
|
+
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
|
27
|
+
s.required_ruby_version = '>=3.0'
|
28
|
+
s.name = 'verbose'
|
29
|
+
s.version = '0.0.1'
|
30
|
+
s.license = 'MIT'
|
31
|
+
s.summary = 'A Decorator that Logs Every Method Call of a Decoratee'
|
32
|
+
s.description =
|
33
|
+
'Simplifies the process of tracking method calls in a particular object, ' \
|
34
|
+
'usually when it is a slow-moving object'
|
35
|
+
s.authors = ['Yegor Bugayenko']
|
36
|
+
s.email = 'yegor256@gmail.com'
|
37
|
+
s.homepage = 'http://github.com/yegor256/verbose.rb'
|
38
|
+
s.files = `git ls-files`.split($RS)
|
39
|
+
s.rdoc_options = ['--charset=UTF-8']
|
40
|
+
s.extra_rdoc_files = ['README.md', 'LICENSE.txt']
|
41
|
+
s.add_runtime_dependency 'loog', '~>0.2'
|
42
|
+
s.add_runtime_dependency 'tago', '~>0.0'
|
43
|
+
s.metadata['rubygems_mfa_required'] = 'true'
|
44
|
+
end
|
metadata
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: verbose
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Yegor Bugayenko
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2024-06-13 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: loog
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.2'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.2'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: tago
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.0'
|
41
|
+
description: Simplifies the process of tracking method calls in a particular object,
|
42
|
+
usually when it is a slow-moving object
|
43
|
+
email: yegor256@gmail.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files:
|
47
|
+
- README.md
|
48
|
+
- LICENSE.txt
|
49
|
+
files:
|
50
|
+
- ".0pdd.yml"
|
51
|
+
- ".gitattributes"
|
52
|
+
- ".github/workflows/actionlint.yml"
|
53
|
+
- ".github/workflows/codecov.yml"
|
54
|
+
- ".github/workflows/copyrights.yml"
|
55
|
+
- ".github/workflows/markdown-lint.yml"
|
56
|
+
- ".github/workflows/pdd.yml"
|
57
|
+
- ".github/workflows/rake.yml"
|
58
|
+
- ".github/workflows/xcop.yml"
|
59
|
+
- ".github/workflows/yamllint.yml"
|
60
|
+
- ".gitignore"
|
61
|
+
- ".pdd"
|
62
|
+
- ".rubocop.yml"
|
63
|
+
- ".rultor.yml"
|
64
|
+
- ".simplecov"
|
65
|
+
- ".yamllint.yml"
|
66
|
+
- Gemfile
|
67
|
+
- Gemfile.lock
|
68
|
+
- LICENSE.txt
|
69
|
+
- README.md
|
70
|
+
- Rakefile
|
71
|
+
- lib/verbose.rb
|
72
|
+
- renovate.json
|
73
|
+
- test/test__helper.rb
|
74
|
+
- test/test_verbose.rb
|
75
|
+
- verbose.gemspec
|
76
|
+
homepage: http://github.com/yegor256/verbose.rb
|
77
|
+
licenses:
|
78
|
+
- MIT
|
79
|
+
metadata:
|
80
|
+
rubygems_mfa_required: 'true'
|
81
|
+
post_install_message:
|
82
|
+
rdoc_options:
|
83
|
+
- "--charset=UTF-8"
|
84
|
+
require_paths:
|
85
|
+
- lib
|
86
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '3.0'
|
91
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
requirements: []
|
97
|
+
rubygems_version: 3.4.10
|
98
|
+
signing_key:
|
99
|
+
specification_version: 4
|
100
|
+
summary: A Decorator that Logs Every Method Call of a Decoratee
|
101
|
+
test_files: []
|