Skip to content

Commit 9fe4350

Browse files
authored
Merge pull request #1003 from ksss/bundled-gem-4.0
Add bundled gems for Ruby v4.0
2 parents 9c796e7 + 1db02fd commit 9fe4350

File tree

11 files changed

+1644
-0
lines changed

11 files changed

+1644
-0
lines changed

gems/logger/.rubocop.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# This configuration inherits from /.rubocop.yml.
2+
# You can configure RBS style of this gem.
3+
# This file is used on CI. It is configured to automatically
4+
# make rubocop suggestions on pull requests for this gem.
5+
# If you do not like the style enforcement, you should remove this file.
6+
inherit_from: ../../.rubocop.yml
7+
8+
##
9+
# If you want to customize the style, please consult with the gem reviewers.
10+
# You can see the list of cops at https://github.com/ksss/rubocop-on-rbs/blob/main/docs/modules/ROOT/pages/cops.adoc
11+
12+
RBS/Layout:
13+
Enabled: true
14+
15+
RBS/Lint:
16+
Enabled: true
17+
18+
RBS/Style:
19+
Enabled: true

gems/logger/1.7/formatter.rbs

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
%a{annotate:rdoc:skip}
2+
class Logger
3+
# <!-- rdoc-file=lib/logger/formatter.rb -->
4+
# Default formatter for log messages.
5+
#
6+
class Formatter
7+
attr_accessor datetime_format: String?
8+
9+
# <!--
10+
# rdoc-file=lib/logger/formatter.rb
11+
# - call(severity, time, progname, msg)
12+
# -->
13+
#
14+
def call: (String severity, Time time, untyped progname, untyped msg) -> String
15+
16+
private
17+
18+
# <!--
19+
# rdoc-file=lib/logger/formatter.rb
20+
# - format_datetime(time)
21+
# -->
22+
#
23+
def format_datetime: (Time time) -> untyped
24+
25+
# <!--
26+
# rdoc-file=lib/logger/formatter.rb
27+
# - new()
28+
# -->
29+
#
30+
def initialize: () -> void
31+
32+
# <!--
33+
# rdoc-file=lib/logger/formatter.rb
34+
# - msg2str(msg)
35+
# -->
36+
#
37+
def msg2str: (String | Exception | untyped msg) -> String
38+
end
39+
40+
interface _Formatter
41+
def call: (String severity, Time time, untyped progname, untyped msg) -> _ToS
42+
end
43+
end
44+
45+
Logger::Formatter::Format: String

gems/logger/1.7/log_device.rbs

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
%a{annotate:rdoc:skip}
2+
class Logger
3+
# <!-- rdoc-file=lib/logger/log_device.rb -->
4+
# Device used for logging messages.
5+
#
6+
class LogDevice
7+
include MonitorMixin
8+
9+
include Period
10+
11+
attr_reader dev: _WriteCloser
12+
attr_reader filename: String?
13+
14+
# <!--
15+
# rdoc-file=lib/logger/log_device.rb
16+
# - close()
17+
# -->
18+
#
19+
def close: () -> nil
20+
21+
# <!--
22+
# rdoc-file=lib/logger/log_device.rb
23+
# - reopen(log = nil)
24+
# -->
25+
#
26+
def reopen: (?logdev log) -> self
27+
28+
# <!--
29+
# rdoc-file=lib/logger/log_device.rb
30+
# - write(message)
31+
# -->
32+
#
33+
def write: (untyped message) -> untyped
34+
35+
private
36+
37+
# <!--
38+
# rdoc-file=lib/logger/log_device.rb
39+
# - add_log_header(file)
40+
# -->
41+
#
42+
def add_log_header: (IO file) -> untyped
43+
44+
# <!--
45+
# rdoc-file=lib/logger/log_device.rb
46+
# - check_shift_log()
47+
# -->
48+
#
49+
def check_shift_log: () -> untyped
50+
51+
# <!--
52+
# rdoc-file=lib/logger/log_device.rb
53+
# - create_logfile(filename)
54+
# -->
55+
#
56+
def create_logfile: (String filename) -> File
57+
58+
# <!--
59+
# rdoc-file=lib/logger/log_device.rb
60+
# - new(log = nil, shift_age: nil, shift_size: nil, shift_period_suffix: nil, binmode: false, reraise_write_errors: [])
61+
# -->
62+
#
63+
def initialize: (?untyped logdev, ?binmode: boolish, ?shift_period_suffix: String, ?shift_size: Integer, ?shift_age: Numeric | String) -> void
64+
65+
# <!--
66+
# rdoc-file=lib/logger/log_device.rb
67+
# - lock_shift_log() { || ... }
68+
# -->
69+
#
70+
def lock_shift_log: () { () -> untyped } -> untyped
71+
72+
# <!--
73+
# rdoc-file=lib/logger/log_device.rb
74+
# - open_logfile(filename)
75+
# -->
76+
#
77+
def open_logfile: (String filename) -> File
78+
79+
# <!--
80+
# rdoc-file=lib/logger/log_device.rb
81+
# - set_dev(log)
82+
# -->
83+
#
84+
def set_dev: (logdev log) -> untyped
85+
86+
# <!--
87+
# rdoc-file=lib/logger/log_device.rb
88+
# - shift_log_age()
89+
# -->
90+
#
91+
def shift_log_age: () -> true
92+
93+
# <!--
94+
# rdoc-file=lib/logger/log_device.rb
95+
# - shift_log_period(period_end)
96+
# -->
97+
#
98+
def shift_log_period: (Time period_end) -> true
99+
end
100+
end

0 commit comments

Comments
 (0)