loog 0.6.1 → 0.7.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 +7 -8
- data/Gemfile.lock +37 -34
- data/LICENSE.txt +1 -1
- data/LICENSES/MIT.txt +1 -1
- data/README.md +10 -0
- data/Rakefile +2 -2
- data/lib/loog/ellipsized.rb +59 -0
- data/lib/loog/tee.rb +2 -2
- data/lib/loog.rb +2 -2
- data/loog.gemspec +5 -4
- metadata +18 -23
- data/.0pdd.yml +0 -12
- 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 -21
- data/.github/workflows/yamllint.yml +0 -19
- data/.gitignore +0 -12
- data/.pdd +0 -5
- data/.rubocop.yml +0 -32
- data/.rultor.yml +0 -25
- data/renovate.json +0 -6
- data/test/test__helper.rb +0 -31
- data/test/test_loog.rb +0 -63
- data/test/test_tee.rb +0 -22
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dfd382c687b56de8264decc871bf4edd67c3dd0bc34af6072dbeeffd6b4fa5b9
|
|
4
|
+
data.tar.gz: 0b5610e54655500cdafc1f2a9dbb14e13988f5b9cca21ac15b12c2775ca39c0d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 59f9e40500c00a7e9d932b4d12e8f78d23f4f9f68db78472f6e18a96256d1d57044891f3333dca5554f5925ecd8490f7f6e33cb066b21455c6cd9fdb12b1ca5b
|
|
7
|
+
data.tar.gz: 22a8e7b63133b3acfeaf2265b2a782cfc376617c3471ba3674c281b52c46f39b49dd0072b46e62d862c5c90f500e8985bf51e26a28bd1e6b537d5d82bd70922f
|
data/Gemfile
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# SPDX-FileCopyrightText: Copyright (c) 2018-
|
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2018-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
|
-
gem 'rdoc', '~>
|
|
12
|
+
gem 'rdoc', '~>7.0', require: false
|
|
13
13
|
gem 'rubocop', '~>1.71', require: false
|
|
14
|
-
gem 'rubocop-minitest', '
|
|
15
|
-
gem 'rubocop-performance', '
|
|
16
|
-
gem 'rubocop-rake', '
|
|
17
|
-
gem 'rubocop-rspec', '>0', require: false
|
|
14
|
+
gem 'rubocop-minitest', '~>0.38', require: false
|
|
15
|
+
gem 'rubocop-performance', '~>1.25', require: false
|
|
16
|
+
gem 'rubocop-rake', '~>0.7', require: false
|
|
18
17
|
gem 'simplecov', '~>0.22', require: false
|
|
19
|
-
gem 'simplecov-cobertura', '~>
|
|
18
|
+
gem 'simplecov-cobertura', '~>3.0', require: false
|
data/Gemfile.lock
CHANGED
|
@@ -2,6 +2,7 @@ PATH
|
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
4
|
loog (0.0.0)
|
|
5
|
+
ellipsized
|
|
5
6
|
logger (~> 1.0)
|
|
6
7
|
|
|
7
8
|
GEM
|
|
@@ -10,34 +11,39 @@ GEM
|
|
|
10
11
|
ansi (1.5.0)
|
|
11
12
|
ast (2.4.3)
|
|
12
13
|
builder (3.3.0)
|
|
13
|
-
date (3.
|
|
14
|
+
date (3.5.1)
|
|
14
15
|
docile (1.4.1)
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
ellipsized (0.3.0)
|
|
17
|
+
erb (6.0.1)
|
|
18
|
+
json (2.18.0)
|
|
19
|
+
language_server-protocol (3.17.0.5)
|
|
17
20
|
lint_roller (1.1.0)
|
|
18
21
|
logger (1.7.0)
|
|
19
|
-
minitest (
|
|
22
|
+
minitest (6.0.1)
|
|
23
|
+
prism (~> 1.5)
|
|
20
24
|
minitest-reporters (1.7.1)
|
|
21
25
|
ansi
|
|
22
26
|
builder
|
|
23
27
|
minitest (>= 5.0)
|
|
24
28
|
ruby-progressbar
|
|
25
29
|
parallel (1.27.0)
|
|
26
|
-
parser (3.3.
|
|
30
|
+
parser (3.3.10.1)
|
|
27
31
|
ast (~> 2.4.1)
|
|
28
32
|
racc
|
|
29
|
-
prism (1.
|
|
30
|
-
psych (5.
|
|
33
|
+
prism (1.8.0)
|
|
34
|
+
psych (5.3.1)
|
|
31
35
|
date
|
|
32
36
|
stringio
|
|
33
37
|
racc (1.8.1)
|
|
34
38
|
rainbow (3.1.1)
|
|
35
|
-
rake (13.
|
|
36
|
-
rdoc (
|
|
39
|
+
rake (13.3.1)
|
|
40
|
+
rdoc (7.1.0)
|
|
41
|
+
erb
|
|
37
42
|
psych (>= 4.0.0)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
tsort
|
|
44
|
+
regexp_parser (2.11.3)
|
|
45
|
+
rexml (3.4.4)
|
|
46
|
+
rubocop (1.82.1)
|
|
41
47
|
json (~> 2.3)
|
|
42
48
|
language_server-protocol (~> 3.17.0.2)
|
|
43
49
|
lint_roller (~> 1.1.0)
|
|
@@ -45,40 +51,38 @@ GEM
|
|
|
45
51
|
parser (>= 3.3.0.2)
|
|
46
52
|
rainbow (>= 2.2.2, < 4.0)
|
|
47
53
|
regexp_parser (>= 2.9.3, < 3.0)
|
|
48
|
-
rubocop-ast (>= 1.
|
|
54
|
+
rubocop-ast (>= 1.48.0, < 2.0)
|
|
49
55
|
ruby-progressbar (~> 1.7)
|
|
50
56
|
unicode-display_width (>= 2.4.0, < 4.0)
|
|
51
|
-
rubocop-ast (1.
|
|
57
|
+
rubocop-ast (1.49.0)
|
|
52
58
|
parser (>= 3.3.7.2)
|
|
53
|
-
prism (~> 1.
|
|
54
|
-
rubocop-minitest (0.38.
|
|
59
|
+
prism (~> 1.7)
|
|
60
|
+
rubocop-minitest (0.38.2)
|
|
55
61
|
lint_roller (~> 1.1)
|
|
56
62
|
rubocop (>= 1.75.0, < 2.0)
|
|
57
63
|
rubocop-ast (>= 1.38.0, < 2.0)
|
|
58
|
-
rubocop-performance (1.
|
|
64
|
+
rubocop-performance (1.26.1)
|
|
59
65
|
lint_roller (~> 1.1)
|
|
60
66
|
rubocop (>= 1.75.0, < 2.0)
|
|
61
|
-
rubocop-ast (>= 1.
|
|
67
|
+
rubocop-ast (>= 1.47.1, < 2.0)
|
|
62
68
|
rubocop-rake (0.7.1)
|
|
63
69
|
lint_roller (~> 1.1)
|
|
64
70
|
rubocop (>= 1.72.1)
|
|
65
|
-
rubocop-rspec (3.6.0)
|
|
66
|
-
lint_roller (~> 1.1)
|
|
67
|
-
rubocop (~> 1.72, >= 1.72.1)
|
|
68
71
|
ruby-progressbar (1.13.0)
|
|
69
72
|
simplecov (0.22.0)
|
|
70
73
|
docile (~> 1.1)
|
|
71
74
|
simplecov-html (~> 0.11)
|
|
72
75
|
simplecov_json_formatter (~> 0.1)
|
|
73
|
-
simplecov-cobertura (
|
|
76
|
+
simplecov-cobertura (3.1.0)
|
|
74
77
|
rexml
|
|
75
78
|
simplecov (~> 0.19)
|
|
76
|
-
simplecov-html (0.13.
|
|
79
|
+
simplecov-html (0.13.2)
|
|
77
80
|
simplecov_json_formatter (0.1.4)
|
|
78
|
-
stringio (3.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
stringio (3.2.0)
|
|
82
|
+
tsort (0.2.0)
|
|
83
|
+
unicode-display_width (3.2.0)
|
|
84
|
+
unicode-emoji (~> 4.1)
|
|
85
|
+
unicode-emoji (4.2.0)
|
|
82
86
|
|
|
83
87
|
PLATFORMS
|
|
84
88
|
arm64-darwin-22
|
|
@@ -89,17 +93,16 @@ PLATFORMS
|
|
|
89
93
|
|
|
90
94
|
DEPENDENCIES
|
|
91
95
|
loog!
|
|
92
|
-
minitest (~>
|
|
96
|
+
minitest (~> 6.0)
|
|
93
97
|
minitest-reporters (~> 1.7)
|
|
94
98
|
rake (~> 13.2)
|
|
95
|
-
rdoc (~>
|
|
99
|
+
rdoc (~> 7.0)
|
|
96
100
|
rubocop (~> 1.71)
|
|
97
|
-
rubocop-minitest (
|
|
98
|
-
rubocop-performance (
|
|
99
|
-
rubocop-rake (
|
|
100
|
-
rubocop-rspec (> 0)
|
|
101
|
+
rubocop-minitest (~> 0.38)
|
|
102
|
+
rubocop-performance (~> 1.25)
|
|
103
|
+
rubocop-rake (~> 0.7)
|
|
101
104
|
simplecov (~> 0.22)
|
|
102
|
-
simplecov-cobertura (~>
|
|
105
|
+
simplecov-cobertura (~> 3.0)
|
|
103
106
|
|
|
104
107
|
BUNDLED WITH
|
|
105
108
|
2.5.16
|
data/LICENSE.txt
CHANGED
data/LICENSES/MIT.txt
CHANGED
data/README.md
CHANGED
|
@@ -47,6 +47,16 @@ loog.info('Hello, world!')
|
|
|
47
47
|
assert(buf.to_s.include?('Hello'))
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
+
You can also truncate long messages with `Loog::Ellipsized`:
|
|
51
|
+
|
|
52
|
+
```ruby
|
|
53
|
+
require 'loog'
|
|
54
|
+
require 'loog/ellipsized'
|
|
55
|
+
loog = Loog::Ellipsized.new(Loog::VERBOSE, 20)
|
|
56
|
+
loog.info('This is a very long message that will be truncated')
|
|
57
|
+
# prints: "This is...truncated"
|
|
58
|
+
```
|
|
59
|
+
|
|
50
60
|
## How to contribute
|
|
51
61
|
|
|
52
62
|
Read
|
data/Rakefile
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# SPDX-FileCopyrightText: Copyright (c) 2018-
|
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2018-2026 Yegor Bugayenko
|
|
4
4
|
# SPDX-License-Identifier: MIT
|
|
5
5
|
|
|
6
6
|
require 'rubygems'
|
|
7
7
|
require 'rake'
|
|
8
8
|
require 'rake/clean'
|
|
9
9
|
|
|
10
|
-
CLEAN
|
|
10
|
+
CLEAN.include('coverage')
|
|
11
11
|
|
|
12
12
|
def name
|
|
13
13
|
@name ||= File.basename(Dir['*.gemspec'].first, '.*')
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2018-2026 Yegor Bugayenko
|
|
4
|
+
# SPDX-License-Identifier: MIT
|
|
5
|
+
|
|
6
|
+
require 'ellipsized'
|
|
7
|
+
require_relative '../loog'
|
|
8
|
+
|
|
9
|
+
# Log decorator that makes all lines ellipsized in the middle.
|
|
10
|
+
#
|
|
11
|
+
# require 'loog'
|
|
12
|
+
# require 'loog/ellipsized'
|
|
13
|
+
# tee = Loog::Ellipsized.new(Loog::VERBOSE, 10)
|
|
14
|
+
# tee.info('Hello, world!')
|
|
15
|
+
#
|
|
16
|
+
# Only a part of the message is printed.
|
|
17
|
+
#
|
|
18
|
+
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
19
|
+
# Copyright:: Copyright (c) 2018-2026 Yegor Bugayenko
|
|
20
|
+
# License:: MIT
|
|
21
|
+
class Loog::Ellipsized
|
|
22
|
+
# Makes an instance.
|
|
23
|
+
def initialize(log, width = 100)
|
|
24
|
+
@log = log
|
|
25
|
+
@width = width
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def debug(msg)
|
|
29
|
+
@log.debug(msg.ellipsized(@width))
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def debug?
|
|
33
|
+
@log.debug?
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def info(msg)
|
|
37
|
+
@log.info(msg.ellipsized(@width))
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def info?
|
|
41
|
+
@log.info?
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def warn(msg)
|
|
45
|
+
@log.warn(msg.ellipsized(@width))
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def warn?
|
|
49
|
+
@log.warn?
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def error(msg)
|
|
53
|
+
@log.error(msg.ellipsized(@width))
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def error?
|
|
57
|
+
@log.error?
|
|
58
|
+
end
|
|
59
|
+
end
|
data/lib/loog/tee.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# SPDX-FileCopyrightText: Copyright (c) 2018-
|
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2018-2026 Yegor Bugayenko
|
|
4
4
|
# SPDX-License-Identifier: MIT
|
|
5
5
|
|
|
6
6
|
require_relative '../loog'
|
|
@@ -15,7 +15,7 @@ require_relative '../loog'
|
|
|
15
15
|
# This way you can log to console and to the file at the same time.
|
|
16
16
|
#
|
|
17
17
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
18
|
-
# Copyright:: Copyright (c) 2018-
|
|
18
|
+
# Copyright:: Copyright (c) 2018-2026 Yegor Bugayenko
|
|
19
19
|
# License:: MIT
|
|
20
20
|
class Loog::Tee
|
|
21
21
|
# Makes an instance.
|
data/lib/loog.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# SPDX-FileCopyrightText: Copyright (c) 2018-
|
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2018-2026 Yegor Bugayenko
|
|
4
4
|
# SPDX-License-Identifier: MIT
|
|
5
5
|
|
|
6
6
|
require 'logger'
|
|
@@ -16,7 +16,7 @@ require 'time'
|
|
|
16
16
|
# {README}[https://github.com/yegor256/loog/blob/master/README.md] file.
|
|
17
17
|
#
|
|
18
18
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
19
|
-
# Copyright:: Copyright (c) 2018-
|
|
19
|
+
# Copyright:: Copyright (c) 2018-2026 Yegor Bugayenko
|
|
20
20
|
# License:: MIT
|
|
21
21
|
module Loog
|
|
22
22
|
# Compact formatter
|
data/loog.gemspec
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# SPDX-FileCopyrightText: Copyright (c) 2018-
|
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2018-2026 Yegor Bugayenko
|
|
4
4
|
# SPDX-License-Identifier: MIT
|
|
5
5
|
|
|
6
6
|
require 'English'
|
|
@@ -8,16 +8,17 @@ Gem::Specification.new do |s|
|
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
|
|
9
9
|
s.required_ruby_version = '>=2.3'
|
|
10
10
|
s.name = 'loog'
|
|
11
|
-
s.version = '0.
|
|
11
|
+
s.version = '0.7.0'
|
|
12
12
|
s.license = 'MIT'
|
|
13
13
|
s.summary = 'Object-oriented logging wrapper'
|
|
14
14
|
s.description = 'Object-oriented wrapper for Ruby default logging facility'
|
|
15
15
|
s.authors = ['Yegor Bugayenko']
|
|
16
16
|
s.email = 'yegor256@gmail.com'
|
|
17
|
-
s.homepage = '
|
|
18
|
-
s.files = `git ls-files`.split($RS)
|
|
17
|
+
s.homepage = 'https://github.com/yegor256/loog'
|
|
18
|
+
s.files = `git ls-files | grep -v -E '^(test/|\\.|renovate)'`.split($RS)
|
|
19
19
|
s.rdoc_options = ['--charset=UTF-8']
|
|
20
20
|
s.extra_rdoc_files = ['README.md']
|
|
21
|
+
s.add_dependency 'ellipsized'
|
|
21
22
|
s.add_dependency 'logger', '~>1.0'
|
|
22
23
|
s.metadata['rubygems_mfa_required'] = 'true'
|
|
23
24
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: loog
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yegor Bugayenko
|
|
@@ -9,6 +9,20 @@ bindir: bin
|
|
|
9
9
|
cert_chain: []
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: ellipsized
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '0'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - ">="
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '0'
|
|
12
26
|
- !ruby/object:Gem::Dependency
|
|
13
27
|
name: logger
|
|
14
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -30,22 +44,6 @@ extensions: []
|
|
|
30
44
|
extra_rdoc_files:
|
|
31
45
|
- README.md
|
|
32
46
|
files:
|
|
33
|
-
- ".0pdd.yml"
|
|
34
|
-
- ".gitattributes"
|
|
35
|
-
- ".github/workflows/actionlint.yml"
|
|
36
|
-
- ".github/workflows/codecov.yml"
|
|
37
|
-
- ".github/workflows/copyrights.yml"
|
|
38
|
-
- ".github/workflows/markdown-lint.yml"
|
|
39
|
-
- ".github/workflows/pdd.yml"
|
|
40
|
-
- ".github/workflows/rake.yml"
|
|
41
|
-
- ".github/workflows/reuse.yml"
|
|
42
|
-
- ".github/workflows/typos.yml"
|
|
43
|
-
- ".github/workflows/xcop.yml"
|
|
44
|
-
- ".github/workflows/yamllint.yml"
|
|
45
|
-
- ".gitignore"
|
|
46
|
-
- ".pdd"
|
|
47
|
-
- ".rubocop.yml"
|
|
48
|
-
- ".rultor.yml"
|
|
49
47
|
- Gemfile
|
|
50
48
|
- Gemfile.lock
|
|
51
49
|
- LICENSE.txt
|
|
@@ -54,14 +52,11 @@ files:
|
|
|
54
52
|
- REUSE.toml
|
|
55
53
|
- Rakefile
|
|
56
54
|
- lib/loog.rb
|
|
55
|
+
- lib/loog/ellipsized.rb
|
|
57
56
|
- lib/loog/tee.rb
|
|
58
57
|
- logo.svg
|
|
59
58
|
- loog.gemspec
|
|
60
|
-
|
|
61
|
-
- test/test__helper.rb
|
|
62
|
-
- test/test_loog.rb
|
|
63
|
-
- test/test_tee.rb
|
|
64
|
-
homepage: http://github.com/yegor256/loog
|
|
59
|
+
homepage: https://github.com/yegor256/loog
|
|
65
60
|
licenses:
|
|
66
61
|
- MIT
|
|
67
62
|
metadata:
|
|
@@ -81,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
81
76
|
- !ruby/object:Gem::Version
|
|
82
77
|
version: '0'
|
|
83
78
|
requirements: []
|
|
84
|
-
rubygems_version: 3.6.
|
|
79
|
+
rubygems_version: 3.6.9
|
|
85
80
|
specification_version: 4
|
|
86
81
|
summary: Object-oriented logging wrapper
|
|
87
82
|
test_files: []
|
data/.0pdd.yml
DELETED
data/.gitattributes
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2018-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) 2018-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: actions/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) 2018-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.8
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2018-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: articulate/actions-markdownlint@v1
|
data/.github/workflows/pdd.yml
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2018-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) 2018-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
|
-
test:
|
|
15
|
-
strategy:
|
|
16
|
-
matrix:
|
|
17
|
-
os: [ubuntu-24.04]
|
|
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) 2018-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) 2018-2025 Yegor Bugayenko
|
|
2
|
-
# SPDX-License-Identifier: MIT
|
|
3
|
-
---
|
|
4
|
-
# yamllint disable rule:line-length
|
|
5
|
-
name: typos
|
|
6
|
-
'on':
|
|
7
|
-
push:
|
|
8
|
-
branches:
|
|
9
|
-
- master
|
|
10
|
-
pull_request:
|
|
11
|
-
branches:
|
|
12
|
-
- master
|
|
13
|
-
jobs:
|
|
14
|
-
typos:
|
|
15
|
-
timeout-minutes: 15
|
|
16
|
-
runs-on: ubuntu-24.04
|
|
17
|
-
steps:
|
|
18
|
-
- uses: actions/checkout@v4
|
|
19
|
-
- uses: crate-ci/typos@v1.32.0
|
data/.github/workflows/xcop.yml
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2018-2025 Yegor Bugayenko
|
|
2
|
-
# SPDX-License-Identifier: MIT
|
|
3
|
-
---
|
|
4
|
-
# yamllint disable rule:line-length
|
|
5
|
-
name: xcop
|
|
6
|
-
"on":
|
|
7
|
-
push:
|
|
8
|
-
branches:
|
|
9
|
-
- master
|
|
10
|
-
pull_request:
|
|
11
|
-
branches:
|
|
12
|
-
- master
|
|
13
|
-
jobs:
|
|
14
|
-
xcop:
|
|
15
|
-
timeout-minutes: 15
|
|
16
|
-
runs-on: ubuntu-24.04
|
|
17
|
-
steps:
|
|
18
|
-
- uses: actions/checkout@v4
|
|
19
|
-
- uses: g4s8/xcop-action@master
|
|
20
|
-
with:
|
|
21
|
-
files: '**/*.xml'
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2018-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
|
data/.gitignore
DELETED
data/.pdd
DELETED
data/.rubocop.yml
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2018-2025 Yegor Bugayenko
|
|
2
|
-
# SPDX-License-Identifier: MIT
|
|
3
|
-
---
|
|
4
|
-
AllCops:
|
|
5
|
-
DisplayCopNames: true
|
|
6
|
-
TargetRubyVersion: 2.3.3
|
|
7
|
-
SuggestExtensions: false
|
|
8
|
-
NewCops: enable
|
|
9
|
-
plugins:
|
|
10
|
-
- rubocop-rake
|
|
11
|
-
- rubocop-minitest
|
|
12
|
-
- rubocop-performance
|
|
13
|
-
Minitest/EmptyLineBeforeAssertionMethods:
|
|
14
|
-
Enabled: false
|
|
15
|
-
Layout/EmptyLineAfterGuardClause:
|
|
16
|
-
Enabled: false
|
|
17
|
-
Layout/MultilineMethodCallIndentation:
|
|
18
|
-
Enabled: false
|
|
19
|
-
Metrics/AbcSize:
|
|
20
|
-
Max: 50
|
|
21
|
-
Metrics/MethodLength:
|
|
22
|
-
Max: 30
|
|
23
|
-
Metrics/CyclomaticComplexity:
|
|
24
|
-
Max: 10
|
|
25
|
-
Metrics/PerceivedComplexity:
|
|
26
|
-
Max: 10
|
|
27
|
-
Metrics/ParameterLists:
|
|
28
|
-
Max: 10
|
|
29
|
-
Layout/ParameterAlignment:
|
|
30
|
-
Enabled: false
|
|
31
|
-
Style/ClassAndModuleChildren:
|
|
32
|
-
Enabled: false
|
data/.rultor.yml
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2018-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
|
-
sudo bundle install --no-color "--gemfile=$(pwd)/Gemfile"
|
|
12
|
-
release:
|
|
13
|
-
pre: false
|
|
14
|
-
script: |-
|
|
15
|
-
bundle exec rake
|
|
16
|
-
rm -rf *.gem
|
|
17
|
-
sed -i "s/0\.0\.0/${tag}/g" loog.gemspec
|
|
18
|
-
git add loog.gemspec
|
|
19
|
-
git commit -m "version set to ${tag}"
|
|
20
|
-
gem build loog.gemspec
|
|
21
|
-
chmod 0600 ../rubygems.yml
|
|
22
|
-
gem push *.gem --config-file ../rubygems.yml
|
|
23
|
-
merge:
|
|
24
|
-
script: |-
|
|
25
|
-
bundle exec rake
|
data/renovate.json
DELETED
data/test/test__helper.rb
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# SPDX-FileCopyrightText: Copyright (c) 2018-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 || ENV['PICKS']
|
|
11
|
-
SimpleCov.command_name('test')
|
|
12
|
-
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
|
|
13
|
-
[
|
|
14
|
-
SimpleCov::Formatter::HTMLFormatter,
|
|
15
|
-
SimpleCov::Formatter::CoberturaFormatter
|
|
16
|
-
]
|
|
17
|
-
)
|
|
18
|
-
SimpleCov.minimum_coverage 90
|
|
19
|
-
SimpleCov.minimum_coverage_by_file 80
|
|
20
|
-
SimpleCov.start do
|
|
21
|
-
add_filter 'test/'
|
|
22
|
-
add_filter 'vendor/'
|
|
23
|
-
add_filter 'target/'
|
|
24
|
-
track_files 'lib/**/*.rb'
|
|
25
|
-
track_files '*.rb'
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
require 'minitest/autorun'
|
|
30
|
-
require 'minitest/reporters'
|
|
31
|
-
Minitest::Reporters.use! [Minitest::Reporters::SpecReporter.new]
|
data/test/test_loog.rb
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# SPDX-FileCopyrightText: Copyright (c) 2018-2025 Yegor Bugayenko
|
|
4
|
-
# SPDX-License-Identifier: MIT
|
|
5
|
-
|
|
6
|
-
require 'minitest/autorun'
|
|
7
|
-
require_relative '../lib/loog'
|
|
8
|
-
|
|
9
|
-
# Loog test.
|
|
10
|
-
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
11
|
-
# Copyright:: Copyright (c) 2018-2025 Yegor Bugayenko
|
|
12
|
-
# License:: MIT
|
|
13
|
-
class LoogTest < Minitest::Test
|
|
14
|
-
def test_simple_logging
|
|
15
|
-
Loog::VERBOSE.info('Works?')
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def test_null_logging
|
|
19
|
-
Loog::NULL.info('Should not be visible')
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def test_buffering
|
|
23
|
-
b = Loog::Buffer.new(formatter: Loog::FULL)
|
|
24
|
-
b.debug('Hello, world!')
|
|
25
|
-
b.info('Hello, world!')
|
|
26
|
-
b.warn('Hello, world!')
|
|
27
|
-
b.error('Hello, world!')
|
|
28
|
-
stdout = b.to_s
|
|
29
|
-
assert_includes(stdout, 'Hello')
|
|
30
|
-
assert_includes(stdout, 'DEBUG')
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
def test_quiet_buffering
|
|
34
|
-
b = Loog::Buffer.new
|
|
35
|
-
b.info('Hey, друг!')
|
|
36
|
-
b.warn('Bye!')
|
|
37
|
-
b.error('+')
|
|
38
|
-
assert_equal("Hey, друг!\nBye!\n+\n", b.to_s)
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
def test_buffer_non_utf
|
|
42
|
-
b = Loog::Buffer.new
|
|
43
|
-
msg = [0x41, 0x42, 0xC0].pack('c*')
|
|
44
|
-
b.debug('привет')
|
|
45
|
-
b.debug(msg)
|
|
46
|
-
stdout = b.to_s
|
|
47
|
-
assert_includes(stdout, 'AB', stdout)
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
def test_handles_invalid_utf8_without_exception
|
|
51
|
-
broken = "\xFF\xFE\x12"
|
|
52
|
-
Loog::VERBOSE.info(broken)
|
|
53
|
-
Loog::REGULAR.info(broken)
|
|
54
|
-
Loog::ERRORS.error(broken)
|
|
55
|
-
b = Loog::Buffer.new
|
|
56
|
-
b.info(broken)
|
|
57
|
-
output = b.to_s
|
|
58
|
-
assert_match(/\?+/, output)
|
|
59
|
-
b = Loog::Buffer.new(formatter: Loog::FULL)
|
|
60
|
-
b.info(broken)
|
|
61
|
-
assert_match(/\?+/, b.to_s)
|
|
62
|
-
end
|
|
63
|
-
end
|
data/test/test_tee.rb
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# SPDX-FileCopyrightText: Copyright (c) 2018-2025 Yegor Bugayenko
|
|
4
|
-
# SPDX-License-Identifier: MIT
|
|
5
|
-
|
|
6
|
-
require 'minitest/autorun'
|
|
7
|
-
require_relative '../lib/loog'
|
|
8
|
-
require_relative '../lib/loog/tee'
|
|
9
|
-
|
|
10
|
-
# Loog::Tee test.
|
|
11
|
-
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
12
|
-
# Copyright:: Copyright (c) 2018-2025 Yegor Bugayenko
|
|
13
|
-
# License:: MIT
|
|
14
|
-
class TeeTest < Minitest::Test
|
|
15
|
-
def test_simple_logging
|
|
16
|
-
tee = Loog::Tee.new(Loog::VERBOSE, Loog::REGULAR)
|
|
17
|
-
tee.info('Works?')
|
|
18
|
-
tee.debug('Works?')
|
|
19
|
-
tee.warn('Works?')
|
|
20
|
-
tee.error('Works?')
|
|
21
|
-
end
|
|
22
|
-
end
|