decentworks-date-support 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.
Files changed (142) hide show
  1. checksums.yaml +7 -0
  2. data/.gem_rbs_collection/actionpack/7.2/.rbs_meta.yaml +9 -0
  3. data/.gem_rbs_collection/actionpack/7.2/actioncontroller-7.2.rbs +14 -0
  4. data/.gem_rbs_collection/actionpack/7.2/actioncontroller.rbs +290 -0
  5. data/.gem_rbs_collection/actionpack/7.2/actiondispatch.rbs +349 -0
  6. data/.gem_rbs_collection/actionpack/7.2/actionpack-generated.rbs +11497 -0
  7. data/.gem_rbs_collection/actionpack/7.2/patch.rbs +77 -0
  8. data/.gem_rbs_collection/actionview/6.0/.rbs_meta.yaml +9 -0
  9. data/.gem_rbs_collection/actionview/6.0/actionview-generated.rbs +8976 -0
  10. data/.gem_rbs_collection/actionview/6.0/actionview.rbs +1940 -0
  11. data/.gem_rbs_collection/actionview/6.0/patch.rbs +57 -0
  12. data/.gem_rbs_collection/activesupport/7.0/.rbs_meta.yaml +9 -0
  13. data/.gem_rbs_collection/activesupport/7.0/activesupport-7.0.rbs +381 -0
  14. data/.gem_rbs_collection/activesupport/7.0/activesupport-generated.rbs +11633 -0
  15. data/.gem_rbs_collection/activesupport/7.0/activesupport.rbs +724 -0
  16. data/.gem_rbs_collection/activesupport/7.0/manifest.yaml +15 -0
  17. data/.gem_rbs_collection/activesupport/7.0/patch.rbs +55 -0
  18. data/.gem_rbs_collection/ast/2.4/.rbs_meta.yaml +9 -0
  19. data/.gem_rbs_collection/ast/2.4/ast.rbs +73 -0
  20. data/.gem_rbs_collection/cgi/0.5/.rbs_meta.yaml +9 -0
  21. data/.gem_rbs_collection/cgi/0.5/core.rbs +925 -0
  22. data/.gem_rbs_collection/cgi/0.5/manifest.yaml +3 -0
  23. data/.gem_rbs_collection/concurrent-ruby/1.1/.rbs_meta.yaml +9 -0
  24. data/.gem_rbs_collection/concurrent-ruby/1.1/array.rbs +4 -0
  25. data/.gem_rbs_collection/concurrent-ruby/1.1/atomic_reference.rbs +16 -0
  26. data/.gem_rbs_collection/concurrent-ruby/1.1/executor.rbs +96 -0
  27. data/.gem_rbs_collection/concurrent-ruby/1.1/hash.rbs +4 -0
  28. data/.gem_rbs_collection/concurrent-ruby/1.1/map.rbs +68 -0
  29. data/.gem_rbs_collection/concurrent-ruby/1.1/promises.rbs +249 -0
  30. data/.gem_rbs_collection/concurrent-ruby/1.1/set.rbs +4 -0
  31. data/.gem_rbs_collection/concurrent-ruby/1.1/timer_task.rbs +47 -0
  32. data/.gem_rbs_collection/concurrent-ruby/1.1/utility/processor_counter.rbs +5 -0
  33. data/.gem_rbs_collection/connection_pool/2.4/.rbs_meta.yaml +9 -0
  34. data/.gem_rbs_collection/connection_pool/2.4/connection_pool.rbs +34 -0
  35. data/.gem_rbs_collection/connection_pool/2.4/manifest.yaml +2 -0
  36. data/.gem_rbs_collection/diff-lcs/1.5/.rbs_meta.yaml +9 -0
  37. data/.gem_rbs_collection/diff-lcs/1.5/diff-lcs.rbs +11 -0
  38. data/.gem_rbs_collection/faker/3.4.2/.rbs_meta.yaml +9 -0
  39. data/.gem_rbs_collection/faker/3.4.2/faker-2.23.rbs +90 -0
  40. data/.gem_rbs_collection/faker/3.4.2/faker.rbs +18 -0
  41. data/.gem_rbs_collection/i18n/1.10/.rbs_meta.yaml +9 -0
  42. data/.gem_rbs_collection/i18n/1.10/backend.rbs +274 -0
  43. data/.gem_rbs_collection/i18n/1.10/i18n.rbs +116 -0
  44. data/.gem_rbs_collection/lint_roller/1.1/.rbs_meta.yaml +9 -0
  45. data/.gem_rbs_collection/lint_roller/1.1/lint_roller.rbs +48 -0
  46. data/.gem_rbs_collection/minitest/5.25/.rbs_meta.yaml +9 -0
  47. data/.gem_rbs_collection/minitest/5.25/minitest/abstract_reporter.rbs +52 -0
  48. data/.gem_rbs_collection/minitest/5.25/minitest/assertion.rbs +17 -0
  49. data/.gem_rbs_collection/minitest/5.25/minitest/assertions.rbs +590 -0
  50. data/.gem_rbs_collection/minitest/5.25/minitest/backtrace_filter.rbs +23 -0
  51. data/.gem_rbs_collection/minitest/5.25/minitest/bench_spec.rbs +102 -0
  52. data/.gem_rbs_collection/minitest/5.25/minitest/benchmark.rbs +259 -0
  53. data/.gem_rbs_collection/minitest/5.25/minitest/composite_reporter.rbs +25 -0
  54. data/.gem_rbs_collection/minitest/5.25/minitest/compress.rbs +13 -0
  55. data/.gem_rbs_collection/minitest/5.25/minitest/error_on_warning.rbs +3 -0
  56. data/.gem_rbs_collection/minitest/5.25/minitest/expectation.rbs +2 -0
  57. data/.gem_rbs_collection/minitest/5.25/minitest/expectations.rbs +21 -0
  58. data/.gem_rbs_collection/minitest/5.25/minitest/guard.rbs +64 -0
  59. data/.gem_rbs_collection/minitest/5.25/minitest/mock.rbs +64 -0
  60. data/.gem_rbs_collection/minitest/5.25/minitest/parallel/executor.rbs +46 -0
  61. data/.gem_rbs_collection/minitest/5.25/minitest/parallel/test/class_methods.rbs +5 -0
  62. data/.gem_rbs_collection/minitest/5.25/minitest/parallel/test.rbs +3 -0
  63. data/.gem_rbs_collection/minitest/5.25/minitest/parallel.rbs +2 -0
  64. data/.gem_rbs_collection/minitest/5.25/minitest/pride_io.rbs +62 -0
  65. data/.gem_rbs_collection/minitest/5.25/minitest/pride_lol.rbs +19 -0
  66. data/.gem_rbs_collection/minitest/5.25/minitest/progress_reporter.rbs +11 -0
  67. data/.gem_rbs_collection/minitest/5.25/minitest/reportable.rbs +53 -0
  68. data/.gem_rbs_collection/minitest/5.25/minitest/reporter.rbs +5 -0
  69. data/.gem_rbs_collection/minitest/5.25/minitest/result.rbs +28 -0
  70. data/.gem_rbs_collection/minitest/5.25/minitest/runnable.rbs +163 -0
  71. data/.gem_rbs_collection/minitest/5.25/minitest/skip.rbs +6 -0
  72. data/.gem_rbs_collection/minitest/5.25/minitest/spec/dsl/instance_methods.rbs +48 -0
  73. data/.gem_rbs_collection/minitest/5.25/minitest/spec/dsl.rbs +129 -0
  74. data/.gem_rbs_collection/minitest/5.25/minitest/spec.rbs +11 -0
  75. data/.gem_rbs_collection/minitest/5.25/minitest/statistics_reporter.rbs +81 -0
  76. data/.gem_rbs_collection/minitest/5.25/minitest/summary_reporter.rbs +18 -0
  77. data/.gem_rbs_collection/minitest/5.25/minitest/test/lifecycle_hooks.rbs +92 -0
  78. data/.gem_rbs_collection/minitest/5.25/minitest/test.rbs +69 -0
  79. data/.gem_rbs_collection/minitest/5.25/minitest/unexpected_error.rbs +12 -0
  80. data/.gem_rbs_collection/minitest/5.25/minitest/unexpected_warning.rbs +6 -0
  81. data/.gem_rbs_collection/minitest/5.25/minitest/unit/test_case.rbs +3 -0
  82. data/.gem_rbs_collection/minitest/5.25/minitest/unit.rbs +4 -0
  83. data/.gem_rbs_collection/minitest/5.25/minitest.rbs +115 -0
  84. data/.gem_rbs_collection/nokogiri/1.11/.rbs_meta.yaml +9 -0
  85. data/.gem_rbs_collection/nokogiri/1.11/nokogiri.rbs +2332 -0
  86. data/.gem_rbs_collection/nokogiri/1.11/patch.rbs +4 -0
  87. data/.gem_rbs_collection/parallel/1.20/.rbs_meta.yaml +9 -0
  88. data/.gem_rbs_collection/parallel/1.20/parallel.rbs +86 -0
  89. data/.gem_rbs_collection/parser/3.2/.rbs_meta.yaml +9 -0
  90. data/.gem_rbs_collection/parser/3.2/manifest.yaml +7 -0
  91. data/.gem_rbs_collection/parser/3.2/parser.rbs +194 -0
  92. data/.gem_rbs_collection/parser/3.2/polyfill.rbs +4 -0
  93. data/.gem_rbs_collection/rack/2.2/.rbs_meta.yaml +9 -0
  94. data/.gem_rbs_collection/rack/2.2/manifest.yaml +3 -0
  95. data/.gem_rbs_collection/rack/2.2/rack.rbs +1480 -0
  96. data/.gem_rbs_collection/rails-dom-testing/2.0/.rbs_meta.yaml +9 -0
  97. data/.gem_rbs_collection/rails-dom-testing/2.0/rails-dom-testing.rbs +51 -0
  98. data/.gem_rbs_collection/rails-html-sanitizer/1.6/.rbs_meta.yaml +9 -0
  99. data/.gem_rbs_collection/rails-html-sanitizer/1.6/rails-html-sanitizer.rbs +53 -0
  100. data/.gem_rbs_collection/railties/6.0/.rbs_meta.yaml +9 -0
  101. data/.gem_rbs_collection/railties/6.0/manifest.yaml +2 -0
  102. data/.gem_rbs_collection/railties/6.0/patch.rbs +17 -0
  103. data/.gem_rbs_collection/railties/6.0/railties-generated.rbs +4822 -0
  104. data/.gem_rbs_collection/railties/6.0/railties.rbs +44 -0
  105. data/.gem_rbs_collection/rainbow/3.0/.rbs_meta.yaml +9 -0
  106. data/.gem_rbs_collection/rainbow/3.0/global.rbs +7 -0
  107. data/.gem_rbs_collection/rainbow/3.0/presenter.rbs +209 -0
  108. data/.gem_rbs_collection/rainbow/3.0/rainbow.rbs +5 -0
  109. data/.gem_rbs_collection/rake/13.0/.rbs_meta.yaml +9 -0
  110. data/.gem_rbs_collection/rake/13.0/manifest.yaml +2 -0
  111. data/.gem_rbs_collection/rake/13.0/rake.rbs +39 -0
  112. data/.gem_rbs_collection/regexp_parser/2.8/.rbs_meta.yaml +9 -0
  113. data/.gem_rbs_collection/regexp_parser/2.8/regexp_parser.rbs +17 -0
  114. data/.gem_rbs_collection/rubocop/1.57/.rbs_meta.yaml +9 -0
  115. data/.gem_rbs_collection/rubocop/1.57/rubocop.rbs +208 -0
  116. data/.gem_rbs_collection/rubocop-ast/1.46/.rbs_meta.yaml +9 -0
  117. data/.gem_rbs_collection/rubocop-ast/1.46/rubocop-ast.rbs +903 -0
  118. data/.gem_rbs_collection/thor/1.2/.rbs_meta.yaml +9 -0
  119. data/.gem_rbs_collection/thor/1.2/thor.rbs +62 -0
  120. data/.gem_rbs_collection/tzinfo/2.0/.rbs_meta.yaml +9 -0
  121. data/.gem_rbs_collection/tzinfo/2.0/manifest.yaml +7 -0
  122. data/.gem_rbs_collection/tzinfo/2.0/tzinfo.rbs +600 -0
  123. data/.rspec +3 -0
  124. data/.rubocop.yml +8 -0
  125. data/.ruby-version +1 -0
  126. data/CHANGELOG.md +5 -0
  127. data/CODE_OF_CONDUCT.md +132 -0
  128. data/LICENSE +21 -0
  129. data/LICENSE.txt +21 -0
  130. data/README.md +54 -0
  131. data/Rakefile +12 -0
  132. data/Steepfile +43 -0
  133. data/lib/decentworks/active_support/time_with_zone_support.rb +327 -0
  134. data/lib/decentworks/date/support/version.rb +9 -0
  135. data/lib/decentworks/date_support.rb +323 -0
  136. data/lib/decentworks_date_support.rb +4 -0
  137. data/rbs_collection.lock.yaml +288 -0
  138. data/rbs_collection.yaml +41 -0
  139. data/sig/decentworks/active_support/time_with_zone_support.rbs +109 -0
  140. data/sig/decentworks/date/support.rbs +8 -0
  141. data/sig/decentworks/date_support.rbs +107 -0
  142. metadata +197 -0
@@ -0,0 +1,724 @@
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: () -> self
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
+ module ActiveSupport
360
+ module Tryable : BasicObject
361
+ def try: [T] () { (self) -> T } -> T # When yield self
362
+ | [T] () { () -> T } -> T # When instance_eval
363
+ | ((String | Symbol) method_name, *untyped args) ?{ (*untyped) -> untyped } -> untyped
364
+
365
+ def try!: [T] () { (self) -> T } -> T # When yield self
366
+ | [T] () { () -> T } -> T # When instance_eval
367
+ | ((String | Symbol) method_name, *untyped args) ?{ (*untyped) -> untyped } -> untyped
368
+ end
369
+ end
370
+
371
+ class NilClass
372
+ def try: () { (untyped) -> untyped } -> nil
373
+ | () { () -> untyped } -> nil
374
+ | ((String | Symbol) method_name, *untyped args) ?{ (*untyped) -> untyped } -> nil
375
+
376
+ def try!: () { (untyped) -> untyped } -> nil
377
+ | () { () -> untyped } -> nil
378
+ | ((String | Symbol) method_name, *untyped args) ?{ (*untyped) -> untyped } -> nil
379
+ end
380
+
381
+ class Array[unchecked out Elem]
382
+ # Manual definition to make block optional
383
+ def in_groups: (untyped number, ?untyped? fill_with) ?{ (untyped) -> untyped } -> untyped
384
+
385
+ # Returns a string that represents the array in XML by invoking +to_xml+
386
+ # on each element. Active Record collections delegate their representation
387
+ # in XML to this method.
388
+ #
389
+ # All elements are expected to respond to +to_xml+, if any of them does
390
+ # not then an exception is raised.
391
+ #
392
+ # The root node reflects the class name of the first element in plural
393
+ # if all elements belong to the same type and that's not Hash:
394
+ #
395
+ # customer.projects.to_xml
396
+ #
397
+ # <?xml version="1.0" encoding="UTF-8"?>
398
+ # <projects type="array">
399
+ # <project>
400
+ # <amount type="decimal">20000.0</amount>
401
+ # <customer-id type="integer">1567</customer-id>
402
+ # <deal-date type="date">2008-04-09</deal-date>
403
+ # ...
404
+ # </project>
405
+ # <project>
406
+ # <amount type="decimal">57230.0</amount>
407
+ # <customer-id type="integer">1567</customer-id>
408
+ # <deal-date type="date">2008-04-15</deal-date>
409
+ # ...
410
+ # </project>
411
+ # </projects>
412
+ #
413
+ # Otherwise the root element is "objects":
414
+ #
415
+ # [{ foo: 1, bar: 2}, { baz: 3}].to_xml
416
+ #
417
+ # <?xml version="1.0" encoding="UTF-8"?>
418
+ # <objects type="array">
419
+ # <object>
420
+ # <bar type="integer">2</bar>
421
+ # <foo type="integer">1</foo>
422
+ # </object>
423
+ # <object>
424
+ # <baz type="integer">3</baz>
425
+ # </object>
426
+ # </objects>
427
+ #
428
+ # If the collection is empty the root element is "nil-classes" by default:
429
+ #
430
+ # [].to_xml
431
+ #
432
+ # <?xml version="1.0" encoding="UTF-8"?>
433
+ # <nil-classes type="array"/>
434
+ #
435
+ # To ensure a meaningful root element use the <tt>:root</tt> option:
436
+ #
437
+ # customer_with_no_projects.projects.to_xml(root: 'projects')
438
+ #
439
+ # <?xml version="1.0" encoding="UTF-8"?>
440
+ # <projects type="array"/>
441
+ #
442
+ # By default name of the node for the children of root is <tt>root.singularize</tt>.
443
+ # You can change it with the <tt>:children</tt> option.
444
+ #
445
+ # The +options+ hash is passed downwards:
446
+ #
447
+ # Message.all.to_xml(skip_types: true)
448
+ #
449
+ # <?xml version="1.0" encoding="UTF-8"?>
450
+ # <messages>
451
+ # <message>
452
+ # <created-at>2008-03-07T09:58:18+01:00</created-at>
453
+ # <id>1</id>
454
+ # <name>1</name>
455
+ # <updated-at>2008-03-07T09:58:18+01:00</updated-at>
456
+ # <user-id>1</user-id>
457
+ # </message>
458
+ # </messages>
459
+ #
460
+ def to_xml: (?::Hash[untyped, untyped] options) ?{ (untyped) -> untyped } -> untyped
461
+ end
462
+
463
+ # active_support/core_ext/object/blank.rb
464
+ class Object
465
+ def blank?: () -> bool
466
+ def present?: () -> bool
467
+ def presence: () -> self?
468
+ end
469
+
470
+ # active_support/core_ext/object/inclusion.rb
471
+ class Object
472
+ def in?: (ActiveSupport::_IncludeP another_object) -> bool
473
+ def presence_in: (ActiveSupport::_IncludeP another_object) -> (self | nil)
474
+ end
475
+
476
+ class NilClass
477
+ def blank?: () -> true
478
+ def present?: () -> false
479
+ end
480
+
481
+ class FalseClass
482
+ def blank?: () -> true
483
+ def present?: () -> false
484
+ end
485
+
486
+ class TrueClass
487
+ def blank?: () -> false
488
+ def present?: () -> true
489
+ end
490
+
491
+ class Array[unchecked out Elem]
492
+ alias blank? empty?
493
+ def present?: () -> bool
494
+ end
495
+
496
+ class Hash[unchecked out K, unchecked out V]
497
+ alias blank? empty?
498
+ def present?: () -> bool
499
+
500
+ # Returns a string containing an XML representation of its receiver:
501
+ #
502
+ # { foo: 1, bar: 2 }.to_xml
503
+ # # =>
504
+ # # <?xml version="1.0" encoding="UTF-8"?>
505
+ # # <hash>
506
+ # # <foo type="integer">1</foo>
507
+ # # <bar type="integer">2</bar>
508
+ # # </hash>
509
+ #
510
+ # To do so, the method loops over the pairs and builds nodes that depend on
511
+ # the _values_. Given a pair +key+, +value+:
512
+ #
513
+ # * If +value+ is a hash there's a recursive call with +key+ as <tt>:root</tt>.
514
+ #
515
+ # * If +value+ is an array there's a recursive call with +key+ as <tt>:root</tt>,
516
+ # and +key+ singularized as <tt>:children</tt>.
517
+ #
518
+ # * If +value+ is a callable object it must expect one or two arguments. Depending
519
+ # on the arity, the callable is invoked with the +options+ hash as first argument
520
+ # with +key+ as <tt>:root</tt>, and +key+ singularized as second argument. The
521
+ # callable can add nodes by using <tt>options[:builder]</tt>.
522
+ #
523
+ # {foo: lambda { |options, key| options[:builder].b(key) }}.to_xml
524
+ # # => "<b>foo</b>"
525
+ #
526
+ # * If +value+ responds to +to_xml+ the method is invoked with +key+ as <tt>:root</tt>.
527
+ #
528
+ # class Foo
529
+ # def to_xml(options)
530
+ # options[:builder].bar 'fooing!'
531
+ # end
532
+ # end
533
+ #
534
+ # { foo: Foo.new }.to_xml(skip_instruct: true)
535
+ # # =>
536
+ # # <hash>
537
+ # # <bar>fooing!</bar>
538
+ # # </hash>
539
+ #
540
+ # * Otherwise, a node with +key+ as tag is created with a string representation of
541
+ # +value+ as text node. If +value+ is +nil+ an attribute "nil" set to "true" is added.
542
+ # Unless the option <tt>:skip_types</tt> exists and is true, an attribute "type" is
543
+ # added as well according to the following mapping:
544
+ #
545
+ # XML_TYPE_NAMES = {
546
+ # "Symbol" => "symbol",
547
+ # "Integer" => "integer",
548
+ # "BigDecimal" => "decimal",
549
+ # "Float" => "float",
550
+ # "TrueClass" => "boolean",
551
+ # "FalseClass" => "boolean",
552
+ # "Date" => "date",
553
+ # "DateTime" => "dateTime",
554
+ # "Time" => "dateTime"
555
+ # }
556
+ #
557
+ # By default the root node is "hash", but that's configurable via the <tt>:root</tt> option.
558
+ #
559
+ # The default XML builder is a fresh instance of <tt>Builder::XmlMarkup</tt>. You can
560
+ # configure your own builder with the <tt>:builder</tt> option. The method also accepts
561
+ # options like <tt>:dasherize</tt> and friends, they are forwarded to the builder.
562
+ def to_xml: (?::Hash[untyped, untyped] options) ?{ (untyped) -> untyped } -> untyped
563
+ end
564
+
565
+ class String
566
+ BLANK_RE: Regexp
567
+ ENCODED_BLANKS: Concurrent::Map[Encoding, Regexp]
568
+ def blank?: () -> bool
569
+ def present?: () -> bool
570
+ end
571
+
572
+ class Numeric
573
+ def blank?: () -> false
574
+ end
575
+
576
+ class Time
577
+ def blank?: () -> false
578
+ end
579
+
580
+ # active_support/core_ext/string/inflections.rb
581
+ class String
582
+ def camelize: (?Symbol first_letter) -> String
583
+ alias camelcase camelize
584
+ def underscore: () -> String
585
+ def dasherize: () -> String
586
+ def pluralize: (?Integer | Symbol? count, ?Symbol locale) -> String
587
+ def singularize: (?Symbol locale) -> String
588
+ def constantize: () -> untyped
589
+ def safe_constantize: () -> untyped
590
+ def titleize: (?keep_id_suffix: boolish) -> String
591
+ alias titlecase titleize
592
+ def demodulize: () -> String
593
+ def deconstantize: () -> String
594
+ def parameterize: (?separator: String, ?preserve_case: boolish, ?locale: Symbol) -> String
595
+ def tableize: () -> String
596
+ def classify: () -> String
597
+ def humanize: (?capitalize: boolish, ?keep_id_suffix: boolish) -> String
598
+ def upcase_first: () -> String
599
+ def foreign_key: (?boolish separate_class_name_and_id_with_underscore) -> String
600
+ end
601
+
602
+ class Array[unchecked out Elem]
603
+ # Wraps its argument in an array unless it is already an array (or array-like).
604
+ #
605
+ # Specifically:
606
+ #
607
+ # * If the argument is +nil+ an empty array is returned.
608
+ # * Otherwise, if the argument responds to +to_ary+ it is invoked, and its result returned.
609
+ # * Otherwise, returns an array with the argument as its single element.
610
+ #
611
+ # Array.wrap(nil) # => []
612
+ # Array.wrap([1, 2, 3]) # => [1, 2, 3]
613
+ # Array.wrap(0) # => [0]
614
+ #
615
+ # This method is similar in purpose to <tt>Kernel#Array</tt>, but there are some differences:
616
+ #
617
+ # * If the argument responds to +to_ary+ the method is invoked. <tt>Kernel#Array</tt>
618
+ # moves on to try +to_a+ if the returned value is +nil+, but <tt>Array.wrap</tt> returns
619
+ # an array with the argument as its single element right away.
620
+ # * If the returned value from +to_ary+ is neither +nil+ nor an +Array+ object, <tt>Kernel#Array</tt>
621
+ # raises an exception, while <tt>Array.wrap</tt> does not, it just returns the value.
622
+ # * It does not call +to_a+ on the argument, if the argument does not respond to +to_ary+
623
+ # it returns an array with the argument as its single element.
624
+ #
625
+ # The last point is easily explained with some enumerables:
626
+ #
627
+ # Array(foo: :bar) # => [[:foo, :bar]]
628
+ # Array.wrap(foo: :bar) # => [{:foo=>:bar}]
629
+ #
630
+ # There's also a related idiom that uses the splat operator:
631
+ #
632
+ # [*object]
633
+ #
634
+ # which returns <tt>[]</tt> for +nil+, but calls to <tt>Array(object)</tt> otherwise.
635
+ #
636
+ # The differences with <tt>Kernel#Array</tt> explained above
637
+ # apply to the rest of <tt>object</tt>s.
638
+ def self.wrap: (nil) -> Array[untyped]
639
+ | [T] (_ToAry[T] array_like) -> Array[T]
640
+ | [T] (T ele) -> Array[T]
641
+ end
642
+
643
+ module ActiveSupport
644
+ # Rescuable module adds support for easier exception handling.
645
+ module Rescuable
646
+ extend Concern
647
+
648
+ module ClassMethods
649
+ # Rescue exceptions raised in controller actions.
650
+ #
651
+ # <tt>rescue_from</tt> receives a series of exception classes or class
652
+ # names, and a trailing <tt>:with</tt> option with the name of a method
653
+ # or a Proc object to be called to handle them. Alternatively a block can
654
+ # be given.
655
+ #
656
+ # Handlers that take one argument will be called with the exception, so
657
+ # that the exception can be inspected when dealing with it.
658
+ #
659
+ # Handlers are inherited. They are searched from right to left, from
660
+ # bottom to top, and up the hierarchy. The handler of the first class for
661
+ # which <tt>exception.is_a?(klass)</tt> holds true is the one invoked, if
662
+ # any.
663
+ #
664
+ # class ApplicationController < ActionController::Base
665
+ # rescue_from User::NotAuthorized, with: :deny_access # self defined exception
666
+ # rescue_from ActiveRecord::RecordInvalid, with: :show_errors
667
+ #
668
+ # rescue_from 'MyAppError::Base' do |exception|
669
+ # render xml: exception, status: 500
670
+ # end
671
+ #
672
+ # private
673
+ # def deny_access
674
+ # ...
675
+ # end
676
+ #
677
+ # def show_errors(exception)
678
+ # exception.record.new_record? ? ...
679
+ # end
680
+ # end
681
+ #
682
+ # Exceptions raised inside exception handlers are not propagated up.
683
+ def rescue_from: (*Class) { (Exception) [self: instance] -> void } -> void
684
+ | (*Class, with: Symbol | ^(Exception) [self: instance] -> void) -> void
685
+
686
+ # Matches an exception to a handler based on the exception class.
687
+ #
688
+ # If no handler matches the exception, check for a handler matching the
689
+ # (optional) exception.cause. If no handler matches the exception or its
690
+ # cause, this returns +nil+, so you can deal with unhandled exceptions.
691
+ # Be sure to re-raise unhandled exceptions if this is what you expect.
692
+ #
693
+ # begin
694
+ # (trim non-ascii characters)
695
+ # rescue => exception
696
+ # rescue_with_handler(exception) || raise
697
+ # end
698
+ #
699
+ # Returns the exception if it was handled and +nil+ if it was not.
700
+ def rescue_with_handler: (untyped exception, ?visited_exceptions: untyped visited_exceptions, ?object: untyped object) -> untyped
701
+
702
+ def handler_for_rescue: (untyped exception, ?object: untyped object) -> untyped
703
+
704
+ private
705
+
706
+ def find_rescue_handler: (untyped exception) -> untyped
707
+
708
+ def constantize_rescue_handler_class: (untyped class_or_name) -> untyped
709
+ end
710
+
711
+ # Delegates to the class method, but uses the instance as the subject for
712
+ # rescue_from handlers (method calls, instance_exec blocks).
713
+ def rescue_with_handler: (untyped exception) -> untyped
714
+
715
+ def handler_for_rescue: (untyped exception) -> untyped
716
+ end
717
+ end
718
+
719
+ module ActiveSupport
720
+ module Messages
721
+ module Metadata
722
+ end
723
+ end
724
+ end