decoor 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +5 -4
- data/Gemfile.lock +51 -41
- data/LICENSE.txt +1 -1
- data/LICENSES/MIT.txt +1 -1
- data/Rakefile +3 -2
- data/decoor.gemspec +5 -5
- data/lib/decoor.rb +16 -37
- metadata +3 -24
- data/.0pdd.yml +0 -8
- data/.gitattributes +0 -7
- data/.github/workflows/actionlint.yml +0 -25
- data/.github/workflows/codecov.yml +0 -25
- data/.github/workflows/copyrights.yml +0 -15
- data/.github/workflows/markdown-lint.yml +0 -23
- data/.github/workflows/pdd.yml +0 -19
- data/.github/workflows/rake.yml +0 -28
- data/.github/workflows/reuse.yml +0 -19
- data/.github/workflows/typos.yml +0 -19
- data/.github/workflows/xcop.yml +0 -15
- data/.github/workflows/yamllint.yml +0 -21
- data/.gitignore +0 -10
- data/.pdd +0 -7
- data/.rubocop.yml +0 -39
- data/.rultor.yml +0 -26
- data/.simplecov +0 -24
- data/.yamllint.yml +0 -7
- data/renovate.json +0 -6
- data/test/test__helper.rb +0 -29
- data/test/test_decoor.rb +0 -65
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0e69b5f78457177d0bf13b43f218b9c75dacc9116423601e61ec408ada491a23
|
|
4
|
+
data.tar.gz: 225ac30d14b4fd8254b5524be6051892a013ccd67078446381b12294e9ea8bc9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 10b1bd882a7cff4daf8dc55fdd0c7361e82c390adda55d6e917d9ce6d3dc962705cef185880b03bc80935ea48f5cd6e04b54da98a1a1636bada8e720e92f2e31
|
|
7
|
+
data.tar.gz: 4d515a370b8a7521ed15e6c6b81df2170447d0216f7b43fc8bb6ad39ed336cdbc3130a6a5b19e02da95ab0d7afdccc72eadede0425db9e2a5010114849deb60f
|
data/Gemfile
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-
|
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 Yegor Bugayenko
|
|
4
4
|
# SPDX-License-Identifier: MIT
|
|
5
5
|
|
|
6
6
|
source 'https://rubygems.org'
|
|
7
7
|
gemspec
|
|
8
8
|
|
|
9
|
-
gem 'minitest', '~>
|
|
9
|
+
gem 'minitest', '~>6.0', require: false
|
|
10
10
|
gem 'minitest-reporters', '~>1.7', require: false
|
|
11
11
|
gem 'rake', '~>13.2', require: false
|
|
12
12
|
gem 'rubocop', '~>1.65', require: false
|
|
13
|
+
gem 'rubocop-elegant', '~>0.5', require: false
|
|
13
14
|
gem 'rubocop-minitest', '~>0.38', require: false
|
|
14
15
|
gem 'rubocop-performance', '~>1.0', require: false
|
|
15
16
|
gem 'rubocop-rake', '~>0.7', require: false
|
|
16
|
-
gem 'simplecov', '~>0
|
|
17
|
-
gem 'simplecov-cobertura', '~>
|
|
17
|
+
gem 'simplecov', '~>1.0', require: false
|
|
18
|
+
gem 'simplecov-cobertura', '~>4.0', require: false
|
|
18
19
|
gem 'yard', '~>0.9', require: false
|
data/Gemfile.lock
CHANGED
|
@@ -6,89 +6,99 @@ PATH
|
|
|
6
6
|
GEM
|
|
7
7
|
remote: https://rubygems.org/
|
|
8
8
|
specs:
|
|
9
|
-
ansi (1.
|
|
9
|
+
ansi (1.6.1)
|
|
10
|
+
logger
|
|
10
11
|
ast (2.4.3)
|
|
11
12
|
builder (3.3.0)
|
|
12
|
-
|
|
13
|
-
json (2.
|
|
14
|
-
language_server-protocol (3.17.0.
|
|
13
|
+
drb (2.2.3)
|
|
14
|
+
json (3.2.0)
|
|
15
|
+
language_server-protocol (3.17.0.6)
|
|
15
16
|
lint_roller (1.1.0)
|
|
16
|
-
|
|
17
|
-
minitest
|
|
17
|
+
logger (1.7.0)
|
|
18
|
+
minitest (6.1.0)
|
|
19
|
+
drb (~> 2.0)
|
|
20
|
+
prism (>= 1.5, < 3)
|
|
21
|
+
minitest-reporters (1.8.0)
|
|
18
22
|
ansi
|
|
19
23
|
builder
|
|
20
|
-
minitest (>= 5.0)
|
|
24
|
+
minitest (>= 5.0, < 7)
|
|
21
25
|
ruby-progressbar
|
|
22
|
-
parallel (
|
|
23
|
-
parser (3.3.
|
|
26
|
+
parallel (2.3.0)
|
|
27
|
+
parser (3.3.14.0)
|
|
24
28
|
ast (~> 2.4.1)
|
|
25
29
|
racc
|
|
26
|
-
prism (1.
|
|
30
|
+
prism (2.1.0)
|
|
31
|
+
prism (2.1.0-arm64-darwin)
|
|
32
|
+
prism (2.1.0-x64-mingw-ucrt)
|
|
33
|
+
prism (2.1.0-x86_64-darwin)
|
|
34
|
+
prism (2.1.0-x86_64-linux-gnu)
|
|
27
35
|
racc (1.8.1)
|
|
28
36
|
rainbow (3.1.1)
|
|
29
|
-
rake (13.
|
|
30
|
-
regexp_parser (2.
|
|
31
|
-
rexml (3.4.
|
|
32
|
-
rubocop (1.
|
|
33
|
-
json (
|
|
37
|
+
rake (13.4.2)
|
|
38
|
+
regexp_parser (2.13.4)
|
|
39
|
+
rexml (3.4.4)
|
|
40
|
+
rubocop (1.93.0)
|
|
41
|
+
json (>= 2.3)
|
|
34
42
|
language_server-protocol (~> 3.17.0.2)
|
|
35
43
|
lint_roller (~> 1.1.0)
|
|
36
|
-
parallel (
|
|
44
|
+
parallel (>= 1.10)
|
|
37
45
|
parser (>= 3.3.0.2)
|
|
38
46
|
rainbow (>= 2.2.2, < 4.0)
|
|
39
|
-
regexp_parser (>= 2.
|
|
40
|
-
rubocop-ast (>= 1.
|
|
47
|
+
regexp_parser (>= 2.11.3, < 3.0)
|
|
48
|
+
rubocop-ast (>= 1.54.0, < 2.0)
|
|
41
49
|
ruby-progressbar (~> 1.7)
|
|
42
50
|
unicode-display_width (>= 2.4.0, < 4.0)
|
|
43
|
-
rubocop-ast (1.
|
|
51
|
+
rubocop-ast (1.54.0)
|
|
52
|
+
ast (~> 2.4)
|
|
44
53
|
parser (>= 3.3.7.2)
|
|
45
|
-
prism (
|
|
46
|
-
|
|
54
|
+
prism (>= 1.7)
|
|
55
|
+
racc
|
|
56
|
+
rubocop-elegant (0.8.0)
|
|
47
57
|
lint_roller (~> 1.1)
|
|
48
|
-
rubocop (
|
|
49
|
-
|
|
50
|
-
rubocop-performance (1.25.0)
|
|
58
|
+
rubocop (~> 1.75)
|
|
59
|
+
rubocop-minitest (0.41.0)
|
|
51
60
|
lint_roller (~> 1.1)
|
|
52
|
-
rubocop (>= 1.
|
|
61
|
+
rubocop (>= 1.89.0, < 2.0)
|
|
53
62
|
rubocop-ast (>= 1.38.0, < 2.0)
|
|
63
|
+
rubocop-performance (1.27.0)
|
|
64
|
+
lint_roller (~> 1.1)
|
|
65
|
+
rubocop (>= 1.89.0, < 2.0)
|
|
66
|
+
rubocop-ast (>= 1.47.1, < 2.0)
|
|
54
67
|
rubocop-rake (0.7.1)
|
|
55
68
|
lint_roller (~> 1.1)
|
|
56
69
|
rubocop (>= 1.72.1)
|
|
57
70
|
ruby-progressbar (1.13.0)
|
|
58
|
-
simplecov (
|
|
59
|
-
|
|
60
|
-
simplecov-html (~> 0.11)
|
|
61
|
-
simplecov_json_formatter (~> 0.1)
|
|
62
|
-
simplecov-cobertura (2.1.0)
|
|
71
|
+
simplecov (1.3.2)
|
|
72
|
+
simplecov-cobertura (4.0.0)
|
|
63
73
|
rexml
|
|
64
|
-
simplecov (~> 0
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
unicode-
|
|
68
|
-
|
|
69
|
-
unicode-emoji (4.0.4)
|
|
70
|
-
yard (0.9.37)
|
|
74
|
+
simplecov (~> 1.0)
|
|
75
|
+
unicode-display_width (3.3.0)
|
|
76
|
+
unicode-emoji (~> 4.3)
|
|
77
|
+
unicode-emoji (4.3.0)
|
|
78
|
+
yard (0.9.46)
|
|
71
79
|
|
|
72
80
|
PLATFORMS
|
|
73
81
|
arm64-darwin-22
|
|
74
82
|
arm64-darwin-23
|
|
75
83
|
arm64-darwin-24
|
|
84
|
+
ruby
|
|
76
85
|
x64-mingw-ucrt
|
|
77
86
|
x86_64-darwin-20
|
|
78
87
|
x86_64-linux
|
|
79
88
|
|
|
80
89
|
DEPENDENCIES
|
|
81
90
|
decoor!
|
|
82
|
-
minitest (~>
|
|
91
|
+
minitest (~> 6.0)
|
|
83
92
|
minitest-reporters (~> 1.7)
|
|
84
93
|
rake (~> 13.2)
|
|
85
94
|
rubocop (~> 1.65)
|
|
95
|
+
rubocop-elegant (~> 0.5)
|
|
86
96
|
rubocop-minitest (~> 0.38)
|
|
87
97
|
rubocop-performance (~> 1.0)
|
|
88
98
|
rubocop-rake (~> 0.7)
|
|
89
|
-
simplecov (~> 0
|
|
90
|
-
simplecov-cobertura (~>
|
|
99
|
+
simplecov (~> 1.0)
|
|
100
|
+
simplecov-cobertura (~> 4.0)
|
|
91
101
|
yard (~> 0.9)
|
|
92
102
|
|
|
93
103
|
BUNDLED WITH
|
|
94
|
-
|
|
104
|
+
4.0.24
|
data/LICENSE.txt
CHANGED
data/LICENSES/MIT.txt
CHANGED
data/Rakefile
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-
|
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 Yegor Bugayenko
|
|
4
4
|
# SPDX-License-Identifier: MIT
|
|
5
5
|
|
|
6
|
-
require 'rubygems'
|
|
7
6
|
require 'rake'
|
|
8
7
|
require 'rake/clean'
|
|
8
|
+
require 'rubygems'
|
|
9
9
|
|
|
10
10
|
def name
|
|
11
11
|
@name ||= File.basename(Dir['*.gemspec'].first, '.*')
|
|
@@ -31,6 +31,7 @@ require 'yard'
|
|
|
31
31
|
desc 'Build Yard documentation'
|
|
32
32
|
YARD::Rake::YardocTask.new do |t|
|
|
33
33
|
t.files = ['lib/**/*.rb']
|
|
34
|
+
t.options = ['--fail-on-warning']
|
|
34
35
|
end
|
|
35
36
|
|
|
36
37
|
require 'rubocop/rake_task'
|
data/decoor.gemspec
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-
|
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 Yegor Bugayenko
|
|
4
4
|
# SPDX-License-Identifier: MIT
|
|
5
5
|
|
|
6
6
|
require 'English'
|
|
7
7
|
|
|
8
8
|
Gem::Specification.new do |s|
|
|
9
|
-
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to?
|
|
9
|
+
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to?(:required_rubygems_version=)
|
|
10
10
|
s.required_ruby_version = '>=3.0'
|
|
11
11
|
s.name = 'decoor'
|
|
12
|
-
s.version = '0.1.
|
|
12
|
+
s.version = '0.1.1'
|
|
13
13
|
s.license = 'MIT'
|
|
14
14
|
s.summary = 'Decoor'
|
|
15
15
|
s.description =
|
|
@@ -19,8 +19,8 @@ Gem::Specification.new do |s|
|
|
|
19
19
|
object-oriented.'
|
|
20
20
|
s.authors = ['Yegor Bugayenko']
|
|
21
21
|
s.email = 'yegor256@gmail.com'
|
|
22
|
-
s.homepage = 'https://github.com/yegor256/decoor
|
|
23
|
-
s.files = `git ls-files`.split($RS)
|
|
22
|
+
s.homepage = 'https://github.com/yegor256/decoor'
|
|
23
|
+
s.files = `git ls-files | grep -v -E '^(test/|\\.|renovate)'`.split($RS)
|
|
24
24
|
s.rdoc_options = ['--charset=UTF-8']
|
|
25
25
|
s.extra_rdoc_files = ['README.md', 'LICENSE.txt']
|
|
26
26
|
s.metadata['rubygems_mfa_required'] = 'true'
|
data/lib/decoor.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-
|
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 Yegor Bugayenko
|
|
4
4
|
# SPDX-License-Identifier: MIT
|
|
5
5
|
|
|
6
6
|
# System module, for global functions.
|
|
@@ -43,50 +43,29 @@ module Kernel
|
|
|
43
43
|
# @since 0.1.0
|
|
44
44
|
def decoor(origin, attrs = {}, &)
|
|
45
45
|
if block_given?
|
|
46
|
-
c =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
attrs.each do |k, v|
|
|
52
|
-
instance_eval("@#{k} = v", __FILE__, __LINE__) # @foo = v
|
|
46
|
+
c =
|
|
47
|
+
Class.new do
|
|
48
|
+
def initialize(origin, attrs)
|
|
49
|
+
@origin = origin
|
|
50
|
+
attrs.each { |k, v| instance_variable_set(:"@#{k}", v) }
|
|
53
51
|
end
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
@origin.__send__(*args) do |*a|
|
|
60
|
-
yield(*a) if block_given?
|
|
52
|
+
def method_missing(...)
|
|
53
|
+
@origin.public_send(...)
|
|
54
|
+
end
|
|
55
|
+
def respond_to_missing?(mtd, inc = false)
|
|
56
|
+
@origin.respond_to?(mtd, inc) || super
|
|
61
57
|
end
|
|
62
58
|
end
|
|
63
|
-
|
|
64
|
-
def respond_to?(_mtd, _inc = false)
|
|
65
|
-
true
|
|
66
|
-
end
|
|
67
|
-
|
|
68
|
-
def respond_to_missing?(_mtd, _inc = false)
|
|
69
|
-
true
|
|
70
|
-
end
|
|
71
|
-
end
|
|
72
59
|
c.class_eval(&)
|
|
73
60
|
c.new(origin, attrs)
|
|
74
61
|
else
|
|
75
|
-
class_eval("def __get_origin__; @#{origin}; end
|
|
62
|
+
class_eval("def __get_origin__; @#{origin}; end # def __get_origin__; @origin; end", __FILE__, __LINE__)
|
|
76
63
|
class_eval do
|
|
77
|
-
def method_missing(
|
|
78
|
-
|
|
79
|
-
o.send(*args) do |*a|
|
|
80
|
-
yield(*a) if block_given?
|
|
81
|
-
end
|
|
64
|
+
def method_missing(...)
|
|
65
|
+
__get_origin__.public_send(...)
|
|
82
66
|
end
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
true
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
def respond_to_missing?(_mtd, _inc = false)
|
|
89
|
-
true
|
|
67
|
+
def respond_to_missing?(mtd, inc = false)
|
|
68
|
+
__get_origin__.respond_to?(mtd, inc) || super
|
|
90
69
|
end
|
|
91
70
|
end
|
|
92
71
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: decoor
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yegor Bugayenko
|
|
@@ -21,24 +21,6 @@ extra_rdoc_files:
|
|
|
21
21
|
- LICENSE.txt
|
|
22
22
|
- README.md
|
|
23
23
|
files:
|
|
24
|
-
- ".0pdd.yml"
|
|
25
|
-
- ".gitattributes"
|
|
26
|
-
- ".github/workflows/actionlint.yml"
|
|
27
|
-
- ".github/workflows/codecov.yml"
|
|
28
|
-
- ".github/workflows/copyrights.yml"
|
|
29
|
-
- ".github/workflows/markdown-lint.yml"
|
|
30
|
-
- ".github/workflows/pdd.yml"
|
|
31
|
-
- ".github/workflows/rake.yml"
|
|
32
|
-
- ".github/workflows/reuse.yml"
|
|
33
|
-
- ".github/workflows/typos.yml"
|
|
34
|
-
- ".github/workflows/xcop.yml"
|
|
35
|
-
- ".github/workflows/yamllint.yml"
|
|
36
|
-
- ".gitignore"
|
|
37
|
-
- ".pdd"
|
|
38
|
-
- ".rubocop.yml"
|
|
39
|
-
- ".rultor.yml"
|
|
40
|
-
- ".simplecov"
|
|
41
|
-
- ".yamllint.yml"
|
|
42
24
|
- Gemfile
|
|
43
25
|
- Gemfile.lock
|
|
44
26
|
- LICENSE.txt
|
|
@@ -48,10 +30,7 @@ files:
|
|
|
48
30
|
- Rakefile
|
|
49
31
|
- decoor.gemspec
|
|
50
32
|
- lib/decoor.rb
|
|
51
|
-
|
|
52
|
-
- test/test__helper.rb
|
|
53
|
-
- test/test_decoor.rb
|
|
54
|
-
homepage: https://github.com/yegor256/decoor.rb
|
|
33
|
+
homepage: https://github.com/yegor256/decoor
|
|
55
34
|
licenses:
|
|
56
35
|
- MIT
|
|
57
36
|
metadata:
|
|
@@ -71,7 +50,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
71
50
|
- !ruby/object:Gem::Version
|
|
72
51
|
version: '0'
|
|
73
52
|
requirements: []
|
|
74
|
-
rubygems_version: 3.6.
|
|
53
|
+
rubygems_version: 3.6.9
|
|
75
54
|
specification_version: 4
|
|
76
55
|
summary: Decoor
|
|
77
56
|
test_files: []
|
data/.0pdd.yml
DELETED
data/.gitattributes
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
|
2
|
-
# SPDX-License-Identifier: MIT
|
|
3
|
-
---
|
|
4
|
-
# yamllint disable rule:line-length
|
|
5
|
-
name: actionlint
|
|
6
|
-
'on':
|
|
7
|
-
push:
|
|
8
|
-
branches:
|
|
9
|
-
- master
|
|
10
|
-
pull_request:
|
|
11
|
-
branches:
|
|
12
|
-
- master
|
|
13
|
-
jobs:
|
|
14
|
-
actionlint:
|
|
15
|
-
timeout-minutes: 15
|
|
16
|
-
runs-on: ubuntu-24.04
|
|
17
|
-
steps:
|
|
18
|
-
- uses: actions/checkout@v4
|
|
19
|
-
- name: Download actionlint
|
|
20
|
-
id: get_actionlint
|
|
21
|
-
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
|
|
22
|
-
shell: bash
|
|
23
|
-
- name: Check workflow files
|
|
24
|
-
run: ${{ steps.get_actionlint.outputs.executable }} -color
|
|
25
|
-
shell: bash
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
|
2
|
-
# SPDX-License-Identifier: MIT
|
|
3
|
-
---
|
|
4
|
-
# yamllint disable rule:line-length
|
|
5
|
-
name: codecov
|
|
6
|
-
'on':
|
|
7
|
-
push:
|
|
8
|
-
branches:
|
|
9
|
-
- master
|
|
10
|
-
jobs:
|
|
11
|
-
codecov:
|
|
12
|
-
timeout-minutes: 15
|
|
13
|
-
runs-on: ubuntu-24.04
|
|
14
|
-
steps:
|
|
15
|
-
- uses: actions/checkout@v4
|
|
16
|
-
- uses: ruby/setup-ruby@v1
|
|
17
|
-
with:
|
|
18
|
-
ruby-version: 3.3
|
|
19
|
-
bundler-cache: true
|
|
20
|
-
- run: bundle config set --global path "$(pwd)/vendor/bundle"
|
|
21
|
-
- run: bundle install --no-color
|
|
22
|
-
- run: bundle exec rake
|
|
23
|
-
- uses: codecov/codecov-action@v5
|
|
24
|
-
with:
|
|
25
|
-
token: ${{ secrets.CODECOV_TOKEN }}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
|
2
|
-
# SPDX-License-Identifier: MIT
|
|
3
|
-
---
|
|
4
|
-
# yamllint disable rule:line-length
|
|
5
|
-
name: copyrights
|
|
6
|
-
'on':
|
|
7
|
-
push:
|
|
8
|
-
pull_request:
|
|
9
|
-
jobs:
|
|
10
|
-
copyrights:
|
|
11
|
-
timeout-minutes: 15
|
|
12
|
-
runs-on: ubuntu-24.04
|
|
13
|
-
steps:
|
|
14
|
-
- uses: actions/checkout@v4
|
|
15
|
-
- uses: yegor256/copyrights-action@0.0.12
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
|
2
|
-
# SPDX-License-Identifier: MIT
|
|
3
|
-
---
|
|
4
|
-
# yamllint disable rule:line-length
|
|
5
|
-
name: markdown-lint
|
|
6
|
-
'on':
|
|
7
|
-
push:
|
|
8
|
-
branches:
|
|
9
|
-
- master
|
|
10
|
-
pull_request:
|
|
11
|
-
branches:
|
|
12
|
-
- master
|
|
13
|
-
paths-ignore: ['paper/**', 'sandbox/**']
|
|
14
|
-
concurrency:
|
|
15
|
-
group: markdown-lint-${{ github.ref }}
|
|
16
|
-
cancel-in-progress: true
|
|
17
|
-
jobs:
|
|
18
|
-
markdown-lint:
|
|
19
|
-
timeout-minutes: 15
|
|
20
|
-
runs-on: ubuntu-24.04
|
|
21
|
-
steps:
|
|
22
|
-
- uses: actions/checkout@v4
|
|
23
|
-
- uses: DavidAnson/markdownlint-cli2-action@v20.0.0
|
data/.github/workflows/pdd.yml
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
|
2
|
-
# SPDX-License-Identifier: MIT
|
|
3
|
-
---
|
|
4
|
-
# yamllint disable rule:line-length
|
|
5
|
-
name: pdd
|
|
6
|
-
'on':
|
|
7
|
-
push:
|
|
8
|
-
branches:
|
|
9
|
-
- master
|
|
10
|
-
pull_request:
|
|
11
|
-
branches:
|
|
12
|
-
- master
|
|
13
|
-
jobs:
|
|
14
|
-
pdd:
|
|
15
|
-
timeout-minutes: 15
|
|
16
|
-
runs-on: ubuntu-24.04
|
|
17
|
-
steps:
|
|
18
|
-
- uses: actions/checkout@v4
|
|
19
|
-
- uses: volodya-lombrozo/pdd-action@master
|
data/.github/workflows/rake.yml
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
|
2
|
-
# SPDX-License-Identifier: MIT
|
|
3
|
-
---
|
|
4
|
-
# yamllint disable rule:line-length
|
|
5
|
-
name: rake
|
|
6
|
-
'on':
|
|
7
|
-
push:
|
|
8
|
-
branches:
|
|
9
|
-
- master
|
|
10
|
-
pull_request:
|
|
11
|
-
branches:
|
|
12
|
-
- master
|
|
13
|
-
jobs:
|
|
14
|
-
rake:
|
|
15
|
-
strategy:
|
|
16
|
-
matrix:
|
|
17
|
-
os: [ubuntu-24.04, macos-15, windows-2022]
|
|
18
|
-
ruby: [3.3]
|
|
19
|
-
runs-on: ${{ matrix.os }}
|
|
20
|
-
steps:
|
|
21
|
-
- uses: actions/checkout@v4
|
|
22
|
-
- uses: ruby/setup-ruby@v1
|
|
23
|
-
with:
|
|
24
|
-
ruby-version: ${{ matrix.ruby }}
|
|
25
|
-
bundler-cache: true
|
|
26
|
-
- run: bundle config set --global path "$(pwd)/vendor/bundle"
|
|
27
|
-
- run: bundle install --no-color
|
|
28
|
-
- run: bundle exec rake
|
data/.github/workflows/reuse.yml
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
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
|
data/.github/workflows/typos.yml
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
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.33.1
|
data/.github/workflows/xcop.yml
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
|
2
|
-
# SPDX-License-Identifier: MIT
|
|
3
|
-
---
|
|
4
|
-
# yamllint disable rule:line-length
|
|
5
|
-
name: xcop
|
|
6
|
-
'on':
|
|
7
|
-
push:
|
|
8
|
-
pull_request:
|
|
9
|
-
jobs:
|
|
10
|
-
xcop:
|
|
11
|
-
timeout-minutes: 15
|
|
12
|
-
runs-on: ubuntu-24.04
|
|
13
|
-
steps:
|
|
14
|
-
- uses: actions/checkout@v4
|
|
15
|
-
- uses: g4s8/xcop-action@master
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
|
2
|
-
# SPDX-License-Identifier: MIT
|
|
3
|
-
---
|
|
4
|
-
# yamllint disable rule:line-length
|
|
5
|
-
name: yamllint
|
|
6
|
-
'on':
|
|
7
|
-
push:
|
|
8
|
-
branches:
|
|
9
|
-
- master
|
|
10
|
-
pull_request:
|
|
11
|
-
branches:
|
|
12
|
-
- master
|
|
13
|
-
jobs:
|
|
14
|
-
yamllint:
|
|
15
|
-
timeout-minutes: 15
|
|
16
|
-
runs-on: ubuntu-24.04
|
|
17
|
-
steps:
|
|
18
|
-
- uses: actions/checkout@v4
|
|
19
|
-
- uses: ibiqlik/action-yamllint@v3
|
|
20
|
-
with:
|
|
21
|
-
config_file: .yamllint.yml
|
data/.gitignore
DELETED
data/.pdd
DELETED
data/.rubocop.yml
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
|
2
|
-
# SPDX-License-Identifier: MIT
|
|
3
|
-
---
|
|
4
|
-
AllCops:
|
|
5
|
-
Exclude:
|
|
6
|
-
- 'bin/**/*'
|
|
7
|
-
- 'assets/**/*'
|
|
8
|
-
- 'vendor/**/**'
|
|
9
|
-
DisplayCopNames: true
|
|
10
|
-
TargetRubyVersion: 3.2
|
|
11
|
-
SuggestExtensions: false
|
|
12
|
-
NewCops: enable
|
|
13
|
-
plugins:
|
|
14
|
-
- rubocop-rake
|
|
15
|
-
- rubocop-minitest
|
|
16
|
-
Minitest/EmptyLineBeforeAssertionMethods:
|
|
17
|
-
Enabled: false
|
|
18
|
-
Style/OptionalBooleanParameter:
|
|
19
|
-
Enabled: false
|
|
20
|
-
Lint/NestedMethodDefinition:
|
|
21
|
-
Enabled: false
|
|
22
|
-
Gemspec/RequiredRubyVersion:
|
|
23
|
-
Enabled: false
|
|
24
|
-
Metrics/MethodLength:
|
|
25
|
-
Enabled: false
|
|
26
|
-
Metrics/AbcSize:
|
|
27
|
-
Enabled: false
|
|
28
|
-
Metrics/BlockLength:
|
|
29
|
-
Enabled: false
|
|
30
|
-
Metrics/CyclomaticComplexity:
|
|
31
|
-
Enabled: false
|
|
32
|
-
Metrics/PerceivedComplexity:
|
|
33
|
-
Enabled: false
|
|
34
|
-
Metrics/ClassLength:
|
|
35
|
-
Enabled: false
|
|
36
|
-
Layout/EmptyLineAfterGuardClause:
|
|
37
|
-
Enabled: false
|
|
38
|
-
Layout/EndOfLine:
|
|
39
|
-
EnforcedStyle: lf
|
data/.rultor.yml
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
|
2
|
-
# SPDX-License-Identifier: MIT
|
|
3
|
-
---
|
|
4
|
-
# yamllint disable rule:line-length
|
|
5
|
-
docker:
|
|
6
|
-
image: yegor256/ruby
|
|
7
|
-
assets:
|
|
8
|
-
rubygems.yml: yegor256/home#assets/rubygems.yml
|
|
9
|
-
install: |
|
|
10
|
-
pdd -f /dev/null
|
|
11
|
-
bundle install --no-color
|
|
12
|
-
release:
|
|
13
|
-
pre: false
|
|
14
|
-
script: |-
|
|
15
|
-
[[ "${tag}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || exit -1
|
|
16
|
-
bundle exec rake
|
|
17
|
-
rm -rf *.gem
|
|
18
|
-
sed -i "s/0\.0\.0/${tag}/g" decoor.gemspec
|
|
19
|
-
git add decoor.gemspec
|
|
20
|
-
git commit -m "version set to ${tag}"
|
|
21
|
-
gem build decoor.gemspec
|
|
22
|
-
chmod 0600 ../rubygems.yml
|
|
23
|
-
gem push *.gem --config-file ../rubygems.yml
|
|
24
|
-
merge:
|
|
25
|
-
script: |-
|
|
26
|
-
bundle exec rake
|
data/.simplecov
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
#
|
|
4
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
|
5
|
-
# SPDX-License-Identifier: MIT
|
|
6
|
-
|
|
7
|
-
if Gem.win_platform?
|
|
8
|
-
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
|
9
|
-
SimpleCov::Formatter::HTMLFormatter
|
|
10
|
-
]
|
|
11
|
-
SimpleCov.start do
|
|
12
|
-
add_filter '/test/'
|
|
13
|
-
add_filter '/features/'
|
|
14
|
-
end
|
|
15
|
-
else
|
|
16
|
-
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
|
|
17
|
-
[SimpleCov::Formatter::HTMLFormatter]
|
|
18
|
-
)
|
|
19
|
-
SimpleCov.start do
|
|
20
|
-
add_filter '/test/'
|
|
21
|
-
add_filter '/features/'
|
|
22
|
-
minimum_coverage 20
|
|
23
|
-
end
|
|
24
|
-
end
|
data/.yamllint.yml
DELETED
data/renovate.json
DELETED
data/test/test__helper.rb
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
|
4
|
-
# SPDX-License-Identifier: MIT
|
|
5
|
-
|
|
6
|
-
$stdout.sync = true
|
|
7
|
-
|
|
8
|
-
require 'simplecov'
|
|
9
|
-
require 'simplecov-cobertura'
|
|
10
|
-
unless SimpleCov.running
|
|
11
|
-
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
|
|
12
|
-
[
|
|
13
|
-
SimpleCov::Formatter::HTMLFormatter,
|
|
14
|
-
SimpleCov::Formatter::CoberturaFormatter
|
|
15
|
-
]
|
|
16
|
-
)
|
|
17
|
-
SimpleCov.minimum_coverage 85
|
|
18
|
-
SimpleCov.minimum_coverage_by_file 85
|
|
19
|
-
SimpleCov.start do
|
|
20
|
-
add_filter 'test/'
|
|
21
|
-
add_filter 'vendor/'
|
|
22
|
-
add_filter 'target/'
|
|
23
|
-
track_files 'lib/**/*.rb'
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
require 'minitest/autorun'
|
|
28
|
-
require 'minitest/reporters'
|
|
29
|
-
Minitest::Reporters.use! [Minitest::Reporters::SpecReporter.new]
|
data/test/test_decoor.rb
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
|
4
|
-
# SPDX-License-Identifier: MIT
|
|
5
|
-
|
|
6
|
-
require_relative 'test__helper'
|
|
7
|
-
require_relative '../lib/decoor'
|
|
8
|
-
|
|
9
|
-
# Decoor main module test.
|
|
10
|
-
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
11
|
-
# Copyright:: Copyright (c) 2024-2025 Yegor Bugayenko
|
|
12
|
-
# License:: MIT
|
|
13
|
-
class TestDecoor < Minitest::Test
|
|
14
|
-
def test_object_decoration
|
|
15
|
-
cy = Class.new do
|
|
16
|
-
def booo
|
|
17
|
-
yield 55
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def zero
|
|
21
|
-
0
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
x = decoor(cy.new, bar: 42) do
|
|
25
|
-
def foo
|
|
26
|
-
@bar
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
def sum
|
|
30
|
-
@origin.zero + 10
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
assert_equal(42, x.foo)
|
|
34
|
-
assert_equal(10, x.sum)
|
|
35
|
-
assert_equal(56, x.booo { |v| v + 1 })
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
def test_class_decoration
|
|
39
|
-
cy = Class.new do
|
|
40
|
-
def booo
|
|
41
|
-
yield 44
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
def to_s
|
|
45
|
-
'yes'
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
cz = Class.new do
|
|
49
|
-
decoor(:origin)
|
|
50
|
-
|
|
51
|
-
def initialize(origin, bar: nil)
|
|
52
|
-
@origin = origin
|
|
53
|
-
@bar = bar
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
def foo
|
|
57
|
-
@bar
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
z = cz.new(cy.new, bar: 42)
|
|
61
|
-
assert_equal(42, z.foo)
|
|
62
|
-
assert_equal(45, z.booo { |v| v + 1 })
|
|
63
|
-
refute_equal(z.to_s, 'yes')
|
|
64
|
-
end
|
|
65
|
-
end
|