expo_notifier 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 (113) hide show
  1. checksums.yaml +7 -0
  2. data/.ruby-version +1 -0
  3. data/CHANGELOG.md +3 -0
  4. data/LICENSE.txt +21 -0
  5. data/README.md +172 -0
  6. data/Rakefile +17 -0
  7. data/lib/expo_notifier/mapper/base.rb +30 -0
  8. data/lib/expo_notifier/mapper/error.rb +24 -0
  9. data/lib/expo_notifier/mapper/push_message.rb +132 -0
  10. data/lib/expo_notifier/mapper/push_messages.rb +15 -0
  11. data/lib/expo_notifier/mapper/push_receipt.rb +23 -0
  12. data/lib/expo_notifier/mapper/push_receipt_error_details.rb +23 -0
  13. data/lib/expo_notifier/mapper/push_receipt_ids.rb +16 -0
  14. data/lib/expo_notifier/mapper/push_receipts.rb +38 -0
  15. data/lib/expo_notifier/mapper/push_ticket.rb +30 -0
  16. data/lib/expo_notifier/mapper/push_ticket_error_details.rb +19 -0
  17. data/lib/expo_notifier/mapper/push_tickets.rb +26 -0
  18. data/lib/expo_notifier/mapper/rich_content.rb +17 -0
  19. data/lib/expo_notifier/request/base.rb +162 -0
  20. data/lib/expo_notifier/request/get_push_notification_receipts.rb +18 -0
  21. data/lib/expo_notifier/request/send_push_notifications.rb +26 -0
  22. data/lib/expo_notifier/response.rb +93 -0
  23. data/lib/expo_notifier/sorbet_shim.rb +18 -0
  24. data/lib/expo_notifier/version.rb +6 -0
  25. data/lib/expo_notifier.rb +19 -0
  26. data/sorbet/config +6 -0
  27. data/sorbet/rbi/annotations/.gitattributes +1 -0
  28. data/sorbet/rbi/annotations/activesupport.rbi +495 -0
  29. data/sorbet/rbi/annotations/faraday.rbi +17 -0
  30. data/sorbet/rbi/annotations/minitest.rbi +119 -0
  31. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  32. data/sorbet/rbi/annotations/webmock.rbi +9 -0
  33. data/sorbet/rbi/dsl/.gitattributes +1 -0
  34. data/sorbet/rbi/dsl/active_support/callbacks.rbi +21 -0
  35. data/sorbet/rbi/dsl/expo_notifier/mapper/base.rbi +12 -0
  36. data/sorbet/rbi/dsl/expo_notifier/mapper/error.rbi +42 -0
  37. data/sorbet/rbi/dsl/expo_notifier/mapper/push_message.rbi +263 -0
  38. data/sorbet/rbi/dsl/expo_notifier/mapper/push_messages.rbi +29 -0
  39. data/sorbet/rbi/dsl/expo_notifier/mapper/push_receipt.rbi +45 -0
  40. data/sorbet/rbi/dsl/expo_notifier/mapper/push_receipt_error_details.rbi +38 -0
  41. data/sorbet/rbi/dsl/expo_notifier/mapper/push_receipt_ids.rbi +20 -0
  42. data/sorbet/rbi/dsl/expo_notifier/mapper/push_receipts.rbi +25 -0
  43. data/sorbet/rbi/dsl/expo_notifier/mapper/push_ticket.rbi +59 -0
  44. data/sorbet/rbi/dsl/expo_notifier/mapper/push_ticket_error_details.rbi +32 -0
  45. data/sorbet/rbi/dsl/expo_notifier/mapper/push_tickets.rbi +54 -0
  46. data/sorbet/rbi/dsl/expo_notifier/mapper/rich_content.rbi +26 -0
  47. data/sorbet/rbi/dsl/time.rbi +13 -0
  48. data/sorbet/rbi/gems/.gitattributes +1 -0
  49. data/sorbet/rbi/gems/activesupport@8.1.1.rbi +22456 -0
  50. data/sorbet/rbi/gems/addressable@2.8.8.rbi +2005 -0
  51. data/sorbet/rbi/gems/ast@2.4.3.rbi +586 -0
  52. data/sorbet/rbi/gems/base64@0.3.0.rbi +545 -0
  53. data/sorbet/rbi/gems/benchmark@0.5.0.rbi +637 -0
  54. data/sorbet/rbi/gems/bigdecimal@4.0.1.rbi +409 -0
  55. data/sorbet/rbi/gems/booleans@0.1.3.rbi +31 -0
  56. data/sorbet/rbi/gems/concurrent-ruby@1.3.6.rbi +11729 -0
  57. data/sorbet/rbi/gems/connection_pool@3.0.2.rbi +9 -0
  58. data/sorbet/rbi/gems/crack@1.0.1.rbi +145 -0
  59. data/sorbet/rbi/gems/date@3.5.1.rbi +403 -0
  60. data/sorbet/rbi/gems/drb@2.2.3.rbi +1661 -0
  61. data/sorbet/rbi/gems/erb@6.0.1.rbi +815 -0
  62. data/sorbet/rbi/gems/erubi@1.13.1.rbi +157 -0
  63. data/sorbet/rbi/gems/faraday-net_http@3.4.2.rbi +72 -0
  64. data/sorbet/rbi/gems/faraday@2.14.0.rbi +3301 -0
  65. data/sorbet/rbi/gems/hashdiff@1.2.1.rbi +355 -0
  66. data/sorbet/rbi/gems/i18n@1.14.8.rbi +2383 -0
  67. data/sorbet/rbi/gems/io-console@0.8.2.rbi +9 -0
  68. data/sorbet/rbi/gems/json@2.18.0.rbi +2278 -0
  69. data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +323 -0
  70. data/sorbet/rbi/gems/logger@1.7.0.rbi +963 -0
  71. data/sorbet/rbi/gems/minitest@6.0.1.rbi +1524 -0
  72. data/sorbet/rbi/gems/net-http@0.9.1.rbi +4304 -0
  73. data/sorbet/rbi/gems/netrc@0.11.0.rbi +177 -0
  74. data/sorbet/rbi/gems/parallel@1.27.0.rbi +291 -0
  75. data/sorbet/rbi/gems/parser@3.3.10.0.rbi +5537 -0
  76. data/sorbet/rbi/gems/pp@0.6.3.rbi +390 -0
  77. data/sorbet/rbi/gems/prettyprint@0.2.0.rbi +477 -0
  78. data/sorbet/rbi/gems/prism@1.6.0.rbi +42126 -0
  79. data/sorbet/rbi/gems/psych@5.3.1.rbi +2556 -0
  80. data/sorbet/rbi/gems/public_suffix@7.0.2.rbi +957 -0
  81. data/sorbet/rbi/gems/racc@1.8.1.rbi +168 -0
  82. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +404 -0
  83. data/sorbet/rbi/gems/rake@13.3.1.rbi +3038 -0
  84. data/sorbet/rbi/gems/rbi@0.3.8.rbi +5238 -0
  85. data/sorbet/rbi/gems/rbs@4.0.0.dev.4.rbi +7805 -0
  86. data/sorbet/rbi/gems/regexp_parser@2.11.3.rbi +3849 -0
  87. data/sorbet/rbi/gems/reline@0.6.3.rbi +2995 -0
  88. data/sorbet/rbi/gems/require-hooks@0.2.2.rbi +110 -0
  89. data/sorbet/rbi/gems/rexml@3.4.4.rbi +5258 -0
  90. data/sorbet/rbi/gems/rubocop-espago@1.2.0.rbi +9 -0
  91. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1318 -0
  92. data/sorbet/rbi/gems/securerandom@0.4.1.rbi +75 -0
  93. data/sorbet/rbi/gems/shale-builder@0.8.5.rbi +267 -0
  94. data/sorbet/rbi/gems/shale@1.2.2.rbi +2323 -0
  95. data/sorbet/rbi/gems/shoulda-context@2.0.0.rbi +563 -0
  96. data/sorbet/rbi/gems/spoom@1.7.11.rbi +5878 -0
  97. data/sorbet/rbi/gems/stringio@3.2.0.rbi +9 -0
  98. data/sorbet/rbi/gems/tapioca@0.17.4.rbi +3507 -0
  99. data/sorbet/rbi/gems/thor@1.4.0.rbi +4399 -0
  100. data/sorbet/rbi/gems/tsort@0.2.0.rbi +393 -0
  101. data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5919 -0
  102. data/sorbet/rbi/gems/unicode-display_width@3.2.0.rbi +132 -0
  103. data/sorbet/rbi/gems/unicode-emoji@4.2.0.rbi +254 -0
  104. data/sorbet/rbi/gems/uri@1.1.1.rbi +2407 -0
  105. data/sorbet/rbi/gems/vcr@6.4.0.rbi +3055 -0
  106. data/sorbet/rbi/gems/webmock@3.26.1.rbi +1816 -0
  107. data/sorbet/rbi/shims/gems/set.rbi +2 -0
  108. data/sorbet/rbi/shims/gems/shale.rbi +27 -0
  109. data/sorbet/rbi/shims/gems/shoulda-context.rbi +20 -0
  110. data/sorbet/tapioca/config.yml +21 -0
  111. data/sorbet/tapioca/extensions/load_gem.rb +1 -0
  112. data/sorbet/tapioca/require.rb +15 -0
  113. metadata +228 -0
@@ -0,0 +1,815 @@
1
+ # typed: false
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `erb` gem.
5
+ # Please instead update this file by running `bin/tapioca gem erb`.
6
+
7
+
8
+ # source://erb//lib/erb/version.rb#2
9
+ class ERB
10
+ # :markup: markdown
11
+ #
12
+ # :call-seq:
13
+ # ERB.new(template, trim_mode: nil, eoutvar: '_erbout')
14
+ #
15
+ # Returns a new \ERB object containing the given string +template+.
16
+ #
17
+ # For details about `template`, its embedded tags, and generated results, see ERB.
18
+ #
19
+ # **Keyword Argument `trim_mode`**
20
+ #
21
+ # You can use keyword argument `trim_mode: '%'`
22
+ # to enable the [shorthand format][shorthand format] for execution tags.
23
+ #
24
+ # This value allows [blank line control][blank line control]:
25
+ #
26
+ # - `'-'`: Omit each blank line ending with `'%>'`.
27
+ #
28
+ # Other values allow [newline control][newline control]:
29
+ #
30
+ # - `'>'`: Omit newline for each line ending with `'%>'`.
31
+ # - `'<>'`: Omit newline for each line starting with `'<%'` and ending with `'%>'`.
32
+ #
33
+ # You can also [combine trim modes][combine trim modes].
34
+ #
35
+ # **Keyword Argument `eoutvar`**
36
+ #
37
+ # The string value of keyword argument `eoutvar` specifies the name of the variable
38
+ # that method #result uses to construct its result string;
39
+ # see #src.
40
+ #
41
+ # This is useful when you need to run multiple \ERB templates through the same binding
42
+ # and/or when you want to control where output ends up.
43
+ #
44
+ # It's good practice to choose a variable name that begins with an underscore: `'_'`.
45
+ #
46
+ # [blank line control]: rdoc-ref:ERB@Suppressing+Unwanted+Blank+Lines
47
+ # [combine trim modes]: rdoc-ref:ERB@Combining+Trim+Modes
48
+ # [newline control]: rdoc-ref:ERB@Suppressing+Unwanted+Newlines
49
+ # [shorthand format]: rdoc-ref:ERB@Shorthand+Format+for+Execution+Tags
50
+ #
51
+ # @return [ERB] a new instance of ERB
52
+ #
53
+ # source://erb//lib/erb.rb#832
54
+ def initialize(str, trim_mode: T.unsafe(nil), eoutvar: T.unsafe(nil)); end
55
+
56
+ # :markup: markdown
57
+ #
58
+ # :call-seq:
59
+ # def_class(super_class = Object, method_name = 'result') -> new_class
60
+ #
61
+ # Returns a new nameless class whose superclass is `super_class`,
62
+ # and which has instance method `method_name`.
63
+ #
64
+ # Create a template from HTML that has embedded expression tags that use `@arg1` and `@arg2`:
65
+ #
66
+ # ```
67
+ # html = <<TEMPLATE
68
+ # <html>
69
+ # <body>
70
+ # <p><%= @arg1 %></p>
71
+ # <p><%= @arg2 %></p>
72
+ # </body>
73
+ # </html>
74
+ # TEMPLATE
75
+ # template = ERB.new(html)
76
+ # ```
77
+ #
78
+ # Create a base class that has `@arg1` and `@arg2`:
79
+ #
80
+ # ```
81
+ # class MyBaseClass
82
+ # def initialize(arg1, arg2)
83
+ # @arg1 = arg1
84
+ # @arg2 = arg2
85
+ # end
86
+ # end
87
+ # ```
88
+ #
89
+ # Use method #def_class to create a subclass that has method `:render`:
90
+ #
91
+ # ```
92
+ # MySubClass = template.def_class(MyBaseClass, :render)
93
+ # ```
94
+ #
95
+ # Generate the result:
96
+ #
97
+ # ```
98
+ # puts MySubClass.new('foo', 123).render
99
+ # <html>
100
+ # <body>
101
+ # <p>foo</p>
102
+ # <p>123</p>
103
+ # </body>
104
+ # </html>
105
+ # ```
106
+ #
107
+ # source://erb//lib/erb.rb#1170
108
+ def def_class(superklass = T.unsafe(nil), methodname = T.unsafe(nil)); end
109
+
110
+ # :markup: markdown
111
+ #
112
+ # :call-seq:
113
+ # def_method(module, method_signature, filename = '(ERB)') -> method_name
114
+ #
115
+ # Creates and returns a new instance method in the given module `module`;
116
+ # returns the method name as a symbol.
117
+ #
118
+ # The method is created from the given `method_signature`,
119
+ # which consists of the method name and its argument names (if any).
120
+ #
121
+ # The `filename` sets the value of #filename;
122
+ # see [Error Reporting][error reporting].
123
+ #
124
+ # [error reporting]: rdoc-ref:ERB@Error+Reporting
125
+ #
126
+ # ```
127
+ # template = '<%= arg1 %> <%= arg2 %>'
128
+ # erb = ERB.new(template)
129
+ # MyModule = Module.new
130
+ # erb.def_method(MyModule, 'render(arg1, arg2)') # => :render
131
+ # class MyClass; include MyModule; end
132
+ # MyClass.new.render('foo', 123) # => "foo 123"
133
+ # ```
134
+ #
135
+ # source://erb//lib/erb.rb#1088
136
+ def def_method(mod, methodname, fname = T.unsafe(nil)); end
137
+
138
+ # :markup: markdown
139
+ #
140
+ # :call-seq:
141
+ # def_module(method_name = 'erb') -> new_module
142
+ #
143
+ # Returns a new nameless module that has instance method `method_name`.
144
+ #
145
+ # ```
146
+ # template = '<%= arg1 %> <%= arg2 %>'
147
+ # erb = ERB.new(template)
148
+ # MyModule = template.def_module('render(arg1, arg2)')
149
+ # class MyClass
150
+ # include MyModule
151
+ # end
152
+ # MyClass.new.render('foo', 123)
153
+ # # => "foo 123"
154
+ # ```
155
+ #
156
+ # source://erb//lib/erb.rb#1113
157
+ def def_module(methodname = T.unsafe(nil)); end
158
+
159
+ # :markup: markdown
160
+ #
161
+ # Returns the encoding of `self`;
162
+ # see [Encodings][encodings]:
163
+ #
164
+ # [encodings]: rdoc-ref:ERB@Encodings
165
+ #
166
+ # source://erb//lib/erb.rb#909
167
+ def encoding; end
168
+
169
+ # :markup: markdown
170
+ #
171
+ # Sets or returns the file name to be used in reporting errors;
172
+ # see [Error Reporting][error reporting].
173
+ #
174
+ # [error reporting]: rdoc-ref:ERB@Error+Reporting
175
+ #
176
+ # source://erb//lib/erb.rb#917
177
+ def filename; end
178
+
179
+ # :markup: markdown
180
+ #
181
+ # Sets or returns the file name to be used in reporting errors;
182
+ # see [Error Reporting][error reporting].
183
+ #
184
+ # [error reporting]: rdoc-ref:ERB@Error+Reporting
185
+ #
186
+ # source://erb//lib/erb.rb#917
187
+ def filename=(_arg0); end
188
+
189
+ # :markup: markdown
190
+ #
191
+ # Sets or returns the line number to be used in reporting errors;
192
+ # see [Error Reporting][error reporting].
193
+ #
194
+ # [error reporting]: rdoc-ref:ERB@Error+Reporting
195
+ #
196
+ # source://erb//lib/erb.rb#925
197
+ def lineno; end
198
+
199
+ # :markup: markdown
200
+ #
201
+ # Sets or returns the line number to be used in reporting errors;
202
+ # see [Error Reporting][error reporting].
203
+ #
204
+ # [error reporting]: rdoc-ref:ERB@Error+Reporting
205
+ #
206
+ # source://erb//lib/erb.rb#925
207
+ def lineno=(_arg0); end
208
+
209
+ # :markup: markdown
210
+ #
211
+ # :call-seq:
212
+ # location = [filename, lineno] => [filename, lineno]
213
+ # location = filename -> filename
214
+ #
215
+ # Sets the values of #filename and, if given, #lineno;
216
+ # see [Error Reporting][error reporting].
217
+ #
218
+ # [error reporting]: rdoc-ref:ERB@Error+Reporting
219
+ #
220
+ # source://erb//lib/erb.rb#937
221
+ def location=(_arg0); end
222
+
223
+ # :markup: markdown
224
+ #
225
+ # :call-seq:
226
+ # make_compiler -> erb_compiler
227
+ #
228
+ # Returns a new ERB::Compiler with the given `trim_mode`;
229
+ # for `trim_mode` values, see ERB.new:
230
+ #
231
+ # ```
232
+ # ERB.new('').make_compiler(nil)
233
+ # # => #<ERB::Compiler:0x000001cff9467678 @insert_cmd="print", @percent=false, @post_cmd=[], @pre_cmd=[], @put_cmd="print", @trim_mode=nil>
234
+ # ```
235
+ #
236
+ # source://erb//lib/erb.rb#854
237
+ def make_compiler(trim_mode); end
238
+
239
+ # :markup: markdown
240
+ #
241
+ # :call-seq:
242
+ # result(binding = new_toplevel) -> new_string
243
+ #
244
+ # Returns the string result formed by processing \ERB tags found in the stored template in `self`.
245
+ #
246
+ # With no argument given, uses the default binding;
247
+ # see [Default Binding][default binding].
248
+ #
249
+ # With argument `binding` given, uses the local binding;
250
+ # see [Local Binding][local binding].
251
+ #
252
+ # See also #result_with_hash.
253
+ #
254
+ # [default binding]: rdoc-ref:ERB@Default+Binding
255
+ # [local binding]: rdoc-ref:ERB@Local+Binding
256
+ #
257
+ # source://erb//lib/erb.rb#1008
258
+ def result(b = T.unsafe(nil)); end
259
+
260
+ # :markup: markdown
261
+ #
262
+ # :call-seq:
263
+ # result_with_hash(hash) -> new_string
264
+ #
265
+ # Returns the string result formed by processing \ERB tags found in the stored string in `self`;
266
+ # see [Augmented Binding][augmented binding].
267
+ #
268
+ # See also #result.
269
+ #
270
+ # [augmented binding]: rdoc-ref:ERB@Augmented+Binding
271
+ #
272
+ # source://erb//lib/erb.rb#1027
273
+ def result_with_hash(hash); end
274
+
275
+ # :markup: markdown
276
+ #
277
+ # :call-seq:
278
+ # run(binding = new_toplevel) -> nil
279
+ #
280
+ # Like #result, but prints the result string (instead of returning it);
281
+ # returns `nil`.
282
+ #
283
+ # source://erb//lib/erb.rb#986
284
+ def run(b = T.unsafe(nil)); end
285
+
286
+ # :markup: markdown
287
+ #
288
+ # :call-seq:
289
+ # set_eoutvar(compiler, eoutvar = '_erbout') -> [eoutvar]
290
+ #
291
+ # Sets the `eoutvar` value in the ERB::Compiler object `compiler`;
292
+ # returns a 1-element array containing the value of `eoutvar`:
293
+ #
294
+ # ```
295
+ # template = ERB.new('')
296
+ # compiler = template.make_compiler(nil)
297
+ # pp compiler
298
+ # #<ERB::Compiler:0x000001cff8a9aa00
299
+ # @insert_cmd="print",
300
+ # @percent=false,
301
+ # @post_cmd=[],
302
+ # @pre_cmd=[],
303
+ # @put_cmd="print",
304
+ # @trim_mode=nil>
305
+ # template.set_eoutvar(compiler, '_foo') # => ["_foo"]
306
+ # pp compiler
307
+ # #<ERB::Compiler:0x000001cff8a9aa00
308
+ # @insert_cmd="_foo.<<",
309
+ # @percent=false,
310
+ # @post_cmd=["_foo"],
311
+ # @pre_cmd=["_foo = +''"],
312
+ # @put_cmd="_foo.<<",
313
+ # @trim_mode=nil>
314
+ # ```
315
+ #
316
+ # source://erb//lib/erb.rb#972
317
+ def set_eoutvar(compiler, eoutvar = T.unsafe(nil)); end
318
+
319
+ # :markup: markdown
320
+ #
321
+ # Returns the Ruby code that, when executed, generates the result;
322
+ # the code is executed by method #result,
323
+ # and by its wrapper methods #result_with_hash and #run:
324
+ #
325
+ # ```
326
+ # template = 'The time is <%= Time.now %>.'
327
+ # erb = ERB.new(template)
328
+ # erb.src
329
+ # # => "#coding:UTF-8\n_erbout = +''; _erbout.<< \"The time is \".freeze; _erbout.<<(( Time.now ).to_s); _erbout.<< \".\".freeze; _erbout"
330
+ # erb.result
331
+ # # => "The time is 2025-09-18 15:58:08 -0500."
332
+ # ```
333
+ #
334
+ # In a more readable format:
335
+ #
336
+ # ```
337
+ # # puts erb.src.split('; ')
338
+ # # #coding:UTF-8
339
+ # # _erbout = +''
340
+ # # _erbout.<< "The time is ".freeze
341
+ # # _erbout.<<(( Time.now ).to_s)
342
+ # # _erbout.<< ".".freeze
343
+ # # _erbout
344
+ # ```
345
+ #
346
+ # Variable `_erbout` is used to store the intermediate results in the code;
347
+ # the name `_erbout` is the default in ERB.new,
348
+ # and can be changed via keyword argument `eoutvar`:
349
+ #
350
+ # ```
351
+ # erb = ERB.new(template, eoutvar: '_foo')
352
+ # puts template.src.split('; ')
353
+ # #coding:UTF-8
354
+ # _foo = +''
355
+ # _foo.<< "The time is ".freeze
356
+ # _foo.<<(( Time.now ).to_s)
357
+ # _foo.<< ".".freeze
358
+ # _foo
359
+ # ```
360
+ #
361
+ # source://erb//lib/erb.rb#900
362
+ def src; end
363
+
364
+ private
365
+
366
+ # :markup: markdown
367
+ #
368
+ # :call-seq:
369
+ # new_toplevel(symbols) -> new_binding
370
+ #
371
+ # Returns a new binding based on `TOPLEVEL_BINDING`;
372
+ # used to create a default binding for a call to #result.
373
+ #
374
+ # See [Default Binding][default binding].
375
+ #
376
+ # Argument `symbols` is an array of symbols;
377
+ # each symbol `symbol` is defined as a new variable to hide and
378
+ # prevent it from overwriting a variable of the same name already
379
+ # defined within the binding.
380
+ #
381
+ # [default binding]: rdoc-ref:ERB@Default+Binding
382
+ #
383
+ # source://erb//lib/erb.rb#1051
384
+ def new_toplevel(vars = T.unsafe(nil)); end
385
+
386
+ class << self
387
+ # :markup: markdown
388
+ #
389
+ # :call-seq:
390
+ # self.version -> string
391
+ #
392
+ # Returns the string \ERB version.
393
+ #
394
+ # source://erb//lib/erb.rb#787
395
+ def version; end
396
+ end
397
+ end
398
+
399
+ # --
400
+ # ERB::Compiler
401
+ #
402
+ # Compiles ERB templates into Ruby code; the compiled code produces the
403
+ # template result when evaluated. ERB::Compiler provides hooks to define how
404
+ # generated output is handled.
405
+ #
406
+ # Internally ERB does something like this to generate the code returned by
407
+ # ERB#src:
408
+ #
409
+ # compiler = ERB::Compiler.new('<>')
410
+ # compiler.pre_cmd = ["_erbout=+''"]
411
+ # compiler.put_cmd = "_erbout.<<"
412
+ # compiler.insert_cmd = "_erbout.<<"
413
+ # compiler.post_cmd = ["_erbout"]
414
+ #
415
+ # code, enc = compiler.compile("Got <%= obj %>!\n")
416
+ # puts code
417
+ #
418
+ # <i>Generates</i>:
419
+ #
420
+ # #coding:UTF-8
421
+ # _erbout=+''; _erbout.<< "Got ".freeze; _erbout.<<(( obj ).to_s); _erbout.<< "!\n".freeze; _erbout
422
+ #
423
+ # By default the output is sent to the print method. For example:
424
+ #
425
+ # compiler = ERB::Compiler.new('<>')
426
+ # code, enc = compiler.compile("Got <%= obj %>!\n")
427
+ # puts code
428
+ #
429
+ # <i>Generates</i>:
430
+ #
431
+ # #coding:UTF-8
432
+ # print "Got ".freeze; print(( obj ).to_s); print "!\n".freeze
433
+ #
434
+ # == Evaluation
435
+ #
436
+ # The compiled code can be used in any context where the names in the code
437
+ # correctly resolve. Using the last example, each of these print 'Got It!'
438
+ #
439
+ # Evaluate using a variable:
440
+ #
441
+ # obj = 'It'
442
+ # eval code
443
+ #
444
+ # Evaluate using an input:
445
+ #
446
+ # mod = Module.new
447
+ # mod.module_eval %{
448
+ # def get(obj)
449
+ # #{code}
450
+ # end
451
+ # }
452
+ # extend mod
453
+ # get('It')
454
+ #
455
+ # Evaluate using an accessor:
456
+ #
457
+ # klass = Class.new Object
458
+ # klass.class_eval %{
459
+ # attr_accessor :obj
460
+ # def initialize(obj)
461
+ # @obj = obj
462
+ # end
463
+ # def get_it
464
+ # #{code}
465
+ # end
466
+ # }
467
+ # klass.new('It').get_it
468
+ #
469
+ # Good! See also ERB#def_method, ERB#def_module, and ERB#def_class.
470
+ #
471
+ # source://erb//lib/erb/compiler.rb#73
472
+ class ERB::Compiler
473
+ # Construct a new compiler using the trim_mode. See ERB::new for available
474
+ # trim modes.
475
+ #
476
+ # @return [Compiler] a new instance of Compiler
477
+ #
478
+ # source://erb//lib/erb/compiler.rb#433
479
+ def initialize(trim_mode); end
480
+
481
+ # source://erb//lib/erb/compiler.rb#315
482
+ def add_insert_cmd(out, content); end
483
+
484
+ # source://erb//lib/erb/compiler.rb#311
485
+ def add_put_cmd(out, content); end
486
+
487
+ # Compiles an ERB template into Ruby code. Returns an array of the code
488
+ # and encoding like ["code", Encoding].
489
+ #
490
+ # @raise [ArgumentError]
491
+ #
492
+ # source://erb//lib/erb/compiler.rb#321
493
+ def compile(s); end
494
+
495
+ # source://erb//lib/erb/compiler.rb#381
496
+ def compile_content(stag, out); end
497
+
498
+ # source://erb//lib/erb/compiler.rb#368
499
+ def compile_etag(etag, out, scanner); end
500
+
501
+ # source://erb//lib/erb/compiler.rb#344
502
+ def compile_stag(stag, out, scanner); end
503
+
504
+ # The command to handle text that is inserted prior to a newline
505
+ #
506
+ # source://erb//lib/erb/compiler.rb#446
507
+ def insert_cmd; end
508
+
509
+ # The command to handle text that is inserted prior to a newline
510
+ #
511
+ # source://erb//lib/erb/compiler.rb#446
512
+ def insert_cmd=(_arg0); end
513
+
514
+ # source://erb//lib/erb/compiler.rb#427
515
+ def make_scanner(src); end
516
+
517
+ # Returns the value of attribute percent.
518
+ #
519
+ # source://erb//lib/erb/compiler.rb#440
520
+ def percent; end
521
+
522
+ # An array of commands appended to compiled code
523
+ #
524
+ # source://erb//lib/erb/compiler.rb#452
525
+ def post_cmd; end
526
+
527
+ # An array of commands appended to compiled code
528
+ #
529
+ # source://erb//lib/erb/compiler.rb#452
530
+ def post_cmd=(_arg0); end
531
+
532
+ # An array of commands prepended to compiled code
533
+ #
534
+ # source://erb//lib/erb/compiler.rb#449
535
+ def pre_cmd; end
536
+
537
+ # An array of commands prepended to compiled code
538
+ #
539
+ # source://erb//lib/erb/compiler.rb#449
540
+ def pre_cmd=(_arg0); end
541
+
542
+ # source://erb//lib/erb/compiler.rb#398
543
+ def prepare_trim_mode(mode); end
544
+
545
+ # The command to handle text that ends with a newline
546
+ #
547
+ # source://erb//lib/erb/compiler.rb#443
548
+ def put_cmd; end
549
+
550
+ # The command to handle text that ends with a newline
551
+ #
552
+ # source://erb//lib/erb/compiler.rb#443
553
+ def put_cmd=(_arg0); end
554
+
555
+ # Returns the value of attribute trim_mode.
556
+ #
557
+ # source://erb//lib/erb/compiler.rb#440
558
+ def trim_mode; end
559
+
560
+ private
561
+
562
+ # A buffered text in #compile
563
+ #
564
+ # source://erb//lib/erb/compiler.rb#457
565
+ def content; end
566
+
567
+ # A buffered text in #compile
568
+ #
569
+ # source://erb//lib/erb/compiler.rb#457
570
+ def content=(_arg0); end
571
+
572
+ # source://erb//lib/erb/compiler.rb#459
573
+ def detect_magic_comment(s, enc = T.unsafe(nil)); end
574
+
575
+ # source://erb//lib/erb/compiler.rb#484
576
+ def warn_invalid_trim_mode(mode, uplevel:); end
577
+ end
578
+
579
+ # source://erb//lib/erb/compiler.rb#278
580
+ class ERB::Compiler::Buffer
581
+ # @return [Buffer] a new instance of Buffer
582
+ #
583
+ # source://erb//lib/erb/compiler.rb#279
584
+ def initialize(compiler, enc = T.unsafe(nil), frozen = T.unsafe(nil)); end
585
+
586
+ # source://erb//lib/erb/compiler.rb#301
587
+ def close; end
588
+
589
+ # source://erb//lib/erb/compiler.rb#295
590
+ def cr; end
591
+
592
+ # source://erb//lib/erb/compiler.rb#291
593
+ def push(cmd); end
594
+
595
+ # Returns the value of attribute script.
596
+ #
597
+ # source://erb//lib/erb/compiler.rb#289
598
+ def script; end
599
+ end
600
+
601
+ # source://erb//lib/erb/compiler.rb#254
602
+ class ERB::Compiler::ExplicitScanner < ::ERB::Compiler::Scanner
603
+ # source://erb//lib/erb/compiler.rb#255
604
+ def scan; end
605
+ end
606
+
607
+ # source://erb//lib/erb/compiler.rb#74
608
+ class ERB::Compiler::PercentLine
609
+ # @return [PercentLine] a new instance of PercentLine
610
+ #
611
+ # source://erb//lib/erb/compiler.rb#75
612
+ def initialize(str); end
613
+
614
+ # Returns the value of attribute value.
615
+ #
616
+ # source://erb//lib/erb/compiler.rb#79
617
+ def to_s; end
618
+
619
+ # Returns the value of attribute value.
620
+ #
621
+ # source://erb//lib/erb/compiler.rb#78
622
+ def value; end
623
+ end
624
+
625
+ # source://erb//lib/erb/compiler.rb#82
626
+ class ERB::Compiler::Scanner
627
+ # @return [Scanner] a new instance of Scanner
628
+ #
629
+ # source://erb//lib/erb/compiler.rb#108
630
+ def initialize(src, trim_mode, percent); end
631
+
632
+ # Returns the value of attribute etags.
633
+ #
634
+ # source://erb//lib/erb/compiler.rb#115
635
+ def etags; end
636
+
637
+ # source://erb//lib/erb/compiler.rb#117
638
+ def scan; end
639
+
640
+ # Returns the value of attribute stag.
641
+ #
642
+ # source://erb//lib/erb/compiler.rb#114
643
+ def stag; end
644
+
645
+ # Sets the attribute stag
646
+ #
647
+ # @param value the value to set the attribute stag to.
648
+ #
649
+ # source://erb//lib/erb/compiler.rb#114
650
+ def stag=(_arg0); end
651
+
652
+ # Returns the value of attribute stags.
653
+ #
654
+ # source://erb//lib/erb/compiler.rb#115
655
+ def stags; end
656
+
657
+ class << self
658
+ # source://erb//lib/erb/compiler.rb#97
659
+ def default_scanner=(klass); end
660
+
661
+ # source://erb//lib/erb/compiler.rb#101
662
+ def make_scanner(src, trim_mode, percent); end
663
+
664
+ # source://erb//lib/erb/compiler.rb#94
665
+ def regist_scanner(klass, trim_mode, percent); end
666
+
667
+ # source://erb//lib/erb/compiler.rb#86
668
+ def register_scanner(klass, trim_mode, percent); end
669
+ end
670
+ end
671
+
672
+ # source://erb//lib/erb/compiler.rb#107
673
+ ERB::Compiler::Scanner::DEFAULT_ETAGS = T.let(T.unsafe(nil), Array)
674
+
675
+ # source://erb//lib/erb/compiler.rb#106
676
+ ERB::Compiler::Scanner::DEFAULT_STAGS = T.let(T.unsafe(nil), Array)
677
+
678
+ # source://erb//lib/erb/compiler.rb#240
679
+ class ERB::Compiler::SimpleScanner < ::ERB::Compiler::Scanner
680
+ # source://erb//lib/erb/compiler.rb#241
681
+ def scan; end
682
+ end
683
+
684
+ # source://erb//lib/erb/compiler.rb#120
685
+ class ERB::Compiler::TrimScanner < ::ERB::Compiler::Scanner
686
+ # @return [TrimScanner] a new instance of TrimScanner
687
+ #
688
+ # source://erb//lib/erb/compiler.rb#121
689
+ def initialize(src, trim_mode, percent); end
690
+
691
+ # source://erb//lib/erb/compiler.rb#210
692
+ def explicit_trim_line(line); end
693
+
694
+ # @return [Boolean]
695
+ #
696
+ # source://erb//lib/erb/compiler.rb#229
697
+ def is_erb_stag?(s); end
698
+
699
+ # source://erb//lib/erb/compiler.rb#152
700
+ def percent_line(line, &block); end
701
+
702
+ # source://erb//lib/erb/compiler.rb#140
703
+ def scan(&block); end
704
+
705
+ # source://erb//lib/erb/compiler.rb#165
706
+ def scan_line(line); end
707
+
708
+ # source://erb//lib/erb/compiler.rb#174
709
+ def trim_line1(line); end
710
+
711
+ # source://erb//lib/erb/compiler.rb#188
712
+ def trim_line2(line); end
713
+ end
714
+
715
+ # :stopdoc:
716
+ #
717
+ # source://erb//lib/erb/compiler.rb#476
718
+ ERB::Compiler::WARNING_UPLEVEL = T.let(T.unsafe(nil), Integer)
719
+
720
+ # ERB::DefMethod
721
+ #
722
+ # Utility module to define eRuby script as instance method.
723
+ #
724
+ # === Example
725
+ #
726
+ # example.rhtml:
727
+ # <% for item in @items %>
728
+ # <b><%= item %></b>
729
+ # <% end %>
730
+ #
731
+ # example.rb:
732
+ # require 'erb'
733
+ # class MyClass
734
+ # extend ERB::DefMethod
735
+ # def_erb_method('render()', 'example.rhtml')
736
+ # def initialize(items)
737
+ # @items = items
738
+ # end
739
+ # end
740
+ # print MyClass.new([10,20,30]).render()
741
+ #
742
+ # result:
743
+ #
744
+ # <b>10</b>
745
+ #
746
+ # <b>20</b>
747
+ #
748
+ # <b>30</b>
749
+ #
750
+ # source://erb//lib/erb/def_method.rb#33
751
+ module ERB::DefMethod
752
+ private
753
+
754
+ # define _methodname_ as instance method of current module, using ERB
755
+ # object or eRuby file
756
+ #
757
+ # source://erb//lib/erb/def_method.rb#36
758
+ def def_erb_method(methodname, erb_or_fname); end
759
+
760
+ class << self
761
+ # define _methodname_ as instance method of current module, using ERB
762
+ # object or eRuby file
763
+ #
764
+ # source://erb//lib/erb/def_method.rb#46
765
+ def def_erb_method(methodname, erb_or_fname); end
766
+ end
767
+ end
768
+
769
+ module ERB::Escape; end
770
+
771
+ # ERB::Util
772
+ #
773
+ # A utility module for conversion routines, often handy in HTML generation.
774
+ #
775
+ # source://erb//lib/erb/util.rb#33
776
+ module ERB::Util
777
+ include ::ActiveSupport::CoreExt::ERBUtil
778
+ include ::ERB::Escape
779
+ extend ::ActiveSupport::CoreExt::ERBUtil
780
+
781
+ private
782
+
783
+ # cgi.gem <= v0.3.2
784
+ #
785
+ # source://erb//lib/erb/util.rb#74
786
+ def u(s); end
787
+
788
+ # cgi.gem <= v0.3.2
789
+ #
790
+ # source://erb//lib/erb/util.rb#64
791
+ def url_encode(s); end
792
+
793
+ class << self
794
+ # source://erb//lib/erb/util.rb#49
795
+ def h(s); end
796
+
797
+ # source://erb//lib/erb/util.rb#47
798
+ def html_escape(s); end
799
+
800
+ # cgi.gem <= v0.3.2
801
+ #
802
+ # source://erb//lib/erb/util.rb#75
803
+ def u(s); end
804
+
805
+ # cgi.gem <= v0.3.2
806
+ #
807
+ # source://erb//lib/erb/util.rb#76
808
+ def url_encode(s); end
809
+ end
810
+ end
811
+
812
+ # The string \ERB version.
813
+ #
814
+ # source://erb//lib/erb/version.rb#4
815
+ ERB::VERSION = T.let(T.unsafe(nil), String)