packwerk-haml 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +3 -0
  3. data/.rubocop.yml +75 -0
  4. data/Gemfile +22 -0
  5. data/Gemfile.lock +190 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +32 -0
  8. data/Rakefile +16 -0
  9. data/lib/packwerk_haml/parser.rb +64 -0
  10. data/lib/packwerk_haml/version.rb +6 -0
  11. data/lib/packwerk_haml.rb +8 -0
  12. data/packwerk-haml.gemspec +40 -0
  13. data/sig/packwerk/haml.rbs +4 -0
  14. data/sorbet/config +4 -0
  15. data/sorbet/rbi/annotations/.gitattributes +1 -0
  16. data/sorbet/rbi/annotations/actionview.rbi +75 -0
  17. data/sorbet/rbi/annotations/activesupport.rbi +136 -0
  18. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  19. data/sorbet/rbi/gems/.gitattributes +1 -0
  20. data/sorbet/rbi/gems/actionview@7.1.1.rbi +15004 -0
  21. data/sorbet/rbi/gems/activesupport@7.1.1.rbi +18784 -0
  22. data/sorbet/rbi/gems/ast@2.4.2.rbi +584 -0
  23. data/sorbet/rbi/gems/base64@0.1.1.rbi +172 -0
  24. data/sorbet/rbi/gems/better_html@2.0.2.rbi +529 -0
  25. data/sorbet/rbi/gems/bigdecimal@3.1.4.rbi +77 -0
  26. data/sorbet/rbi/gems/builder@3.2.4.rbi +8 -0
  27. data/sorbet/rbi/gems/concurrent-ruby@1.2.2.rbi +11545 -0
  28. data/sorbet/rbi/gems/connection_pool@2.4.1.rbi +8 -0
  29. data/sorbet/rbi/gems/constant_resolver@0.2.0.rbi +90 -0
  30. data/sorbet/rbi/gems/crass@1.0.6.rbi +622 -0
  31. data/sorbet/rbi/gems/drb@2.1.1.rbi +1313 -0
  32. data/sorbet/rbi/gems/erubi@1.12.0.rbi +145 -0
  33. data/sorbet/rbi/gems/haml@6.2.3.rbi +1619 -0
  34. data/sorbet/rbi/gems/i18n@1.14.1.rbi +2325 -0
  35. data/sorbet/rbi/gems/json@2.6.3.rbi +1533 -0
  36. data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +14237 -0
  37. data/sorbet/rbi/gems/loofah@2.21.4.rbi +1021 -0
  38. data/sorbet/rbi/gems/m@1.6.2.rbi +257 -0
  39. data/sorbet/rbi/gems/method_source@1.0.0.rbi +8 -0
  40. data/sorbet/rbi/gems/minitest-focus@1.4.0.rbi +91 -0
  41. data/sorbet/rbi/gems/minitest@5.20.0.rbi +1509 -0
  42. data/sorbet/rbi/gems/mutex_m@0.1.2.rbi +91 -0
  43. data/sorbet/rbi/gems/netrc@0.11.0.rbi +158 -0
  44. data/sorbet/rbi/gems/nokogiri@1.15.4.rbi +7317 -0
  45. data/sorbet/rbi/gems/packwerk@3.1.0-752d37add96b9f4bf28492d7db152f6523b1d29c.rbi +2370 -0
  46. data/sorbet/rbi/gems/parallel@1.23.0.rbi +273 -0
  47. data/sorbet/rbi/gems/parser@3.2.2.4.rbi +7253 -0
  48. data/sorbet/rbi/gems/prettier_print@1.2.1.rbi +951 -0
  49. data/sorbet/rbi/gems/racc@1.7.1.rbi +161 -0
  50. data/sorbet/rbi/gems/rails-dom-testing@2.2.0.rbi +8 -0
  51. data/sorbet/rbi/gems/rails-html-sanitizer@1.6.0.rbi +716 -0
  52. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +402 -0
  53. data/sorbet/rbi/gems/rake@13.0.6.rbi +3042 -0
  54. data/sorbet/rbi/gems/rbi@0.1.1.rbi +2926 -0
  55. data/sorbet/rbi/gems/regexp_parser@2.8.2.rbi +3749 -0
  56. data/sorbet/rbi/gems/rexml@3.2.6.rbi +4781 -0
  57. data/sorbet/rbi/gems/rubocop-ast@1.29.0.rbi +7075 -0
  58. data/sorbet/rbi/gems/rubocop-performance@1.19.1.rbi +3208 -0
  59. data/sorbet/rbi/gems/rubocop-shopify@2.14.0.rbi +8 -0
  60. data/sorbet/rbi/gems/rubocop-sorbet@0.7.4.rbi +1442 -0
  61. data/sorbet/rbi/gems/rubocop@1.57.0.rbi +56753 -0
  62. data/sorbet/rbi/gems/ruby-lsp@0.2.4.rbi +11 -0
  63. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1317 -0
  64. data/sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi +8 -0
  65. data/sorbet/rbi/gems/smart_properties@1.17.0.rbi +474 -0
  66. data/sorbet/rbi/gems/spoom@1.2.4.rbi +3777 -0
  67. data/sorbet/rbi/gems/syntax_tree@6.2.0.rbi +23136 -0
  68. data/sorbet/rbi/gems/tapioca@0.11.9.rbi +3498 -0
  69. data/sorbet/rbi/gems/temple@0.10.3.rbi +1738 -0
  70. data/sorbet/rbi/gems/thor@1.2.2.rbi +3965 -0
  71. data/sorbet/rbi/gems/tilt@2.3.0.rbi +925 -0
  72. data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5917 -0
  73. data/sorbet/rbi/gems/unicode-display_width@2.5.0.rbi +65 -0
  74. data/sorbet/rbi/gems/yard-sorbet@0.8.1.rbi +428 -0
  75. data/sorbet/rbi/gems/yard@0.9.34.rbi +18219 -0
  76. data/sorbet/rbi/gems/yarp@0.13.0.rbi +21646 -0
  77. data/sorbet/rbi/gems/zeitwerk@2.6.12.rbi +997 -0
  78. data/sorbet/tapioca/config.yml +13 -0
  79. data/sorbet/tapioca/require.rb +5 -0
  80. metadata +167 -0
@@ -0,0 +1,925 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `tilt` gem.
5
+ # Please instead update this file by running `bin/tapioca gem tilt`.
6
+
7
+ # Namespace for Tilt. This module is not intended to be included anywhere.
8
+ #
9
+ # source://tilt//lib/tilt/template.rb#2
10
+ module Tilt
11
+ class << self
12
+ # @see Tilt::Mapping#[]
13
+ #
14
+ # source://tilt//lib/tilt.rb#71
15
+ def [](file); end
16
+
17
+ # @return [Tilt::Mapping] the main mapping object
18
+ #
19
+ # source://tilt//lib/tilt.rb#87
20
+ def default_mapping; end
21
+
22
+ # Replace the default mapping with a finalized version of the default
23
+ # mapping. This can be done to improve performance after the template
24
+ # libraries you desire to use have already been loaded. Once this is
25
+ # is called, all attempts to modify the default mapping will fail.
26
+ # This also freezes Tilt itself.
27
+ #
28
+ # source://tilt//lib/tilt.rb#20
29
+ def finalize!; end
30
+
31
+ # @private
32
+ #
33
+ # source://tilt//lib/tilt.rb#41
34
+ def lazy_map; end
35
+
36
+ # @see Tilt::Mapping#new
37
+ #
38
+ # source://tilt//lib/tilt.rb#66
39
+ def new(file, line = T.unsafe(nil), options = T.unsafe(nil), &block); end
40
+
41
+ # Alias register as prefer for Tilt 1.x compatibility.
42
+ #
43
+ # @see Tilt::Mapping#register
44
+ #
45
+ # source://tilt//lib/tilt.rb#46
46
+ def prefer(template_class, *extensions); end
47
+
48
+ # @see Tilt::Mapping#register
49
+ #
50
+ # source://tilt//lib/tilt.rb#46
51
+ def register(template_class, *extensions); end
52
+
53
+ # @see Tilt::Mapping#register_lazy
54
+ #
55
+ # source://tilt//lib/tilt.rb#51
56
+ def register_lazy(class_name, file, *extensions); end
57
+
58
+ # @see Tilt::Mapping#register_pipeline
59
+ #
60
+ # source://tilt//lib/tilt.rb#56
61
+ def register_pipeline(ext, options = T.unsafe(nil)); end
62
+
63
+ # @return [Boolean]
64
+ # @see Tilt::Mapping#registered?
65
+ #
66
+ # source://tilt//lib/tilt.rb#61
67
+ def registered?(ext); end
68
+
69
+ # @see Tilt::Mapping#template_for
70
+ #
71
+ # source://tilt//lib/tilt.rb#76
72
+ def template_for(file); end
73
+
74
+ # @see Tilt::Mapping#templates_for
75
+ #
76
+ # source://tilt//lib/tilt.rb#81
77
+ def templates_for(file); end
78
+ end
79
+ end
80
+
81
+ # Private internal base class for both Mapping and FinalizedMapping, for the shared methods.
82
+ #
83
+ # source://tilt//lib/tilt/mapping.rb#6
84
+ class Tilt::BaseMapping
85
+ # Looks up a template class based on file name and/or extension.
86
+ #
87
+ # @example
88
+ # mapping['views/hello.erb'] # => Tilt::ERBTemplate
89
+ # mapping['hello.erb'] # => Tilt::ERBTemplate
90
+ # mapping['erb'] # => Tilt::ERBTemplate
91
+ # @return [template class]
92
+ #
93
+ # source://tilt//lib/tilt/mapping.rb#32
94
+ def [](file); end
95
+
96
+ # Instantiates a new template class based on the file.
97
+ #
98
+ # @example
99
+ # mapping.new('index.mt') # => instance of MyEngine::Template
100
+ # @raise [RuntimeError] if there is no template class registered for the
101
+ # file name.
102
+ # @see Tilt::Template.new
103
+ #
104
+ # source://tilt//lib/tilt/mapping.rb#16
105
+ def new(file, line = T.unsafe(nil), options = T.unsafe(nil), &block); end
106
+
107
+ # Looks up a template class based on file name and/or extension.
108
+ #
109
+ # @example
110
+ # mapping['views/hello.erb'] # => Tilt::ERBTemplate
111
+ # mapping['hello.erb'] # => Tilt::ERBTemplate
112
+ # mapping['erb'] # => Tilt::ERBTemplate
113
+ # @return [template class]
114
+ #
115
+ # source://tilt//lib/tilt/mapping.rb#32
116
+ def template_for(file); end
117
+
118
+ # Looks up a list of template classes based on file name. If the file name
119
+ # has multiple extensions, it will return all template classes matching the
120
+ # extensions from the end.
121
+ #
122
+ # @example
123
+ # mapping.templates_for('views/index.haml.erb')
124
+ # # => [Tilt::ERBTemplate, Tilt::HamlTemplate]
125
+ # @return [Array<template class>]
126
+ #
127
+ # source://tilt//lib/tilt/mapping.rb#48
128
+ def templates_for(file); end
129
+
130
+ private
131
+
132
+ # source://tilt//lib/tilt/mapping.rb#63
133
+ def split(file); end
134
+ end
135
+
136
+ # Builder template implementation.
137
+ #
138
+ # source://tilt//lib/tilt/builder.rb#7
139
+ class Tilt::BuilderTemplate < ::Tilt::Template
140
+ # source://tilt//lib/tilt/builder.rb#14
141
+ def evaluate(scope, locals, &block); end
142
+
143
+ # source://tilt//lib/tilt/builder.rb#28
144
+ def precompiled_postamble(locals); end
145
+
146
+ # source://tilt//lib/tilt/builder.rb#32
147
+ def precompiled_template(locals); end
148
+
149
+ # source://tilt//lib/tilt/builder.rb#10
150
+ def prepare; end
151
+
152
+ private
153
+
154
+ # source://tilt//lib/tilt/builder.rb#38
155
+ def xml_builder; end
156
+ end
157
+
158
+ # CSV Template implementation. See:
159
+ # http://ruby-doc.org/stdlib/libdoc/csv/rdoc/CSV.html
160
+ #
161
+ # == Example
162
+ #
163
+ # # Example of csv template
164
+ # tpl = <<-EOS
165
+ # # header
166
+ # csv << ['NAME', 'ID']
167
+ #
168
+ # # data rows
169
+ # @people.each do |person|
170
+ # csv << [person[:name], person[:id]]
171
+ # end
172
+ # EOS
173
+ #
174
+ # @people = [
175
+ # {:name => "Joshua Peek", :id => 1},
176
+ # {:name => "Ryan Tomayko", :id => 2},
177
+ # {:name => "Simone Carletti", :id => 3}
178
+ # ]
179
+ #
180
+ # template = Tilt::CSVTemplate.new { tpl }
181
+ # template.render(self)
182
+ #
183
+ # source://tilt//lib/tilt/csv.rb#32
184
+ class Tilt::CSVTemplate < ::Tilt::Template
185
+ # source://tilt//lib/tilt/csv.rb#47
186
+ def precompiled(locals); end
187
+
188
+ # source://tilt//lib/tilt/csv.rb#39
189
+ def precompiled_template(locals); end
190
+
191
+ # source://tilt//lib/tilt/csv.rb#35
192
+ def prepare; end
193
+ end
194
+
195
+ # Extremely simple template cache implementation. Calling applications
196
+ # create a Tilt::Cache instance and use #fetch with any set of hashable
197
+ # arguments (such as those to Tilt.new):
198
+ #
199
+ # cache = Tilt::Cache.new
200
+ # cache.fetch(path, line, options) { Tilt.new(path, line, options) }
201
+ #
202
+ # Subsequent invocations return the already loaded template object.
203
+ #
204
+ # @note Tilt::Cache is a thin wrapper around Hash. It has the following
205
+ # limitations:
206
+ # * Not thread-safe.
207
+ # * Size is unbounded.
208
+ # * Keys are not copied defensively, and should not be modified after
209
+ # being passed to #fetch. More specifically, the values returned by
210
+ # key#hash and key#eql? should not change.
211
+ # If this is too limiting for you, use a different cache implementation.
212
+ #
213
+ # source://tilt//lib/tilt.rb#111
214
+ class Tilt::Cache
215
+ # @return [Cache] a new instance of Cache
216
+ #
217
+ # source://tilt//lib/tilt.rb#112
218
+ def initialize; end
219
+
220
+ # Clears the cache.
221
+ #
222
+ # source://tilt//lib/tilt.rb#129
223
+ def clear; end
224
+
225
+ # Caches a value for key, or returns the previously cached value.
226
+ # If a value has been previously cached for key then it is
227
+ # returned. Otherwise, block is yielded to and its return value
228
+ # which may be nil, is cached under key and returned.
229
+ #
230
+ # @yield
231
+ # @yieldreturn the value to cache for key
232
+ #
233
+ # source://tilt//lib/tilt.rb#122
234
+ def fetch(*key); end
235
+ end
236
+
237
+ # @private
238
+ #
239
+ # source://tilt//lib/tilt/template.rb#4
240
+ module Tilt::CompiledTemplates; end
241
+
242
+ # source://tilt//lib/tilt.rb#10
243
+ Tilt::EMPTY_HASH = T.let(T.unsafe(nil), Hash)
244
+
245
+ # ERB template implementation. See:
246
+ # http://www.ruby-doc.org/stdlib/libdoc/erb/rdoc/classes/ERB.html
247
+ #
248
+ # source://tilt//lib/tilt/erb.rb#8
249
+ class Tilt::ERBTemplate < ::Tilt::Template
250
+ # @return [Boolean]
251
+ #
252
+ # source://tilt//lib/tilt/erb.rb#60
253
+ def freeze_string_literals?; end
254
+
255
+ # ERB generates a line to specify the character coding of the generated
256
+ # source in 1.9. Account for this in the line offset.
257
+ #
258
+ # source://tilt//lib/tilt/erb.rb#55
259
+ def precompiled(locals); end
260
+
261
+ # source://tilt//lib/tilt/erb.rb#44
262
+ def precompiled_postamble(locals); end
263
+
264
+ # source://tilt//lib/tilt/erb.rb#36
265
+ def precompiled_preamble(locals); end
266
+
267
+ # source://tilt//lib/tilt/erb.rb#31
268
+ def precompiled_template(locals); end
269
+
270
+ # source://tilt//lib/tilt/erb.rb#11
271
+ def prepare; end
272
+ end
273
+
274
+ # source://tilt//lib/tilt/erb.rb#9
275
+ Tilt::ERBTemplate::SUPPORTS_KVARGS = T.let(T.unsafe(nil), Array)
276
+
277
+ # Erubi (a simplified version of Erubis) template implementation.
278
+ # See https://github.com/jeremyevans/erubi
279
+ #
280
+ # ErubiTemplate supports the following additional options, in addition
281
+ # to the options supported by the Erubi engine:
282
+ #
283
+ # :engine_class :: allows you to specify a custom engine class to use
284
+ # instead of the default (which is ::Erubi::Engine).
285
+ #
286
+ # source://tilt//lib/tilt/erubi.rb#14
287
+ class Tilt::ErubiTemplate < ::Tilt::Template
288
+ # @return [Boolean]
289
+ #
290
+ # source://tilt//lib/tilt/erubi.rb#51
291
+ def freeze_string_literals?; end
292
+
293
+ # source://tilt//lib/tilt/erubi.rb#47
294
+ def precompiled_template(locals); end
295
+
296
+ # source://tilt//lib/tilt/erubi.rb#15
297
+ def prepare; end
298
+ end
299
+
300
+ # source://tilt//lib/tilt/etanni.rb#5
301
+ class Tilt::EtanniTemplate < ::Tilt::Template
302
+ # source://tilt//lib/tilt/etanni.rb#23
303
+ def precompiled(locals); end
304
+
305
+ # source://tilt//lib/tilt/etanni.rb#19
306
+ def precompiled_template(locals); end
307
+
308
+ # source://tilt//lib/tilt/etanni.rb#6
309
+ def prepare; end
310
+ end
311
+
312
+ # Private internal class for finalized mappings, which are frozen and
313
+ # cannot be modified.
314
+ #
315
+ # source://tilt//lib/tilt/mapping.rb#370
316
+ class Tilt::FinalizedMapping < ::Tilt::BaseMapping
317
+ # Set the template map to use. The template map should already
318
+ # be frozen, but this is an internal class, so it does not
319
+ # explicitly check for that.
320
+ #
321
+ # @return [FinalizedMapping] a new instance of FinalizedMapping
322
+ #
323
+ # source://tilt//lib/tilt/mapping.rb#374
324
+ def initialize(template_map); end
325
+
326
+ # Returns receiver, since instances are always frozen.
327
+ #
328
+ # source://tilt//lib/tilt/mapping.rb#385
329
+ def clone(freeze: T.unsafe(nil)); end
330
+
331
+ # Returns receiver, since instances are always frozen.
332
+ #
333
+ # source://tilt//lib/tilt/mapping.rb#380
334
+ def dup; end
335
+
336
+ # Returns an aarry of all extensions the template class will
337
+ # be used for.
338
+ #
339
+ # source://tilt//lib/tilt/mapping.rb#396
340
+ def extensions_for(template_class); end
341
+
342
+ # Return whether the given file extension has been registered.
343
+ #
344
+ # @return [Boolean]
345
+ #
346
+ # source://tilt//lib/tilt/mapping.rb#390
347
+ def registered?(ext); end
348
+
349
+ private
350
+
351
+ # source://tilt//lib/tilt/mapping.rb#407
352
+ def lookup(ext); end
353
+ end
354
+
355
+ # source://tilt//lib/tilt/haml.rb#10
356
+ Tilt::HamlTemplate = Haml::Template
357
+
358
+ # @private
359
+ #
360
+ # source://tilt//lib/tilt/template.rb#11
361
+ Tilt::LOCK = T.let(T.unsafe(nil), Thread::Mutex)
362
+
363
+ # Tilt::Mapping associates file extensions with template implementations.
364
+ #
365
+ # mapping = Tilt::Mapping.new
366
+ # mapping.register(Tilt::RDocTemplate, 'rdoc')
367
+ # mapping['index.rdoc'] # => Tilt::RDocTemplate
368
+ # mapping.new('index.rdoc').render
369
+ #
370
+ # You can use {#register} to register a template class by file
371
+ # extension, {#registered?} to see if a file extension is mapped,
372
+ # {#[]} to lookup template classes, and {#new} to instantiate template
373
+ # objects.
374
+ #
375
+ # Mapping also supports *lazy* template implementations. Note that regularly
376
+ # registered template implementations *always* have preference over lazily
377
+ # registered template implementations. You should use {#register} if you
378
+ # depend on a specific template implementation and {#register_lazy} if there
379
+ # are multiple alternatives.
380
+ #
381
+ # mapping = Tilt::Mapping.new
382
+ # mapping.register_lazy('RDiscount::Template', 'rdiscount/template', 'md')
383
+ # mapping['index.md']
384
+ # # => RDiscount::Template
385
+ #
386
+ # {#register_lazy} takes a class name, a filename, and a list of file
387
+ # extensions. When you try to lookup a template name that matches the
388
+ # file extension, Tilt will automatically try to require the filename and
389
+ # constantize the class name.
390
+ #
391
+ # Unlike {#register}, there can be multiple template implementations
392
+ # registered lazily to the same file extension. Tilt will attempt to load the
393
+ # template implementations in order (registered *last* would be tried first),
394
+ # returning the first which doesn't raise LoadError.
395
+ #
396
+ # If all of the registered template implementations fails, Tilt will raise
397
+ # the exception of the first, since that was the most preferred one.
398
+ #
399
+ # mapping = Tilt::Mapping.new
400
+ # mapping.register_lazy('Maruku::Template', 'maruku/template', 'md')
401
+ # mapping.register_lazy('RDiscount::Template', 'rdiscount/template', 'md')
402
+ # mapping['index.md']
403
+ # # => RDiscount::Template
404
+ #
405
+ # In the previous example we say that RDiscount has a *higher priority* than
406
+ # Maruku. Tilt will first try to `require "rdiscount/template"`, falling
407
+ # back to `require "maruku/template"`. If none of these are successful,
408
+ # the first error will be raised.
409
+ #
410
+ # source://tilt//lib/tilt/mapping.rb#125
411
+ class Tilt::Mapping < ::Tilt::BaseMapping
412
+ # @return [Mapping] a new instance of Mapping
413
+ #
414
+ # source://tilt//lib/tilt/mapping.rb#131
415
+ def initialize; end
416
+
417
+ # Finds the extensions the template class has been registered under.
418
+ #
419
+ # @param template_class [template class]
420
+ #
421
+ # source://tilt//lib/tilt/mapping.rb#287
422
+ def extensions_for(template_class); end
423
+
424
+ # Return a finalized mapping. A finalized mapping will only include
425
+ # support for template libraries already loaded, and will not
426
+ # allow registering new template libraries or lazy loading template
427
+ # libraries not yet loaded. Finalized mappings improve performance
428
+ # by not requiring synchronization and ensure that the mapping will
429
+ # not attempt to load additional files (useful when restricting
430
+ # file system access after template libraries in use are loaded).
431
+ #
432
+ # source://tilt//lib/tilt/mapping.rb#151
433
+ def finalized; end
434
+
435
+ # @private
436
+ #
437
+ # source://tilt//lib/tilt/mapping.rb#129
438
+ def lazy_map; end
439
+
440
+ # Registers a template implementation by file extension. There can only be
441
+ # one template implementation per file extension, and this method will
442
+ # override any existing mapping.
443
+ #
444
+ # @example
445
+ # mapping.register MyEngine::Template, 'mt'
446
+ # mapping['index.mt'] # => MyEngine::Template
447
+ # @param template_class
448
+ # @param extensions [Array<String>] List of extensions.
449
+ # @return [void]
450
+ #
451
+ # source://tilt//lib/tilt/mapping.rb#200
452
+ def register(template_class, *extensions); end
453
+
454
+ # Registers a lazy template implementation by file extension. You
455
+ # can have multiple lazy template implementations defined on the
456
+ # same file extension, in which case the template implementation
457
+ # defined *last* will be attempted loaded *first*.
458
+ #
459
+ # @example
460
+ # mapping.register_lazy 'MyEngine::Template', 'my_engine/template', 'mt'
461
+ #
462
+ # defined?(MyEngine::Template) # => false
463
+ # mapping['index.mt'] # => MyEngine::Template
464
+ # defined?(MyEngine::Template) # => true
465
+ # @param class_name [String] Class name of a template class.
466
+ # @param file [String] Filename where the template class is defined.
467
+ # @param extensions [Array<String>] List of extensions.
468
+ # @return [void]
469
+ #
470
+ # source://tilt//lib/tilt/mapping.rb#176
471
+ def register_lazy(class_name, file, *extensions); end
472
+
473
+ # Register a new template class using the given extension that
474
+ # represents a pipeline of multiple existing template, where the
475
+ # output from the previous template is used as input to the next
476
+ # template.
477
+ #
478
+ # This will register a template class that processes the input
479
+ # with the *erb* template processor, and takes the output of
480
+ # that and feeds it to the *scss* template processor, returning
481
+ # the output of the *scss* template processor as the result of
482
+ # the pipeline.
483
+ #
484
+ # @example
485
+ # mapping.register_pipeline('scss.erb')
486
+ # mapping.register_pipeline('scss.erb', 'erb'=>{:outvar=>'@foo'})
487
+ # mapping.register_pipeline('scsserb', :extra_exts => 'scss.erb',
488
+ # :templates=>['erb', 'scss'])
489
+ # @option :templates
490
+ # @option :extra_exts
491
+ # @option String
492
+ # @param ext [String] Primary extension to register
493
+ # @param :templates [Hash] a customizable set of options
494
+ # @param :extra_exts [Hash] a customizable set of options
495
+ # @param String [Hash] a customizable set of options
496
+ # @return [void]
497
+ #
498
+ # source://tilt//lib/tilt/mapping.rb#238
499
+ def register_pipeline(ext, options = T.unsafe(nil)); end
500
+
501
+ # Checks if a file extension is registered (either eagerly or
502
+ # lazily) in this mapping.
503
+ #
504
+ # @example
505
+ # mapping.registered?('erb') # => true
506
+ # mapping.registered?('nope') # => false
507
+ # @param ext [String] File extension.
508
+ # @return [Boolean]
509
+ #
510
+ # source://tilt//lib/tilt/mapping.rb#280
511
+ def registered?(ext); end
512
+
513
+ # @private
514
+ #
515
+ # source://tilt//lib/tilt/mapping.rb#129
516
+ def template_map; end
517
+
518
+ # Unregisters an extension. This removes the both normal registrations
519
+ # and lazy registrations.
520
+ #
521
+ # @example
522
+ # mapping.register MyEngine::Template, 'mt'
523
+ # mapping['index.mt'] # => MyEngine::Template
524
+ # mapping.unregister('mt')
525
+ # mapping['index.mt'] # => nil
526
+ # @param extensions [Array<String>] List of extensions.
527
+ # @return nil
528
+ #
529
+ # source://tilt//lib/tilt/mapping.rb#260
530
+ def unregister(*extensions); end
531
+
532
+ private
533
+
534
+ # The proper behavior (in MRI) for autoload? is to
535
+ # return `false` when the constant/file has been
536
+ # explicitly required.
537
+ #
538
+ # However, in JRuby it returns `true` even after it's
539
+ # been required. In that case it turns out that `defined?`
540
+ # returns `"constant"` if it exists and `nil` when it doesn't.
541
+ # This is actually a second bug: `defined?` should resolve
542
+ # autoload (aka. actually try to require the file).
543
+ #
544
+ # We use the second bug in order to resolve the first bug.
545
+ #
546
+ # @return [Boolean]
547
+ #
548
+ # source://tilt//lib/tilt/mapping.rb#360
549
+ def constant_defined?(name); end
550
+
551
+ # @private
552
+ #
553
+ # source://tilt//lib/tilt/mapping.rb#137
554
+ def initialize_copy(other); end
555
+
556
+ # @return [Boolean]
557
+ #
558
+ # source://tilt//lib/tilt/mapping.rb#301
559
+ def lazy?(ext); end
560
+
561
+ # source://tilt//lib/tilt/mapping.rb#320
562
+ def lazy_load(pattern); end
563
+
564
+ # source://tilt//lib/tilt/mapping.rb#306
565
+ def lookup(ext); end
566
+
567
+ # source://tilt//lib/tilt/mapping.rb#310
568
+ def register_defined_classes(class_names, pattern); end
569
+ end
570
+
571
+ # source://tilt//lib/tilt/mapping.rb#126
572
+ Tilt::Mapping::LOCK = T.let(T.unsafe(nil), Thread::Mutex)
573
+
574
+ # Nokogiri template implementation. See:
575
+ # http://nokogiri.org/
576
+ #
577
+ # source://tilt//lib/tilt/nokogiri.rb#8
578
+ class Tilt::NokogiriTemplate < ::Tilt::Template
579
+ # source://tilt//lib/tilt/nokogiri.rb#12
580
+ def evaluate(scope, locals); end
581
+
582
+ # source://tilt//lib/tilt/nokogiri.rb#29
583
+ def precompiled_postamble(locals); end
584
+
585
+ # source://tilt//lib/tilt/nokogiri.rb#24
586
+ def precompiled_preamble(locals); end
587
+
588
+ # source://tilt//lib/tilt/nokogiri.rb#33
589
+ def precompiled_template(locals); end
590
+ end
591
+
592
+ # source://tilt//lib/tilt/nokogiri.rb#9
593
+ Tilt::NokogiriTemplate::DOCUMENT_HEADER = T.let(T.unsafe(nil), Regexp)
594
+
595
+ # Superclass used for pipeline templates. Should not be used directly.
596
+ #
597
+ # source://tilt//lib/tilt/pipeline.rb#6
598
+ class Tilt::Pipeline < ::Tilt::Template
599
+ # source://tilt//lib/tilt/pipeline.rb#15
600
+ def evaluate(scope, locals, &block); end
601
+
602
+ # source://tilt//lib/tilt/pipeline.rb#7
603
+ def prepare; end
604
+ end
605
+
606
+ # Raw text (no template functionality).
607
+ #
608
+ # source://tilt//lib/tilt/plain.rb#0
609
+ class Tilt::PlainTemplate < ::Tilt::StaticTemplate
610
+ private
611
+
612
+ # source://tilt//lib/tilt/plain.rb#5
613
+ def _prepare_output; end
614
+ end
615
+
616
+ # RDoc template. See: https://github.com/ruby/rdoc
617
+ #
618
+ # It's suggested that your program run the following at load time when
619
+ # using this templae engine in a threaded environment:
620
+ #
621
+ # require 'rdoc'
622
+ # require 'rdoc/markup'
623
+ # require 'rdoc/markup/to_html'
624
+ # require 'rdoc/options'
625
+ #
626
+ # source://tilt//lib/tilt/rdoc.rb#0
627
+ class Tilt::RDocTemplate < ::Tilt::StaticTemplate
628
+ private
629
+
630
+ # source://tilt//lib/tilt/rdoc.rb#17
631
+ def _prepare_output; end
632
+ end
633
+
634
+ # source://tilt//lib/tilt/template.rb#416
635
+ class Tilt::StaticTemplate < ::Tilt::Template
636
+ # Static templates never allow script.
637
+ #
638
+ # @return [Boolean]
639
+ #
640
+ # source://tilt//lib/tilt/template.rb#439
641
+ def allows_script?; end
642
+
643
+ # Raise NotImplementedError, since static templates
644
+ # do not support compiled methods.
645
+ #
646
+ # @raise [NotImplementedError]
647
+ #
648
+ # source://tilt//lib/tilt/template.rb#434
649
+ def compiled_method(locals_keys, scope_class = T.unsafe(nil)); end
650
+
651
+ # Static templates always return the prepared output.
652
+ #
653
+ # source://tilt//lib/tilt/template.rb#428
654
+ def render(scope = T.unsafe(nil), locals = T.unsafe(nil)); end
655
+
656
+ protected
657
+
658
+ # source://tilt//lib/tilt/template.rb#445
659
+ def prepare; end
660
+
661
+ private
662
+
663
+ # Do nothing, since compiled method cache is not used.
664
+ #
665
+ # source://tilt//lib/tilt/template.rb#452
666
+ def set_compiled_method_cache; end
667
+
668
+ class << self
669
+ # source://tilt//lib/tilt/template.rb#417
670
+ def subclass(mime_type: T.unsafe(nil), &block); end
671
+ end
672
+ end
673
+
674
+ # The template source is evaluated as a Ruby string. The #{} interpolation
675
+ # syntax can be used to generated dynamic output.
676
+ #
677
+ # source://tilt//lib/tilt/string.rb#7
678
+ class Tilt::StringTemplate < ::Tilt::Template
679
+ # @return [Boolean]
680
+ #
681
+ # source://tilt//lib/tilt/string.rb#23
682
+ def freeze_string_literals?; end
683
+
684
+ # source://tilt//lib/tilt/string.rb#18
685
+ def precompiled(locals); end
686
+
687
+ # source://tilt//lib/tilt/string.rb#14
688
+ def precompiled_template(locals); end
689
+
690
+ # source://tilt//lib/tilt/string.rb#8
691
+ def prepare; end
692
+ end
693
+
694
+ # @private
695
+ #
696
+ # source://tilt//lib/tilt/template.rb#8
697
+ Tilt::TOPOBJECT = Tilt::CompiledTemplates
698
+
699
+ # Base class for template implementations. Subclasses must implement
700
+ # the #prepare method and one of the #evaluate or #precompiled_template
701
+ # methods.
702
+ #
703
+ # source://tilt//lib/tilt/template.rb#16
704
+ class Tilt::Template
705
+ # Create a new template with the file, line, and options specified. By
706
+ # default, template data is read from the file. When a block is given,
707
+ # it should read template data and return as a String. When file is nil,
708
+ # a block is required.
709
+ #
710
+ # All arguments are optional.
711
+ #
712
+ # @raise [ArgumentError]
713
+ # @return [Template] a new instance of Template
714
+ #
715
+ # source://tilt//lib/tilt/template.rb#61
716
+ def initialize(file = T.unsafe(nil), line = T.unsafe(nil), options = T.unsafe(nil)); end
717
+
718
+ # The basename of the template file.
719
+ #
720
+ # source://tilt//lib/tilt/template.rb#106
721
+ def basename(suffix = T.unsafe(nil)); end
722
+
723
+ # The compiled method for the locals keys and scope_class provided.
724
+ # Returns an UnboundMethod, which can be used to define methods
725
+ # directly on the scope class, which are much faster to call than
726
+ # Tilt's normal rendering.
727
+ #
728
+ # source://tilt//lib/tilt/template.rb#147
729
+ def compiled_method(locals_keys, scope_class = T.unsafe(nil)); end
730
+
731
+ # A path ending in .rb that the template code will be written to, then
732
+ # required, instead of being evaled. This is useful for determining
733
+ # coverage of compiled template code, or to use static analysis tools
734
+ # on the compiled template code.
735
+ #
736
+ # source://tilt//lib/tilt/template.rb#35
737
+ def compiled_path; end
738
+
739
+ # Set the prefix to use for compiled paths.
740
+ #
741
+ # source://tilt//lib/tilt/template.rb#133
742
+ def compiled_path=(path); end
743
+
744
+ # Template source; loaded from a file or given directly.
745
+ #
746
+ # source://tilt//lib/tilt/template.rb#18
747
+ def data; end
748
+
749
+ # The filename used in backtraces to describe the template.
750
+ #
751
+ # source://tilt//lib/tilt/template.rb#118
752
+ def eval_file; end
753
+
754
+ # The name of the file where the template data was loaded from.
755
+ #
756
+ # source://tilt//lib/tilt/template.rb#21
757
+ def file; end
758
+
759
+ # The line number in #file where template data was loaded from.
760
+ #
761
+ # source://tilt//lib/tilt/template.rb#24
762
+ def line; end
763
+
764
+ # An empty Hash that the template engine can populate with various
765
+ # metadata.
766
+ #
767
+ # source://tilt//lib/tilt/template.rb#124
768
+ def metadata; end
769
+
770
+ # The template file's basename with all extensions chomped off.
771
+ #
772
+ # source://tilt//lib/tilt/template.rb#111
773
+ def name; end
774
+
775
+ # A Hash of template engine specific options. This is passed directly
776
+ # to the underlying engine and is not used by the generic template
777
+ # interface.
778
+ #
779
+ # source://tilt//lib/tilt/template.rb#29
780
+ def options; end
781
+
782
+ # Render the template in the given scope with the locals specified. If a
783
+ # block is given, it is typically available within the template via
784
+ # +yield+.
785
+ #
786
+ # source://tilt//lib/tilt/template.rb#101
787
+ def render(scope = T.unsafe(nil), locals = T.unsafe(nil), &block); end
788
+
789
+ protected
790
+
791
+ # The encoding of the source data. Defaults to the
792
+ # default_encoding-option if present. You may override this method
793
+ # in your template class if you have a better hint of the data's
794
+ # encoding.
795
+ #
796
+ # source://tilt//lib/tilt/template.rb#169
797
+ def default_encoding; end
798
+
799
+ # Execute the compiled template and return the result string. Template
800
+ # evaluation is guaranteed to be performed in the scope object with the
801
+ # locals specified and with support for yielding to the block.
802
+ #
803
+ # This method is only used by source generating templates. Subclasses that
804
+ # override render() may not support all features.
805
+ #
806
+ # source://tilt//lib/tilt/template.rb#192
807
+ def evaluate(scope, locals, &block); end
808
+
809
+ # Generates all template source by combining the preamble, template, and
810
+ # postamble and returns a two-tuple of the form: [source, offset], where
811
+ # source is the string containing (Ruby) source code for the template and
812
+ # offset is the integer line offset where line reporting should begin.
813
+ #
814
+ # Template subclasses may override this method when they need complete
815
+ # control over source generation or want to adjust the default line
816
+ # offset. In most cases, overriding the #precompiled_template method is
817
+ # easier and more appropriate.
818
+ #
819
+ # source://tilt//lib/tilt/template.rb#224
820
+ def precompiled(local_keys); end
821
+
822
+ # source://tilt//lib/tilt/template.rb#262
823
+ def precompiled_postamble(local_keys); end
824
+
825
+ # source://tilt//lib/tilt/template.rb#258
826
+ def precompiled_preamble(local_keys); end
827
+
828
+ # A string containing the (Ruby) source code for the template. The
829
+ # default Template#evaluate implementation requires either this
830
+ # method or the #precompiled method be overridden. When defined,
831
+ # the base Template guarantees correct file/line handling, locals
832
+ # support, custom scopes, proper encoding, and support for template
833
+ # compilation.
834
+ #
835
+ # @raise [NotImplementedError]
836
+ #
837
+ # source://tilt//lib/tilt/template.rb#254
838
+ def precompiled_template(local_keys); end
839
+
840
+ # Do whatever preparation is necessary to setup the underlying template
841
+ # engine. Called immediately after template data is loaded. Instance
842
+ # variables set in this method are available when #evaluate is called.
843
+ #
844
+ # Empty by default as some subclasses do not need separate preparation.
845
+ #
846
+ # source://tilt//lib/tilt/template.rb#180
847
+ def prepare; end
848
+
849
+ # @return [Boolean]
850
+ #
851
+ # source://tilt//lib/tilt/template.rb#171
852
+ def skip_compiled_encoding_detection?; end
853
+
854
+ private
855
+
856
+ # source://tilt//lib/tilt/template.rb#407
857
+ def binary(string); end
858
+
859
+ # source://tilt//lib/tilt/template.rb#341
860
+ def bind_compiled_method(method_source, offset, scope_class); end
861
+
862
+ # source://tilt//lib/tilt/template.rb#318
863
+ def compile_template_method(local_keys, scope_class = T.unsafe(nil)); end
864
+
865
+ # source://tilt//lib/tilt/template.rb#370
866
+ def eval_compiled_method(method_source, offset, scope_class); end
867
+
868
+ # source://tilt//lib/tilt/template.rb#388
869
+ def extract_encoding(script, &block); end
870
+
871
+ # source://tilt//lib/tilt/template.rb#392
872
+ def extract_magic_comment(script); end
873
+
874
+ # @return [Boolean]
875
+ #
876
+ # source://tilt//lib/tilt/template.rb#403
877
+ def freeze_string_literals?; end
878
+
879
+ # source://tilt//lib/tilt/template.rb#374
880
+ def load_compiled_method(path, method_source); end
881
+
882
+ # source://tilt//lib/tilt/template.rb#297
883
+ def local_extraction(local_keys); end
884
+
885
+ # source://tilt//lib/tilt/template.rb#270
886
+ def process_arg(arg); end
887
+
888
+ # source://tilt//lib/tilt/template.rb#284
889
+ def read_template_file; end
890
+
891
+ # source://tilt//lib/tilt/template.rb#293
892
+ def set_compiled_method_cache; end
893
+
894
+ # source://tilt//lib/tilt/template.rb#382
895
+ def unbind_compiled_method(method_name); end
896
+
897
+ class << self
898
+ # Use `.metadata[:mime_type]` instead.
899
+ #
900
+ # source://tilt//lib/tilt/template.rb#45
901
+ def default_mime_type; end
902
+
903
+ # Use `.metadata[:mime_type] = val` instead.
904
+ #
905
+ # source://tilt//lib/tilt/template.rb#50
906
+ def default_mime_type=(value); end
907
+
908
+ # An empty Hash that the template engine can populate with various
909
+ # metadata.
910
+ #
911
+ # source://tilt//lib/tilt/template.rb#40
912
+ def metadata; end
913
+ end
914
+ end
915
+
916
+ # source://tilt//lib/tilt/template.rb#183
917
+ Tilt::Template::CLASS_METHOD = T.let(T.unsafe(nil), UnboundMethod)
918
+
919
+ # source://tilt//lib/tilt/template.rb#184
920
+ Tilt::Template::USE_BIND_CALL = T.let(T.unsafe(nil), TrueClass)
921
+
922
+ # Current version.
923
+ #
924
+ # source://tilt//lib/tilt.rb#8
925
+ Tilt::VERSION = T.let(T.unsafe(nil), String)