rubysky 0.1.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 +7 -0
- data/.gem_rbs_collection/activesupport/7.0/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/activesupport/7.0/activesupport-7.0.rbs +140 -0
- data/.gem_rbs_collection/activesupport/7.0/activesupport-generated.rbs +11950 -0
- data/.gem_rbs_collection/activesupport/7.0/activesupport.rbs +583 -0
- data/.gem_rbs_collection/activesupport/7.0/manifest.yaml +16 -0
- data/.gem_rbs_collection/activesupport/7.0/patch.rbs +55 -0
- data/.gem_rbs_collection/ast/2.4/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/ast/2.4/ast.rbs +73 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/array.rbs +4 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/executor.rbs +26 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/hash.rbs +4 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/map.rbs +58 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/promises.rbs +249 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/utility/processor_counter.rbs +5 -0
- data/.gem_rbs_collection/connection_pool/2.4/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/connection_pool/2.4/connection_pool.rbs +34 -0
- data/.gem_rbs_collection/connection_pool/2.4/manifest.yaml +2 -0
- data/.gem_rbs_collection/diff-lcs/1.5/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/diff-lcs/1.5/diff-lcs.rbs +11 -0
- data/.gem_rbs_collection/i18n/1.10/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/i18n/1.10/backend.rbs +269 -0
- data/.gem_rbs_collection/i18n/1.10/i18n.rbs +117 -0
- data/.gem_rbs_collection/listen/3.9/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/listen/3.9/listen.rbs +25 -0
- data/.gem_rbs_collection/listen/3.9/listener.rbs +24 -0
- data/.gem_rbs_collection/parallel/1.20/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/parallel/1.20/parallel.rbs +86 -0
- data/.gem_rbs_collection/parser/3.2/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/parser/3.2/manifest.yaml +7 -0
- data/.gem_rbs_collection/parser/3.2/parser.rbs +104 -0
- data/.gem_rbs_collection/parser/3.2/polyfill.rbs +4 -0
- data/.gem_rbs_collection/rainbow/3.0/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/rainbow/3.0/global.rbs +7 -0
- data/.gem_rbs_collection/rainbow/3.0/presenter.rbs +209 -0
- data/.gem_rbs_collection/rainbow/3.0/rainbow.rbs +5 -0
- data/.gem_rbs_collection/rake/13.0/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/rake/13.0/manifest.yaml +2 -0
- data/.gem_rbs_collection/rake/13.0/rake.rbs +28 -0
- data/.gem_rbs_collection/regexp_parser/2.8/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/regexp_parser/2.8/regexp_parser.rbs +17 -0
- data/.gem_rbs_collection/rubocop/1.57/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/rubocop/1.57/rubocop.rbs +34 -0
- data/.gem_rbs_collection/rubocop-ast/1.30/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/rubocop-ast/1.30/rubocop-ast.rbs +15 -0
- data/.gem_rbs_collection/tzinfo/2.0/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/tzinfo/2.0/manifest.yaml +7 -0
- data/.gem_rbs_collection/tzinfo/2.0/tzinfo.rbs +601 -0
- data/.rspec +3 -0
- data/.rubocop.yml +18 -0
- data/CHANGELOG.md +5 -0
- data/CODE_OF_CONDUCT.md +132 -0
- data/LICENSE.txt +21 -0
- data/README.md +39 -0
- data/Rakefile +12 -0
- data/Steepfile +32 -0
- data/lib/rubysky/client.rb +40 -0
- data/lib/rubysky/post.rb +15 -0
- data/lib/rubysky/raw/client.rb +133 -0
- data/lib/rubysky/raw/did_doc.rb +15 -0
- data/lib/rubysky/raw/embed.rb +18 -0
- data/lib/rubysky/raw/post.rb +29 -0
- data/lib/rubysky/raw/session.rb +41 -0
- data/lib/rubysky/version.rb +5 -0
- data/lib/rubysky.rb +17 -0
- data/rbs_collection.lock.yaml +232 -0
- data/rbs_collection.yaml +18 -0
- data/sig/rubysky.rbs +101 -0
- metadata +129 -0
@@ -0,0 +1,583 @@
|
|
1
|
+
module ActiveSupport
|
2
|
+
interface _IncludeP
|
3
|
+
def include?: (untyped value) -> bool
|
4
|
+
end
|
5
|
+
end
|
6
|
+
|
7
|
+
module ActiveSupport
|
8
|
+
module Callbacks
|
9
|
+
module ClassMethods
|
10
|
+
# Manual definition to make block optional
|
11
|
+
def set_callback: (untyped name, *untyped filter_list) ?{ () -> untyped } -> untyped
|
12
|
+
| ...
|
13
|
+
|
14
|
+
# Manual definition to make block optional
|
15
|
+
def skip_callback: (untyped name, *untyped filter_list) ?{ () -> untyped } -> untyped
|
16
|
+
| ...
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
module Configurable
|
21
|
+
extend Concern
|
22
|
+
|
23
|
+
class Configuration < InheritableOptions
|
24
|
+
def compile_methods!: () -> void
|
25
|
+
|
26
|
+
# Compiles reader methods so we don't have to go through method_missing.
|
27
|
+
def self.compile_methods!: (Array[Symbol | String] keys) -> void
|
28
|
+
end
|
29
|
+
|
30
|
+
module ClassMethods
|
31
|
+
def config: () -> InheritableOptions
|
32
|
+
|
33
|
+
def configure: () { (InheritableOptions config) -> void } -> void
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
# TODO: Fix to use `interned` in names params after releasing ruby/rbs#1499
|
38
|
+
def config_accessor: (*(String | Symbol) names, ?instance_accessor: bool instance_accessor, ?instance_writer: bool instance_writer, ?instance_reader: bool instance_reader) ?{ () -> untyped } -> void
|
39
|
+
end
|
40
|
+
|
41
|
+
def config: () -> InheritableOptions
|
42
|
+
end
|
43
|
+
|
44
|
+
class Deprecation
|
45
|
+
class DeprecatedConstantProxy
|
46
|
+
# Manual definition to make block optional
|
47
|
+
def self.new: (*untyped args, **untyped kwargs) ?{ () -> untyped } -> untyped
|
48
|
+
| ...
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
class HashWithIndifferentAccess[T, U] < Hash[T, U]
|
53
|
+
# Manual definition to make block optional
|
54
|
+
def fetch_values: (*untyped indices) ?{ () -> untyped } -> untyped
|
55
|
+
| ...
|
56
|
+
|
57
|
+
# Manual definition to make block optional
|
58
|
+
def merge: (untyped hash) ?{ () -> untyped } -> untyped
|
59
|
+
| ...
|
60
|
+
|
61
|
+
# Manual definition to make block optional
|
62
|
+
def select: (*untyped args) ?{ () -> untyped } -> untyped
|
63
|
+
| ...
|
64
|
+
|
65
|
+
# Manual definition to make block optional
|
66
|
+
def reject: (*untyped args) ?{ () -> untyped } -> untyped
|
67
|
+
| ...
|
68
|
+
|
69
|
+
# Manual definition to make block optional
|
70
|
+
def transform_values: (*untyped args) ?{ () -> untyped } -> untyped
|
71
|
+
| ...
|
72
|
+
|
73
|
+
# Manual definition to make block optional
|
74
|
+
def transform_keys: (*untyped args) ?{ () -> untyped } -> untyped
|
75
|
+
| ...
|
76
|
+
|
77
|
+
# Manual definition to make block optional
|
78
|
+
def transform_keys!: () ?{ (untyped) -> untyped } -> untyped
|
79
|
+
| ...
|
80
|
+
end
|
81
|
+
|
82
|
+
module Testing
|
83
|
+
module TimeHelpers
|
84
|
+
# Manual definition to make block optional
|
85
|
+
def travel: (untyped duration) ?{ () -> untyped } -> untyped
|
86
|
+
| ...
|
87
|
+
|
88
|
+
# Manual definition to make block optional
|
89
|
+
def travel_to: (untyped date_or_time) ?{ () -> untyped } -> untyped
|
90
|
+
| ...
|
91
|
+
|
92
|
+
# Manual definition to make block optional
|
93
|
+
def freeze_time: () ?{ () -> untyped } -> untyped
|
94
|
+
| ...
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
class TimeWithZone
|
99
|
+
include DateAndTime::Calculations
|
100
|
+
|
101
|
+
# Returns a <tt>Time</tt> instance that represents the time in +time_zone+.
|
102
|
+
def time: () -> ::Time
|
103
|
+
|
104
|
+
# Returns a <tt>Time</tt> instance of the simultaneous time in the UTC timezone.
|
105
|
+
def utc: () -> ::Time
|
106
|
+
|
107
|
+
# Returns a <tt>Time</tt> instance of the simultaneous time in the system timezone.
|
108
|
+
def localtime: (?::String utc_offset) -> ::Time
|
109
|
+
| (?::Integer utc_offset) -> ::Time
|
110
|
+
|
111
|
+
# Returns true if the current time is within Daylight Savings Time for the
|
112
|
+
# specified time zone.
|
113
|
+
#
|
114
|
+
# Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)'
|
115
|
+
# Time.zone.parse("2012-5-30").dst? # => true
|
116
|
+
# Time.zone.parse("2012-11-30").dst? # => false
|
117
|
+
def dst?: () -> bool
|
118
|
+
|
119
|
+
# Returns true if the current time zone is set to UTC.
|
120
|
+
#
|
121
|
+
# Time.zone = 'UTC' # => 'UTC'
|
122
|
+
# Time.zone.now.utc? # => true
|
123
|
+
# Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)'
|
124
|
+
# Time.zone.now.utc? # => false
|
125
|
+
def utc?: () -> bool
|
126
|
+
|
127
|
+
# Returns the offset from current time to UTC time in seconds.
|
128
|
+
def utc_offset: () -> ::Integer
|
129
|
+
|
130
|
+
# Returns the time zone abbreviation.
|
131
|
+
#
|
132
|
+
# Time.zone = 'Eastern Time (US & Canada)' # => "Eastern Time (US & Canada)"
|
133
|
+
# Time.zone.now.zone # => "EST"
|
134
|
+
def zone: () -> ::String
|
135
|
+
|
136
|
+
# Returns a string of the object's date and time in the format used by
|
137
|
+
# HTTP requests.
|
138
|
+
#
|
139
|
+
# Time.zone.now.httpdate # => "Tue, 01 Jan 2013 04:39:43 GMT"
|
140
|
+
def httpdate: () -> ::String
|
141
|
+
|
142
|
+
# Returns a string of the object's date and time in the RFC 2822 standard
|
143
|
+
# format.
|
144
|
+
#
|
145
|
+
# Time.zone.now.rfc2822 # => "Tue, 01 Jan 2013 04:51:39 +0000"
|
146
|
+
def rfc2822: () -> ::String
|
147
|
+
|
148
|
+
# Replaces <tt>%Z</tt> directive with +zone before passing to Time#strftime,
|
149
|
+
# so that zone information is correct.
|
150
|
+
def strftime: (::String arg0) -> ::String
|
151
|
+
|
152
|
+
# Returns Array of parts of Time in sequence of
|
153
|
+
# [seconds, minutes, hours, day, month, year, weekday, yearday, dst?, zone].
|
154
|
+
#
|
155
|
+
# now = Time.zone.now # => Tue, 18 Aug 2015 02:29:27 UTC +00:00
|
156
|
+
# now.to_a # => [27, 29, 2, 18, 8, 2015, 2, 230, false, "UTC"]
|
157
|
+
def to_a: () -> [ ::Integer, ::Integer, ::Integer, ::Integer, ::Integer, ::Integer, ::Integer, ::Integer, bool, ::String ]
|
158
|
+
|
159
|
+
# Returns the object's date and time as a floating point number of seconds
|
160
|
+
# since the Epoch (January 1, 1970 00:00 UTC).
|
161
|
+
#
|
162
|
+
# Time.zone.now.to_f # => 1417709320.285418
|
163
|
+
def to_f: () -> ::Float
|
164
|
+
|
165
|
+
# Returns the object's date and time as an integer number of seconds
|
166
|
+
# since the Epoch (January 1, 1970 00:00 UTC).
|
167
|
+
#
|
168
|
+
# Time.zone.now.to_i # => 1417709320
|
169
|
+
def to_i: () -> ::Integer
|
170
|
+
|
171
|
+
# Returns the object's date and time as a rational number of seconds
|
172
|
+
# since the Epoch (January 1, 1970 00:00 UTC).
|
173
|
+
#
|
174
|
+
# Time.zone.now.to_r # => (708854548642709/500000)
|
175
|
+
def to_r: () -> ::Rational
|
176
|
+
|
177
|
+
# Returns an instance of DateTime with the timezone's UTC offset
|
178
|
+
#
|
179
|
+
# Time.zone.now.to_datetime # => Tue, 18 Aug 2015 02:32:20 +0000
|
180
|
+
# Time.current.in_time_zone('Hawaii').to_datetime # => Mon, 17 Aug 2015 16:32:20 -1000
|
181
|
+
def to_datetime: () -> ::DateTime
|
182
|
+
|
183
|
+
# Returns an instance of +Time+, either with the same UTC offset
|
184
|
+
# as +self+ or in the local system timezone depending on the setting
|
185
|
+
# of +ActiveSupport.to_time_preserves_timezone+.
|
186
|
+
def to_time: () -> ::Time
|
187
|
+
|
188
|
+
# class_eval
|
189
|
+
def year: () -> Integer
|
190
|
+
def mon: () -> Integer
|
191
|
+
def month: () -> Integer
|
192
|
+
def day: () -> Integer
|
193
|
+
def mday: () -> Integer
|
194
|
+
def wday: () -> Integer
|
195
|
+
def yday: () -> Integer
|
196
|
+
def hour: () -> Integer
|
197
|
+
def min: () -> Integer
|
198
|
+
def sec: () -> Integer
|
199
|
+
def usec: () -> Integer
|
200
|
+
def nsec: () -> Integer
|
201
|
+
def to_date: () -> Date
|
202
|
+
|
203
|
+
# method_missing
|
204
|
+
def asctime: () -> String
|
205
|
+
alias at_beginning_of_day beginning_of_day
|
206
|
+
alias at_beginning_of_hour beginning_of_hour
|
207
|
+
alias at_beginning_of_minute beginning_of_minute
|
208
|
+
alias at_end_of_day end_of_day
|
209
|
+
alias at_end_of_hour end_of_hour
|
210
|
+
alias at_end_of_minute end_of_minute
|
211
|
+
alias at_midday middle_of_day
|
212
|
+
alias at_middle_of_day middle_of_day
|
213
|
+
alias at_midnight beginning_of_day
|
214
|
+
alias at_noon middle_of_day
|
215
|
+
def beginning_of_day: () -> self
|
216
|
+
def beginning_of_hour: () -> self
|
217
|
+
def beginning_of_minute: () -> self
|
218
|
+
def ceil: (?int ndigits) -> self
|
219
|
+
def compare_with_coercion: (untyped other) -> (-1 | 0 | 1 | nil)
|
220
|
+
def compare_without_coercion: (untyped other) -> (-1 | 0 | 1 | nil)
|
221
|
+
def ctime: () -> String
|
222
|
+
def end_of_day: () -> self
|
223
|
+
def end_of_hour: () -> self
|
224
|
+
def end_of_minute: () -> self
|
225
|
+
def eql_with_coercion: (untyped other) -> bool
|
226
|
+
def eql_without_coercion: (untyped other) -> bool
|
227
|
+
def floor: (?int ndigits) -> self
|
228
|
+
def friday?: () -> bool
|
229
|
+
alias midday middle_of_day
|
230
|
+
def middle_of_day: () -> self
|
231
|
+
alias midnight beginning_of_day
|
232
|
+
def minus_with_coercion: (Time | self arg0) -> Float
|
233
|
+
| (Numeric arg0) -> self
|
234
|
+
def minus_with_duration: (Time | self arg0) -> Float
|
235
|
+
| (Numeric arg0) -> self
|
236
|
+
def minus_without_coercion: (Time | self arg0) -> Float
|
237
|
+
| (Numeric arg0) -> self
|
238
|
+
def minus_without_duration: (Time | self arg0) -> Float
|
239
|
+
| (Numeric arg0) -> self
|
240
|
+
def monday?: () -> bool
|
241
|
+
def next_day: () -> self
|
242
|
+
def next_month: () -> self
|
243
|
+
def next_year: () -> self
|
244
|
+
alias noon middle_of_day
|
245
|
+
def plus_without_duration: (Time | self arg0) -> Float
|
246
|
+
| (Numeric arg0) -> self
|
247
|
+
def prev_day: () -> self
|
248
|
+
def prev_month: () -> self
|
249
|
+
def prev_year: () -> self
|
250
|
+
def round: (?int ndigits) -> self
|
251
|
+
def saturday?: () -> bool
|
252
|
+
def seconds_since_midnight: () -> Float
|
253
|
+
def seconds_until_end_of_day: () -> Integer
|
254
|
+
def sec_fraction: () -> (Integer | Rational)
|
255
|
+
def subsec: () -> (Integer | Rational)
|
256
|
+
def sunday?: () -> bool
|
257
|
+
def thursday?: () -> bool
|
258
|
+
def to_default_s: () -> String
|
259
|
+
def tuesday?: () -> bool
|
260
|
+
def tv_nsec: () -> Integer
|
261
|
+
def tv_usec: () -> Integer
|
262
|
+
def wednesday?: () -> bool
|
263
|
+
end
|
264
|
+
|
265
|
+
module SecurityUtils
|
266
|
+
def self?.fixed_length_secure_compare: (String a, String b) -> bool
|
267
|
+
|
268
|
+
def self?.secure_compare: (String a, String b) -> bool
|
269
|
+
end
|
270
|
+
|
271
|
+
class OrderedOptions < Hash[Symbol, untyped]
|
272
|
+
alias _get []
|
273
|
+
|
274
|
+
# TODO: Fix to use `interned` in key params after releasing ruby/rbs#1499
|
275
|
+
def []=: ((String | Symbol) key, untyped value) -> untyped
|
276
|
+
|
277
|
+
# TODO: Fix to use `interned` in key params after releasing ruby/rbs#1499
|
278
|
+
def []: ((String | Symbol) key) -> untyped
|
279
|
+
|
280
|
+
def method_missing: (Symbol name, *untyped args) -> untyped
|
281
|
+
|
282
|
+
def respond_to_missing?: (Symbol name, ?bool include_private) -> true
|
283
|
+
|
284
|
+
def extractable_options?: () -> true
|
285
|
+
end
|
286
|
+
|
287
|
+
class InheritableOptions < OrderedOptions
|
288
|
+
# TODO: Fix to use `interned` in parent params after releasing ruby/rbs#1499
|
289
|
+
def initialize: (?Hash[(String | Symbol), untyped]? parent) -> void
|
290
|
+
|
291
|
+
def inheritable_copy: () -> instance
|
292
|
+
end
|
293
|
+
end
|
294
|
+
|
295
|
+
class Hash[unchecked out K, unchecked out V]
|
296
|
+
# Manual definition to make block optional
|
297
|
+
def deep_merge: (untyped other_hash) ?{ () -> untyped } -> untyped
|
298
|
+
| ...
|
299
|
+
|
300
|
+
# Manual definition to make block optional
|
301
|
+
def deep_merge!: (untyped other_hash) ?{ () -> untyped } -> untyped
|
302
|
+
| ...
|
303
|
+
|
304
|
+
def stringify_keys: () -> Hash[String, V]
|
305
|
+
|
306
|
+
def stringify_keys!: () -> self
|
307
|
+
|
308
|
+
def symbolize_keys: () -> Hash[Symbol, V]
|
309
|
+
alias to_options symbolize_keys
|
310
|
+
|
311
|
+
def symbolize_keys!: () -> self
|
312
|
+
alias to_options! symbolize_keys!
|
313
|
+
|
314
|
+
def deep_stringify_keys: () -> Hash[String, untyped]
|
315
|
+
|
316
|
+
def deep_stringify_keys!: () -> self
|
317
|
+
|
318
|
+
def deep_symbolize_keys: () -> Hash[Symbol, untyped]
|
319
|
+
|
320
|
+
def deep_symbolize_keys!: () -> self
|
321
|
+
end
|
322
|
+
|
323
|
+
class Module
|
324
|
+
# Manual definition to make block optional
|
325
|
+
def mattr_reader: (*untyped syms, ?default: untyped? default, ?instance_accessor: bool instance_accessor, ?instance_reader: bool instance_reader) ?{ () -> untyped } -> untyped
|
326
|
+
| ...
|
327
|
+
|
328
|
+
# Manual definition to make block optional
|
329
|
+
def mattr_writer: (*untyped syms, ?default: untyped? default, ?instance_accessor: bool instance_accessor, ?instance_writer: bool instance_writer) ?{ () -> untyped } -> untyped
|
330
|
+
| ...
|
331
|
+
|
332
|
+
# Manual definition to make block optional
|
333
|
+
def mattr_accessor: (*untyped syms, ?default: untyped? default, ?instance_accessor: bool instance_accessor, ?instance_writer: bool instance_writer, ?instance_reader: bool instance_reader) ?{ () -> untyped } -> untyped
|
334
|
+
| ...
|
335
|
+
|
336
|
+
# TODO: Fix to use `interned` in attrs params after releasing ruby/rbs#1499
|
337
|
+
def attr_internal_reader: (*(Symbol | String) attrs) -> void
|
338
|
+
|
339
|
+
# TODO: Fix to use `interned` in attrs params after releasing ruby/rbs#1499
|
340
|
+
def attr_internal_writer: (*(Symbol | String) attrs) -> void
|
341
|
+
|
342
|
+
# TODO: Fix to use `interned` in attrs params after releasing ruby/rbs#1499
|
343
|
+
def attr_internal_accessor: (*(Symbol | String) attrs) -> void
|
344
|
+
|
345
|
+
alias attr_internal attr_internal_accessor
|
346
|
+
|
347
|
+
attr_accessor self.attr_internal_naming_format: String
|
348
|
+
|
349
|
+
private
|
350
|
+
|
351
|
+
# TODO: Fix to use `interned` in attr params after releasing ruby/rbs#1499
|
352
|
+
def attr_internal_ivar_name: ((Symbol | String) attr) -> String
|
353
|
+
|
354
|
+
type access_type = :reader | :writer
|
355
|
+
# TODO: Fix to use `interned` in attr params after releasing ruby/rbs#1499
|
356
|
+
def attr_internal_define: ((Symbol | String) attr_name, access_type `type`) -> void
|
357
|
+
end
|
358
|
+
|
359
|
+
class Integer
|
360
|
+
prepend ActiveSupport::NumericWithFormat
|
361
|
+
end
|
362
|
+
|
363
|
+
class Float
|
364
|
+
prepend ActiveSupport::NumericWithFormat
|
365
|
+
end
|
366
|
+
|
367
|
+
class BigDecimal
|
368
|
+
prepend ActiveSupport::NumericWithFormat
|
369
|
+
end
|
370
|
+
|
371
|
+
module ActiveSupport
|
372
|
+
module Tryable : BasicObject
|
373
|
+
def try: [T] () { (self) -> T } -> T # When yield self
|
374
|
+
| [T] () { () -> T } -> T # When instance_eval
|
375
|
+
| (Object::name method_name, *untyped args) ?{ (*untyped) -> untyped } -> untyped
|
376
|
+
|
377
|
+
def try!: [T] () { (self) -> T } -> T # When yield self
|
378
|
+
| [T] () { () -> T } -> T # When instance_eval
|
379
|
+
| (Object::name method_name, *untyped args) ?{ (*untyped) -> untyped } -> untyped
|
380
|
+
end
|
381
|
+
end
|
382
|
+
|
383
|
+
class NilClass
|
384
|
+
def try: () { (untyped) -> untyped } -> nil
|
385
|
+
| () { () -> untyped } -> nil
|
386
|
+
| (Object::name method_name, *untyped args) ?{ (*untyped) -> untyped } -> nil
|
387
|
+
|
388
|
+
def try!: () { (untyped) -> untyped } -> nil
|
389
|
+
| () { () -> untyped } -> nil
|
390
|
+
| (Object::name method_name, *untyped args) ?{ (*untyped) -> untyped } -> nil
|
391
|
+
|
392
|
+
end
|
393
|
+
|
394
|
+
class Array[unchecked out Elem]
|
395
|
+
# Manual definition to make block optional
|
396
|
+
def in_groups: (untyped number, ?untyped? fill_with) ?{ (untyped) -> untyped } -> untyped
|
397
|
+
end
|
398
|
+
|
399
|
+
# active_support/core_ext/object/blank.rb
|
400
|
+
class Object
|
401
|
+
def blank?: () -> bool
|
402
|
+
def present?: () -> bool
|
403
|
+
def presence: () -> self?
|
404
|
+
end
|
405
|
+
|
406
|
+
# active_support/core_ext/object/inclusion.rb
|
407
|
+
class Object
|
408
|
+
def in?: (ActiveSupport::_IncludeP another_object) -> bool
|
409
|
+
def presence_in: (ActiveSupport::_IncludeP another_object) -> (self | nil)
|
410
|
+
end
|
411
|
+
|
412
|
+
class NilClass
|
413
|
+
def blank?: () -> true
|
414
|
+
end
|
415
|
+
|
416
|
+
class FalseClass
|
417
|
+
def blank?: () -> true
|
418
|
+
end
|
419
|
+
|
420
|
+
class TrueClass
|
421
|
+
def blank?: () -> false
|
422
|
+
end
|
423
|
+
|
424
|
+
class Array[unchecked out Elem]
|
425
|
+
alias blank? empty?
|
426
|
+
end
|
427
|
+
|
428
|
+
class Hash[unchecked out K, unchecked out V]
|
429
|
+
alias blank? empty?
|
430
|
+
end
|
431
|
+
|
432
|
+
class String
|
433
|
+
BLANK_RE: Regexp
|
434
|
+
ENCODED_BLANKS: Concurrent::Map[Encoding, Regexp]
|
435
|
+
def blank?: () -> bool
|
436
|
+
end
|
437
|
+
|
438
|
+
class Numeric
|
439
|
+
def blank?: () -> false
|
440
|
+
end
|
441
|
+
|
442
|
+
class Time
|
443
|
+
def blank?: () -> false
|
444
|
+
end
|
445
|
+
|
446
|
+
# active_support/core_ext/string/inflections.rb
|
447
|
+
class String
|
448
|
+
def camelize: (?Symbol first_letter) -> String
|
449
|
+
alias camelcase camelize
|
450
|
+
def underscore: () -> String
|
451
|
+
def dasherize: () -> String
|
452
|
+
def pluralize: (?Integer | Symbol? count, ?Symbol locale) -> String
|
453
|
+
def singularize: (?Symbol locale) -> String
|
454
|
+
def constantize: () -> untyped
|
455
|
+
def safe_constantize: () -> untyped
|
456
|
+
def titleize: (?keep_id_suffix: boolish) -> String
|
457
|
+
alias titlecase titleize
|
458
|
+
def demodulize: () -> String
|
459
|
+
def deconstantize: () -> String
|
460
|
+
def parameterize: (?separator: String, ?preserve_case: boolish, ?locale: Symbol) -> String
|
461
|
+
def tableize: () -> String
|
462
|
+
def classify: () -> String
|
463
|
+
def humanize: (?capitalize: boolish, ?keep_id_suffix: boolish) -> String
|
464
|
+
def upcase_first: () -> String
|
465
|
+
def foreign_key: (?boolish separate_class_name_and_id_with_underscore) -> String
|
466
|
+
end
|
467
|
+
|
468
|
+
class Array[unchecked out Elem]
|
469
|
+
# Wraps its argument in an array unless it is already an array (or array-like).
|
470
|
+
#
|
471
|
+
# Specifically:
|
472
|
+
#
|
473
|
+
# * If the argument is +nil+ an empty array is returned.
|
474
|
+
# * Otherwise, if the argument responds to +to_ary+ it is invoked, and its result returned.
|
475
|
+
# * Otherwise, returns an array with the argument as its single element.
|
476
|
+
#
|
477
|
+
# Array.wrap(nil) # => []
|
478
|
+
# Array.wrap([1, 2, 3]) # => [1, 2, 3]
|
479
|
+
# Array.wrap(0) # => [0]
|
480
|
+
#
|
481
|
+
# This method is similar in purpose to <tt>Kernel#Array</tt>, but there are some differences:
|
482
|
+
#
|
483
|
+
# * If the argument responds to +to_ary+ the method is invoked. <tt>Kernel#Array</tt>
|
484
|
+
# moves on to try +to_a+ if the returned value is +nil+, but <tt>Array.wrap</tt> returns
|
485
|
+
# an array with the argument as its single element right away.
|
486
|
+
# * If the returned value from +to_ary+ is neither +nil+ nor an +Array+ object, <tt>Kernel#Array</tt>
|
487
|
+
# raises an exception, while <tt>Array.wrap</tt> does not, it just returns the value.
|
488
|
+
# * It does not call +to_a+ on the argument, if the argument does not respond to +to_ary+
|
489
|
+
# it returns an array with the argument as its single element.
|
490
|
+
#
|
491
|
+
# The last point is easily explained with some enumerables:
|
492
|
+
#
|
493
|
+
# Array(foo: :bar) # => [[:foo, :bar]]
|
494
|
+
# Array.wrap(foo: :bar) # => [{:foo=>:bar}]
|
495
|
+
#
|
496
|
+
# There's also a related idiom that uses the splat operator:
|
497
|
+
#
|
498
|
+
# [*object]
|
499
|
+
#
|
500
|
+
# which returns <tt>[]</tt> for +nil+, but calls to <tt>Array(object)</tt> otherwise.
|
501
|
+
#
|
502
|
+
# The differences with <tt>Kernel#Array</tt> explained above
|
503
|
+
# apply to the rest of <tt>object</tt>s.
|
504
|
+
def self.wrap: (nil) -> Array[untyped]
|
505
|
+
| [T] (_ToAry[T] array_like) -> Array[T]
|
506
|
+
| [T] (T ele) -> Array[T]
|
507
|
+
end
|
508
|
+
|
509
|
+
module ActiveSupport
|
510
|
+
# Rescuable module adds support for easier exception handling.
|
511
|
+
module Rescuable
|
512
|
+
extend Concern
|
513
|
+
|
514
|
+
module ClassMethods
|
515
|
+
# Rescue exceptions raised in controller actions.
|
516
|
+
#
|
517
|
+
# <tt>rescue_from</tt> receives a series of exception classes or class
|
518
|
+
# names, and a trailing <tt>:with</tt> option with the name of a method
|
519
|
+
# or a Proc object to be called to handle them. Alternatively a block can
|
520
|
+
# be given.
|
521
|
+
#
|
522
|
+
# Handlers that take one argument will be called with the exception, so
|
523
|
+
# that the exception can be inspected when dealing with it.
|
524
|
+
#
|
525
|
+
# Handlers are inherited. They are searched from right to left, from
|
526
|
+
# bottom to top, and up the hierarchy. The handler of the first class for
|
527
|
+
# which <tt>exception.is_a?(klass)</tt> holds true is the one invoked, if
|
528
|
+
# any.
|
529
|
+
#
|
530
|
+
# class ApplicationController < ActionController::Base
|
531
|
+
# rescue_from User::NotAuthorized, with: :deny_access # self defined exception
|
532
|
+
# rescue_from ActiveRecord::RecordInvalid, with: :show_errors
|
533
|
+
#
|
534
|
+
# rescue_from 'MyAppError::Base' do |exception|
|
535
|
+
# render xml: exception, status: 500
|
536
|
+
# end
|
537
|
+
#
|
538
|
+
# private
|
539
|
+
# def deny_access
|
540
|
+
# ...
|
541
|
+
# end
|
542
|
+
#
|
543
|
+
# def show_errors(exception)
|
544
|
+
# exception.record.new_record? ? ...
|
545
|
+
# end
|
546
|
+
# end
|
547
|
+
#
|
548
|
+
# Exceptions raised inside exception handlers are not propagated up.
|
549
|
+
def rescue_from: (*Class) { (Exception) [self: instance] -> void } -> void
|
550
|
+
| (*Class, with: Symbol | ^(Exception) [self: instance] -> void) -> void
|
551
|
+
|
552
|
+
# Matches an exception to a handler based on the exception class.
|
553
|
+
#
|
554
|
+
# If no handler matches the exception, check for a handler matching the
|
555
|
+
# (optional) exception.cause. If no handler matches the exception or its
|
556
|
+
# cause, this returns +nil+, so you can deal with unhandled exceptions.
|
557
|
+
# Be sure to re-raise unhandled exceptions if this is what you expect.
|
558
|
+
#
|
559
|
+
# begin
|
560
|
+
# (trim non-ascii characters)
|
561
|
+
# rescue => exception
|
562
|
+
# rescue_with_handler(exception) || raise
|
563
|
+
# end
|
564
|
+
#
|
565
|
+
# Returns the exception if it was handled and +nil+ if it was not.
|
566
|
+
def rescue_with_handler: (untyped exception, ?visited_exceptions: untyped visited_exceptions, ?object: untyped object) -> untyped
|
567
|
+
|
568
|
+
def handler_for_rescue: (untyped exception, ?object: untyped object) -> untyped
|
569
|
+
|
570
|
+
private
|
571
|
+
|
572
|
+
def find_rescue_handler: (untyped exception) -> untyped
|
573
|
+
|
574
|
+
def constantize_rescue_handler_class: (untyped class_or_name) -> untyped
|
575
|
+
end
|
576
|
+
|
577
|
+
# Delegates to the class method, but uses the instance as the subject for
|
578
|
+
# rescue_from handlers (method calls, instance_exec blocks).
|
579
|
+
def rescue_with_handler: (untyped exception) -> untyped
|
580
|
+
|
581
|
+
def handler_for_rescue: (untyped exception) -> untyped
|
582
|
+
end
|
583
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# manifest.yaml describes dependencies which do not appear in the gemspec.
|
2
|
+
# If this gem includes such dependencies, comment-out the following lines and
|
3
|
+
# declare the dependencies.
|
4
|
+
# If all dependencies appear in the gemspec, you should remove this file.
|
5
|
+
#
|
6
|
+
dependencies:
|
7
|
+
- name: date
|
8
|
+
- name: logger
|
9
|
+
- name: minitest
|
10
|
+
- name: monitor
|
11
|
+
- name: mutex_m
|
12
|
+
- name: openssl
|
13
|
+
- name: singleton
|
14
|
+
- name: time
|
15
|
+
- name: securerandom
|
16
|
+
- name: erb
|
@@ -0,0 +1,55 @@
|
|
1
|
+
module ActiveSupport
|
2
|
+
class TestCase < ::Minitest::Test
|
3
|
+
# It is necessary to satisfy alias target.
|
4
|
+
# TODO: Define this method to correct place.
|
5
|
+
def name: () -> untyped
|
6
|
+
def assert_raises: (*untyped) -> untyped
|
7
|
+
def refute_empty: (*untyped) -> untyped
|
8
|
+
def refute_equal: (*untyped) -> untyped
|
9
|
+
def refute_in_delta: (*untyped) -> untyped
|
10
|
+
def refute_in_epsilon: (*untyped) -> untyped
|
11
|
+
def refute_includes: (*untyped) -> untyped
|
12
|
+
def refute_instance_of: (*untyped) -> untyped
|
13
|
+
def refute_kind_of: (*untyped) -> untyped
|
14
|
+
def refute_match: (*untyped) -> untyped
|
15
|
+
def refute_nil: (*untyped) -> untyped
|
16
|
+
def refute_operator: (*untyped) -> untyped
|
17
|
+
def refute_predicate: (*untyped) -> untyped
|
18
|
+
def refute_respond_to: (*untyped) -> untyped
|
19
|
+
def refute_same: (*untyped) -> untyped
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# Remove the fake type of LibXML
|
24
|
+
# if the real types are available.
|
25
|
+
module LibXML
|
26
|
+
module XML
|
27
|
+
module SaxParser
|
28
|
+
module Callbacks
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
# Remove the fake type of Nokogiri
|
35
|
+
# if the real types are available.
|
36
|
+
module Nokogiri
|
37
|
+
module XML
|
38
|
+
module SAX
|
39
|
+
class Document
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# Remove the fake type of DRb
|
46
|
+
# if the real types are available.
|
47
|
+
module DRb
|
48
|
+
module DRbUndumped
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
module Rails
|
53
|
+
class Railtie
|
54
|
+
end
|
55
|
+
end
|