always 0.0.5 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +12 -27
- data/Gemfile.lock +58 -146
- data/LICENSE.txt +1 -1
- data/LICENSES/MIT.txt +21 -0
- data/README.md +17 -11
- data/REUSE.toml +34 -0
- data/Rakefile +3 -31
- data/always.gemspec +6 -23
- data/lib/always.rb +40 -39
- metadata +7 -26
- data/.0pdd.yml +0 -22
- data/.gitattributes +0 -7
- data/.github/workflows/actionlint.yml +0 -41
- data/.github/workflows/codecov.yml +0 -39
- data/.github/workflows/license.yml +0 -57
- data/.github/workflows/markdown-lint.yml +0 -38
- data/.github/workflows/pdd.yml +0 -34
- data/.github/workflows/rake.yml +0 -44
- data/.github/workflows/xcop.yml +0 -30
- data/.github/workflows/yamllint.yml +0 -34
- data/.gitignore +0 -9
- data/.pdd +0 -7
- data/.rubocop.yml +0 -34
- data/.rultor.yml +0 -44
- data/.simplecov +0 -41
- data/renovate.json +0 -6
- data/test/test__helper.rb +0 -31
- data/test/test_always.rb +0 -106
data/lib/always.rb
CHANGED
|
@@ -1,26 +1,10 @@
|
|
|
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 'concurrent/atom'
|
|
7
|
+
require 'securerandom'
|
|
24
8
|
|
|
25
9
|
# Always.
|
|
26
10
|
#
|
|
@@ -28,14 +12,14 @@ require 'concurrent/atom'
|
|
|
28
12
|
# over and over again, with a 60-seconds pause between cycles, do this:
|
|
29
13
|
#
|
|
30
14
|
# require 'always'
|
|
31
|
-
# a = Always.new(5)
|
|
32
|
-
#
|
|
33
|
-
# puts 'Hello, world!
|
|
15
|
+
# a = Always.new(5) do
|
|
16
|
+
# puts 'Hello, world!'
|
|
34
17
|
# end
|
|
18
|
+
# a.start!(60)
|
|
35
19
|
#
|
|
36
20
|
# Then, in order to stop them all together:
|
|
37
21
|
#
|
|
38
|
-
# a.stop
|
|
22
|
+
# a.stop!
|
|
39
23
|
#
|
|
40
24
|
# It's possible to get a quick summary of the thread pool, by calling +to_s+.
|
|
41
25
|
# The result will be a +"T/C/E"+ string, where +T+ is the total number of
|
|
@@ -43,22 +27,32 @@ require 'concurrent/atom'
|
|
|
43
27
|
# so far, and +E+ is the total number of all errors seen so far.
|
|
44
28
|
#
|
|
45
29
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
46
|
-
# Copyright:: Copyright (c) 2024 Yegor Bugayenko
|
|
30
|
+
# Copyright:: Copyright (c) 2024-2025 Yegor Bugayenko
|
|
47
31
|
# License:: MIT
|
|
48
32
|
class Always
|
|
33
|
+
# Get the array of most recent exception backtraces.
|
|
34
|
+
# @return [Array<Exception>] The array of exceptions caught
|
|
35
|
+
# @example
|
|
36
|
+
# a = Always.new(5, max_backtraces: 10)
|
|
37
|
+
# a.start { raise 'Oops' }
|
|
38
|
+
# sleep 1
|
|
39
|
+
# puts a.backtraces.size # => number of exceptions caught
|
|
49
40
|
attr_reader :backtraces
|
|
50
41
|
|
|
51
42
|
# The version of the framework.
|
|
52
|
-
VERSION = '0.0
|
|
43
|
+
VERSION = '0.2.0'
|
|
53
44
|
|
|
54
45
|
# Constructor.
|
|
55
46
|
# @param [Integer] total The number of threads to run
|
|
56
47
|
# @param [Integer] max_backtraces How many backtraces to keep in memory?
|
|
57
|
-
|
|
48
|
+
# @param [Block] block The block to execute
|
|
49
|
+
def initialize(total, max_backtraces: 32, name: "always-#{SecureRandom.hex(4)}", &block)
|
|
58
50
|
raise "The number of threads (#{total}) must be positive" unless total.positive?
|
|
59
51
|
|
|
60
52
|
@total = total
|
|
53
|
+
@block = block
|
|
61
54
|
@on_error = nil
|
|
55
|
+
@name = name
|
|
62
56
|
@threads = []
|
|
63
57
|
@backtraces = []
|
|
64
58
|
@cycles = Concurrent::Atom.new(0)
|
|
@@ -69,7 +63,7 @@ class Always
|
|
|
69
63
|
# What to do when an exception occurs?
|
|
70
64
|
#
|
|
71
65
|
# Call it like this (the +e+ provided is the exception and +i+ is the
|
|
72
|
-
# number of the thread where it
|
|
66
|
+
# number of the thread where it occurred):
|
|
73
67
|
#
|
|
74
68
|
# a = Always.new(5)
|
|
75
69
|
# a.on_error do |e, i|
|
|
@@ -86,18 +80,21 @@ class Always
|
|
|
86
80
|
|
|
87
81
|
# Start them all and let them run forever (until the +stop+ method is called).
|
|
88
82
|
# @param [Integer] pause The delay between cycles, in seconds
|
|
89
|
-
def start(pause = 0
|
|
83
|
+
def start!(pause = 0)
|
|
90
84
|
raise 'It is running now, call .stop() first' unless @threads.empty?
|
|
91
85
|
|
|
92
|
-
(0
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
86
|
+
(0..(@total - 1)).each do |i|
|
|
87
|
+
t =
|
|
88
|
+
Thread.new do
|
|
89
|
+
body(pause)
|
|
90
|
+
end
|
|
91
|
+
t.name = "#{@name}-#{i + 1}"
|
|
92
|
+
@threads[i] = t
|
|
96
93
|
end
|
|
97
94
|
end
|
|
98
95
|
|
|
99
96
|
# Stop them all.
|
|
100
|
-
def stop
|
|
97
|
+
def stop!
|
|
101
98
|
raise 'It is not running now, call .start() first' if @threads.empty?
|
|
102
99
|
|
|
103
100
|
@threads.delete_if do |t|
|
|
@@ -111,8 +108,12 @@ class Always
|
|
|
111
108
|
|
|
112
109
|
# Represent its internal state as a string.
|
|
113
110
|
# @return [String] Something like "4/230/23", where 4 is the number of running
|
|
114
|
-
# threads, 230 is the number of
|
|
115
|
-
# of failures
|
|
111
|
+
# threads, 230 is the number of successful loops, and 23 is the number
|
|
112
|
+
# of failures occurred so far.
|
|
113
|
+
# @example
|
|
114
|
+
# a = Always.new(5)
|
|
115
|
+
# a.start(60) { puts 'Working...' }
|
|
116
|
+
# puts a.to_s # => "5/42/3"
|
|
116
117
|
def to_s
|
|
117
118
|
"#{@threads.size}/#{@cycles.value}/#{@errors.value}"
|
|
118
119
|
end
|
|
@@ -120,9 +121,9 @@ class Always
|
|
|
120
121
|
private
|
|
121
122
|
|
|
122
123
|
# rubocop:disable Lint/RescueException
|
|
123
|
-
def body(pause
|
|
124
|
+
def body(pause)
|
|
124
125
|
loop do
|
|
125
|
-
one
|
|
126
|
+
one
|
|
126
127
|
@cycles.swap { |c| c + 1 }
|
|
127
128
|
sleep(pause) unless pause.zero?
|
|
128
129
|
rescue Exception
|
|
@@ -135,12 +136,12 @@ class Always
|
|
|
135
136
|
|
|
136
137
|
# rubocop:disable Lint/RescueException
|
|
137
138
|
def one
|
|
138
|
-
|
|
139
|
+
@block.call
|
|
139
140
|
rescue Exception => e
|
|
140
141
|
@errors.swap { |c| c + 1 }
|
|
141
142
|
@backtraces << e
|
|
142
143
|
@backtraces.shift if @backtraces.size > @max_backtraces
|
|
143
|
-
@on_error&.call(e)
|
|
144
|
+
@on_error&.call(e, Thread.current.object_id)
|
|
144
145
|
end
|
|
145
146
|
# rubocop:enable Lint/RescueException
|
|
146
147
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: always
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yegor Bugayenko
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: concurrent-ruby
|
|
@@ -31,40 +30,23 @@ email: yegor256@gmail.com
|
|
|
31
30
|
executables: []
|
|
32
31
|
extensions: []
|
|
33
32
|
extra_rdoc_files:
|
|
34
|
-
- README.md
|
|
35
33
|
- LICENSE.txt
|
|
34
|
+
- README.md
|
|
36
35
|
files:
|
|
37
|
-
- ".0pdd.yml"
|
|
38
|
-
- ".gitattributes"
|
|
39
|
-
- ".github/workflows/actionlint.yml"
|
|
40
|
-
- ".github/workflows/codecov.yml"
|
|
41
|
-
- ".github/workflows/license.yml"
|
|
42
|
-
- ".github/workflows/markdown-lint.yml"
|
|
43
|
-
- ".github/workflows/pdd.yml"
|
|
44
|
-
- ".github/workflows/rake.yml"
|
|
45
|
-
- ".github/workflows/xcop.yml"
|
|
46
|
-
- ".github/workflows/yamllint.yml"
|
|
47
|
-
- ".gitignore"
|
|
48
|
-
- ".pdd"
|
|
49
|
-
- ".rubocop.yml"
|
|
50
|
-
- ".rultor.yml"
|
|
51
|
-
- ".simplecov"
|
|
52
36
|
- Gemfile
|
|
53
37
|
- Gemfile.lock
|
|
54
38
|
- LICENSE.txt
|
|
39
|
+
- LICENSES/MIT.txt
|
|
55
40
|
- README.md
|
|
41
|
+
- REUSE.toml
|
|
56
42
|
- Rakefile
|
|
57
43
|
- always.gemspec
|
|
58
44
|
- lib/always.rb
|
|
59
|
-
|
|
60
|
-
- test/test__helper.rb
|
|
61
|
-
- test/test_always.rb
|
|
62
|
-
homepage: http://github.com/yegor256/always
|
|
45
|
+
homepage: https://github.com/yegor256/always
|
|
63
46
|
licenses:
|
|
64
47
|
- MIT
|
|
65
48
|
metadata:
|
|
66
49
|
rubygems_mfa_required: 'true'
|
|
67
|
-
post_install_message:
|
|
68
50
|
rdoc_options:
|
|
69
51
|
- "--charset=UTF-8"
|
|
70
52
|
require_paths:
|
|
@@ -80,8 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
80
62
|
- !ruby/object:Gem::Version
|
|
81
63
|
version: '0'
|
|
82
64
|
requirements: []
|
|
83
|
-
rubygems_version: 3.
|
|
84
|
-
signing_key:
|
|
65
|
+
rubygems_version: 3.6.9
|
|
85
66
|
specification_version: 4
|
|
86
67
|
summary: A simple Ruby framework that spins a loop forever, in a background thread
|
|
87
68
|
test_files: []
|
data/.0pdd.yml
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
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
|
data/.gitattributes
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
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: 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
|
|
@@ -1,39 +0,0 @@
|
|
|
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 }}
|
|
@@ -1,57 +0,0 @@
|
|
|
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: license
|
|
22
|
-
'on':
|
|
23
|
-
push:
|
|
24
|
-
branches:
|
|
25
|
-
- master
|
|
26
|
-
pull_request:
|
|
27
|
-
branches:
|
|
28
|
-
- master
|
|
29
|
-
jobs:
|
|
30
|
-
license:
|
|
31
|
-
runs-on: ubuntu-22.04
|
|
32
|
-
steps:
|
|
33
|
-
- uses: actions/checkout@v4
|
|
34
|
-
- shell: bash
|
|
35
|
-
run: |
|
|
36
|
-
header="Copyright (c) $(date +%Y) Yegor Bugayenko"
|
|
37
|
-
failed="false"
|
|
38
|
-
while IFS= read -r file; do
|
|
39
|
-
if ! grep -q "${header}" "${file}"; then
|
|
40
|
-
failed="true"
|
|
41
|
-
echo "⚠️ Copyright header is not found in: ${file}"
|
|
42
|
-
else
|
|
43
|
-
echo "File looks good: ${file}"
|
|
44
|
-
fi
|
|
45
|
-
done < <(find . -type f \( \
|
|
46
|
-
-name "Dockerfile" -o \
|
|
47
|
-
-name "LICENSE.txt" -o \
|
|
48
|
-
-name "Makefile" -o \
|
|
49
|
-
-name "Rakefile" -o \
|
|
50
|
-
-name "*.sh" -o \
|
|
51
|
-
-name "*.rb" -o \
|
|
52
|
-
-name "*.fe" -o \
|
|
53
|
-
-name "*.yml" \
|
|
54
|
-
\) -print)
|
|
55
|
-
if [ "${failed}" = "true" ]; then
|
|
56
|
-
exit 1
|
|
57
|
-
fi
|
|
@@ -1,38 +0,0 @@
|
|
|
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: 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
|
data/.github/workflows/pdd.yml
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
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
|
data/.github/workflows/rake.yml
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
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]
|
|
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
|
data/.github/workflows/xcop.yml
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
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
|
|
@@ -1,34 +0,0 @@
|
|
|
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: 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
|
data/.gitignore
DELETED
data/.pdd
DELETED
data/.rubocop.yml
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
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
|
-
Layout/EndOfLine:
|
|
32
|
-
EnforcedStyle: lf
|
|
33
|
-
Style/EvalWithLocation:
|
|
34
|
-
Enabled: false
|