zonesync 0.9.0 → 0.10.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 (74) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -0
  3. data/lib/zonesync/cli.rb +9 -0
  4. data/lib/zonesync/cloudflare.rb +64 -39
  5. data/lib/zonesync/diff.rb +10 -1
  6. data/lib/zonesync/errors.rb +35 -0
  7. data/lib/zonesync/generate.rb +14 -0
  8. data/lib/zonesync/http.rb +24 -8
  9. data/lib/zonesync/logger.rb +20 -15
  10. data/lib/zonesync/manifest.rb +21 -5
  11. data/lib/zonesync/parser.rb +337 -0
  12. data/lib/zonesync/provider.rb +80 -26
  13. data/lib/zonesync/record.rb +18 -23
  14. data/lib/zonesync/route53.rb +48 -27
  15. data/lib/zonesync/sync.rb +40 -0
  16. data/lib/zonesync/validator.rb +19 -15
  17. data/lib/zonesync/version.rb +1 -1
  18. data/lib/zonesync/zonefile.rb +22 -311
  19. data/lib/zonesync.rb +27 -60
  20. data/sorbet/config +4 -0
  21. data/sorbet/rbi/annotations/.gitattributes +1 -0
  22. data/sorbet/rbi/annotations/activesupport.rbi +457 -0
  23. data/sorbet/rbi/annotations/minitest.rbi +119 -0
  24. data/sorbet/rbi/annotations/webmock.rbi +9 -0
  25. data/sorbet/rbi/gems/.gitattributes +1 -0
  26. data/sorbet/rbi/gems/activesupport@8.0.1.rbi +18474 -0
  27. data/sorbet/rbi/gems/addressable@2.8.7.rbi +1994 -0
  28. data/sorbet/rbi/gems/base64@0.2.0.rbi +507 -0
  29. data/sorbet/rbi/gems/benchmark@0.4.0.rbi +618 -0
  30. data/sorbet/rbi/gems/bigdecimal@3.1.9.rbi +9 -0
  31. data/sorbet/rbi/gems/concurrent-ruby@1.3.4.rbi +11645 -0
  32. data/sorbet/rbi/gems/connection_pool@2.4.1.rbi +9 -0
  33. data/sorbet/rbi/gems/crack@1.0.0.rbi +145 -0
  34. data/sorbet/rbi/gems/date@3.4.1.rbi +75 -0
  35. data/sorbet/rbi/gems/diff-lcs@1.5.1.rbi +1131 -0
  36. data/sorbet/rbi/gems/drb@2.2.1.rbi +1347 -0
  37. data/sorbet/rbi/gems/erubi@1.13.1.rbi +155 -0
  38. data/sorbet/rbi/gems/hashdiff@1.1.2.rbi +353 -0
  39. data/sorbet/rbi/gems/i18n@1.14.6.rbi +2275 -0
  40. data/sorbet/rbi/gems/io-console@0.8.0.rbi +9 -0
  41. data/sorbet/rbi/gems/logger@1.6.4.rbi +940 -0
  42. data/sorbet/rbi/gems/minitest@5.25.4.rbi +1547 -0
  43. data/sorbet/rbi/gems/netrc@0.11.0.rbi +159 -0
  44. data/sorbet/rbi/gems/parallel@1.26.3.rbi +291 -0
  45. data/sorbet/rbi/gems/polyglot@0.3.5.rbi +42 -0
  46. data/sorbet/rbi/gems/prism@1.3.0.rbi +40040 -0
  47. data/sorbet/rbi/gems/psych@5.2.2.rbi +1785 -0
  48. data/sorbet/rbi/gems/public_suffix@6.0.1.rbi +936 -0
  49. data/sorbet/rbi/gems/rake@13.2.1.rbi +3028 -0
  50. data/sorbet/rbi/gems/rbi@0.2.2.rbi +4527 -0
  51. data/sorbet/rbi/gems/rdoc@6.10.0.rbi +12766 -0
  52. data/sorbet/rbi/gems/reline@0.6.0.rbi +9 -0
  53. data/sorbet/rbi/gems/rexml@3.4.0.rbi +4974 -0
  54. data/sorbet/rbi/gems/rspec-core@3.13.2.rbi +10896 -0
  55. data/sorbet/rbi/gems/rspec-expectations@3.13.3.rbi +8183 -0
  56. data/sorbet/rbi/gems/rspec-mocks@3.13.2.rbi +5341 -0
  57. data/sorbet/rbi/gems/rspec-support@3.13.2.rbi +1630 -0
  58. data/sorbet/rbi/gems/rspec@3.13.0.rbi +83 -0
  59. data/sorbet/rbi/gems/securerandom@0.4.1.rbi +75 -0
  60. data/sorbet/rbi/gems/spoom@1.5.0.rbi +4932 -0
  61. data/sorbet/rbi/gems/stringio@3.1.2.rbi +9 -0
  62. data/sorbet/rbi/gems/tapioca@0.16.6.rbi +3611 -0
  63. data/sorbet/rbi/gems/thor@1.3.2.rbi +4378 -0
  64. data/sorbet/rbi/gems/treetop@1.6.12.rbi +1895 -0
  65. data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5918 -0
  66. data/sorbet/rbi/gems/uri@1.0.2.rbi +2340 -0
  67. data/sorbet/rbi/gems/webmock@3.24.0.rbi +1780 -0
  68. data/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +435 -0
  69. data/sorbet/rbi/gems/yard@0.9.37.rbi +18379 -0
  70. data/sorbet/rbi/todo.rbi +7 -0
  71. data/sorbet/tapioca/config.yml +13 -0
  72. data/sorbet/tapioca/require.rb +4 -0
  73. data/zonesync.gemspec +3 -0
  74. metadata +100 -2
@@ -0,0 +1,507 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `base64` gem.
5
+ # Please instead update this file by running `bin/tapioca gem base64`.
6
+
7
+
8
+ # \Module \Base64 provides methods for:
9
+ #
10
+ # - Encoding a binary string (containing non-ASCII characters)
11
+ # as a string of printable ASCII characters.
12
+ # - Decoding such an encoded string.
13
+ #
14
+ # \Base64 is commonly used in contexts where binary data
15
+ # is not allowed or supported:
16
+ #
17
+ # - Images in HTML or CSS files, or in URLs.
18
+ # - Email attachments.
19
+ #
20
+ # A \Base64-encoded string is about one-third larger that its source.
21
+ # See the {Wikipedia article}[https://en.wikipedia.org/wiki/Base64]
22
+ # for more information.
23
+ #
24
+ # This module provides three pairs of encode/decode methods.
25
+ # Your choices among these methods should depend on:
26
+ #
27
+ # - Which character set is to be used for encoding and decoding.
28
+ # - Whether "padding" is to be used.
29
+ # - Whether encoded strings are to contain newlines.
30
+ #
31
+ # Note: Examples on this page assume that the including program has executed:
32
+ #
33
+ # require 'base64'
34
+ #
35
+ # == Encoding Character Sets
36
+ #
37
+ # A \Base64-encoded string consists only of characters from a 64-character set:
38
+ #
39
+ # - <tt>('A'..'Z')</tt>.
40
+ # - <tt>('a'..'z')</tt>.
41
+ # - <tt>('0'..'9')</tt>.
42
+ # - <tt>=</tt>, the 'padding' character.
43
+ # - Either:
44
+ # - <tt>%w[+ /]</tt>:
45
+ # {RFC-2045-compliant}[https://datatracker.ietf.org/doc/html/rfc2045];
46
+ # _not_ safe for URLs.
47
+ # - <tt>%w[- _]</tt>:
48
+ # {RFC-4648-compliant}[https://datatracker.ietf.org/doc/html/rfc4648];
49
+ # safe for URLs.
50
+ #
51
+ # If you are working with \Base64-encoded strings that will come from
52
+ # or be put into URLs, you should choose this encoder-decoder pair
53
+ # of RFC-4648-compliant methods:
54
+ #
55
+ # - Base64.urlsafe_encode64 and Base64.urlsafe_decode64.
56
+ #
57
+ # Otherwise, you may choose any of the pairs in this module,
58
+ # including the pair above, or the RFC-2045-compliant pairs:
59
+ #
60
+ # - Base64.encode64 and Base64.decode64.
61
+ # - Base64.strict_encode64 and Base64.strict_decode64.
62
+ #
63
+ # == Padding
64
+ #
65
+ # \Base64-encoding changes a triplet of input bytes
66
+ # into a quartet of output characters.
67
+ #
68
+ # <b>Padding in Encode Methods</b>
69
+ #
70
+ # Padding -- extending an encoded string with zero, one, or two trailing
71
+ # <tt>=</tt> characters -- is performed by methods Base64.encode64,
72
+ # Base64.strict_encode64, and, by default, Base64.urlsafe_encode64:
73
+ #
74
+ # Base64.encode64('s') # => "cw==\n"
75
+ # Base64.strict_encode64('s') # => "cw=="
76
+ # Base64.urlsafe_encode64('s') # => "cw=="
77
+ # Base64.urlsafe_encode64('s', padding: false) # => "cw"
78
+ #
79
+ # When padding is performed, the encoded string is always of length <em>4n</em>,
80
+ # where +n+ is a non-negative integer:
81
+ #
82
+ # - Input bytes of length <em>3n</em> generate unpadded output characters
83
+ # of length <em>4n</em>:
84
+ #
85
+ # # n = 1: 3 bytes => 4 characters.
86
+ # Base64.strict_encode64('123') # => "MDEy"
87
+ # # n = 2: 6 bytes => 8 characters.
88
+ # Base64.strict_encode64('123456') # => "MDEyMzQ1"
89
+ #
90
+ # - Input bytes of length <em>3n+1</em> generate padded output characters
91
+ # of length <em>4(n+1)</em>, with two padding characters at the end:
92
+ #
93
+ # # n = 1: 4 bytes => 8 characters.
94
+ # Base64.strict_encode64('1234') # => "MDEyMw=="
95
+ # # n = 2: 7 bytes => 12 characters.
96
+ # Base64.strict_encode64('1234567') # => "MDEyMzQ1Ng=="
97
+ #
98
+ # - Input bytes of length <em>3n+2</em> generate padded output characters
99
+ # of length <em>4(n+1)</em>, with one padding character at the end:
100
+ #
101
+ # # n = 1: 5 bytes => 8 characters.
102
+ # Base64.strict_encode64('12345') # => "MDEyMzQ="
103
+ # # n = 2: 8 bytes => 12 characters.
104
+ # Base64.strict_encode64('12345678') # => "MDEyMzQ1Njc="
105
+ #
106
+ # When padding is suppressed, for a positive integer <em>n</em>:
107
+ #
108
+ # - Input bytes of length <em>3n</em> generate unpadded output characters
109
+ # of length <em>4n</em>:
110
+ #
111
+ # # n = 1: 3 bytes => 4 characters.
112
+ # Base64.urlsafe_encode64('123', padding: false) # => "MDEy"
113
+ # # n = 2: 6 bytes => 8 characters.
114
+ # Base64.urlsafe_encode64('123456', padding: false) # => "MDEyMzQ1"
115
+ #
116
+ # - Input bytes of length <em>3n+1</em> generate unpadded output characters
117
+ # of length <em>4n+2</em>, with two padding characters at the end:
118
+ #
119
+ # # n = 1: 4 bytes => 6 characters.
120
+ # Base64.urlsafe_encode64('1234', padding: false) # => "MDEyMw"
121
+ # # n = 2: 7 bytes => 10 characters.
122
+ # Base64.urlsafe_encode64('1234567', padding: false) # => "MDEyMzQ1Ng"
123
+ #
124
+ # - Input bytes of length <em>3n+2</em> generate unpadded output characters
125
+ # of length <em>4n+3</em>, with one padding character at the end:
126
+ #
127
+ # # n = 1: 5 bytes => 7 characters.
128
+ # Base64.urlsafe_encode64('12345', padding: false) # => "MDEyMzQ"
129
+ # # m = 2: 8 bytes => 11 characters.
130
+ # Base64.urlsafe_encode64('12345678', padding: false) # => "MDEyMzQ1Njc"
131
+ #
132
+ # <b>Padding in Decode Methods</b>
133
+ #
134
+ # All of the \Base64 decode methods support (but do not require) padding.
135
+ #
136
+ # \Method Base64.decode64 does not check the size of the padding:
137
+ #
138
+ # Base64.decode64("MDEyMzQ1Njc") # => "01234567"
139
+ # Base64.decode64("MDEyMzQ1Njc=") # => "01234567"
140
+ # Base64.decode64("MDEyMzQ1Njc==") # => "01234567"
141
+ #
142
+ # \Method Base64.strict_decode64 strictly enforces padding size:
143
+ #
144
+ # Base64.strict_decode64("MDEyMzQ1Njc") # Raises ArgumentError
145
+ # Base64.strict_decode64("MDEyMzQ1Njc=") # => "01234567"
146
+ # Base64.strict_decode64("MDEyMzQ1Njc==") # Raises ArgumentError
147
+ #
148
+ # \Method Base64.urlsafe_decode64 allows padding in +str+,
149
+ # which if present, must be correct:
150
+ # see {Padding}[Base64.html#module-Base64-label-Padding], above:
151
+ #
152
+ # Base64.urlsafe_decode64("MDEyMzQ1Njc") # => "01234567"
153
+ # Base64.urlsafe_decode64("MDEyMzQ1Njc=") # => "01234567"
154
+ # Base64.urlsafe_decode64("MDEyMzQ1Njc==") # Raises ArgumentError.
155
+ #
156
+ # == Newlines
157
+ #
158
+ # An encoded string returned by Base64.encode64 or Base64.urlsafe_encode64
159
+ # has an embedded newline character
160
+ # after each 60-character sequence, and, if non-empty, at the end:
161
+ #
162
+ # # No newline if empty.
163
+ # encoded = Base64.encode64("\x00" * 0)
164
+ # encoded.index("\n") # => nil
165
+ #
166
+ # # Newline at end of short output.
167
+ # encoded = Base64.encode64("\x00" * 1)
168
+ # encoded.size # => 4
169
+ # encoded.index("\n") # => 4
170
+ #
171
+ # # Newline at end of longer output.
172
+ # encoded = Base64.encode64("\x00" * 45)
173
+ # encoded.size # => 60
174
+ # encoded.index("\n") # => 60
175
+ #
176
+ # # Newlines embedded and at end of still longer output.
177
+ # encoded = Base64.encode64("\x00" * 46)
178
+ # encoded.size # => 65
179
+ # encoded.rindex("\n") # => 65
180
+ # encoded.split("\n").map {|s| s.size } # => [60, 4]
181
+ #
182
+ # The string to be encoded may itself contain newlines,
183
+ # which are encoded as \Base64:
184
+ #
185
+ # # Base64.encode64("\n\n\n") # => "CgoK\n"
186
+ # s = "This is line 1\nThis is line 2\n"
187
+ # Base64.encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n"
188
+ module Base64
189
+ private
190
+
191
+ # Returns a string containing the decoding of an RFC-2045-compliant
192
+ # \Base64-encoded string +str+:
193
+ #
194
+ # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n"
195
+ # Base64.decode64(s) # => "This is line 1\nThis is line 2\n"
196
+ #
197
+ # Non-\Base64 characters in +str+ are ignored;
198
+ # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above:
199
+ # these include newline characters and characters <tt>-</tt> and <tt>/</tt>:
200
+ #
201
+ # Base64.decode64("\x00\n-_") # => ""
202
+ #
203
+ # Padding in +str+ (even if incorrect) is ignored:
204
+ #
205
+ # Base64.decode64("MDEyMzQ1Njc") # => "01234567"
206
+ # Base64.decode64("MDEyMzQ1Njc=") # => "01234567"
207
+ # Base64.decode64("MDEyMzQ1Njc==") # => "01234567"
208
+ #
209
+ # source://base64//base64.rb#241
210
+ def decode64(str); end
211
+
212
+ # Returns a string containing the RFC-2045-compliant \Base64-encoding of +bin+.
213
+ #
214
+ # Per RFC 2045, the returned string may contain the URL-unsafe characters
215
+ # <tt>+</tt> or <tt>/</tt>;
216
+ # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above:
217
+ #
218
+ # Base64.encode64("\xFB\xEF\xBE") # => "++++\n"
219
+ # Base64.encode64("\xFF\xFF\xFF") # => "////\n"
220
+ #
221
+ # The returned string may include padding;
222
+ # see {Padding}[Base64.html#module-Base64-label-Padding] above.
223
+ #
224
+ # Base64.encode64('*') # => "Kg==\n"
225
+ #
226
+ # The returned string ends with a newline character, and if sufficiently long
227
+ # will have one or more embedded newline characters;
228
+ # see {Newlines}[Base64.html#module-Base64-label-Newlines] above:
229
+ #
230
+ # Base64.encode64('*') # => "Kg==\n"
231
+ # Base64.encode64('*' * 46)
232
+ # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq\nKg==\n"
233
+ #
234
+ # The string to be encoded may itself contain newlines,
235
+ # which will be encoded as ordinary \Base64:
236
+ #
237
+ # Base64.encode64("\n\n\n") # => "CgoK\n"
238
+ # s = "This is line 1\nThis is line 2\n"
239
+ # Base64.encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n"
240
+ #
241
+ # source://base64//base64.rb#219
242
+ def encode64(bin); end
243
+
244
+ # Returns a string containing the decoding of an RFC-2045-compliant
245
+ # \Base64-encoded string +str+:
246
+ #
247
+ # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK"
248
+ # Base64.strict_decode64(s) # => "This is line 1\nThis is line 2\n"
249
+ #
250
+ # Non-\Base64 characters in +str+ not allowed;
251
+ # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above:
252
+ # these include newline characters and characters <tt>-</tt> and <tt>/</tt>:
253
+ #
254
+ # Base64.strict_decode64("\n") # Raises ArgumentError
255
+ # Base64.strict_decode64('-') # Raises ArgumentError
256
+ # Base64.strict_decode64('_') # Raises ArgumentError
257
+ #
258
+ # Padding in +str+, if present, must be correct:
259
+ #
260
+ # Base64.strict_decode64("MDEyMzQ1Njc") # Raises ArgumentError
261
+ # Base64.strict_decode64("MDEyMzQ1Njc=") # => "01234567"
262
+ # Base64.strict_decode64("MDEyMzQ1Njc==") # Raises ArgumentError
263
+ #
264
+ # source://base64//base64.rb#297
265
+ def strict_decode64(str); end
266
+
267
+ # Returns a string containing the RFC-2045-compliant \Base64-encoding of +bin+.
268
+ #
269
+ # Per RFC 2045, the returned string may contain the URL-unsafe characters
270
+ # <tt>+</tt> or <tt>/</tt>;
271
+ # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above:
272
+ #
273
+ # Base64.strict_encode64("\xFB\xEF\xBE") # => "++++\n"
274
+ # Base64.strict_encode64("\xFF\xFF\xFF") # => "////\n"
275
+ #
276
+ # The returned string may include padding;
277
+ # see {Padding}[Base64.html#module-Base64-label-Padding] above.
278
+ #
279
+ # Base64.strict_encode64('*') # => "Kg==\n"
280
+ #
281
+ # The returned string will have no newline characters, regardless of its length;
282
+ # see {Newlines}[Base64.html#module-Base64-label-Newlines] above:
283
+ #
284
+ # Base64.strict_encode64('*') # => "Kg=="
285
+ # Base64.strict_encode64('*' * 46)
286
+ # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg=="
287
+ #
288
+ # The string to be encoded may itself contain newlines,
289
+ # which will be encoded as ordinary \Base64:
290
+ #
291
+ # Base64.strict_encode64("\n\n\n") # => "CgoK"
292
+ # s = "This is line 1\nThis is line 2\n"
293
+ # Base64.strict_encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK"
294
+ #
295
+ # source://base64//base64.rb#273
296
+ def strict_encode64(bin); end
297
+
298
+ # Returns the decoding of an RFC-4648-compliant \Base64-encoded string +str+:
299
+ #
300
+ # +str+ may not contain non-Base64 characters;
301
+ # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above:
302
+ #
303
+ # Base64.urlsafe_decode64('+') # Raises ArgumentError.
304
+ # Base64.urlsafe_decode64('/') # Raises ArgumentError.
305
+ # Base64.urlsafe_decode64("\n") # Raises ArgumentError.
306
+ #
307
+ # Padding in +str+, if present, must be correct:
308
+ # see {Padding}[Base64.html#module-Base64-label-Padding], above:
309
+ #
310
+ # Base64.urlsafe_decode64("MDEyMzQ1Njc") # => "01234567"
311
+ # Base64.urlsafe_decode64("MDEyMzQ1Njc=") # => "01234567"
312
+ # Base64.urlsafe_decode64("MDEyMzQ1Njc==") # Raises ArgumentError.
313
+ #
314
+ # source://base64//base64.rb#351
315
+ def urlsafe_decode64(str); end
316
+
317
+ # Returns the RFC-4648-compliant \Base64-encoding of +bin+.
318
+ #
319
+ # Per RFC 4648, the returned string will not contain the URL-unsafe characters
320
+ # <tt>+</tt> or <tt>/</tt>,
321
+ # but instead may contain the URL-safe characters
322
+ # <tt>-</tt> and <tt>_</tt>;
323
+ # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above:
324
+ #
325
+ # Base64.urlsafe_encode64("\xFB\xEF\xBE") # => "----"
326
+ # Base64.urlsafe_encode64("\xFF\xFF\xFF") # => "____"
327
+ #
328
+ # By default, the returned string may have padding;
329
+ # see {Padding}[Base64.html#module-Base64-label-Padding], above:
330
+ #
331
+ # Base64.urlsafe_encode64('*') # => "Kg=="
332
+ #
333
+ # Optionally, you can suppress padding:
334
+ #
335
+ # Base64.urlsafe_encode64('*', padding: false) # => "Kg"
336
+ #
337
+ # The returned string will have no newline characters, regardless of its length;
338
+ # see {Newlines}[Base64.html#module-Base64-label-Newlines] above:
339
+ #
340
+ # Base64.urlsafe_encode64('*') # => "Kg=="
341
+ # Base64.urlsafe_encode64('*' * 46)
342
+ # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg=="
343
+ #
344
+ # source://base64//base64.rb#328
345
+ def urlsafe_encode64(bin, padding: T.unsafe(nil)); end
346
+
347
+ class << self
348
+ # Returns a string containing the decoding of an RFC-2045-compliant
349
+ # \Base64-encoded string +str+:
350
+ #
351
+ # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n"
352
+ # Base64.decode64(s) # => "This is line 1\nThis is line 2\n"
353
+ #
354
+ # Non-\Base64 characters in +str+ are ignored;
355
+ # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above:
356
+ # these include newline characters and characters <tt>-</tt> and <tt>/</tt>:
357
+ #
358
+ # Base64.decode64("\x00\n-_") # => ""
359
+ #
360
+ # Padding in +str+ (even if incorrect) is ignored:
361
+ #
362
+ # Base64.decode64("MDEyMzQ1Njc") # => "01234567"
363
+ # Base64.decode64("MDEyMzQ1Njc=") # => "01234567"
364
+ # Base64.decode64("MDEyMzQ1Njc==") # => "01234567"
365
+ #
366
+ # source://base64//base64.rb#241
367
+ def decode64(str); end
368
+
369
+ # Returns a string containing the RFC-2045-compliant \Base64-encoding of +bin+.
370
+ #
371
+ # Per RFC 2045, the returned string may contain the URL-unsafe characters
372
+ # <tt>+</tt> or <tt>/</tt>;
373
+ # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above:
374
+ #
375
+ # Base64.encode64("\xFB\xEF\xBE") # => "++++\n"
376
+ # Base64.encode64("\xFF\xFF\xFF") # => "////\n"
377
+ #
378
+ # The returned string may include padding;
379
+ # see {Padding}[Base64.html#module-Base64-label-Padding] above.
380
+ #
381
+ # Base64.encode64('*') # => "Kg==\n"
382
+ #
383
+ # The returned string ends with a newline character, and if sufficiently long
384
+ # will have one or more embedded newline characters;
385
+ # see {Newlines}[Base64.html#module-Base64-label-Newlines] above:
386
+ #
387
+ # Base64.encode64('*') # => "Kg==\n"
388
+ # Base64.encode64('*' * 46)
389
+ # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq\nKg==\n"
390
+ #
391
+ # The string to be encoded may itself contain newlines,
392
+ # which will be encoded as ordinary \Base64:
393
+ #
394
+ # Base64.encode64("\n\n\n") # => "CgoK\n"
395
+ # s = "This is line 1\nThis is line 2\n"
396
+ # Base64.encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n"
397
+ #
398
+ # source://base64//base64.rb#219
399
+ def encode64(bin); end
400
+
401
+ # Returns a string containing the decoding of an RFC-2045-compliant
402
+ # \Base64-encoded string +str+:
403
+ #
404
+ # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK"
405
+ # Base64.strict_decode64(s) # => "This is line 1\nThis is line 2\n"
406
+ #
407
+ # Non-\Base64 characters in +str+ not allowed;
408
+ # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above:
409
+ # these include newline characters and characters <tt>-</tt> and <tt>/</tt>:
410
+ #
411
+ # Base64.strict_decode64("\n") # Raises ArgumentError
412
+ # Base64.strict_decode64('-') # Raises ArgumentError
413
+ # Base64.strict_decode64('_') # Raises ArgumentError
414
+ #
415
+ # Padding in +str+, if present, must be correct:
416
+ #
417
+ # Base64.strict_decode64("MDEyMzQ1Njc") # Raises ArgumentError
418
+ # Base64.strict_decode64("MDEyMzQ1Njc=") # => "01234567"
419
+ # Base64.strict_decode64("MDEyMzQ1Njc==") # Raises ArgumentError
420
+ #
421
+ # source://base64//base64.rb#297
422
+ def strict_decode64(str); end
423
+
424
+ # Returns a string containing the RFC-2045-compliant \Base64-encoding of +bin+.
425
+ #
426
+ # Per RFC 2045, the returned string may contain the URL-unsafe characters
427
+ # <tt>+</tt> or <tt>/</tt>;
428
+ # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above:
429
+ #
430
+ # Base64.strict_encode64("\xFB\xEF\xBE") # => "++++\n"
431
+ # Base64.strict_encode64("\xFF\xFF\xFF") # => "////\n"
432
+ #
433
+ # The returned string may include padding;
434
+ # see {Padding}[Base64.html#module-Base64-label-Padding] above.
435
+ #
436
+ # Base64.strict_encode64('*') # => "Kg==\n"
437
+ #
438
+ # The returned string will have no newline characters, regardless of its length;
439
+ # see {Newlines}[Base64.html#module-Base64-label-Newlines] above:
440
+ #
441
+ # Base64.strict_encode64('*') # => "Kg=="
442
+ # Base64.strict_encode64('*' * 46)
443
+ # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg=="
444
+ #
445
+ # The string to be encoded may itself contain newlines,
446
+ # which will be encoded as ordinary \Base64:
447
+ #
448
+ # Base64.strict_encode64("\n\n\n") # => "CgoK"
449
+ # s = "This is line 1\nThis is line 2\n"
450
+ # Base64.strict_encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK"
451
+ #
452
+ # source://base64//base64.rb#273
453
+ def strict_encode64(bin); end
454
+
455
+ # Returns the decoding of an RFC-4648-compliant \Base64-encoded string +str+:
456
+ #
457
+ # +str+ may not contain non-Base64 characters;
458
+ # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above:
459
+ #
460
+ # Base64.urlsafe_decode64('+') # Raises ArgumentError.
461
+ # Base64.urlsafe_decode64('/') # Raises ArgumentError.
462
+ # Base64.urlsafe_decode64("\n") # Raises ArgumentError.
463
+ #
464
+ # Padding in +str+, if present, must be correct:
465
+ # see {Padding}[Base64.html#module-Base64-label-Padding], above:
466
+ #
467
+ # Base64.urlsafe_decode64("MDEyMzQ1Njc") # => "01234567"
468
+ # Base64.urlsafe_decode64("MDEyMzQ1Njc=") # => "01234567"
469
+ # Base64.urlsafe_decode64("MDEyMzQ1Njc==") # Raises ArgumentError.
470
+ #
471
+ # source://base64//base64.rb#351
472
+ def urlsafe_decode64(str); end
473
+
474
+ # Returns the RFC-4648-compliant \Base64-encoding of +bin+.
475
+ #
476
+ # Per RFC 4648, the returned string will not contain the URL-unsafe characters
477
+ # <tt>+</tt> or <tt>/</tt>,
478
+ # but instead may contain the URL-safe characters
479
+ # <tt>-</tt> and <tt>_</tt>;
480
+ # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above:
481
+ #
482
+ # Base64.urlsafe_encode64("\xFB\xEF\xBE") # => "----"
483
+ # Base64.urlsafe_encode64("\xFF\xFF\xFF") # => "____"
484
+ #
485
+ # By default, the returned string may have padding;
486
+ # see {Padding}[Base64.html#module-Base64-label-Padding], above:
487
+ #
488
+ # Base64.urlsafe_encode64('*') # => "Kg=="
489
+ #
490
+ # Optionally, you can suppress padding:
491
+ #
492
+ # Base64.urlsafe_encode64('*', padding: false) # => "Kg"
493
+ #
494
+ # The returned string will have no newline characters, regardless of its length;
495
+ # see {Newlines}[Base64.html#module-Base64-label-Newlines] above:
496
+ #
497
+ # Base64.urlsafe_encode64('*') # => "Kg=="
498
+ # Base64.urlsafe_encode64('*' * 46)
499
+ # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg=="
500
+ #
501
+ # source://base64//base64.rb#328
502
+ def urlsafe_encode64(bin, padding: T.unsafe(nil)); end
503
+ end
504
+ end
505
+
506
+ # source://base64//base64.rb#186
507
+ Base64::VERSION = T.let(T.unsafe(nil), String)