m2m_keygen 0.4.9 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.overcommit.yml +4 -7
- data/.rubocop.yml +19 -16
- data/.ruby-version +1 -1
- data/.streerc +1 -0
- data/.tool-versions +1 -1
- data/CHANGELOG.md +60 -1
- data/Gemfile +2 -2
- data/Gemfile.lock +135 -158
- data/README.md +64 -78
- data/docs/MIGRATING.md +69 -0
- data/docs/SPEC.md +245 -0
- data/examples/nonce_store/postgres.rb +40 -0
- data/examples/nonce_store/redis.rb +23 -0
- data/gemfiles/rack_2.gemfile +5 -0
- data/gemfiles/rack_3.gemfile +5 -0
- data/lib/m2m_keygen/canonicalizer.rb +57 -0
- data/lib/m2m_keygen/nonce_store/disabled.rb +19 -0
- data/lib/m2m_keygen/nonce_store/memory.rb +64 -0
- data/lib/m2m_keygen/nonce_store.rb +18 -0
- data/lib/m2m_keygen/rack_validator.rb +72 -19
- data/lib/m2m_keygen/request_signer/signed_request.rb +10 -0
- data/lib/m2m_keygen/request_signer.rb +118 -0
- data/lib/m2m_keygen/signature.rb +41 -39
- data/lib/m2m_keygen/types/params_type.rb +6 -17
- data/lib/m2m_keygen/version.rb +1 -1
- data/lib/m2m_keygen.rb +6 -0
- data/m2m_keygen.gemspec +12 -14
- data/sorbet/config +1 -0
- data/sorbet/rbi/gems/.gitattributes +1 -0
- data/sorbet/rbi/gems/{ast@2.4.2.rbi → ast@2.4.3.rbi} +45 -79
- data/sorbet/rbi/gems/{benchmark@0.2.0.rbi → benchmark@0.5.0.rbi} +91 -58
- data/sorbet/rbi/gems/bundler-audit@0.9.3.rbi +397 -0
- data/sorbet/rbi/gems/byebug@13.0.0.rbi +3651 -0
- data/sorbet/rbi/gems/childprocess@5.1.0.rbi +336 -0
- data/sorbet/rbi/gems/concurrent-ruby@1.3.7.rbi +384 -0
- data/sorbet/rbi/gems/{diff-lcs@1.5.0.rbi → diff-lcs@1.6.2.rbi} +189 -199
- data/sorbet/rbi/gems/{docile@1.4.0.rbi → docile@1.4.1.rbi} +147 -147
- data/sorbet/rbi/gems/dotenv@3.2.0.rbi +267 -0
- data/sorbet/rbi/gems/erubi@1.13.1.rbi +155 -0
- data/sorbet/rbi/gems/{faker@2.22.0.rbi → faker@3.8.0.rbi} +8468 -3829
- data/sorbet/rbi/gems/{ffi@1.15.5.rbi → ffi@1.17.4.rbi} +1 -0
- data/sorbet/rbi/gems/{formatador@1.1.0.rbi → formatador@1.2.3.rbi} +1 -0
- data/sorbet/rbi/gems/{guard@2.18.0.rbi → guard@2.20.1.rbi} +1 -0
- data/sorbet/rbi/gems/{i18n@1.12.0.rbi → i18n@1.15.2.rbi} +687 -827
- data/sorbet/rbi/gems/io-console@0.8.2.rbi +9 -0
- data/sorbet/rbi/gems/{json@2.6.2.rbi → json@2.20.0.rbi} +994 -252
- data/sorbet/rbi/gems/language_server-protocol@3.17.0.5.rbi +9 -0
- data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +189 -0
- data/sorbet/rbi/gems/listen@3.10.0.rbi +9 -0
- data/sorbet/rbi/gems/logger@1.7.0.rbi +896 -0
- data/sorbet/rbi/gems/{lumberjack@1.2.8.rbi → lumberjack@1.4.2.rbi} +1 -0
- data/sorbet/rbi/gems/{method_source@1.0.0.rbi → method_source@1.1.0.rbi} +111 -90
- data/sorbet/rbi/gems/{overcommit@0.59.1.rbi → overcommit@0.71.0.rbi} +503 -647
- data/sorbet/rbi/gems/parallel@2.1.0.rbi +321 -0
- data/sorbet/rbi/gems/parser@3.3.11.1.rbi +5229 -0
- data/sorbet/rbi/gems/prettier_print@1.2.1.rbi +878 -0
- data/sorbet/rbi/gems/prism@1.9.0.rbi +42224 -0
- data/sorbet/rbi/gems/pry-byebug@3.12.0.rbi +481 -0
- data/sorbet/rbi/gems/{pry@0.14.1.rbi → pry@0.16.0.rbi} +2567 -3550
- data/sorbet/rbi/gems/{racc@1.6.0.rbi → racc@1.8.1.rbi} +54 -40
- data/sorbet/rbi/gems/rack@3.2.6.rbi +4653 -0
- data/sorbet/rbi/gems/{rake@13.0.6.rbi → rake@13.4.2.rbi} +963 -732
- data/sorbet/rbi/gems/{rb-inotify@0.10.1.rbi → rb-inotify@0.11.1.rbi} +1 -0
- data/sorbet/rbi/gems/rbi@0.3.14.rbi +5519 -0
- data/sorbet/rbi/gems/rbs@4.0.3.rbi +6908 -0
- data/sorbet/rbi/gems/regexp_parser@2.12.0.rbi +3398 -0
- data/sorbet/rbi/gems/reline@0.6.3.rbi +2446 -0
- data/sorbet/rbi/gems/require-hooks@0.4.0.rbi +152 -0
- data/sorbet/rbi/gems/{rexml@3.2.5.rbi → rexml@3.4.4.rbi} +1085 -894
- data/sorbet/rbi/gems/rspec-core@3.13.6.rbi +9475 -0
- data/sorbet/rbi/gems/rspec-expectations@3.13.5.rbi +6108 -0
- data/sorbet/rbi/gems/rspec-mocks@3.13.8.rbi +4787 -0
- data/sorbet/rbi/gems/rspec-support@3.13.7.rbi +1274 -0
- data/sorbet/rbi/gems/rspec@3.13.2.rbi +15 -0
- data/sorbet/rbi/gems/rspec_in_context@1.2.2.rbi +294 -0
- data/sorbet/rbi/gems/rubocop-ast@1.49.1.rbi +7140 -0
- data/sorbet/rbi/gems/rubocop-faker@1.3.0.rbi +88 -0
- data/sorbet/rbi/gems/rubocop-performance@1.26.1.rbi +3403 -0
- data/sorbet/rbi/gems/rubocop-sorbet@0.12.0.rbi +2448 -0
- data/sorbet/rbi/gems/rubocop@1.88.1.rbi +63103 -0
- data/sorbet/rbi/gems/ruby-lsp@0.26.9.rbi +28 -0
- data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +988 -0
- data/sorbet/rbi/gems/rubydex@0.2.7.rbi +836 -0
- data/sorbet/rbi/gems/simplecov-html@0.13.2.rbi +90 -0
- data/sorbet/rbi/gems/{simplecov@0.21.2.rbi → simplecov@0.22.0.rbi} +438 -578
- data/sorbet/rbi/gems/spoom@1.8.2.rbi +6691 -0
- data/sorbet/rbi/gems/syntax_tree@6.3.0.rbi +22090 -0
- data/sorbet/rbi/gems/tapioca@0.19.2.rbi +3597 -0
- data/sorbet/rbi/gems/{thor@1.2.1.rbi → thor@1.5.0.rbi} +1085 -1171
- data/sorbet/rbi/gems/tsort@0.2.0.rbi +389 -0
- data/sorbet/rbi/gems/unicode-display_width@3.2.0.rbi +130 -0
- data/sorbet/rbi/gems/unicode-emoji@4.2.0.rbi +332 -0
- data/sorbet/rbi/gems/{yard-sorbet@0.7.0.rbi → yard-sorbet@0.9.0.rbi} +142 -99
- data/sorbet/rbi/gems/{yard@0.9.28.rbi → yard@0.9.44.rbi} +5350 -6316
- data/sorbet/rbi/gems/zeitwerk@2.8.2.rbi +1178 -0
- metadata +105 -111
- data/.prettierrc.js +0 -4
- data/docs/M2mKeygen/Error.html +0 -135
- data/docs/M2mKeygen/ParamsEncoder.html +0 -321
- data/docs/M2mKeygen/RackValidator.html +0 -533
- data/docs/M2mKeygen/Signature.html +0 -680
- data/docs/M2mKeygen/Types.html +0 -147
- data/docs/M2mKeygen.html +0 -157
- data/docs/_index.html +0 -182
- data/docs/class_list.html +0 -51
- data/docs/css/common.css +0 -1
- data/docs/css/full_list.css +0 -58
- data/docs/css/style.css +0 -497
- data/docs/file.README.html +0 -230
- data/docs/file_list.html +0 -56
- data/docs/frames.html +0 -17
- data/docs/index.html +0 -230
- data/docs/js/app.js +0 -314
- data/docs/js/full_list.js +0 -216
- data/docs/js/jquery.js +0 -4
- data/docs/method_list.html +0 -139
- data/docs/top-level-namespace.html +0 -110
- data/lib/m2m_keygen/params_encoder.rb +0 -56
- data/package.json +0 -12
- data/sig/m2m_keygen.rbs +0 -4
- data/sorbet/rbi/gems/activesupport@7.0.3.1.rbi +0 -18608
- data/sorbet/rbi/gems/backport@1.2.0.rbi +0 -522
- data/sorbet/rbi/gems/bundler-audit@0.9.1.rbi +0 -308
- data/sorbet/rbi/gems/byebug@11.1.3.rbi +0 -3603
- data/sorbet/rbi/gems/childprocess@4.1.0.rbi +0 -401
- data/sorbet/rbi/gems/concurrent-ruby@1.1.10.rbi +0 -11581
- data/sorbet/rbi/gems/dotenv@2.8.1.rbi +0 -234
- data/sorbet/rbi/gems/e2mmap@0.1.0.rbi +0 -8
- data/sorbet/rbi/gems/haml@5.2.2.rbi +0 -3190
- data/sorbet/rbi/gems/jaro_winkler@1.5.4.rbi +0 -19
- data/sorbet/rbi/gems/kramdown-parser-gfm@1.1.0.rbi +0 -133
- data/sorbet/rbi/gems/kramdown@2.4.0.rbi +0 -3261
- data/sorbet/rbi/gems/listen@3.7.1.rbi +0 -1181
- data/sorbet/rbi/gems/minitest@5.16.3.rbi +0 -1459
- data/sorbet/rbi/gems/nokogiri@1.13.8.rbi +0 -6514
- data/sorbet/rbi/gems/parallel@1.22.1.rbi +0 -277
- data/sorbet/rbi/gems/parser@3.1.2.1.rbi +0 -6826
- data/sorbet/rbi/gems/prettier@3.2.0.rbi +0 -22
- data/sorbet/rbi/gems/prettier_print@0.1.0.rbi +0 -8
- data/sorbet/rbi/gems/pry-byebug@3.10.1.rbi +0 -1222
- data/sorbet/rbi/gems/rack@2.2.4.rbi +0 -5630
- data/sorbet/rbi/gems/rbi@0.0.15.rbi +0 -3007
- data/sorbet/rbi/gems/rbs@2.6.0.rbi +0 -8
- data/sorbet/rbi/gems/regexp_parser@2.5.0.rbi +0 -3366
- data/sorbet/rbi/gems/reverse_markdown@2.1.1.rbi +0 -389
- data/sorbet/rbi/gems/rspec-core@3.11.0.rbi +0 -10786
- data/sorbet/rbi/gems/rspec-expectations@3.11.0.rbi +0 -8170
- data/sorbet/rbi/gems/rspec-mocks@3.11.1.rbi +0 -5385
- data/sorbet/rbi/gems/rspec-support@3.11.0.rbi +0 -1746
- data/sorbet/rbi/gems/rspec@3.11.0.rbi +0 -187
- data/sorbet/rbi/gems/rspec_in_context@1.1.0.3.rbi +0 -1113
- data/sorbet/rbi/gems/rubocop-ast@1.21.0.rbi +0 -7044
- data/sorbet/rbi/gems/rubocop-faker@1.1.0.rbi +0 -106
- data/sorbet/rbi/gems/rubocop-performance@1.14.3.rbi +0 -2982
- data/sorbet/rbi/gems/rubocop-sorbet@0.6.11.rbi +0 -990
- data/sorbet/rbi/gems/rubocop@1.35.1.rbi +0 -52002
- data/sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi +0 -1239
- data/sorbet/rbi/gems/simplecov-html@0.12.3.rbi +0 -219
- data/sorbet/rbi/gems/solargraph@0.46.0.rbi +0 -9075
- data/sorbet/rbi/gems/spoom@1.1.12.rbi +0 -2369
- data/sorbet/rbi/gems/syntax_tree-haml@1.3.1.rbi +0 -8
- data/sorbet/rbi/gems/syntax_tree-rbs@0.5.0.rbi +0 -8
- data/sorbet/rbi/gems/syntax_tree@3.5.0.rbi +0 -8
- data/sorbet/rbi/gems/tapioca@0.9.4.rbi +0 -2946
- data/sorbet/rbi/gems/temple@0.8.2.rbi +0 -1712
- data/sorbet/rbi/gems/tilt@2.0.11.rbi +0 -742
- data/sorbet/rbi/gems/tzinfo@2.0.5.rbi +0 -5914
- data/sorbet/rbi/gems/unicode-display_width@2.2.0.rbi +0 -48
- data/sorbet/rbi/gems/unparser@0.6.5.rbi +0 -4529
- data/sorbet/rbi/gems/webrick@1.7.0.rbi +0 -2553
- data/sorbet/rbi/gems/zeitwerk@2.6.0.rbi +0 -867
- data/sorbet/rbi/manual.rbi +0 -7
- data/yarn.lock +0 -20
|
@@ -1,3190 +0,0 @@
|
|
|
1
|
-
# typed: true
|
|
2
|
-
|
|
3
|
-
# DO NOT EDIT MANUALLY
|
|
4
|
-
# This is an autogenerated file for types exported from the `haml` gem.
|
|
5
|
-
# Please instead update this file by running `bin/tapioca gem haml`.
|
|
6
|
-
|
|
7
|
-
# source://yard-0.9.28/lib/yard.rb:62
|
|
8
|
-
::RUBY19 = T.let(T.unsafe(nil), TrueClass)
|
|
9
|
-
|
|
10
|
-
# The module that contains everything Haml-related:
|
|
11
|
-
#
|
|
12
|
-
# * {Haml::Parser} is Haml's parser.
|
|
13
|
-
# * {Haml::Compiler} is Haml's compiler.
|
|
14
|
-
# * {Haml::Engine} is the class used to render Haml within Ruby code.
|
|
15
|
-
# * {Haml::Options} is where Haml's runtime options are defined.
|
|
16
|
-
# * {Haml::Error} is raised when Haml encounters an error.
|
|
17
|
-
#
|
|
18
|
-
# Also see the {file:REFERENCE.md full Haml reference}.
|
|
19
|
-
#
|
|
20
|
-
# source://haml-5.2.2/lib/haml/version.rb:3
|
|
21
|
-
module Haml
|
|
22
|
-
class << self
|
|
23
|
-
# source://haml-5.2.2/lib/haml.rb:16
|
|
24
|
-
def init_rails(*args); end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
# source://haml-5.2.2/lib/haml/attribute_builder.rb:4
|
|
29
|
-
module Haml::AttributeBuilder
|
|
30
|
-
class << self
|
|
31
|
-
# source://haml-5.2.2/lib/haml/attribute_builder.rb:9
|
|
32
|
-
def build(class_id, obj_ref, is_html, attr_wrapper, escape_attrs, hyphenate_data_attrs, *attributes_hashes); end
|
|
33
|
-
|
|
34
|
-
# source://haml-5.2.2/lib/haml/attribute_builder.rb:20
|
|
35
|
-
def build_attributes(is_html, attr_wrapper, escape_attrs, hyphenate_data_attrs, attributes = T.unsafe(nil)); end
|
|
36
|
-
|
|
37
|
-
# @return [String, nil]
|
|
38
|
-
#
|
|
39
|
-
# source://haml-5.2.2/lib/haml/attribute_builder.rb:64
|
|
40
|
-
def filter_and_join(value, separator); end
|
|
41
|
-
|
|
42
|
-
# Merges two attribute hashes.
|
|
43
|
-
# This is the same as `to.merge!(from)`,
|
|
44
|
-
# except that it merges id, class, and data attributes.
|
|
45
|
-
#
|
|
46
|
-
# ids are concatenated with `"_"`,
|
|
47
|
-
# and classes are concatenated with `" "`.
|
|
48
|
-
# data hashes are simply merged.
|
|
49
|
-
#
|
|
50
|
-
# Destructively modifies `to`.
|
|
51
|
-
#
|
|
52
|
-
# @param to [{String => String,Hash}] The attribute hash to merge into
|
|
53
|
-
# @param from [{String => Object}] The attribute hash to merge from
|
|
54
|
-
# @return [{String => String,Hash}] `to`, after being merged
|
|
55
|
-
#
|
|
56
|
-
# source://haml-5.2.2/lib/haml/attribute_builder.rb:91
|
|
57
|
-
def merge_attributes!(to, from); end
|
|
58
|
-
|
|
59
|
-
# Merge multiple values to one attribute value. No destructive operation.
|
|
60
|
-
#
|
|
61
|
-
# @param key [String]
|
|
62
|
-
# @param values [Array<Object>]
|
|
63
|
-
# @return [String, Hash]
|
|
64
|
-
#
|
|
65
|
-
# source://haml-5.2.2/lib/haml/attribute_builder.rb:103
|
|
66
|
-
def merge_values(key, *values); end
|
|
67
|
-
|
|
68
|
-
# source://haml-5.2.2/lib/haml/attribute_builder.rb:109
|
|
69
|
-
def verify_attribute_names!(attribute_names); end
|
|
70
|
-
|
|
71
|
-
private
|
|
72
|
-
|
|
73
|
-
# source://haml-5.2.2/lib/haml/attribute_builder.rb:150
|
|
74
|
-
def build_data_keys(data_hash, hyphenate, attr_name = T.unsafe(nil)); end
|
|
75
|
-
|
|
76
|
-
# source://haml-5.2.2/lib/haml/attribute_builder.rb:162
|
|
77
|
-
def flatten_data_attributes(data, key, join_char, seen = T.unsafe(nil)); end
|
|
78
|
-
|
|
79
|
-
# Merge a couple of values to one attribute value. No destructive operation.
|
|
80
|
-
#
|
|
81
|
-
# @param to [String, Hash, nil]
|
|
82
|
-
# @param from [Object]
|
|
83
|
-
# @return [String, Hash]
|
|
84
|
-
#
|
|
85
|
-
# source://haml-5.2.2/lib/haml/attribute_builder.rb:124
|
|
86
|
-
def merge_value(key, to, from); end
|
|
87
|
-
|
|
88
|
-
# Takes an array of objects and uses the class and id of the first
|
|
89
|
-
# one to create an attributes hash.
|
|
90
|
-
# The second object, if present, is used as a prefix,
|
|
91
|
-
# just like you can do with `dom_id()` and `dom_class()` in Rails
|
|
92
|
-
#
|
|
93
|
-
# source://haml-5.2.2/lib/haml/attribute_builder.rb:178
|
|
94
|
-
def parse_object_ref(ref); end
|
|
95
|
-
|
|
96
|
-
# Changes a word from camel case to underscores.
|
|
97
|
-
# Based on the method of the same name in Rails' Inflector,
|
|
98
|
-
# but copied here so it'll run properly without Rails.
|
|
99
|
-
#
|
|
100
|
-
# source://haml-5.2.2/lib/haml/attribute_builder.rb:208
|
|
101
|
-
def underscore(camel_cased_word); end
|
|
102
|
-
end
|
|
103
|
-
end
|
|
104
|
-
|
|
105
|
-
# https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
|
|
106
|
-
#
|
|
107
|
-
# source://haml-5.2.2/lib/haml/attribute_builder.rb:6
|
|
108
|
-
Haml::AttributeBuilder::INVALID_ATTRIBUTE_NAME_REGEX = T.let(T.unsafe(nil), Regexp)
|
|
109
|
-
|
|
110
|
-
# source://haml-5.2.2/lib/haml/attribute_compiler.rb:6
|
|
111
|
-
class Haml::AttributeCompiler
|
|
112
|
-
# @param options [Haml::Options]
|
|
113
|
-
# @return [AttributeCompiler] a new instance of AttributeCompiler
|
|
114
|
-
#
|
|
115
|
-
# source://haml-5.2.2/lib/haml/attribute_compiler.rb:13
|
|
116
|
-
def initialize(options); end
|
|
117
|
-
|
|
118
|
-
# Returns Temple expression to render attributes.
|
|
119
|
-
#
|
|
120
|
-
# @param attributes [Hash]
|
|
121
|
-
# @param object_ref [String, :nil]
|
|
122
|
-
# @param dynamic_attributes [Haml::Parser::DynamicAttributes]
|
|
123
|
-
# @return [Array] Temple expression
|
|
124
|
-
#
|
|
125
|
-
# source://haml-5.2.2/lib/haml/attribute_compiler.rb:26
|
|
126
|
-
def compile(attributes, object_ref, dynamic_attributes); end
|
|
127
|
-
|
|
128
|
-
private
|
|
129
|
-
|
|
130
|
-
# @param attr [Haml::AttributeCompiler::AttributeValue]
|
|
131
|
-
#
|
|
132
|
-
# source://haml-5.2.2/lib/haml/attribute_compiler.rb:217
|
|
133
|
-
def attr_literal(attr); end
|
|
134
|
-
|
|
135
|
-
# Returns array of AttributeValue instances from static attributes and dynamic_attributes. For each key,
|
|
136
|
-
# the values' order in returned value is preserved in the same order as Haml::Buffer#attributes's merge order.
|
|
137
|
-
#
|
|
138
|
-
# @param attributes [{ String => String }]
|
|
139
|
-
# @param parsed_hashes [{ String => String }]
|
|
140
|
-
# @return [Array<AttributeValue>]
|
|
141
|
-
#
|
|
142
|
-
# source://haml-5.2.2/lib/haml/attribute_compiler.rb:79
|
|
143
|
-
def build_attribute_values(attributes, parsed_hashes); end
|
|
144
|
-
|
|
145
|
-
# Compiles attribute values for one key to Temple expression that generates ` key='value'`.
|
|
146
|
-
#
|
|
147
|
-
# @param key [String]
|
|
148
|
-
# @param values [Array<AttributeValue>]
|
|
149
|
-
# @return [Array] Temple expression
|
|
150
|
-
#
|
|
151
|
-
# source://haml-5.2.2/lib/haml/attribute_compiler.rb:151
|
|
152
|
-
def compile_attribute(key, values); end
|
|
153
|
-
|
|
154
|
-
# Compiles attribute values with the similar key to Temple expression.
|
|
155
|
-
#
|
|
156
|
-
# @param values [Array<AttributeValue>] whose `key`s are partially or fully the same from left.
|
|
157
|
-
# @return [Array] Temple expression
|
|
158
|
-
#
|
|
159
|
-
# source://haml-5.2.2/lib/haml/attribute_compiler.rb:96
|
|
160
|
-
def compile_attribute_values(values); end
|
|
161
|
-
|
|
162
|
-
# @param key [String] Not "id" or "class"
|
|
163
|
-
# @param values [Array<AttributeValue>]
|
|
164
|
-
# @return [Array] Temple expression
|
|
165
|
-
#
|
|
166
|
-
# source://haml-5.2.2/lib/haml/attribute_compiler.rb:186
|
|
167
|
-
def compile_common_attribute(key, values); end
|
|
168
|
-
|
|
169
|
-
# @param id_or_class [String] "id" or "class"
|
|
170
|
-
# @param values [Array<AttributeValue>]
|
|
171
|
-
# @return [Array] Temple expression
|
|
172
|
-
#
|
|
173
|
-
# source://haml-5.2.2/lib/haml/attribute_compiler.rb:167
|
|
174
|
-
def compile_id_or_class_attribute(id_or_class, values); end
|
|
175
|
-
|
|
176
|
-
# Returns a script to render attributes on runtime.
|
|
177
|
-
#
|
|
178
|
-
# @param attributes [Hash]
|
|
179
|
-
# @param object_ref [String, :nil]
|
|
180
|
-
# @param dynamic_attributes [Haml::Parser::DynamicAttributes]
|
|
181
|
-
# @return [String] Attributes rendering code
|
|
182
|
-
#
|
|
183
|
-
# source://haml-5.2.2/lib/haml/attribute_compiler.rb:53
|
|
184
|
-
def compile_runtime_build(attributes, object_ref, dynamic_attributes); end
|
|
185
|
-
|
|
186
|
-
# @param str [String]
|
|
187
|
-
# @return [String]
|
|
188
|
-
#
|
|
189
|
-
# source://haml-5.2.2/lib/haml/attribute_compiler.rb:142
|
|
190
|
-
def frozen_string(str); end
|
|
191
|
-
|
|
192
|
-
# Build array of grouped values whose sort order may go back and forth, which is also sorted with key name.
|
|
193
|
-
# This method needs to group values with the same start because it can be changed in `Haml::AttributeBuidler#build_data_keys`.
|
|
194
|
-
#
|
|
195
|
-
# @param values [Array<Haml::AttributeCompiler::AttributeValue>]
|
|
196
|
-
# @return [Array<Array<Haml::AttributeCompiler::AttributeValue>>]
|
|
197
|
-
#
|
|
198
|
-
# source://haml-5.2.2/lib/haml/attribute_compiler.rb:62
|
|
199
|
-
def group_values_for_sort(values); end
|
|
200
|
-
|
|
201
|
-
# @param key [String]
|
|
202
|
-
# @param values [Array<AttributeValue>]
|
|
203
|
-
# @return [String]
|
|
204
|
-
#
|
|
205
|
-
# source://haml-5.2.2/lib/haml/attribute_compiler.rb:132
|
|
206
|
-
def merged_value(key, values); end
|
|
207
|
-
|
|
208
|
-
# @param values [Array<AttributeValue>]
|
|
209
|
-
# @return [Array] Temple expression
|
|
210
|
-
#
|
|
211
|
-
# source://haml-5.2.2/lib/haml/attribute_compiler.rb:106
|
|
212
|
-
def runtime_build(values); end
|
|
213
|
-
|
|
214
|
-
# Renders attribute values statically.
|
|
215
|
-
#
|
|
216
|
-
# @param values [Array<AttributeValue>]
|
|
217
|
-
# @return [Array] Temple expression
|
|
218
|
-
#
|
|
219
|
-
# source://haml-5.2.2/lib/haml/attribute_compiler.rb:118
|
|
220
|
-
def static_build(values); end
|
|
221
|
-
|
|
222
|
-
# For haml/haml#972
|
|
223
|
-
#
|
|
224
|
-
# @param value [Object]
|
|
225
|
-
#
|
|
226
|
-
# source://haml-5.2.2/lib/haml/attribute_compiler.rb:228
|
|
227
|
-
def to_literal(value); end
|
|
228
|
-
|
|
229
|
-
# source://haml-5.2.2/lib/haml/attribute_compiler.rb:203
|
|
230
|
-
def true_value(key); end
|
|
231
|
-
|
|
232
|
-
# source://haml-5.2.2/lib/haml/attribute_compiler.rb:211
|
|
233
|
-
def unique_name; end
|
|
234
|
-
end
|
|
235
|
-
|
|
236
|
-
# @param type [Symbol] :static or :dynamic
|
|
237
|
-
# @param key [String]
|
|
238
|
-
# @param value [String] Actual string value for :static type, value's Ruby literal for :dynamic type.
|
|
239
|
-
#
|
|
240
|
-
# source://haml-5.2.2/lib/haml/attribute_compiler.rb:10
|
|
241
|
-
class Haml::AttributeCompiler::AttributeValue < ::Struct
|
|
242
|
-
# Returns the value of attribute key
|
|
243
|
-
#
|
|
244
|
-
# @return [Object] the current value of key
|
|
245
|
-
def key; end
|
|
246
|
-
|
|
247
|
-
# Sets the attribute key
|
|
248
|
-
#
|
|
249
|
-
# @param value [Object] the value to set the attribute key to.
|
|
250
|
-
# @return [Object] the newly set value
|
|
251
|
-
def key=(_); end
|
|
252
|
-
|
|
253
|
-
# Returns the value of attribute type
|
|
254
|
-
#
|
|
255
|
-
# @return [Object] the current value of type
|
|
256
|
-
def type; end
|
|
257
|
-
|
|
258
|
-
# Sets the attribute type
|
|
259
|
-
#
|
|
260
|
-
# @param value [Object] the value to set the attribute type to.
|
|
261
|
-
# @return [Object] the newly set value
|
|
262
|
-
def type=(_); end
|
|
263
|
-
|
|
264
|
-
# Returns the value of attribute value
|
|
265
|
-
#
|
|
266
|
-
# @return [Object] the current value of value
|
|
267
|
-
def value; end
|
|
268
|
-
|
|
269
|
-
# Sets the attribute value
|
|
270
|
-
#
|
|
271
|
-
# @param value [Object] the value to set the attribute value to.
|
|
272
|
-
# @return [Object] the newly set value
|
|
273
|
-
def value=(_); end
|
|
274
|
-
|
|
275
|
-
class << self
|
|
276
|
-
def [](*_arg0); end
|
|
277
|
-
def inspect; end
|
|
278
|
-
def keyword_init?; end
|
|
279
|
-
def members; end
|
|
280
|
-
def new(*_arg0); end
|
|
281
|
-
end
|
|
282
|
-
end
|
|
283
|
-
|
|
284
|
-
# Haml::AttriubuteParser parses Hash literal to { String (key name) => String (value literal) }.
|
|
285
|
-
#
|
|
286
|
-
# source://haml-5.2.2/lib/haml/attribute_parser.rb:11
|
|
287
|
-
module Haml::AttributeParser
|
|
288
|
-
class << self
|
|
289
|
-
# @return [Boolean] - return true if AttributeParser.parse can be used.
|
|
290
|
-
#
|
|
291
|
-
# source://haml-5.2.2/lib/haml/attribute_parser.rb:23
|
|
292
|
-
def available?; end
|
|
293
|
-
|
|
294
|
-
# @param exp [String] - Old attributes literal or Hash literal generated from new attributes.
|
|
295
|
-
# @return [Hash<String, String>, nil] - Return parsed attribute Hash whose values are Ruby literals, or return nil if argument is not a single Hash literal.
|
|
296
|
-
#
|
|
297
|
-
# source://haml-5.2.2/lib/haml/attribute_parser.rb:29
|
|
298
|
-
def parse(exp); end
|
|
299
|
-
|
|
300
|
-
private
|
|
301
|
-
|
|
302
|
-
# @param hash_literal [String]
|
|
303
|
-
# @param block [Proc] - that takes [String, String] as arguments
|
|
304
|
-
#
|
|
305
|
-
# source://haml-5.2.2/lib/haml/attribute_parser.rb:99
|
|
306
|
-
def each_attribute(hash_literal, &block); end
|
|
307
|
-
|
|
308
|
-
# @param tokens [Array] - Ripper tokens
|
|
309
|
-
# @param block [Proc] - that takes balanced Ripper tokens as arguments
|
|
310
|
-
#
|
|
311
|
-
# source://haml-5.2.2/lib/haml/attribute_parser.rb:112
|
|
312
|
-
def each_balanced_tokens(tokens, &block); end
|
|
313
|
-
|
|
314
|
-
# @param token [Array] - Ripper token
|
|
315
|
-
#
|
|
316
|
-
# source://haml-5.2.2/lib/haml/attribute_parser.rb:83
|
|
317
|
-
def expect_string_end!(token); end
|
|
318
|
-
|
|
319
|
-
# @param exp [String] - Ruby expression
|
|
320
|
-
# @return [Boolean] - Return true if exp is a single Hash literal
|
|
321
|
-
#
|
|
322
|
-
# source://haml-5.2.2/lib/haml/attribute_parser.rb:45
|
|
323
|
-
def hash_literal?(exp); end
|
|
324
|
-
|
|
325
|
-
# @param tokens [Array] - Ripper tokens
|
|
326
|
-
#
|
|
327
|
-
# source://haml-5.2.2/lib/haml/attribute_parser.rb:90
|
|
328
|
-
def shift_hash_rocket!(tokens); end
|
|
329
|
-
|
|
330
|
-
# @param tokens [Array] - Ripper tokens. Scanned tokens will be destructively removed from this argument.
|
|
331
|
-
# @return [String] - attribute name in String
|
|
332
|
-
#
|
|
333
|
-
# source://haml-5.2.2/lib/haml/attribute_parser.rb:53
|
|
334
|
-
def shift_key!(tokens); end
|
|
335
|
-
end
|
|
336
|
-
end
|
|
337
|
-
|
|
338
|
-
# source://haml-5.2.2/lib/haml/attribute_parser.rb:19
|
|
339
|
-
Haml::AttributeParser::IGNORED_TYPES = T.let(T.unsafe(nil), Array)
|
|
340
|
-
|
|
341
|
-
# source://haml-5.2.2/lib/haml/attribute_parser.rb:17
|
|
342
|
-
Haml::AttributeParser::TEXT = T.let(T.unsafe(nil), Integer)
|
|
343
|
-
|
|
344
|
-
# Indices in Ripper tokens
|
|
345
|
-
#
|
|
346
|
-
# source://haml-5.2.2/lib/haml/attribute_parser.rb:16
|
|
347
|
-
Haml::AttributeParser::TYPE = T.let(T.unsafe(nil), Integer)
|
|
348
|
-
|
|
349
|
-
# source://haml-5.2.2/lib/haml/attribute_parser.rb:13
|
|
350
|
-
class Haml::AttributeParser::UnexpectedKeyError < ::StandardError; end
|
|
351
|
-
|
|
352
|
-
# source://haml-5.2.2/lib/haml/attribute_parser.rb:12
|
|
353
|
-
class Haml::AttributeParser::UnexpectedTokenError < ::StandardError; end
|
|
354
|
-
|
|
355
|
-
# This class is used only internally. It holds the buffer of HTML that
|
|
356
|
-
# is eventually output as the resulting document.
|
|
357
|
-
# It's called from within the precompiled code,
|
|
358
|
-
# and helps reduce the amount of processing done within `instance_eval`ed code.
|
|
359
|
-
#
|
|
360
|
-
# source://haml-5.2.2/lib/haml/buffer.rb:8
|
|
361
|
-
class Haml::Buffer
|
|
362
|
-
include ::Haml::Helpers
|
|
363
|
-
include ::Haml::Util
|
|
364
|
-
|
|
365
|
-
# @param upper [Buffer] The parent buffer
|
|
366
|
-
# @param options [{Symbol => Object}] An options hash.
|
|
367
|
-
# See {Haml::Engine#options\_for\_buffer}
|
|
368
|
-
# @return [Buffer] a new instance of Buffer
|
|
369
|
-
#
|
|
370
|
-
# source://haml-5.2.2/lib/haml/buffer.rb:92
|
|
371
|
-
def initialize(upper = T.unsafe(nil), options = T.unsafe(nil)); end
|
|
372
|
-
|
|
373
|
-
# @return [Boolean]
|
|
374
|
-
# @see #active?
|
|
375
|
-
#
|
|
376
|
-
# source://haml-5.2.2/lib/haml/buffer.rb:39
|
|
377
|
-
def active=(_arg0); end
|
|
378
|
-
|
|
379
|
-
# Whether or not this buffer is currently being used to render a Haml template.
|
|
380
|
-
# Returns `false` if a subtemplate is being rendered,
|
|
381
|
-
# even if it's a subtemplate of this buffer's template.
|
|
382
|
-
#
|
|
383
|
-
# @return [Boolean]
|
|
384
|
-
#
|
|
385
|
-
# source://haml-5.2.2/lib/haml/buffer.rb:72
|
|
386
|
-
def active?; end
|
|
387
|
-
|
|
388
|
-
# Modifies the indentation of the document.
|
|
389
|
-
#
|
|
390
|
-
# @param tab_change [Fixnum] The number of tabs by which to increase
|
|
391
|
-
# or decrease the document's indentation
|
|
392
|
-
#
|
|
393
|
-
# source://haml-5.2.2/lib/haml/buffer.rb:129
|
|
394
|
-
def adjust_tabs(tab_change); end
|
|
395
|
-
|
|
396
|
-
# The string that holds the compiled HTML. This is aliased as
|
|
397
|
-
# `_erbout` for compatibility with ERB-specific code.
|
|
398
|
-
#
|
|
399
|
-
# @return [String]
|
|
400
|
-
#
|
|
401
|
-
# source://haml-5.2.2/lib/haml/buffer.rb:16
|
|
402
|
-
def buffer; end
|
|
403
|
-
|
|
404
|
-
# The string that holds the compiled HTML. This is aliased as
|
|
405
|
-
# `_erbout` for compatibility with ERB-specific code.
|
|
406
|
-
#
|
|
407
|
-
# @return [String]
|
|
408
|
-
#
|
|
409
|
-
# source://haml-5.2.2/lib/haml/buffer.rb:16
|
|
410
|
-
def buffer=(_arg0); end
|
|
411
|
-
|
|
412
|
-
# nil if there's no capture_haml block running,
|
|
413
|
-
# and the position at which it's beginning the capture if there is one.
|
|
414
|
-
#
|
|
415
|
-
# @return [Fixnum, nil]
|
|
416
|
-
#
|
|
417
|
-
# source://haml-5.2.2/lib/haml/buffer.rb:35
|
|
418
|
-
def capture_position; end
|
|
419
|
-
|
|
420
|
-
# nil if there's no capture_haml block running,
|
|
421
|
-
# and the position at which it's beginning the capture if there is one.
|
|
422
|
-
#
|
|
423
|
-
# @return [Fixnum, nil]
|
|
424
|
-
#
|
|
425
|
-
# source://haml-5.2.2/lib/haml/buffer.rb:35
|
|
426
|
-
def capture_position=(_arg0); end
|
|
427
|
-
|
|
428
|
-
# Works like #{find_and_preserve}, but allows the first newline after a
|
|
429
|
-
# preserved opening tag to remain unencoded, and then outdents the content.
|
|
430
|
-
# This change was motivated primarily by the change in Rails 3.2.3 to emit
|
|
431
|
-
# a newline after textarea helpers.
|
|
432
|
-
#
|
|
433
|
-
# @param input [String] The text to process
|
|
434
|
-
# @private
|
|
435
|
-
# @since Haml 4.0.1
|
|
436
|
-
#
|
|
437
|
-
# source://haml-5.2.2/lib/haml/buffer.rb:152
|
|
438
|
-
def fix_textareas!(input); end
|
|
439
|
-
|
|
440
|
-
# @return [Boolean] Whether or not the format is HTML4
|
|
441
|
-
#
|
|
442
|
-
# source://haml-5.2.2/lib/haml/buffer.rb:52
|
|
443
|
-
def html4?; end
|
|
444
|
-
|
|
445
|
-
# @return [Boolean] Whether or not the format is HTML5.
|
|
446
|
-
#
|
|
447
|
-
# source://haml-5.2.2/lib/haml/buffer.rb:57
|
|
448
|
-
def html5?; end
|
|
449
|
-
|
|
450
|
-
# @return [Boolean] Whether or not the format is any flavor of HTML
|
|
451
|
-
#
|
|
452
|
-
# source://haml-5.2.2/lib/haml/buffer.rb:47
|
|
453
|
-
def html?; end
|
|
454
|
-
|
|
455
|
-
# The options hash passed in from {Haml::Engine}.
|
|
456
|
-
#
|
|
457
|
-
# @return [{String => Object}]
|
|
458
|
-
# @see Haml::Options#for_buffer
|
|
459
|
-
#
|
|
460
|
-
# source://haml-5.2.2/lib/haml/buffer.rb:22
|
|
461
|
-
def options; end
|
|
462
|
-
|
|
463
|
-
# The options hash passed in from {Haml::Engine}.
|
|
464
|
-
#
|
|
465
|
-
# @return [{String => Object}]
|
|
466
|
-
# @see Haml::Options#for_buffer
|
|
467
|
-
#
|
|
468
|
-
# source://haml-5.2.2/lib/haml/buffer.rb:22
|
|
469
|
-
def options=(_arg0); end
|
|
470
|
-
|
|
471
|
-
# Appends text to the buffer, properly tabulated.
|
|
472
|
-
# Also modifies the document's indentation.
|
|
473
|
-
#
|
|
474
|
-
# @param text [String] The text to append
|
|
475
|
-
# @param tab_change [Fixnum] The number of tabs by which to increase
|
|
476
|
-
# or decrease the document's indentation
|
|
477
|
-
# @param dont_tab_up [Boolean] If true, don't indent the first line of `text`
|
|
478
|
-
#
|
|
479
|
-
# source://haml-5.2.2/lib/haml/buffer.rb:112
|
|
480
|
-
def push_text(text, tab_change, dont_tab_up); end
|
|
481
|
-
|
|
482
|
-
# Remove the whitespace from the right side of the buffer string.
|
|
483
|
-
# Doesn't do anything if we're at the beginning of a capture_haml block.
|
|
484
|
-
#
|
|
485
|
-
# source://haml-5.2.2/lib/haml/buffer.rb:135
|
|
486
|
-
def rstrip!; end
|
|
487
|
-
|
|
488
|
-
# @return [Fixnum] The current indentation level of the document
|
|
489
|
-
#
|
|
490
|
-
# source://haml-5.2.2/lib/haml/buffer.rb:77
|
|
491
|
-
def tabulation; end
|
|
492
|
-
|
|
493
|
-
# Sets the current tabulation of the document.
|
|
494
|
-
#
|
|
495
|
-
# @param val [Fixnum] The new tabulation
|
|
496
|
-
#
|
|
497
|
-
# source://haml-5.2.2/lib/haml/buffer.rb:84
|
|
498
|
-
def tabulation=(val); end
|
|
499
|
-
|
|
500
|
-
# @return [Boolean] Whether or not this buffer is a top-level template,
|
|
501
|
-
# as opposed to a nested partial
|
|
502
|
-
#
|
|
503
|
-
# source://haml-5.2.2/lib/haml/buffer.rb:63
|
|
504
|
-
def toplevel?; end
|
|
505
|
-
|
|
506
|
-
# The {Buffer} for the enclosing Haml document.
|
|
507
|
-
# This is set for partials and similar sorts of nested templates.
|
|
508
|
-
# It's `nil` at the top level (see \{#toplevel?}).
|
|
509
|
-
#
|
|
510
|
-
# @return [Buffer]
|
|
511
|
-
#
|
|
512
|
-
# source://haml-5.2.2/lib/haml/buffer.rb:29
|
|
513
|
-
def upper; end
|
|
514
|
-
|
|
515
|
-
# The {Buffer} for the enclosing Haml document.
|
|
516
|
-
# This is set for partials and similar sorts of nested templates.
|
|
517
|
-
# It's `nil` at the top level (see \{#toplevel?}).
|
|
518
|
-
#
|
|
519
|
-
# @return [Buffer]
|
|
520
|
-
#
|
|
521
|
-
# source://haml-5.2.2/lib/haml/buffer.rb:29
|
|
522
|
-
def upper=(_arg0); end
|
|
523
|
-
|
|
524
|
-
# @return [Boolean] Whether or not the format is XHTML
|
|
525
|
-
#
|
|
526
|
-
# source://haml-5.2.2/lib/haml/buffer.rb:42
|
|
527
|
-
def xhtml?; end
|
|
528
|
-
|
|
529
|
-
private
|
|
530
|
-
|
|
531
|
-
# source://haml-5.2.2/lib/haml/buffer.rb:171
|
|
532
|
-
def new_encoded_string; end
|
|
533
|
-
|
|
534
|
-
# Gets `count` tabs. Mostly for internal use.
|
|
535
|
-
#
|
|
536
|
-
# source://haml-5.2.2/lib/haml/buffer.rb:177
|
|
537
|
-
def tabs(count = T.unsafe(nil)); end
|
|
538
|
-
end
|
|
539
|
-
|
|
540
|
-
# source://haml-5.2.2/lib/haml/compiler.rb:8
|
|
541
|
-
class Haml::Compiler
|
|
542
|
-
include ::Haml::Util
|
|
543
|
-
|
|
544
|
-
# @return [Compiler] a new instance of Compiler
|
|
545
|
-
#
|
|
546
|
-
# source://haml-5.2.2/lib/haml/compiler.rb:13
|
|
547
|
-
def initialize(options); end
|
|
548
|
-
|
|
549
|
-
# source://haml-5.2.2/lib/haml/compiler.rb:22
|
|
550
|
-
def call(node); end
|
|
551
|
-
|
|
552
|
-
# source://haml-5.2.2/lib/haml/compiler.rb:27
|
|
553
|
-
def compile(node); end
|
|
554
|
-
|
|
555
|
-
# Returns the value of attribute options.
|
|
556
|
-
#
|
|
557
|
-
# source://haml-5.2.2/lib/haml/compiler.rb:11
|
|
558
|
-
def options; end
|
|
559
|
-
|
|
560
|
-
# Sets the attribute options
|
|
561
|
-
#
|
|
562
|
-
# @param value the value to set the attribute options to.
|
|
563
|
-
#
|
|
564
|
-
# source://haml-5.2.2/lib/haml/compiler.rb:11
|
|
565
|
-
def options=(_arg0); end
|
|
566
|
-
|
|
567
|
-
private
|
|
568
|
-
|
|
569
|
-
# source://haml-5.2.2/lib/haml/compiler.rb:278
|
|
570
|
-
def build_script_formatter(text, opts); end
|
|
571
|
-
|
|
572
|
-
# source://haml-5.2.2/lib/haml/compiler.rb:139
|
|
573
|
-
def compile_comment; end
|
|
574
|
-
|
|
575
|
-
# source://haml-5.2.2/lib/haml/compiler.rb:165
|
|
576
|
-
def compile_doctype; end
|
|
577
|
-
|
|
578
|
-
# source://haml-5.2.2/lib/haml/compiler.rb:170
|
|
579
|
-
def compile_filter; end
|
|
580
|
-
|
|
581
|
-
# source://haml-5.2.2/lib/haml/compiler.rb:86
|
|
582
|
-
def compile_haml_comment; end
|
|
583
|
-
|
|
584
|
-
# source://haml-5.2.2/lib/haml/compiler.rb:46
|
|
585
|
-
def compile_plain; end
|
|
586
|
-
|
|
587
|
-
# source://haml-5.2.2/lib/haml/compiler.rb:40
|
|
588
|
-
def compile_root; end
|
|
589
|
-
|
|
590
|
-
# source://haml-5.2.2/lib/haml/compiler.rb:60
|
|
591
|
-
def compile_script(&block); end
|
|
592
|
-
|
|
593
|
-
# source://haml-5.2.2/lib/haml/compiler.rb:68
|
|
594
|
-
def compile_silent_script; end
|
|
595
|
-
|
|
596
|
-
# source://haml-5.2.2/lib/haml/compiler.rb:88
|
|
597
|
-
def compile_tag; end
|
|
598
|
-
|
|
599
|
-
# source://haml-5.2.2/lib/haml/compiler.rb:238
|
|
600
|
-
def flush_merged_text; end
|
|
601
|
-
|
|
602
|
-
# @return [Boolean]
|
|
603
|
-
#
|
|
604
|
-
# source://haml-5.2.2/lib/haml/compiler.rb:50
|
|
605
|
-
def nuke_inner_whitespace?(node); end
|
|
606
|
-
|
|
607
|
-
# source://haml-5.2.2/lib/haml/compiler.rb:294
|
|
608
|
-
def push_generated_script(text); end
|
|
609
|
-
|
|
610
|
-
# Causes `text` to be evaluated in the context of
|
|
611
|
-
# the scope object and the result to be added to `@buffer`.
|
|
612
|
-
#
|
|
613
|
-
# If `opts[:preserve_script]` is true, Haml::Helpers#find_and_preserve is run on
|
|
614
|
-
# the result before it is added to `@buffer`
|
|
615
|
-
#
|
|
616
|
-
# source://haml-5.2.2/lib/haml/compiler.rb:260
|
|
617
|
-
def push_script(text, opts = T.unsafe(nil)); end
|
|
618
|
-
|
|
619
|
-
# Evaluates `text` in the context of the scope object, but
|
|
620
|
-
# does not output the result.
|
|
621
|
-
#
|
|
622
|
-
# source://haml-5.2.2/lib/haml/compiler.rb:218
|
|
623
|
-
def push_silent(text, can_suppress = T.unsafe(nil)); end
|
|
624
|
-
|
|
625
|
-
# source://haml-5.2.2/lib/haml/compiler.rb:231
|
|
626
|
-
def push_temple(temple); end
|
|
627
|
-
|
|
628
|
-
# Adds `text` to `@buffer`.
|
|
629
|
-
#
|
|
630
|
-
# source://haml-5.2.2/lib/haml/compiler.rb:227
|
|
631
|
-
def push_text(text); end
|
|
632
|
-
|
|
633
|
-
# source://haml-5.2.2/lib/haml/compiler.rb:299
|
|
634
|
-
def resolve_newlines; end
|
|
635
|
-
|
|
636
|
-
# Get rid of and whitespace at the end of the buffer
|
|
637
|
-
# or the merged text
|
|
638
|
-
#
|
|
639
|
-
# source://haml-5.2.2/lib/haml/compiler.rb:308
|
|
640
|
-
def rstrip_buffer!(index = T.unsafe(nil)); end
|
|
641
|
-
|
|
642
|
-
# source://haml-5.2.2/lib/haml/compiler.rb:182
|
|
643
|
-
def text_for_doctype; end
|
|
644
|
-
end
|
|
645
|
-
|
|
646
|
-
# This is the frontend for using Haml programmatically.
|
|
647
|
-
# It can be directly used by the user by creating a
|
|
648
|
-
# new instance and calling \{#render} to render the template.
|
|
649
|
-
# For example:
|
|
650
|
-
#
|
|
651
|
-
# template = File.read('templates/really_cool_template.haml')
|
|
652
|
-
# haml_engine = Haml::Engine.new(template)
|
|
653
|
-
# output = haml_engine.render
|
|
654
|
-
# puts output
|
|
655
|
-
#
|
|
656
|
-
# source://haml-5.2.2/lib/haml/engine.rb:24
|
|
657
|
-
class Haml::Engine
|
|
658
|
-
include ::Haml::Util
|
|
659
|
-
extend ::Forwardable
|
|
660
|
-
|
|
661
|
-
# Precompiles the Haml template.
|
|
662
|
-
#
|
|
663
|
-
# @param template [String] The Haml template
|
|
664
|
-
# @param options [{Symbol => Object}] An options hash;
|
|
665
|
-
# see {file:REFERENCE.md#options the Haml options documentation}
|
|
666
|
-
# @raise [Haml::Error] if there's a Haml syntax error in the template
|
|
667
|
-
# @return [Engine] a new instance of Engine
|
|
668
|
-
#
|
|
669
|
-
# source://haml-5.2.2/lib/haml/engine.rb:54
|
|
670
|
-
def initialize(template, options = T.unsafe(nil)); end
|
|
671
|
-
|
|
672
|
-
# Deprecated API for backword compatibility
|
|
673
|
-
#
|
|
674
|
-
# source://haml-5.2.2/lib/haml/engine.rb:69
|
|
675
|
-
def compiler; end
|
|
676
|
-
|
|
677
|
-
# Defines a method on `object` with the given name
|
|
678
|
-
# that renders the template and returns the result as a string.
|
|
679
|
-
#
|
|
680
|
-
# If `object` is a class or module,
|
|
681
|
-
# the method will instead be defined as an instance method.
|
|
682
|
-
# For example:
|
|
683
|
-
#
|
|
684
|
-
# t = Time.now
|
|
685
|
-
# Haml::Engine.new("%p\n Today's date is\n .date= self.to_s").def_method(t, :render)
|
|
686
|
-
# t.render #=> "<p>\n Today's date is\n <div class='date'>Fri Nov 23 18:28:29 -0800 2007</div>\n</p>\n"
|
|
687
|
-
#
|
|
688
|
-
# Haml::Engine.new(".upcased= upcase").def_method(String, :upcased_div)
|
|
689
|
-
# "foobar".upcased_div #=> "<div class='upcased'>FOOBAR</div>\n"
|
|
690
|
-
#
|
|
691
|
-
# The first argument of the defined method is a hash of local variable names to values.
|
|
692
|
-
# However, due to an unfortunate Ruby quirk,
|
|
693
|
-
# the local variables which can be assigned must be pre-declared.
|
|
694
|
-
# This is done with the `local_names` argument.
|
|
695
|
-
# For example:
|
|
696
|
-
#
|
|
697
|
-
# # This works
|
|
698
|
-
# obj = Object.new
|
|
699
|
-
# Haml::Engine.new("%p= foo").def_method(obj, :render, :foo)
|
|
700
|
-
# obj.render(:foo => "Hello!") #=> "<p>Hello!</p>"
|
|
701
|
-
#
|
|
702
|
-
# # This doesn't
|
|
703
|
-
# obj = Object.new
|
|
704
|
-
# Haml::Engine.new("%p= foo").def_method(obj, :render)
|
|
705
|
-
# obj.render(:foo => "Hello!") #=> NameError: undefined local variable or method `foo'
|
|
706
|
-
#
|
|
707
|
-
# Note that Haml modifies the evaluation context
|
|
708
|
-
# (either the scope object or the `self` object of the scope binding).
|
|
709
|
-
# It extends {Haml::Helpers}, and various instance variables are set
|
|
710
|
-
# (all prefixed with `haml_`).
|
|
711
|
-
#
|
|
712
|
-
# @param object [Object, Module] The object on which to define the method
|
|
713
|
-
# @param name [String, Symbol] The name of the method to define
|
|
714
|
-
# @param local_names [Array<Symbol>] The names of the locals that can be passed to the proc
|
|
715
|
-
#
|
|
716
|
-
# source://haml-5.2.2/lib/haml/engine.rb:223
|
|
717
|
-
def def_method(object, name, *local_names); end
|
|
718
|
-
|
|
719
|
-
# The indentation used in the Haml document,
|
|
720
|
-
# or `nil` if the indentation is ambiguous
|
|
721
|
-
# (for example, for a single-level document).
|
|
722
|
-
#
|
|
723
|
-
# @return [String]
|
|
724
|
-
#
|
|
725
|
-
# source://haml-5.2.2/lib/haml/engine.rb:39
|
|
726
|
-
def indentation; end
|
|
727
|
-
|
|
728
|
-
# The indentation used in the Haml document,
|
|
729
|
-
# or `nil` if the indentation is ambiguous
|
|
730
|
-
# (for example, for a single-level document).
|
|
731
|
-
#
|
|
732
|
-
# @return [String]
|
|
733
|
-
#
|
|
734
|
-
# source://haml-5.2.2/lib/haml/engine.rb:39
|
|
735
|
-
def indentation=(_arg0); end
|
|
736
|
-
|
|
737
|
-
# The Haml::Options instance.
|
|
738
|
-
# See {file:REFERENCE.md#options the Haml options documentation}.
|
|
739
|
-
#
|
|
740
|
-
# @return Haml::Options
|
|
741
|
-
#
|
|
742
|
-
# source://haml-5.2.2/lib/haml/engine.rb:32
|
|
743
|
-
def options; end
|
|
744
|
-
|
|
745
|
-
# The Haml::Options instance.
|
|
746
|
-
# See {file:REFERENCE.md#options the Haml options documentation}.
|
|
747
|
-
#
|
|
748
|
-
# @return Haml::Options
|
|
749
|
-
#
|
|
750
|
-
# source://haml-5.2.2/lib/haml/engine.rb:32
|
|
751
|
-
def options=(_arg0); end
|
|
752
|
-
|
|
753
|
-
# source://haml-5.2.2/lib/haml/engine.rb:44
|
|
754
|
-
def options_for_buffer; end
|
|
755
|
-
|
|
756
|
-
# source://RUBY_ROOT/forwardable.rb:229
|
|
757
|
-
def precompiled(*args, **_arg1, &block); end
|
|
758
|
-
|
|
759
|
-
# source://RUBY_ROOT/forwardable.rb:229
|
|
760
|
-
def precompiled_method_return_value(*args, **_arg1, &block); end
|
|
761
|
-
|
|
762
|
-
# Processes the template and returns the result as a string.
|
|
763
|
-
#
|
|
764
|
-
# `scope` is the context in which the template is evaluated.
|
|
765
|
-
# If it's a `Binding`, Haml uses it as the second argument to `Kernel#eval`;
|
|
766
|
-
# otherwise, Haml just uses its `#instance_eval` context.
|
|
767
|
-
#
|
|
768
|
-
# Note that Haml modifies the evaluation context
|
|
769
|
-
# (either the scope object or the `self` object of the scope binding).
|
|
770
|
-
# It extends {Haml::Helpers}, and various instance variables are set
|
|
771
|
-
# (all prefixed with `haml_`).
|
|
772
|
-
# For example:
|
|
773
|
-
#
|
|
774
|
-
# s = "foobar"
|
|
775
|
-
# Haml::Engine.new("%p= upcase").render(s) #=> "<p>FOOBAR</p>"
|
|
776
|
-
#
|
|
777
|
-
# # s now extends Haml::Helpers
|
|
778
|
-
# s.respond_to?(:html_attrs) #=> true
|
|
779
|
-
#
|
|
780
|
-
# `locals` is a hash of local variables to make available to the template.
|
|
781
|
-
# For example:
|
|
782
|
-
#
|
|
783
|
-
# Haml::Engine.new("%p= foo").render(Object.new, :foo => "Hello, world!") #=> "<p>Hello, world!</p>"
|
|
784
|
-
#
|
|
785
|
-
# If a block is passed to render,
|
|
786
|
-
# that block is run when `yield` is called
|
|
787
|
-
# within the template.
|
|
788
|
-
#
|
|
789
|
-
# Due to some Ruby quirks,
|
|
790
|
-
# if `scope` is a `Binding` object and a block is given,
|
|
791
|
-
# the evaluation context may not be quite what the user expects.
|
|
792
|
-
# In particular, it's equivalent to passing `eval("self", scope)` as `scope`.
|
|
793
|
-
# This won't have an effect in most cases,
|
|
794
|
-
# but if you're relying on local variables defined in the context of `scope`,
|
|
795
|
-
# they won't work.
|
|
796
|
-
#
|
|
797
|
-
# @param scope [Binding, Object] The context in which the template is evaluated
|
|
798
|
-
# @param locals [{Symbol => Object}] Local variables that will be made available
|
|
799
|
-
# to the template
|
|
800
|
-
# @param block [#to_proc] A block that can be yielded to within the template
|
|
801
|
-
# @return [String] The rendered template
|
|
802
|
-
#
|
|
803
|
-
# source://haml-5.2.2/lib/haml/engine.rb:113
|
|
804
|
-
def render(scope = T.unsafe(nil), locals = T.unsafe(nil), &block); end
|
|
805
|
-
|
|
806
|
-
# Returns a proc that, when called,
|
|
807
|
-
# renders the template and returns the result as a string.
|
|
808
|
-
#
|
|
809
|
-
# `scope` works the same as it does for render.
|
|
810
|
-
#
|
|
811
|
-
# The first argument of the returned proc is a hash of local variable names to values.
|
|
812
|
-
# However, due to an unfortunate Ruby quirk,
|
|
813
|
-
# the local variables which can be assigned must be pre-declared.
|
|
814
|
-
# This is done with the `local_names` argument.
|
|
815
|
-
# For example:
|
|
816
|
-
#
|
|
817
|
-
# # This works
|
|
818
|
-
# Haml::Engine.new("%p= foo").render_proc(Object.new, :foo).call :foo => "Hello!"
|
|
819
|
-
# #=> "<p>Hello!</p>"
|
|
820
|
-
#
|
|
821
|
-
# # This doesn't
|
|
822
|
-
# Haml::Engine.new("%p= foo").render_proc.call :foo => "Hello!"
|
|
823
|
-
# #=> NameError: undefined local variable or method `foo'
|
|
824
|
-
#
|
|
825
|
-
# The proc doesn't take a block; any yields in the template will fail.
|
|
826
|
-
#
|
|
827
|
-
# @param scope [Binding, Object] The context in which the template is evaluated
|
|
828
|
-
# @param local_names [Array<Symbol>] The names of the locals that can be passed to the proc
|
|
829
|
-
# @return [Proc] The proc that will run the template
|
|
830
|
-
#
|
|
831
|
-
# source://haml-5.2.2/lib/haml/engine.rb:164
|
|
832
|
-
def render_proc(scope = T.unsafe(nil), *local_names); end
|
|
833
|
-
|
|
834
|
-
# Processes the template and returns the result as a string.
|
|
835
|
-
#
|
|
836
|
-
# `scope` is the context in which the template is evaluated.
|
|
837
|
-
# If it's a `Binding`, Haml uses it as the second argument to `Kernel#eval`;
|
|
838
|
-
# otherwise, Haml just uses its `#instance_eval` context.
|
|
839
|
-
#
|
|
840
|
-
# Note that Haml modifies the evaluation context
|
|
841
|
-
# (either the scope object or the `self` object of the scope binding).
|
|
842
|
-
# It extends {Haml::Helpers}, and various instance variables are set
|
|
843
|
-
# (all prefixed with `haml_`).
|
|
844
|
-
# For example:
|
|
845
|
-
#
|
|
846
|
-
# s = "foobar"
|
|
847
|
-
# Haml::Engine.new("%p= upcase").render(s) #=> "<p>FOOBAR</p>"
|
|
848
|
-
#
|
|
849
|
-
# # s now extends Haml::Helpers
|
|
850
|
-
# s.respond_to?(:html_attrs) #=> true
|
|
851
|
-
#
|
|
852
|
-
# `locals` is a hash of local variables to make available to the template.
|
|
853
|
-
# For example:
|
|
854
|
-
#
|
|
855
|
-
# Haml::Engine.new("%p= foo").render(Object.new, :foo => "Hello, world!") #=> "<p>Hello, world!</p>"
|
|
856
|
-
#
|
|
857
|
-
# If a block is passed to render,
|
|
858
|
-
# that block is run when `yield` is called
|
|
859
|
-
# within the template.
|
|
860
|
-
#
|
|
861
|
-
# Due to some Ruby quirks,
|
|
862
|
-
# if `scope` is a `Binding` object and a block is given,
|
|
863
|
-
# the evaluation context may not be quite what the user expects.
|
|
864
|
-
# In particular, it's equivalent to passing `eval("self", scope)` as `scope`.
|
|
865
|
-
# This won't have an effect in most cases,
|
|
866
|
-
# but if you're relying on local variables defined in the context of `scope`,
|
|
867
|
-
# they won't work.
|
|
868
|
-
#
|
|
869
|
-
# @param scope [Binding, Object] The context in which the template is evaluated
|
|
870
|
-
# @param locals [{Symbol => Object}] Local variables that will be made available
|
|
871
|
-
# to the template
|
|
872
|
-
# @param block [#to_proc] A block that can be yielded to within the template
|
|
873
|
-
# @return [String] The rendered template
|
|
874
|
-
#
|
|
875
|
-
# source://haml-5.2.2/lib/haml/engine.rb:113
|
|
876
|
-
def to_html(scope = T.unsafe(nil), locals = T.unsafe(nil), &block); end
|
|
877
|
-
|
|
878
|
-
private
|
|
879
|
-
|
|
880
|
-
# source://haml-5.2.2/lib/haml/engine.rb:232
|
|
881
|
-
def set_locals(locals, scope, scope_object); end
|
|
882
|
-
end
|
|
883
|
-
|
|
884
|
-
# An exception raised by Haml code.
|
|
885
|
-
#
|
|
886
|
-
# source://haml-5.2.2/lib/haml/error.rb:5
|
|
887
|
-
class Haml::Error < ::StandardError
|
|
888
|
-
# @param message [String] The error message
|
|
889
|
-
# @param line [Fixnum] See \{#line}
|
|
890
|
-
# @return [Error] a new instance of Error
|
|
891
|
-
#
|
|
892
|
-
# source://haml-5.2.2/lib/haml/error.rb:52
|
|
893
|
-
def initialize(message = T.unsafe(nil), line = T.unsafe(nil)); end
|
|
894
|
-
|
|
895
|
-
# The line of the template on which the error occurred.
|
|
896
|
-
#
|
|
897
|
-
# @return [Fixnum]
|
|
898
|
-
#
|
|
899
|
-
# source://haml-5.2.2/lib/haml/error.rb:48
|
|
900
|
-
def line; end
|
|
901
|
-
|
|
902
|
-
class << self
|
|
903
|
-
# source://haml-5.2.2/lib/haml/error.rb:40
|
|
904
|
-
def message(key, *args); end
|
|
905
|
-
end
|
|
906
|
-
end
|
|
907
|
-
|
|
908
|
-
# source://haml-5.2.2/lib/haml/error.rb:7
|
|
909
|
-
Haml::Error::MESSAGES = T.let(T.unsafe(nil), Hash)
|
|
910
|
-
|
|
911
|
-
# Like Temple::Filters::Escapable, but with support for escaping by
|
|
912
|
-
# Haml::Herlpers.html_escape and Haml::Herlpers.escape_once.
|
|
913
|
-
#
|
|
914
|
-
# source://haml-5.2.2/lib/haml/escapable.rb:7
|
|
915
|
-
class Haml::Escapable < ::Temple::Filter
|
|
916
|
-
# @return [Escapable] a new instance of Escapable
|
|
917
|
-
#
|
|
918
|
-
# source://haml-5.2.2/lib/haml/escapable.rb:10
|
|
919
|
-
def initialize(*_arg0); end
|
|
920
|
-
|
|
921
|
-
# The same as Haml::AttributeBuilder.build_attributes
|
|
922
|
-
#
|
|
923
|
-
# source://haml-5.2.2/lib/haml/escapable.rb:39
|
|
924
|
-
def on_dynamic(value); end
|
|
925
|
-
|
|
926
|
-
# source://haml-5.2.2/lib/haml/escapable.rb:16
|
|
927
|
-
def on_escape(flag, exp); end
|
|
928
|
-
|
|
929
|
-
# The same as Haml::AttributeBuilder.build_attributes
|
|
930
|
-
#
|
|
931
|
-
# source://haml-5.2.2/lib/haml/escapable.rb:26
|
|
932
|
-
def on_static(value); end
|
|
933
|
-
|
|
934
|
-
private
|
|
935
|
-
|
|
936
|
-
# source://haml-5.2.2/lib/haml/escapable.rb:61
|
|
937
|
-
def escape(value); end
|
|
938
|
-
|
|
939
|
-
# source://haml-5.2.2/lib/haml/escapable.rb:73
|
|
940
|
-
def escape_code(value); end
|
|
941
|
-
|
|
942
|
-
# source://haml-5.2.2/lib/haml/escapable.rb:53
|
|
943
|
-
def escape_once(value); end
|
|
944
|
-
|
|
945
|
-
# source://haml-5.2.2/lib/haml/escapable.rb:69
|
|
946
|
-
def escape_once_code(value); end
|
|
947
|
-
end
|
|
948
|
-
|
|
949
|
-
# Special value of `flag` to ignore html_safe?
|
|
950
|
-
#
|
|
951
|
-
# source://haml-5.2.2/lib/haml/escapable.rb:8
|
|
952
|
-
class Haml::Escapable::EscapeSafeBuffer < ::Struct
|
|
953
|
-
# Returns the value of attribute value
|
|
954
|
-
#
|
|
955
|
-
# @return [Object] the current value of value
|
|
956
|
-
def value; end
|
|
957
|
-
|
|
958
|
-
# Sets the attribute value
|
|
959
|
-
#
|
|
960
|
-
# @param value [Object] the value to set the attribute value to.
|
|
961
|
-
# @return [Object] the newly set value
|
|
962
|
-
def value=(_); end
|
|
963
|
-
|
|
964
|
-
class << self
|
|
965
|
-
def [](*_arg0); end
|
|
966
|
-
def inspect; end
|
|
967
|
-
def keyword_init?; end
|
|
968
|
-
def members; end
|
|
969
|
-
def new(*_arg0); end
|
|
970
|
-
end
|
|
971
|
-
end
|
|
972
|
-
|
|
973
|
-
# The module containing the default Haml filters,
|
|
974
|
-
# as well as the base module, {Haml::Filters::Base}.
|
|
975
|
-
#
|
|
976
|
-
# @see Haml::Filters::Base
|
|
977
|
-
#
|
|
978
|
-
# source://haml-5.2.2/lib/haml/filters.rb:10
|
|
979
|
-
module Haml::Filters
|
|
980
|
-
extend ::Haml::Filters
|
|
981
|
-
|
|
982
|
-
# @return [{String => Haml::Filters::Base}] a hash mapping filter names to
|
|
983
|
-
# classes.
|
|
984
|
-
#
|
|
985
|
-
# source://haml-5.2.2/lib/haml/filters.rb:16
|
|
986
|
-
def defined; end
|
|
987
|
-
|
|
988
|
-
# Loads an external template engine from
|
|
989
|
-
# [Tilt](https://github.com/rtomayko/tilt) as a filter. This method is used
|
|
990
|
-
# internally by Haml to set up filters for Sass, SCSS, Less, Coffeescript,
|
|
991
|
-
# and others. It's left public to make it easy for developers to add their
|
|
992
|
-
# own Tilt-based filters if they choose.
|
|
993
|
-
#
|
|
994
|
-
# @option options
|
|
995
|
-
# @option options
|
|
996
|
-
# @option options
|
|
997
|
-
# @option options
|
|
998
|
-
# @option options
|
|
999
|
-
# @param options [Hash] Options for generating the filter module.
|
|
1000
|
-
# @return [Module] The generated filter.
|
|
1001
|
-
# @since 4.0
|
|
1002
|
-
#
|
|
1003
|
-
# source://haml-5.2.2/lib/haml/filters.rb:40
|
|
1004
|
-
def register_tilt_filter(name, options = T.unsafe(nil)); end
|
|
1005
|
-
|
|
1006
|
-
# Removes a filter from Haml. If the filter was removed, it returns
|
|
1007
|
-
# the Module that was removed upon success, or nil on failure. If you try
|
|
1008
|
-
# to redefine a filter, Haml will raise an error. Use this method first to
|
|
1009
|
-
# explicitly remove the filter before redefining it.
|
|
1010
|
-
#
|
|
1011
|
-
# @return Module The filter module that has been removed
|
|
1012
|
-
# @since 4.0
|
|
1013
|
-
#
|
|
1014
|
-
# source://haml-5.2.2/lib/haml/filters.rb:69
|
|
1015
|
-
def remove_filter(name); end
|
|
1016
|
-
end
|
|
1017
|
-
|
|
1018
|
-
# The base module for Haml filters.
|
|
1019
|
-
# User-defined filters should be modules including this module.
|
|
1020
|
-
# The name of the filter is taken by downcasing the module name.
|
|
1021
|
-
# For instance, if the module is named `FooBar`, the filter will be `:foobar`.
|
|
1022
|
-
#
|
|
1023
|
-
# A user-defined filter should override either \{#render} or {\#compile}.
|
|
1024
|
-
# \{#render} is the most common.
|
|
1025
|
-
# It takes a string, the filter source,
|
|
1026
|
-
# and returns another string, the result of the filter.
|
|
1027
|
-
# For example, the following will define a filter named `:sass`:
|
|
1028
|
-
#
|
|
1029
|
-
# module Haml::Filters::Sass
|
|
1030
|
-
# include Haml::Filters::Base
|
|
1031
|
-
#
|
|
1032
|
-
# def render(text)
|
|
1033
|
-
# ::Sass::Engine.new(text).render
|
|
1034
|
-
# end
|
|
1035
|
-
# end
|
|
1036
|
-
#
|
|
1037
|
-
# For details on overriding \{#compile}, see its documentation.
|
|
1038
|
-
#
|
|
1039
|
-
# Note that filters overriding \{#render} automatically support `#{}`
|
|
1040
|
-
# for interpolating Ruby code.
|
|
1041
|
-
# Those overriding \{#compile} will need to add such support manually
|
|
1042
|
-
# if it's desired.
|
|
1043
|
-
#
|
|
1044
|
-
# source://haml-5.2.2/lib/haml/filters.rb:101
|
|
1045
|
-
module Haml::Filters::Base
|
|
1046
|
-
# This should be overridden when a filter needs to have access to the Haml
|
|
1047
|
-
# evaluation context. Rather than applying a filter to a string at
|
|
1048
|
-
# compile-time, \{#compile} uses the {Haml::Compiler} instance to compile
|
|
1049
|
-
# the string to Ruby code that will be executed in the context of the
|
|
1050
|
-
# active Haml template.
|
|
1051
|
-
#
|
|
1052
|
-
# Warning: the {Haml::Compiler} interface is neither well-documented
|
|
1053
|
-
# nor guaranteed to be stable.
|
|
1054
|
-
# If you want to make use of it, you'll probably need to look at the
|
|
1055
|
-
# source code and should test your filter when upgrading to new Haml
|
|
1056
|
-
# versions.
|
|
1057
|
-
#
|
|
1058
|
-
# @param compiler [Haml::Compiler] The compiler instance
|
|
1059
|
-
# @param text [String] The text of the filter
|
|
1060
|
-
# @raise [Haml::Error] if none of \{#compile}, \{#render}, and
|
|
1061
|
-
# \{#render_with_options} are overridden
|
|
1062
|
-
#
|
|
1063
|
-
# source://haml-5.2.2/lib/haml/filters.rb:162
|
|
1064
|
-
def compile(compiler, text); end
|
|
1065
|
-
|
|
1066
|
-
# Same as \{#compile}, but requires the necessary files first.
|
|
1067
|
-
# *This is used by {Haml::Engine} and is not intended to be overridden or used elsewhere.*
|
|
1068
|
-
#
|
|
1069
|
-
# @see #compile
|
|
1070
|
-
#
|
|
1071
|
-
# source://haml-5.2.2/lib/haml/filters.rb:142
|
|
1072
|
-
def internal_compile(*args); end
|
|
1073
|
-
|
|
1074
|
-
# Takes the source text that should be passed to the filter
|
|
1075
|
-
# and returns the result of running the filter on that string.
|
|
1076
|
-
#
|
|
1077
|
-
# This should be overridden in most individual filter modules
|
|
1078
|
-
# to render text with the given filter.
|
|
1079
|
-
# If \{#compile} is overridden, however, \{#render} doesn't need to be.
|
|
1080
|
-
#
|
|
1081
|
-
# @param text [String] The source text for the filter to process
|
|
1082
|
-
# @raise [Haml::Error] if it's not overridden
|
|
1083
|
-
# @return [String] The filtered result
|
|
1084
|
-
#
|
|
1085
|
-
# source://haml-5.2.2/lib/haml/filters.rb:123
|
|
1086
|
-
def render(_text); end
|
|
1087
|
-
|
|
1088
|
-
# Same as \{#render}, but takes a {Haml::Engine} options hash as well.
|
|
1089
|
-
# It's only safe to rely on options made available in {Haml::Engine#options\_for\_buffer}.
|
|
1090
|
-
#
|
|
1091
|
-
# @param text [String] The source text for the filter to process
|
|
1092
|
-
# @raise [Haml::Error] if it or \{#render} isn't overridden
|
|
1093
|
-
# @return [String] The filtered result
|
|
1094
|
-
# @see #render
|
|
1095
|
-
#
|
|
1096
|
-
# source://haml-5.2.2/lib/haml/filters.rb:134
|
|
1097
|
-
def render_with_options(text, _options); end
|
|
1098
|
-
|
|
1099
|
-
class << self
|
|
1100
|
-
# This method is automatically called when {Base} is included in a module.
|
|
1101
|
-
# It automatically defines a filter
|
|
1102
|
-
# with the downcased name of that module.
|
|
1103
|
-
# For example, if the module is named `FooBar`, the filter will be `:foobar`.
|
|
1104
|
-
#
|
|
1105
|
-
# @param base [Module, Class] The module that this is included in
|
|
1106
|
-
#
|
|
1107
|
-
# source://haml-5.2.2/lib/haml/filters.rb:108
|
|
1108
|
-
def included(base); end
|
|
1109
|
-
end
|
|
1110
|
-
end
|
|
1111
|
-
|
|
1112
|
-
# Surrounds the filtered text with CDATA tags.
|
|
1113
|
-
#
|
|
1114
|
-
# source://haml-5.2.2/lib/haml/filters.rb:249
|
|
1115
|
-
module Haml::Filters::Cdata
|
|
1116
|
-
include ::Haml::Filters::Base
|
|
1117
|
-
extend ::Haml::Filters::Base
|
|
1118
|
-
extend ::Haml::Filters::Cdata
|
|
1119
|
-
|
|
1120
|
-
# @see Base#render
|
|
1121
|
-
#
|
|
1122
|
-
# source://haml-5.2.2/lib/haml/filters.rb:253
|
|
1123
|
-
def render(text); end
|
|
1124
|
-
end
|
|
1125
|
-
|
|
1126
|
-
# source://haml-5.2.2/lib/haml/filters.rb:45
|
|
1127
|
-
module Haml::Filters::Coffee
|
|
1128
|
-
include ::Haml::Filters::Base
|
|
1129
|
-
extend ::Haml::Filters::Base
|
|
1130
|
-
extend ::Haml::Filters::Javascript
|
|
1131
|
-
extend ::Haml::Filters::TiltFilter
|
|
1132
|
-
extend ::Haml::Filters::Coffee
|
|
1133
|
-
|
|
1134
|
-
class << self
|
|
1135
|
-
def render_with_options(text, compiler_options); end
|
|
1136
|
-
end
|
|
1137
|
-
end
|
|
1138
|
-
|
|
1139
|
-
# Surrounds the filtered text with `<style>` and CDATA tags. Useful for
|
|
1140
|
-
# including inline CSS.
|
|
1141
|
-
#
|
|
1142
|
-
# source://haml-5.2.2/lib/haml/filters.rb:229
|
|
1143
|
-
module Haml::Filters::Css
|
|
1144
|
-
include ::Haml::Filters::Base
|
|
1145
|
-
extend ::Haml::Filters::Base
|
|
1146
|
-
extend ::Haml::Filters::Css
|
|
1147
|
-
|
|
1148
|
-
# @see Base#render_with_options
|
|
1149
|
-
#
|
|
1150
|
-
# source://haml-5.2.2/lib/haml/filters.rb:233
|
|
1151
|
-
def render_with_options(text, options); end
|
|
1152
|
-
end
|
|
1153
|
-
|
|
1154
|
-
# Parses the filtered text with ERB.
|
|
1155
|
-
# Not available if the {file:REFERENCE.md#suppress_eval-option
|
|
1156
|
-
# `:suppress_eval`} option is set to true. Embedded Ruby code is evaluated
|
|
1157
|
-
# in the same context as the Haml template.
|
|
1158
|
-
#
|
|
1159
|
-
# source://haml-5.2.2/lib/haml/filters.rb:45
|
|
1160
|
-
module Haml::Filters::Erb
|
|
1161
|
-
include ::Haml::Filters::Base
|
|
1162
|
-
extend ::Haml::Filters::Base
|
|
1163
|
-
extend ::Haml::Filters::Plain
|
|
1164
|
-
extend ::Haml::Filters::TiltFilter
|
|
1165
|
-
extend ::Haml::Filters::Erb
|
|
1166
|
-
extend ::Haml::Filters::PrecompiledTiltFilter
|
|
1167
|
-
|
|
1168
|
-
class << self
|
|
1169
|
-
# source://haml-5.2.2/lib/haml/filters.rb:382
|
|
1170
|
-
def precompiled(text); end
|
|
1171
|
-
|
|
1172
|
-
def render_with_options(text, compiler_options); end
|
|
1173
|
-
end
|
|
1174
|
-
end
|
|
1175
|
-
|
|
1176
|
-
# Works the same as {Plain}, but HTML-escapes the text before placing it in
|
|
1177
|
-
# the document.
|
|
1178
|
-
#
|
|
1179
|
-
# source://haml-5.2.2/lib/haml/filters.rb:260
|
|
1180
|
-
module Haml::Filters::Escaped
|
|
1181
|
-
include ::Haml::Filters::Base
|
|
1182
|
-
extend ::Haml::Filters::Base
|
|
1183
|
-
extend ::Haml::Filters::Escaped
|
|
1184
|
-
|
|
1185
|
-
# @see Base#render
|
|
1186
|
-
#
|
|
1187
|
-
# source://haml-5.2.2/lib/haml/filters.rb:264
|
|
1188
|
-
def render(text); end
|
|
1189
|
-
end
|
|
1190
|
-
|
|
1191
|
-
# Surrounds the filtered text with `<script>` and CDATA tags. Useful for
|
|
1192
|
-
# including inline Javascript.
|
|
1193
|
-
#
|
|
1194
|
-
# source://haml-5.2.2/lib/haml/filters.rb:208
|
|
1195
|
-
module Haml::Filters::Javascript
|
|
1196
|
-
include ::Haml::Filters::Base
|
|
1197
|
-
extend ::Haml::Filters::Base
|
|
1198
|
-
extend ::Haml::Filters::Javascript
|
|
1199
|
-
|
|
1200
|
-
# @see Base#render_with_options
|
|
1201
|
-
#
|
|
1202
|
-
# source://haml-5.2.2/lib/haml/filters.rb:212
|
|
1203
|
-
def render_with_options(text, options); end
|
|
1204
|
-
end
|
|
1205
|
-
|
|
1206
|
-
# source://haml-5.2.2/lib/haml/filters.rb:45
|
|
1207
|
-
module Haml::Filters::Less
|
|
1208
|
-
include ::Haml::Filters::Base
|
|
1209
|
-
extend ::Haml::Filters::Base
|
|
1210
|
-
extend ::Haml::Filters::Css
|
|
1211
|
-
extend ::Haml::Filters::TiltFilter
|
|
1212
|
-
extend ::Haml::Filters::Less
|
|
1213
|
-
|
|
1214
|
-
class << self
|
|
1215
|
-
def render_with_options(text, compiler_options); end
|
|
1216
|
-
end
|
|
1217
|
-
end
|
|
1218
|
-
|
|
1219
|
-
# source://haml-5.2.2/lib/haml/filters.rb:45
|
|
1220
|
-
module Haml::Filters::Markdown
|
|
1221
|
-
include ::Haml::Filters::Base
|
|
1222
|
-
extend ::Haml::Filters::Base
|
|
1223
|
-
extend ::Haml::Filters::Plain
|
|
1224
|
-
extend ::Haml::Filters::TiltFilter
|
|
1225
|
-
extend ::Haml::Filters::Markdown
|
|
1226
|
-
|
|
1227
|
-
class << self
|
|
1228
|
-
def render_with_options(text, compiler_options); end
|
|
1229
|
-
end
|
|
1230
|
-
end
|
|
1231
|
-
|
|
1232
|
-
# Does not parse the filtered text.
|
|
1233
|
-
# This is useful for large blocks of text without HTML tags, when you don't
|
|
1234
|
-
# want lines starting with `.` or `-` to be parsed.
|
|
1235
|
-
#
|
|
1236
|
-
# source://haml-5.2.2/lib/haml/filters.rb:199
|
|
1237
|
-
module Haml::Filters::Plain
|
|
1238
|
-
include ::Haml::Filters::Base
|
|
1239
|
-
extend ::Haml::Filters::Base
|
|
1240
|
-
extend ::Haml::Filters::Plain
|
|
1241
|
-
|
|
1242
|
-
# @see Base#render
|
|
1243
|
-
#
|
|
1244
|
-
# source://haml-5.2.2/lib/haml/filters.rb:203
|
|
1245
|
-
def render(text); end
|
|
1246
|
-
end
|
|
1247
|
-
|
|
1248
|
-
# @private
|
|
1249
|
-
#
|
|
1250
|
-
# source://haml-5.2.2/lib/haml/filters.rb:347
|
|
1251
|
-
module Haml::Filters::PrecompiledTiltFilter
|
|
1252
|
-
# source://haml-5.2.2/lib/haml/filters.rb:352
|
|
1253
|
-
def compile(compiler, text); end
|
|
1254
|
-
|
|
1255
|
-
# source://haml-5.2.2/lib/haml/filters.rb:348
|
|
1256
|
-
def precompiled(text); end
|
|
1257
|
-
end
|
|
1258
|
-
|
|
1259
|
-
# Inserts the filtered text into the template with whitespace preserved.
|
|
1260
|
-
# `preserve`d blocks of text aren't indented, and newlines are replaced with
|
|
1261
|
-
# the HTML escape code for newlines, to preserve nice-looking output.
|
|
1262
|
-
#
|
|
1263
|
-
# @see Haml::Helpers#preserve
|
|
1264
|
-
#
|
|
1265
|
-
# source://haml-5.2.2/lib/haml/filters.rb:304
|
|
1266
|
-
module Haml::Filters::Preserve
|
|
1267
|
-
include ::Haml::Filters::Base
|
|
1268
|
-
extend ::Haml::Filters::Base
|
|
1269
|
-
extend ::Haml::Filters::Preserve
|
|
1270
|
-
|
|
1271
|
-
# @see Base#render
|
|
1272
|
-
#
|
|
1273
|
-
# source://haml-5.2.2/lib/haml/filters.rb:308
|
|
1274
|
-
def render(text); end
|
|
1275
|
-
end
|
|
1276
|
-
|
|
1277
|
-
# Parses the filtered text with the normal Ruby interpreter. Creates an IO
|
|
1278
|
-
# object named `haml_io`, anything written to it is output into the Haml
|
|
1279
|
-
# document. In previous version this filter redirected any output to `$stdout`
|
|
1280
|
-
# to the Haml document, this was not threadsafe and has been removed, you
|
|
1281
|
-
# should use `haml_io` instead.
|
|
1282
|
-
#
|
|
1283
|
-
# Not available if the {file:REFERENCE.md#suppress_eval-option `:suppress_eval`}
|
|
1284
|
-
# option is set to true. The Ruby code is evaluated in the same context as
|
|
1285
|
-
# the Haml template.
|
|
1286
|
-
#
|
|
1287
|
-
# source://haml-5.2.2/lib/haml/filters.rb:278
|
|
1288
|
-
module Haml::Filters::Ruby
|
|
1289
|
-
include ::Haml::Filters::Base
|
|
1290
|
-
extend ::Haml::Filters::Base
|
|
1291
|
-
extend ::Haml::Filters::Ruby
|
|
1292
|
-
|
|
1293
|
-
# @see Base#compile
|
|
1294
|
-
#
|
|
1295
|
-
# source://haml-5.2.2/lib/haml/filters.rb:283
|
|
1296
|
-
def compile(compiler, text); end
|
|
1297
|
-
end
|
|
1298
|
-
|
|
1299
|
-
# source://haml-5.2.2/lib/haml/filters.rb:45
|
|
1300
|
-
module Haml::Filters::Sass
|
|
1301
|
-
include ::Haml::Filters::Base
|
|
1302
|
-
extend ::Haml::Filters::Base
|
|
1303
|
-
extend ::Haml::Filters::Css
|
|
1304
|
-
extend ::Haml::Filters::TiltFilter
|
|
1305
|
-
extend ::Haml::Filters::Sass
|
|
1306
|
-
|
|
1307
|
-
class << self
|
|
1308
|
-
def render_with_options(text, compiler_options); end
|
|
1309
|
-
end
|
|
1310
|
-
end
|
|
1311
|
-
|
|
1312
|
-
# source://haml-5.2.2/lib/haml/filters.rb:45
|
|
1313
|
-
module Haml::Filters::Scss
|
|
1314
|
-
include ::Haml::Filters::Base
|
|
1315
|
-
extend ::Haml::Filters::Base
|
|
1316
|
-
extend ::Haml::Filters::Css
|
|
1317
|
-
extend ::Haml::Filters::TiltFilter
|
|
1318
|
-
extend ::Haml::Filters::Scss
|
|
1319
|
-
|
|
1320
|
-
class << self
|
|
1321
|
-
def render_with_options(text, compiler_options); end
|
|
1322
|
-
end
|
|
1323
|
-
end
|
|
1324
|
-
|
|
1325
|
-
# @private
|
|
1326
|
-
#
|
|
1327
|
-
# source://haml-5.2.2/lib/haml/filters.rb:314
|
|
1328
|
-
module Haml::Filters::TiltFilter
|
|
1329
|
-
extend ::Haml::Filters::TiltFilter
|
|
1330
|
-
|
|
1331
|
-
# Returns the value of attribute options.
|
|
1332
|
-
#
|
|
1333
|
-
# source://haml-5.2.2/lib/haml/filters.rb:316
|
|
1334
|
-
def options; end
|
|
1335
|
-
|
|
1336
|
-
# Sets the attribute options
|
|
1337
|
-
#
|
|
1338
|
-
# @param value the value to set the attribute options to.
|
|
1339
|
-
#
|
|
1340
|
-
# source://haml-5.2.2/lib/haml/filters.rb:316
|
|
1341
|
-
def options=(_arg0); end
|
|
1342
|
-
|
|
1343
|
-
# source://haml-5.2.2/lib/haml/filters.rb:319
|
|
1344
|
-
def template_class; end
|
|
1345
|
-
|
|
1346
|
-
# Sets the attribute template_class
|
|
1347
|
-
#
|
|
1348
|
-
# @param value the value to set the attribute template_class to.
|
|
1349
|
-
#
|
|
1350
|
-
# source://haml-5.2.2/lib/haml/filters.rb:317
|
|
1351
|
-
def template_class=(_arg0); end
|
|
1352
|
-
|
|
1353
|
-
# Returns the value of attribute tilt_extension.
|
|
1354
|
-
#
|
|
1355
|
-
# source://haml-5.2.2/lib/haml/filters.rb:316
|
|
1356
|
-
def tilt_extension; end
|
|
1357
|
-
|
|
1358
|
-
# Sets the attribute tilt_extension
|
|
1359
|
-
#
|
|
1360
|
-
# @param value the value to set the attribute tilt_extension to.
|
|
1361
|
-
#
|
|
1362
|
-
# source://haml-5.2.2/lib/haml/filters.rb:316
|
|
1363
|
-
def tilt_extension=(_arg0); end
|
|
1364
|
-
|
|
1365
|
-
class << self
|
|
1366
|
-
# @private
|
|
1367
|
-
#
|
|
1368
|
-
# source://haml-5.2.2/lib/haml/filters.rb:329
|
|
1369
|
-
def extended(base); end
|
|
1370
|
-
end
|
|
1371
|
-
end
|
|
1372
|
-
|
|
1373
|
-
# Ruby code generator, which is a limited version of Temple::Generator.
|
|
1374
|
-
# Limit methods since Haml doesn't need most of them.
|
|
1375
|
-
#
|
|
1376
|
-
# source://haml-5.2.2/lib/haml/generator.rb:6
|
|
1377
|
-
class Haml::Generator
|
|
1378
|
-
include ::Temple::Mixins::CompiledDispatcher
|
|
1379
|
-
include ::Temple::Mixins::Options
|
|
1380
|
-
extend ::Temple::Mixins::ClassOptions
|
|
1381
|
-
extend ::Temple::Mixins::ThreadOptions
|
|
1382
|
-
|
|
1383
|
-
# source://haml-5.2.2/lib/haml/generator.rb:12
|
|
1384
|
-
def call(exp); end
|
|
1385
|
-
|
|
1386
|
-
# source://haml-5.2.2/lib/haml/generator.rb:28
|
|
1387
|
-
def on_code(exp); end
|
|
1388
|
-
|
|
1389
|
-
# source://haml-5.2.2/lib/haml/generator.rb:24
|
|
1390
|
-
def on_dynamic(code); end
|
|
1391
|
-
|
|
1392
|
-
# source://haml-5.2.2/lib/haml/generator.rb:16
|
|
1393
|
-
def on_multi(*exp); end
|
|
1394
|
-
|
|
1395
|
-
# source://haml-5.2.2/lib/haml/generator.rb:32
|
|
1396
|
-
def on_newline; end
|
|
1397
|
-
|
|
1398
|
-
# source://haml-5.2.2/lib/haml/generator.rb:20
|
|
1399
|
-
def on_static(text); end
|
|
1400
|
-
|
|
1401
|
-
private
|
|
1402
|
-
|
|
1403
|
-
# source://haml-5.2.2/lib/haml/generator.rb:38
|
|
1404
|
-
def concat(str); end
|
|
1405
|
-
end
|
|
1406
|
-
|
|
1407
|
-
# This module contains various helpful methods to make it easier to do various tasks.
|
|
1408
|
-
# {Haml::Helpers} is automatically included in the context
|
|
1409
|
-
# that a Haml template is parsed in, so all these methods are at your
|
|
1410
|
-
# disposal from within the template.
|
|
1411
|
-
#
|
|
1412
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:10
|
|
1413
|
-
module Haml::Helpers
|
|
1414
|
-
extend ::Haml::Helpers
|
|
1415
|
-
|
|
1416
|
-
# Returns whether or not `block` is defined directly in a Haml template.
|
|
1417
|
-
#
|
|
1418
|
-
# @param block [Proc] A Ruby block
|
|
1419
|
-
# @return [Boolean] Whether or not `block` is defined directly in a Haml template
|
|
1420
|
-
#
|
|
1421
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:646
|
|
1422
|
-
def block_is_haml?(block); end
|
|
1423
|
-
|
|
1424
|
-
# Captures the result of a block of Haml code,
|
|
1425
|
-
# gets rid of the excess indentation,
|
|
1426
|
-
# and returns it as a string.
|
|
1427
|
-
# For example, after the following,
|
|
1428
|
-
#
|
|
1429
|
-
# .foo
|
|
1430
|
-
# - foo = capture_haml(13) do |a|
|
|
1431
|
-
# %p= a
|
|
1432
|
-
#
|
|
1433
|
-
# the local variable `foo` would be assigned to `"<p>13</p>\n"`.
|
|
1434
|
-
#
|
|
1435
|
-
# @param args [Array] Arguments to pass into the block
|
|
1436
|
-
# @yield [args] A block of Haml code that will be converted to a string
|
|
1437
|
-
# @yieldparam args [Array] `args`
|
|
1438
|
-
#
|
|
1439
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:373
|
|
1440
|
-
def capture_haml(*args, &block); end
|
|
1441
|
-
|
|
1442
|
-
# Escapes HTML entities in `text`, but without escaping an ampersand
|
|
1443
|
-
# that is already part of an escaped entity.
|
|
1444
|
-
#
|
|
1445
|
-
# @param text [String] The string to sanitize
|
|
1446
|
-
# @return [String] The sanitized string
|
|
1447
|
-
#
|
|
1448
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:623
|
|
1449
|
-
def escape_once(text); end
|
|
1450
|
-
|
|
1451
|
-
# Escapes HTML entities in `text`, but without escaping an ampersand
|
|
1452
|
-
# that is already part of an escaped entity.
|
|
1453
|
-
# Always escape text once regardless of html_safe?
|
|
1454
|
-
#
|
|
1455
|
-
# @param text [String] The string to sanitize
|
|
1456
|
-
# @return [String] The sanitized string
|
|
1457
|
-
#
|
|
1458
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:623
|
|
1459
|
-
def escape_once_without_haml_xss(text); end
|
|
1460
|
-
|
|
1461
|
-
# Uses \{#preserve} to convert any newlines inside whitespace-sensitive tags
|
|
1462
|
-
# into the HTML entities for endlines.
|
|
1463
|
-
#
|
|
1464
|
-
# @overload find_and_preserve
|
|
1465
|
-
# @overload find_and_preserve
|
|
1466
|
-
# @param tags [Array<String>] Tags that should have newlines escaped
|
|
1467
|
-
#
|
|
1468
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:111
|
|
1469
|
-
def find_and_preserve(input = T.unsafe(nil), tags = T.unsafe(nil), &block); end
|
|
1470
|
-
|
|
1471
|
-
# Takes any string, finds all the newlines, and converts them to
|
|
1472
|
-
# HTML entities so they'll render correctly in
|
|
1473
|
-
# whitespace-sensitive tags without screwing up the indentation.
|
|
1474
|
-
#
|
|
1475
|
-
# @overload preserve
|
|
1476
|
-
# @overload preserve
|
|
1477
|
-
#
|
|
1478
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:133
|
|
1479
|
-
def flatten(input = T.unsafe(nil), &block); end
|
|
1480
|
-
|
|
1481
|
-
# Outputs text directly to the Haml buffer, with the proper indentation.
|
|
1482
|
-
#
|
|
1483
|
-
# @param text [#to_s] The text to output
|
|
1484
|
-
#
|
|
1485
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:396
|
|
1486
|
-
def haml_concat(text = T.unsafe(nil)); end
|
|
1487
|
-
|
|
1488
|
-
# @return [String] The indentation string for the current line
|
|
1489
|
-
#
|
|
1490
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:427
|
|
1491
|
-
def haml_indent; end
|
|
1492
|
-
|
|
1493
|
-
# Creates an HTML tag with the given name and optionally text and attributes.
|
|
1494
|
-
# Can take a block that will run between the opening and closing tags.
|
|
1495
|
-
# If the block is a Haml block or outputs text using \{#haml\_concat},
|
|
1496
|
-
# the text will be properly indented.
|
|
1497
|
-
#
|
|
1498
|
-
# `name` can be a string using the standard Haml class/id shorthand
|
|
1499
|
-
# (e.g. "span#foo.bar", "#foo").
|
|
1500
|
-
# Just like standard Haml tags, these class and id values
|
|
1501
|
-
# will be merged with manually-specified attributes.
|
|
1502
|
-
#
|
|
1503
|
-
# `flags` is a list of symbol flags
|
|
1504
|
-
# like those that can be put at the end of a Haml tag
|
|
1505
|
-
# (`:/`, `:<`, and `:>`).
|
|
1506
|
-
# Currently, only `:/` and `:<` are supported.
|
|
1507
|
-
#
|
|
1508
|
-
# `haml_tag` outputs directly to the buffer;
|
|
1509
|
-
# its return value should not be used.
|
|
1510
|
-
# If you need to get the results as a string,
|
|
1511
|
-
# use \{#capture\_haml\}.
|
|
1512
|
-
#
|
|
1513
|
-
# For example,
|
|
1514
|
-
#
|
|
1515
|
-
# haml_tag :table do
|
|
1516
|
-
# haml_tag :tr do
|
|
1517
|
-
# haml_tag 'td.cell' do
|
|
1518
|
-
# haml_tag :strong, "strong!"
|
|
1519
|
-
# haml_concat "data"
|
|
1520
|
-
# end
|
|
1521
|
-
# haml_tag :td do
|
|
1522
|
-
# haml_concat "more_data"
|
|
1523
|
-
# end
|
|
1524
|
-
# end
|
|
1525
|
-
# end
|
|
1526
|
-
#
|
|
1527
|
-
# outputs
|
|
1528
|
-
#
|
|
1529
|
-
# <table>
|
|
1530
|
-
# <tr>
|
|
1531
|
-
# <td class='cell'>
|
|
1532
|
-
# <strong>
|
|
1533
|
-
# strong!
|
|
1534
|
-
# </strong>
|
|
1535
|
-
# data
|
|
1536
|
-
# </td>
|
|
1537
|
-
# <td>
|
|
1538
|
-
# more_data
|
|
1539
|
-
# </td>
|
|
1540
|
-
# </tr>
|
|
1541
|
-
# </table>
|
|
1542
|
-
#
|
|
1543
|
-
# @overload haml_tag
|
|
1544
|
-
# @overload haml_tag
|
|
1545
|
-
# @param name [#to_s] The name of the tag
|
|
1546
|
-
#
|
|
1547
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:488
|
|
1548
|
-
def haml_tag(name, *rest, &block); end
|
|
1549
|
-
|
|
1550
|
-
# Conditionally wrap a block in an element. If `condition` is `true` then
|
|
1551
|
-
# this method renders the tag described by the arguments in `tag` (using
|
|
1552
|
-
# \{#haml_tag}) with the given block inside, otherwise it just renders the block.
|
|
1553
|
-
#
|
|
1554
|
-
# For example,
|
|
1555
|
-
#
|
|
1556
|
-
# - haml_tag_if important, '.important' do
|
|
1557
|
-
# %p
|
|
1558
|
-
# A (possibly) important paragraph.
|
|
1559
|
-
#
|
|
1560
|
-
# will produce
|
|
1561
|
-
#
|
|
1562
|
-
# <div class='important'>
|
|
1563
|
-
# <p>
|
|
1564
|
-
# A (possibly) important paragraph.
|
|
1565
|
-
# </p>
|
|
1566
|
-
# </div>
|
|
1567
|
-
#
|
|
1568
|
-
# if `important` is truthy, and just
|
|
1569
|
-
#
|
|
1570
|
-
# <p>
|
|
1571
|
-
# A (possibly) important paragraph.
|
|
1572
|
-
# </p>
|
|
1573
|
-
#
|
|
1574
|
-
# otherwise.
|
|
1575
|
-
#
|
|
1576
|
-
# Like \{#haml_tag}, `haml_tag_if` outputs directly to the buffer and its
|
|
1577
|
-
# return value should not be used. Use \{#capture_haml} if you need to use
|
|
1578
|
-
# its results as a string.
|
|
1579
|
-
#
|
|
1580
|
-
# @param condition The condition to test to determine whether to render
|
|
1581
|
-
# the enclosing tag
|
|
1582
|
-
# @param tag Definition of the enclosing tag. See \{#haml_tag} for details
|
|
1583
|
-
# (specifically the form that takes a block)
|
|
1584
|
-
#
|
|
1585
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:586
|
|
1586
|
-
def haml_tag_if(condition, *tag); end
|
|
1587
|
-
|
|
1588
|
-
# Returns a hash containing default assignments for the `xmlns`, `lang`, and `xml:lang`
|
|
1589
|
-
# attributes of the `html` HTML element.
|
|
1590
|
-
# For example,
|
|
1591
|
-
#
|
|
1592
|
-
# %html{html_attrs}
|
|
1593
|
-
#
|
|
1594
|
-
# becomes
|
|
1595
|
-
#
|
|
1596
|
-
# <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en-US' lang='en-US'>
|
|
1597
|
-
#
|
|
1598
|
-
# @param lang [String] The value of `xml:lang` and `lang`
|
|
1599
|
-
# @return [{#to_s => String}] The attribute hash
|
|
1600
|
-
#
|
|
1601
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:228
|
|
1602
|
-
def html_attrs(lang = T.unsafe(nil)); end
|
|
1603
|
-
|
|
1604
|
-
# Returns a copy of `text` with ampersands, angle brackets and quotes
|
|
1605
|
-
# escaped into HTML entities.
|
|
1606
|
-
#
|
|
1607
|
-
# Note that if ActionView is loaded and XSS protection is enabled
|
|
1608
|
-
# (as is the default for Rails 3.0+, and optional for version 2.3.5+),
|
|
1609
|
-
# this won't escape text declared as "safe".
|
|
1610
|
-
#
|
|
1611
|
-
# @param text [String] The string to sanitize
|
|
1612
|
-
# @return [String] The sanitized string
|
|
1613
|
-
#
|
|
1614
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:609
|
|
1615
|
-
def html_escape(text); end
|
|
1616
|
-
|
|
1617
|
-
# Returns a copy of `text` with ampersands, angle brackets and quotes
|
|
1618
|
-
# escaped into HTML entities.
|
|
1619
|
-
#
|
|
1620
|
-
# Note that if ActionView is loaded and XSS protection is enabled
|
|
1621
|
-
# (as is the default for Rails 3.0+, and optional for version 2.3.5+),
|
|
1622
|
-
# this won't escape text declared as "safe".
|
|
1623
|
-
# Always escape text regardless of html_safe?
|
|
1624
|
-
#
|
|
1625
|
-
# @param text [String] The string to sanitize
|
|
1626
|
-
# @return [String] The sanitized string
|
|
1627
|
-
#
|
|
1628
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:609
|
|
1629
|
-
def html_escape_without_haml_xss(text); end
|
|
1630
|
-
|
|
1631
|
-
# Note: this does **not** need to be called when using Haml helpers
|
|
1632
|
-
# normally in Rails.
|
|
1633
|
-
#
|
|
1634
|
-
# Initializes the current object as though it were in the same context
|
|
1635
|
-
# as a normal ActionView instance using Haml.
|
|
1636
|
-
# This is useful if you want to use the helpers in a context
|
|
1637
|
-
# other than the normal setup with ActionView.
|
|
1638
|
-
# For example:
|
|
1639
|
-
#
|
|
1640
|
-
# context = Object.new
|
|
1641
|
-
# class << context
|
|
1642
|
-
# include Haml::Helpers
|
|
1643
|
-
# end
|
|
1644
|
-
# context.init_haml_helpers
|
|
1645
|
-
# context.haml_tag :p, "Stuff"
|
|
1646
|
-
#
|
|
1647
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:76
|
|
1648
|
-
def init_haml_helpers; end
|
|
1649
|
-
|
|
1650
|
-
# Returns whether or not the current template is a Haml template.
|
|
1651
|
-
#
|
|
1652
|
-
# This function, unlike other {Haml::Helpers} functions,
|
|
1653
|
-
# also works in other `ActionView` templates,
|
|
1654
|
-
# where it will always return false.
|
|
1655
|
-
#
|
|
1656
|
-
# @return [Boolean] Whether or not the current template is a Haml template
|
|
1657
|
-
#
|
|
1658
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:638
|
|
1659
|
-
def is_haml?; end
|
|
1660
|
-
|
|
1661
|
-
# Takes an `Enumerable` object and a block
|
|
1662
|
-
# and iterates over the enum,
|
|
1663
|
-
# yielding each element to a Haml block
|
|
1664
|
-
# and putting the result into `<li>` elements.
|
|
1665
|
-
# This creates a list of the results of the block.
|
|
1666
|
-
# For example:
|
|
1667
|
-
#
|
|
1668
|
-
# = list_of([['hello'], ['yall']]) do |i|
|
|
1669
|
-
# = i[0]
|
|
1670
|
-
#
|
|
1671
|
-
# Produces:
|
|
1672
|
-
#
|
|
1673
|
-
# <li>hello</li>
|
|
1674
|
-
# <li>yall</li>
|
|
1675
|
-
#
|
|
1676
|
-
# And:
|
|
1677
|
-
#
|
|
1678
|
-
# = list_of({:title => 'All the stuff', :description => 'A book about all the stuff.'}) do |key, val|
|
|
1679
|
-
# %h3= key.humanize
|
|
1680
|
-
# %p= val
|
|
1681
|
-
#
|
|
1682
|
-
# Produces:
|
|
1683
|
-
#
|
|
1684
|
-
# <li>
|
|
1685
|
-
# <h3>Title</h3>
|
|
1686
|
-
# <p>All the stuff</p>
|
|
1687
|
-
# </li>
|
|
1688
|
-
# <li>
|
|
1689
|
-
# <h3>Description</h3>
|
|
1690
|
-
# <p>A book about all the stuff.</p>
|
|
1691
|
-
# </li>
|
|
1692
|
-
#
|
|
1693
|
-
# While:
|
|
1694
|
-
#
|
|
1695
|
-
# = list_of(["Home", "About", "Contact", "FAQ"], {class: "nav", role: "nav"}) do |item|
|
|
1696
|
-
# %a{ href="#" }= item
|
|
1697
|
-
#
|
|
1698
|
-
# Produces:
|
|
1699
|
-
#
|
|
1700
|
-
# <li class='nav' role='nav'>
|
|
1701
|
-
# <a href='#'>Home</a>
|
|
1702
|
-
# </li>
|
|
1703
|
-
# <li class='nav' role='nav'>
|
|
1704
|
-
# <a href='#'>About</a>
|
|
1705
|
-
# </li>
|
|
1706
|
-
# <li class='nav' role='nav'>
|
|
1707
|
-
# <a href='#'>Contact</a>
|
|
1708
|
-
# </li>
|
|
1709
|
-
# <li class='nav' role='nav'>
|
|
1710
|
-
# <a href='#'>FAQ</a>
|
|
1711
|
-
# </li>
|
|
1712
|
-
#
|
|
1713
|
-
# `[[class", "nav"], [role", "nav"]]` could have been used instead of `{class: "nav", role: "nav"}` (or any enumerable collection where each pair of items responds to #to_s)
|
|
1714
|
-
#
|
|
1715
|
-
# @param enum [Enumerable] The list of objects to iterate over
|
|
1716
|
-
# @param opts [Enumerable<#to_s,#to_s>] Each key/value pair will become an attribute pair for each list item element.
|
|
1717
|
-
# @yield [item] A block which contains Haml code that goes within list items
|
|
1718
|
-
# @yieldparam item An element of `enum`
|
|
1719
|
-
#
|
|
1720
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:200
|
|
1721
|
-
def list_of(enum, opts = T.unsafe(nil), &block); end
|
|
1722
|
-
|
|
1723
|
-
# Runs a block of code in a non-Haml context
|
|
1724
|
-
# (i.e. \{#is\_haml?} will return false).
|
|
1725
|
-
#
|
|
1726
|
-
# This is mainly useful for rendering sub-templates such as partials in a non-Haml language,
|
|
1727
|
-
# particularly where helpers may behave differently when run from Haml.
|
|
1728
|
-
#
|
|
1729
|
-
# Note that this is automatically applied to Rails partials.
|
|
1730
|
-
#
|
|
1731
|
-
# @yield A block which won't register as Haml
|
|
1732
|
-
#
|
|
1733
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:90
|
|
1734
|
-
def non_haml; end
|
|
1735
|
-
|
|
1736
|
-
# Prepends a string to the beginning of a Haml block,
|
|
1737
|
-
# with no whitespace between.
|
|
1738
|
-
# For example:
|
|
1739
|
-
#
|
|
1740
|
-
# = precede '*' do
|
|
1741
|
-
# %span.small Not really
|
|
1742
|
-
#
|
|
1743
|
-
# Produces:
|
|
1744
|
-
#
|
|
1745
|
-
# *<span class='small'>Not really</span>
|
|
1746
|
-
#
|
|
1747
|
-
# @param str [String] The string to add before the Haml
|
|
1748
|
-
# @yield A block of Haml to prepend to
|
|
1749
|
-
#
|
|
1750
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:336
|
|
1751
|
-
def precede(str, &block); end
|
|
1752
|
-
|
|
1753
|
-
# Takes any string, finds all the newlines, and converts them to
|
|
1754
|
-
# HTML entities so they'll render correctly in
|
|
1755
|
-
# whitespace-sensitive tags without screwing up the indentation.
|
|
1756
|
-
#
|
|
1757
|
-
# @overload preserve
|
|
1758
|
-
# @overload preserve
|
|
1759
|
-
#
|
|
1760
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:133
|
|
1761
|
-
def preserve(input = T.unsafe(nil), &block); end
|
|
1762
|
-
|
|
1763
|
-
# Appends a string to the end of a Haml block,
|
|
1764
|
-
# with no whitespace between.
|
|
1765
|
-
# For example:
|
|
1766
|
-
#
|
|
1767
|
-
# click
|
|
1768
|
-
# = succeed '.' do
|
|
1769
|
-
# %a{:href=>"thing"} here
|
|
1770
|
-
#
|
|
1771
|
-
# Produces:
|
|
1772
|
-
#
|
|
1773
|
-
# click
|
|
1774
|
-
# <a href='thing'>here</a>.
|
|
1775
|
-
#
|
|
1776
|
-
# @param str [String] The string to add after the Haml
|
|
1777
|
-
# @yield A block of Haml to append to
|
|
1778
|
-
#
|
|
1779
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:355
|
|
1780
|
-
def succeed(str, &block); end
|
|
1781
|
-
|
|
1782
|
-
# Surrounds a block of Haml code with strings,
|
|
1783
|
-
# with no whitespace in between.
|
|
1784
|
-
# For example:
|
|
1785
|
-
#
|
|
1786
|
-
# = surround '(', ')' do
|
|
1787
|
-
# %a{:href => "food"} chicken
|
|
1788
|
-
#
|
|
1789
|
-
# Produces:
|
|
1790
|
-
#
|
|
1791
|
-
# (<a href='food'>chicken</a>)
|
|
1792
|
-
#
|
|
1793
|
-
# and
|
|
1794
|
-
#
|
|
1795
|
-
# = surround '*' do
|
|
1796
|
-
# %strong angry
|
|
1797
|
-
#
|
|
1798
|
-
# Produces:
|
|
1799
|
-
#
|
|
1800
|
-
# *<strong>angry</strong>*
|
|
1801
|
-
#
|
|
1802
|
-
# @param front [String] The string to add before the Haml
|
|
1803
|
-
# @param back [String] The string to add after the Haml
|
|
1804
|
-
# @yield A block of Haml to surround
|
|
1805
|
-
#
|
|
1806
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:317
|
|
1807
|
-
def surround(front, back = T.unsafe(nil), &block); end
|
|
1808
|
-
|
|
1809
|
-
# Decrements the number of tabs the buffer automatically adds
|
|
1810
|
-
# to the lines of the template.
|
|
1811
|
-
#
|
|
1812
|
-
# @param i [Fixnum] The number of tabs by which to decrease the indentation
|
|
1813
|
-
# @see #tab_up
|
|
1814
|
-
#
|
|
1815
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:263
|
|
1816
|
-
def tab_down(i = T.unsafe(nil)); end
|
|
1817
|
-
|
|
1818
|
-
# Increments the number of tabs the buffer automatically adds
|
|
1819
|
-
# to the lines of the template.
|
|
1820
|
-
# For example:
|
|
1821
|
-
#
|
|
1822
|
-
# %h1 foo
|
|
1823
|
-
# - tab_up
|
|
1824
|
-
# %p bar
|
|
1825
|
-
# - tab_down
|
|
1826
|
-
# %strong baz
|
|
1827
|
-
#
|
|
1828
|
-
# Produces:
|
|
1829
|
-
#
|
|
1830
|
-
# <h1>foo</h1>
|
|
1831
|
-
# <p>bar</p>
|
|
1832
|
-
# <strong>baz</strong>
|
|
1833
|
-
#
|
|
1834
|
-
# @param i [Fixnum] The number of tabs by which to increase the indentation
|
|
1835
|
-
# @see #tab_down
|
|
1836
|
-
#
|
|
1837
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:254
|
|
1838
|
-
def tab_up(i = T.unsafe(nil)); end
|
|
1839
|
-
|
|
1840
|
-
# Sets the number of tabs the buffer automatically adds
|
|
1841
|
-
# to the lines of the template,
|
|
1842
|
-
# but only for the duration of the block.
|
|
1843
|
-
# For example:
|
|
1844
|
-
#
|
|
1845
|
-
# %h1 foo
|
|
1846
|
-
# - with_tabs(2) do
|
|
1847
|
-
# %p bar
|
|
1848
|
-
# %strong baz
|
|
1849
|
-
#
|
|
1850
|
-
# Produces:
|
|
1851
|
-
#
|
|
1852
|
-
# <h1>foo</h1>
|
|
1853
|
-
# <p>bar</p>
|
|
1854
|
-
# <strong>baz</strong>
|
|
1855
|
-
#
|
|
1856
|
-
# @param i [Fixnum] The number of tabs to use
|
|
1857
|
-
# @yield A block in which the indentation will be `i` spaces
|
|
1858
|
-
#
|
|
1859
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:286
|
|
1860
|
-
def with_tabs(i); end
|
|
1861
|
-
|
|
1862
|
-
private
|
|
1863
|
-
|
|
1864
|
-
# Gives a proc the same local `_hamlout` and `_erbout` variables
|
|
1865
|
-
# that the current template has.
|
|
1866
|
-
#
|
|
1867
|
-
# @param proc [#call] The proc to bind
|
|
1868
|
-
# @return [Proc] A new proc with the new variables bound
|
|
1869
|
-
#
|
|
1870
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:689
|
|
1871
|
-
def haml_bind_proc(&proc); end
|
|
1872
|
-
|
|
1873
|
-
# The current {Haml::Buffer} object.
|
|
1874
|
-
#
|
|
1875
|
-
# @return [Haml::Buffer]
|
|
1876
|
-
#
|
|
1877
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:680
|
|
1878
|
-
def haml_buffer; end
|
|
1879
|
-
|
|
1880
|
-
# Internal method to write directly to the buffer with control of
|
|
1881
|
-
# whether the first line should be indented, and if there should be a
|
|
1882
|
-
# final newline.
|
|
1883
|
-
#
|
|
1884
|
-
# Lines added will have the proper indentation. This can be controlled
|
|
1885
|
-
# for the first line.
|
|
1886
|
-
#
|
|
1887
|
-
# Used by #haml_concat and #haml_tag.
|
|
1888
|
-
#
|
|
1889
|
-
# @param text [#to_s] The text to output
|
|
1890
|
-
# @param newline [Boolean] Whether to add a newline after the text
|
|
1891
|
-
# @param indent [Boolean] Whether to add indentation to the first line
|
|
1892
|
-
#
|
|
1893
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:413
|
|
1894
|
-
def haml_internal_concat(text = T.unsafe(nil), newline = T.unsafe(nil), indent = T.unsafe(nil)); end
|
|
1895
|
-
|
|
1896
|
-
# Internal method to write directly to the buffer with control of
|
|
1897
|
-
# whether the first line should be indented, and if there should be a
|
|
1898
|
-
# final newline.
|
|
1899
|
-
#
|
|
1900
|
-
# Lines added will have the proper indentation. This can be controlled
|
|
1901
|
-
# for the first line.
|
|
1902
|
-
#
|
|
1903
|
-
# Used by #haml_concat and #haml_tag.
|
|
1904
|
-
# Allows writing raw content. `haml_internal_concat_raw` isn't
|
|
1905
|
-
# effected by XSS mods. Used by #haml_tag to write the actual tags.
|
|
1906
|
-
#
|
|
1907
|
-
# @param text [#to_s] The text to output
|
|
1908
|
-
# @param newline [Boolean] Whether to add a newline after the text
|
|
1909
|
-
# @param indent [Boolean] Whether to add indentation to the first line
|
|
1910
|
-
#
|
|
1911
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:413
|
|
1912
|
-
def haml_internal_concat_raw(text = T.unsafe(nil), newline = T.unsafe(nil), indent = T.unsafe(nil)); end
|
|
1913
|
-
|
|
1914
|
-
# Parses the tag name used for \{#haml\_tag}
|
|
1915
|
-
# and merges it with the Ruby attributes hash.
|
|
1916
|
-
#
|
|
1917
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:654
|
|
1918
|
-
def merge_name_and_attributes(name, attributes_hash = T.unsafe(nil)); end
|
|
1919
|
-
|
|
1920
|
-
# Runs a block of code with the given buffer as the currently active buffer.
|
|
1921
|
-
#
|
|
1922
|
-
# @param buffer [Haml::Buffer] The Haml buffer to use temporarily
|
|
1923
|
-
# @yield A block in which the given buffer should be used
|
|
1924
|
-
#
|
|
1925
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:666
|
|
1926
|
-
def with_haml_buffer(buffer); end
|
|
1927
|
-
|
|
1928
|
-
class << self
|
|
1929
|
-
# @return [Boolean] Whether or not ActionView is loaded
|
|
1930
|
-
#
|
|
1931
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:56
|
|
1932
|
-
def action_view?; end
|
|
1933
|
-
end
|
|
1934
|
-
end
|
|
1935
|
-
|
|
1936
|
-
# An object that raises an error when \{#to\_s} is called.
|
|
1937
|
-
# It's used to raise an error when the return value of a helper is used
|
|
1938
|
-
# when it shouldn't be.
|
|
1939
|
-
#
|
|
1940
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:14
|
|
1941
|
-
class Haml::Helpers::ErrorReturn
|
|
1942
|
-
# @return [ErrorReturn] a new instance of ErrorReturn
|
|
1943
|
-
#
|
|
1944
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:15
|
|
1945
|
-
def initialize(method); end
|
|
1946
|
-
|
|
1947
|
-
# @return [String] A human-readable string representation
|
|
1948
|
-
#
|
|
1949
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:46
|
|
1950
|
-
def inspect; end
|
|
1951
|
-
|
|
1952
|
-
# Raises an error.
|
|
1953
|
-
#
|
|
1954
|
-
# @raise [Haml::Error] The error
|
|
1955
|
-
#
|
|
1956
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:26
|
|
1957
|
-
def to_s; end
|
|
1958
|
-
end
|
|
1959
|
-
|
|
1960
|
-
# Characters that need to be escaped to HTML entities from user input
|
|
1961
|
-
#
|
|
1962
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:596
|
|
1963
|
-
Haml::Helpers::HTML_ESCAPE = T.let(T.unsafe(nil), Hash)
|
|
1964
|
-
|
|
1965
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:616
|
|
1966
|
-
Haml::Helpers::HTML_ESCAPE_ONCE_REGEX = T.let(T.unsafe(nil), Regexp)
|
|
1967
|
-
|
|
1968
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:598
|
|
1969
|
-
Haml::Helpers::HTML_ESCAPE_REGEX = T.let(T.unsafe(nil), Regexp)
|
|
1970
|
-
|
|
1971
|
-
# source://haml-5.2.2/lib/haml/error.rb:64
|
|
1972
|
-
class Haml::InvalidAttributeNameError < ::Haml::SyntaxError; end
|
|
1973
|
-
|
|
1974
|
-
# This class encapsulates all of the configuration options that Haml
|
|
1975
|
-
# understands. Please see the {file:REFERENCE.md#options Haml Reference} to
|
|
1976
|
-
# learn how to set the options.
|
|
1977
|
-
#
|
|
1978
|
-
# source://haml-5.2.2/lib/haml/options.rb:7
|
|
1979
|
-
class Haml::Options
|
|
1980
|
-
# @return [Options] a new instance of Options
|
|
1981
|
-
#
|
|
1982
|
-
# source://haml-5.2.2/lib/haml/options.rb:174
|
|
1983
|
-
def initialize(values = T.unsafe(nil)); end
|
|
1984
|
-
|
|
1985
|
-
# Retrieve an option value.
|
|
1986
|
-
#
|
|
1987
|
-
# @param key The value to retrieve.
|
|
1988
|
-
#
|
|
1989
|
-
# source://haml-5.2.2/lib/haml/options.rb:182
|
|
1990
|
-
def [](key); end
|
|
1991
|
-
|
|
1992
|
-
# Set an option value.
|
|
1993
|
-
#
|
|
1994
|
-
# @param key The key to set.
|
|
1995
|
-
# @param value The value to set for the key.
|
|
1996
|
-
#
|
|
1997
|
-
# source://haml-5.2.2/lib/haml/options.rb:189
|
|
1998
|
-
def []=(key, value); end
|
|
1999
|
-
|
|
2000
|
-
# The character that should wrap element attributes. This defaults to `'`
|
|
2001
|
-
# (an apostrophe). Characters of this type within the attributes will be
|
|
2002
|
-
# escaped (e.g. by replacing them with `'`) if the character is an
|
|
2003
|
-
# apostrophe or a quotation mark.
|
|
2004
|
-
#
|
|
2005
|
-
# source://haml-5.2.2/lib/haml/options.rb:49
|
|
2006
|
-
def attr_wrapper; end
|
|
2007
|
-
|
|
2008
|
-
# source://haml-5.2.2/lib/haml/options.rb:221
|
|
2009
|
-
def attr_wrapper=(value); end
|
|
2010
|
-
|
|
2011
|
-
# A list of tag names that should be automatically self-closed if they have
|
|
2012
|
-
# no content. This can also contain regular expressions that match tag names
|
|
2013
|
-
# (or any object which responds to `#===`). Defaults to `['meta', 'img',
|
|
2014
|
-
# 'link', 'br', 'hr', 'input', 'area', 'param', 'col', 'base']`.
|
|
2015
|
-
#
|
|
2016
|
-
# source://haml-5.2.2/lib/haml/options.rb:55
|
|
2017
|
-
def autoclose; end
|
|
2018
|
-
|
|
2019
|
-
# A list of tag names that should be automatically self-closed if they have
|
|
2020
|
-
# no content. This can also contain regular expressions that match tag names
|
|
2021
|
-
# (or any object which responds to `#===`). Defaults to `['meta', 'img',
|
|
2022
|
-
# 'link', 'br', 'hr', 'input', 'area', 'param', 'col', 'base']`.
|
|
2023
|
-
#
|
|
2024
|
-
# source://haml-5.2.2/lib/haml/options.rb:55
|
|
2025
|
-
def autoclose=(_arg0); end
|
|
2026
|
-
|
|
2027
|
-
# Whether to include CDATA sections around javascript and css blocks when
|
|
2028
|
-
# using the `:javascript` or `:css` filters.
|
|
2029
|
-
#
|
|
2030
|
-
# This option also affects the `:sass`, `:scss`, `:less` and `:coffeescript`
|
|
2031
|
-
# filters.
|
|
2032
|
-
#
|
|
2033
|
-
# Defaults to `false` for html, `true` for xhtml. Cannot be changed when using
|
|
2034
|
-
# xhtml.
|
|
2035
|
-
#
|
|
2036
|
-
# source://haml-5.2.2/lib/haml/options.rb:240
|
|
2037
|
-
def cdata; end
|
|
2038
|
-
|
|
2039
|
-
# Whether to include CDATA sections around javascript and css blocks when
|
|
2040
|
-
# using the `:javascript` or `:css` filters.
|
|
2041
|
-
#
|
|
2042
|
-
# This option also affects the `:sass`, `:scss`, `:less` and `:coffeescript`
|
|
2043
|
-
# filters.
|
|
2044
|
-
#
|
|
2045
|
-
# Defaults to `false` for html, `true` for xhtml. Cannot be changed when using
|
|
2046
|
-
# xhtml.
|
|
2047
|
-
#
|
|
2048
|
-
# source://haml-5.2.2/lib/haml/options.rb:155
|
|
2049
|
-
def cdata=(_arg0); end
|
|
2050
|
-
|
|
2051
|
-
# The compiler class to use. Defaults to Haml::Compiler.
|
|
2052
|
-
#
|
|
2053
|
-
# source://haml-5.2.2/lib/haml/options.rb:161
|
|
2054
|
-
def compiler_class; end
|
|
2055
|
-
|
|
2056
|
-
# The compiler class to use. Defaults to Haml::Compiler.
|
|
2057
|
-
#
|
|
2058
|
-
# source://haml-5.2.2/lib/haml/options.rb:161
|
|
2059
|
-
def compiler_class=(_arg0); end
|
|
2060
|
-
|
|
2061
|
-
# The encoding to use for the HTML output.
|
|
2062
|
-
# This can be a string or an `Encoding` Object. Note that Haml **does not**
|
|
2063
|
-
# automatically re-encode Ruby values; any strings coming from outside the
|
|
2064
|
-
# application should be converted before being passed into the Haml
|
|
2065
|
-
# template. Defaults to `Encoding.default_internal`; if that's not set,
|
|
2066
|
-
# defaults to the encoding of the Haml template; if that's `US-ASCII`,
|
|
2067
|
-
# defaults to `"UTF-8"`.
|
|
2068
|
-
#
|
|
2069
|
-
# source://haml-5.2.2/lib/haml/options.rb:64
|
|
2070
|
-
def encoding; end
|
|
2071
|
-
|
|
2072
|
-
# source://haml-5.2.2/lib/haml/options.rb:244
|
|
2073
|
-
def encoding=(value); end
|
|
2074
|
-
|
|
2075
|
-
# Sets whether or not to escape HTML-sensitive characters in attributes. If
|
|
2076
|
-
# this is true, all HTML-sensitive characters in attributes are escaped. If
|
|
2077
|
-
# it's set to false, no HTML-sensitive characters in attributes are escaped.
|
|
2078
|
-
# If it's set to `:once`, existing HTML escape sequences are preserved, but
|
|
2079
|
-
# other HTML-sensitive characters are escaped.
|
|
2080
|
-
#
|
|
2081
|
-
# Defaults to `true`.
|
|
2082
|
-
#
|
|
2083
|
-
# source://haml-5.2.2/lib/haml/options.rb:73
|
|
2084
|
-
def escape_attrs; end
|
|
2085
|
-
|
|
2086
|
-
# Sets whether or not to escape HTML-sensitive characters in attributes. If
|
|
2087
|
-
# this is true, all HTML-sensitive characters in attributes are escaped. If
|
|
2088
|
-
# it's set to false, no HTML-sensitive characters in attributes are escaped.
|
|
2089
|
-
# If it's set to `:once`, existing HTML escape sequences are preserved, but
|
|
2090
|
-
# other HTML-sensitive characters are escaped.
|
|
2091
|
-
#
|
|
2092
|
-
# Defaults to `true`.
|
|
2093
|
-
#
|
|
2094
|
-
# source://haml-5.2.2/lib/haml/options.rb:73
|
|
2095
|
-
def escape_attrs=(_arg0); end
|
|
2096
|
-
|
|
2097
|
-
def escape_attrs?; end
|
|
2098
|
-
|
|
2099
|
-
# Sets whether or not to escape HTML-sensitive characters in interpolated strings.
|
|
2100
|
-
# See also {file:REFERENCE.md#escaping_html Escaping HTML} and
|
|
2101
|
-
# {file:REFERENCE.md#unescaping_html Unescaping HTML}.
|
|
2102
|
-
#
|
|
2103
|
-
# Defaults to the current value of `escape_html`.
|
|
2104
|
-
#
|
|
2105
|
-
# source://haml-5.2.2/lib/haml/options.rb:90
|
|
2106
|
-
def escape_filter_interpolations; end
|
|
2107
|
-
|
|
2108
|
-
# Sets whether or not to escape HTML-sensitive characters in interpolated strings.
|
|
2109
|
-
# See also {file:REFERENCE.md#escaping_html Escaping HTML} and
|
|
2110
|
-
# {file:REFERENCE.md#unescaping_html Unescaping HTML}.
|
|
2111
|
-
#
|
|
2112
|
-
# Defaults to the current value of `escape_html`.
|
|
2113
|
-
#
|
|
2114
|
-
# source://haml-5.2.2/lib/haml/options.rb:90
|
|
2115
|
-
def escape_filter_interpolations=(_arg0); end
|
|
2116
|
-
|
|
2117
|
-
# Sets whether or not to escape HTML-sensitive characters in script. If this
|
|
2118
|
-
# is true, `=` behaves like {file:REFERENCE.md#escaping_html `&=`};
|
|
2119
|
-
# otherwise, it behaves like {file:REFERENCE.md#unescaping_html `!=`}. Note
|
|
2120
|
-
# that if this is set, `!=` should be used for yielding to subtemplates and
|
|
2121
|
-
# rendering partials. See also {file:REFERENCE.md#escaping_html Escaping HTML} and
|
|
2122
|
-
# {file:REFERENCE.md#unescaping_html Unescaping HTML}.
|
|
2123
|
-
#
|
|
2124
|
-
# Defaults to false.
|
|
2125
|
-
#
|
|
2126
|
-
# source://haml-5.2.2/lib/haml/options.rb:83
|
|
2127
|
-
def escape_html; end
|
|
2128
|
-
|
|
2129
|
-
# Sets whether or not to escape HTML-sensitive characters in script. If this
|
|
2130
|
-
# is true, `=` behaves like {file:REFERENCE.md#escaping_html `&=`};
|
|
2131
|
-
# otherwise, it behaves like {file:REFERENCE.md#unescaping_html `!=`}. Note
|
|
2132
|
-
# that if this is set, `!=` should be used for yielding to subtemplates and
|
|
2133
|
-
# rendering partials. See also {file:REFERENCE.md#escaping_html Escaping HTML} and
|
|
2134
|
-
# {file:REFERENCE.md#unescaping_html Unescaping HTML}.
|
|
2135
|
-
#
|
|
2136
|
-
# Defaults to false.
|
|
2137
|
-
#
|
|
2138
|
-
# source://haml-5.2.2/lib/haml/options.rb:83
|
|
2139
|
-
def escape_html=(_arg0); end
|
|
2140
|
-
|
|
2141
|
-
# The name of the Haml file being parsed.
|
|
2142
|
-
# This is only used as information when exceptions are raised. This is
|
|
2143
|
-
# automatically assigned when working through ActionView, so it's really
|
|
2144
|
-
# only useful for the user to assign when dealing with Haml programatically.
|
|
2145
|
-
#
|
|
2146
|
-
# source://haml-5.2.2/lib/haml/options.rb:96
|
|
2147
|
-
def filename; end
|
|
2148
|
-
|
|
2149
|
-
# The name of the Haml file being parsed.
|
|
2150
|
-
# This is only used as information when exceptions are raised. This is
|
|
2151
|
-
# automatically assigned when working through ActionView, so it's really
|
|
2152
|
-
# only useful for the user to assign when dealing with Haml programatically.
|
|
2153
|
-
#
|
|
2154
|
-
# source://haml-5.2.2/lib/haml/options.rb:96
|
|
2155
|
-
def filename=(_arg0); end
|
|
2156
|
-
|
|
2157
|
-
# Key is filter name in String and value is Class to use. Defaults to {}.
|
|
2158
|
-
#
|
|
2159
|
-
# source://haml-5.2.2/lib/haml/options.rb:172
|
|
2160
|
-
def filters; end
|
|
2161
|
-
|
|
2162
|
-
# Key is filter name in String and value is Class to use. Defaults to {}.
|
|
2163
|
-
#
|
|
2164
|
-
# source://haml-5.2.2/lib/haml/options.rb:172
|
|
2165
|
-
def filters=(_arg0); end
|
|
2166
|
-
|
|
2167
|
-
# Returns a non-default subset of options: those that {Haml::Buffer} cares about.
|
|
2168
|
-
# All of the values here are such that when `#inspect` is called on the hash,
|
|
2169
|
-
# it can be `Kernel#eval`ed to get the same result back.
|
|
2170
|
-
#
|
|
2171
|
-
# See {file:REFERENCE.md#options the Haml options documentation}.
|
|
2172
|
-
#
|
|
2173
|
-
# @return [{Symbol => Object}] The options hash
|
|
2174
|
-
#
|
|
2175
|
-
# source://haml-5.2.2/lib/haml/options.rb:257
|
|
2176
|
-
def for_buffer; end
|
|
2177
|
-
|
|
2178
|
-
# Determines the output format. The default is `:html5`. The other options
|
|
2179
|
-
# are `:html4` and `:xhtml`. If the output is set to XHTML, then Haml
|
|
2180
|
-
# automatically generates self-closing tags and wraps the output of the
|
|
2181
|
-
# Javascript and CSS-like filters inside CDATA. When the output is set to
|
|
2182
|
-
# `:html5` or `:html4`, XML prologs are ignored. In all cases, an appropriate
|
|
2183
|
-
# doctype is generated from `!!!`.
|
|
2184
|
-
#
|
|
2185
|
-
# If the mime_type of the template being rendered is `text/xml` then a
|
|
2186
|
-
# format of `:xhtml` will be used even if the global output format is set to
|
|
2187
|
-
# `:html4` or `:html5`.
|
|
2188
|
-
#
|
|
2189
|
-
# source://haml-5.2.2/lib/haml/options.rb:228
|
|
2190
|
-
def format; end
|
|
2191
|
-
|
|
2192
|
-
# source://haml-5.2.2/lib/haml/options.rb:232
|
|
2193
|
-
def format=(value); end
|
|
2194
|
-
|
|
2195
|
-
# @return [Boolean] Whether or not the format is HTML4.
|
|
2196
|
-
#
|
|
2197
|
-
# source://haml-5.2.2/lib/haml/options.rb:212
|
|
2198
|
-
def html4?; end
|
|
2199
|
-
|
|
2200
|
-
# @return [Boolean] Whether or not the format is HTML5.
|
|
2201
|
-
#
|
|
2202
|
-
# source://haml-5.2.2/lib/haml/options.rb:217
|
|
2203
|
-
def html5?; end
|
|
2204
|
-
|
|
2205
|
-
# @return [Boolean] Whether or not the format is any flavor of HTML.
|
|
2206
|
-
#
|
|
2207
|
-
# source://haml-5.2.2/lib/haml/options.rb:207
|
|
2208
|
-
def html?; end
|
|
2209
|
-
|
|
2210
|
-
# If set to `true`, Haml will convert underscores to hyphens in all
|
|
2211
|
-
# {file:REFERENCE.md#html5_custom_data_attributes Custom Data Attributes} As
|
|
2212
|
-
# of Haml 4.0, this defaults to `true`.
|
|
2213
|
-
#
|
|
2214
|
-
# source://haml-5.2.2/lib/haml/options.rb:101
|
|
2215
|
-
def hyphenate_data_attrs; end
|
|
2216
|
-
|
|
2217
|
-
# If set to `true`, Haml will convert underscores to hyphens in all
|
|
2218
|
-
# {file:REFERENCE.md#html5_custom_data_attributes Custom Data Attributes} As
|
|
2219
|
-
# of Haml 4.0, this defaults to `true`.
|
|
2220
|
-
#
|
|
2221
|
-
# source://haml-5.2.2/lib/haml/options.rb:101
|
|
2222
|
-
def hyphenate_data_attrs=(_arg0); end
|
|
2223
|
-
|
|
2224
|
-
def hyphenate_data_attrs?; end
|
|
2225
|
-
|
|
2226
|
-
# The line offset of the Haml template being parsed. This is useful for
|
|
2227
|
-
# inline templates, similar to the last argument to `Kernel#eval`.
|
|
2228
|
-
#
|
|
2229
|
-
# source://haml-5.2.2/lib/haml/options.rb:105
|
|
2230
|
-
def line; end
|
|
2231
|
-
|
|
2232
|
-
# The line offset of the Haml template being parsed. This is useful for
|
|
2233
|
-
# inline templates, similar to the last argument to `Kernel#eval`.
|
|
2234
|
-
#
|
|
2235
|
-
# source://haml-5.2.2/lib/haml/options.rb:105
|
|
2236
|
-
def line=(_arg0); end
|
|
2237
|
-
|
|
2238
|
-
# The mime type that the rendered document will be served with. If this is
|
|
2239
|
-
# set to `text/xml` then the format will be overridden to `:xhtml` even if
|
|
2240
|
-
# it has set to `:html4` or `:html5`.
|
|
2241
|
-
#
|
|
2242
|
-
# source://haml-5.2.2/lib/haml/options.rb:122
|
|
2243
|
-
def mime_type; end
|
|
2244
|
-
|
|
2245
|
-
# The mime type that the rendered document will be served with. If this is
|
|
2246
|
-
# set to `text/xml` then the format will be overridden to `:xhtml` even if
|
|
2247
|
-
# it has set to `:html4` or `:html5`.
|
|
2248
|
-
#
|
|
2249
|
-
# source://haml-5.2.2/lib/haml/options.rb:122
|
|
2250
|
-
def mime_type=(_arg0); end
|
|
2251
|
-
|
|
2252
|
-
# The parser class to use. Defaults to Haml::Parser.
|
|
2253
|
-
#
|
|
2254
|
-
# source://haml-5.2.2/lib/haml/options.rb:158
|
|
2255
|
-
def parser_class; end
|
|
2256
|
-
|
|
2257
|
-
# The parser class to use. Defaults to Haml::Parser.
|
|
2258
|
-
#
|
|
2259
|
-
# source://haml-5.2.2/lib/haml/options.rb:158
|
|
2260
|
-
def parser_class=(_arg0); end
|
|
2261
|
-
|
|
2262
|
-
# A list of tag names that should automatically have their newlines
|
|
2263
|
-
# preserved using the {Haml::Helpers#preserve} helper. This means that any
|
|
2264
|
-
# content given on the same line as the tag will be preserved. For example,
|
|
2265
|
-
# `%textarea= "Foo\nBar"` compiles to `<textarea>Foo
Bar</textarea>`.
|
|
2266
|
-
# Defaults to `['textarea', 'pre']`. See also
|
|
2267
|
-
# {file:REFERENCE.md#whitespace_preservation Whitespace Preservation}.
|
|
2268
|
-
#
|
|
2269
|
-
# source://haml-5.2.2/lib/haml/options.rb:130
|
|
2270
|
-
def preserve; end
|
|
2271
|
-
|
|
2272
|
-
# A list of tag names that should automatically have their newlines
|
|
2273
|
-
# preserved using the {Haml::Helpers#preserve} helper. This means that any
|
|
2274
|
-
# content given on the same line as the tag will be preserved. For example,
|
|
2275
|
-
# `%textarea= "Foo\nBar"` compiles to `<textarea>Foo
Bar</textarea>`.
|
|
2276
|
-
# Defaults to `['textarea', 'pre']`. See also
|
|
2277
|
-
# {file:REFERENCE.md#whitespace_preservation Whitespace Preservation}.
|
|
2278
|
-
#
|
|
2279
|
-
# source://haml-5.2.2/lib/haml/options.rb:130
|
|
2280
|
-
def preserve=(_arg0); end
|
|
2281
|
-
|
|
2282
|
-
# If set to `true`, all tags are treated as if both
|
|
2283
|
-
# {file:REFERENCE.md#whitespace_removal__and_ whitespace removal} options
|
|
2284
|
-
# were present. Use with caution as this may cause whitespace-related
|
|
2285
|
-
# formatting errors.
|
|
2286
|
-
#
|
|
2287
|
-
# Defaults to `false`.
|
|
2288
|
-
#
|
|
2289
|
-
# source://haml-5.2.2/lib/haml/options.rb:138
|
|
2290
|
-
def remove_whitespace; end
|
|
2291
|
-
|
|
2292
|
-
# If set to `true`, all tags are treated as if both
|
|
2293
|
-
# {file:REFERENCE.md#whitespace_removal__and_ whitespace removal} options
|
|
2294
|
-
# were present. Use with caution as this may cause whitespace-related
|
|
2295
|
-
# formatting errors.
|
|
2296
|
-
#
|
|
2297
|
-
# Defaults to `false`.
|
|
2298
|
-
#
|
|
2299
|
-
# source://haml-5.2.2/lib/haml/options.rb:138
|
|
2300
|
-
def remove_whitespace=(_arg0); end
|
|
2301
|
-
|
|
2302
|
-
def remove_whitespace?; end
|
|
2303
|
-
|
|
2304
|
-
# Whether or not attribute hashes and Ruby scripts designated by `=` or `~`
|
|
2305
|
-
# should be evaluated. If this is `true`, said scripts are rendered as empty
|
|
2306
|
-
# strings.
|
|
2307
|
-
#
|
|
2308
|
-
# Defaults to `false`.
|
|
2309
|
-
#
|
|
2310
|
-
# source://haml-5.2.2/lib/haml/options.rb:145
|
|
2311
|
-
def suppress_eval; end
|
|
2312
|
-
|
|
2313
|
-
# Whether or not attribute hashes and Ruby scripts designated by `=` or `~`
|
|
2314
|
-
# should be evaluated. If this is `true`, said scripts are rendered as empty
|
|
2315
|
-
# strings.
|
|
2316
|
-
#
|
|
2317
|
-
# Defaults to `false`.
|
|
2318
|
-
#
|
|
2319
|
-
# source://haml-5.2.2/lib/haml/options.rb:145
|
|
2320
|
-
def suppress_eval=(_arg0); end
|
|
2321
|
-
|
|
2322
|
-
def suppress_eval?; end
|
|
2323
|
-
|
|
2324
|
-
# Enable template tracing. If true, it will add a 'data-trace' attribute to
|
|
2325
|
-
# each tag generated by Haml. The value of the attribute will be the
|
|
2326
|
-
# source template name and the line number from which the tag was generated,
|
|
2327
|
-
# separated by a colon. On Rails applications, the path given will be a
|
|
2328
|
-
# relative path as from the views directory. On non-Rails applications,
|
|
2329
|
-
# the path will be the full path.
|
|
2330
|
-
#
|
|
2331
|
-
# source://haml-5.2.2/lib/haml/options.rb:169
|
|
2332
|
-
def trace; end
|
|
2333
|
-
|
|
2334
|
-
# Enable template tracing. If true, it will add a 'data-trace' attribute to
|
|
2335
|
-
# each tag generated by Haml. The value of the attribute will be the
|
|
2336
|
-
# source template name and the line number from which the tag was generated,
|
|
2337
|
-
# separated by a colon. On Rails applications, the path given will be a
|
|
2338
|
-
# relative path as from the views directory. On non-Rails applications,
|
|
2339
|
-
# the path will be the full path.
|
|
2340
|
-
#
|
|
2341
|
-
# source://haml-5.2.2/lib/haml/options.rb:169
|
|
2342
|
-
def trace=(_arg0); end
|
|
2343
|
-
|
|
2344
|
-
# @return [Boolean] Whether or not the format is XHTML.
|
|
2345
|
-
#
|
|
2346
|
-
# source://haml-5.2.2/lib/haml/options.rb:202
|
|
2347
|
-
def xhtml?; end
|
|
2348
|
-
|
|
2349
|
-
private
|
|
2350
|
-
|
|
2351
|
-
# source://haml-5.2.2/lib/haml/options.rb:269
|
|
2352
|
-
def defaults; end
|
|
2353
|
-
|
|
2354
|
-
class << self
|
|
2355
|
-
# Returns a subset of defaults: those that {Haml::Buffer} cares about.
|
|
2356
|
-
#
|
|
2357
|
-
# @return [{Symbol => Object}] The options hash
|
|
2358
|
-
#
|
|
2359
|
-
# source://haml-5.2.2/lib/haml/options.rb:30
|
|
2360
|
-
def buffer_defaults; end
|
|
2361
|
-
|
|
2362
|
-
# An array of keys that will be used to provide a hash of options to
|
|
2363
|
-
# {Haml::Buffer}.
|
|
2364
|
-
#
|
|
2365
|
-
# @return Hash
|
|
2366
|
-
#
|
|
2367
|
-
# source://haml-5.2.2/lib/haml/options.rb:26
|
|
2368
|
-
def buffer_option_keys; end
|
|
2369
|
-
|
|
2370
|
-
# The default option values.
|
|
2371
|
-
#
|
|
2372
|
-
# @return Hash
|
|
2373
|
-
#
|
|
2374
|
-
# source://haml-5.2.2/lib/haml/options.rb:15
|
|
2375
|
-
def defaults; end
|
|
2376
|
-
|
|
2377
|
-
# An array of valid values for the `:format` option.
|
|
2378
|
-
#
|
|
2379
|
-
# @return Array
|
|
2380
|
-
#
|
|
2381
|
-
# source://haml-5.2.2/lib/haml/options.rb:21
|
|
2382
|
-
def valid_formats; end
|
|
2383
|
-
|
|
2384
|
-
# source://haml-5.2.2/lib/haml/options.rb:36
|
|
2385
|
-
def wrap(options); end
|
|
2386
|
-
end
|
|
2387
|
-
end
|
|
2388
|
-
|
|
2389
|
-
# source://haml-5.2.2/lib/haml/parser.rb:7
|
|
2390
|
-
class Haml::Parser
|
|
2391
|
-
include ::Haml::Util
|
|
2392
|
-
|
|
2393
|
-
# @return [Parser] a new instance of Parser
|
|
2394
|
-
#
|
|
2395
|
-
# source://haml-5.2.2/lib/haml/parser.rb:97
|
|
2396
|
-
def initialize(options); end
|
|
2397
|
-
|
|
2398
|
-
# source://haml-5.2.2/lib/haml/parser.rb:106
|
|
2399
|
-
def call(template); end
|
|
2400
|
-
|
|
2401
|
-
# @raise [SyntaxError]
|
|
2402
|
-
#
|
|
2403
|
-
# source://haml-5.2.2/lib/haml/parser.rb:158
|
|
2404
|
-
def compute_tabs(line); end
|
|
2405
|
-
|
|
2406
|
-
# Returns the value of attribute root.
|
|
2407
|
-
#
|
|
2408
|
-
# source://haml-5.2.2/lib/haml/parser.rb:10
|
|
2409
|
-
def root; end
|
|
2410
|
-
|
|
2411
|
-
private
|
|
2412
|
-
|
|
2413
|
-
# source://haml-5.2.2/lib/haml/parser.rb:819
|
|
2414
|
-
def balance(*args); end
|
|
2415
|
-
|
|
2416
|
-
# Unlike #balance, this balances Ripper tokens to balance something like `{ a: "}" }` correctly.
|
|
2417
|
-
#
|
|
2418
|
-
# @raise [SyntaxError]
|
|
2419
|
-
#
|
|
2420
|
-
# source://haml-5.2.2/lib/haml/parser.rb:824
|
|
2421
|
-
def balance_tokens(buf, start, finish, count: T.unsafe(nil)); end
|
|
2422
|
-
|
|
2423
|
-
# source://haml-5.2.2/lib/haml/parser.rb:295
|
|
2424
|
-
def block_keyword(text); end
|
|
2425
|
-
|
|
2426
|
-
# @return [Boolean]
|
|
2427
|
-
#
|
|
2428
|
-
# source://haml-5.2.2/lib/haml/parser.rb:842
|
|
2429
|
-
def block_opened?; end
|
|
2430
|
-
|
|
2431
|
-
# source://haml-5.2.2/lib/haml/parser.rb:366
|
|
2432
|
-
def check_push_script_stack(keyword); end
|
|
2433
|
-
|
|
2434
|
-
# source://haml-5.2.2/lib/haml/parser.rb:518
|
|
2435
|
-
def close; end
|
|
2436
|
-
|
|
2437
|
-
# source://haml-5.2.2/lib/haml/parser.rb:524
|
|
2438
|
-
def close_filter(_); end
|
|
2439
|
-
|
|
2440
|
-
# source://haml-5.2.2/lib/haml/parser.rb:532
|
|
2441
|
-
def close_flat_section; end
|
|
2442
|
-
|
|
2443
|
-
# source://haml-5.2.2/lib/haml/parser.rb:528
|
|
2444
|
-
def close_haml_comment(_); end
|
|
2445
|
-
|
|
2446
|
-
# source://haml-5.2.2/lib/haml/parser.rb:538
|
|
2447
|
-
def close_script(node); end
|
|
2448
|
-
|
|
2449
|
-
# source://haml-5.2.2/lib/haml/parser.rb:538
|
|
2450
|
-
def close_silent_script(node); end
|
|
2451
|
-
|
|
2452
|
-
# @return [Boolean]
|
|
2453
|
-
#
|
|
2454
|
-
# source://haml-5.2.2/lib/haml/parser.rb:773
|
|
2455
|
-
def closes_flat?(line); end
|
|
2456
|
-
|
|
2457
|
-
# Renders an XHTML comment.
|
|
2458
|
-
#
|
|
2459
|
-
# source://haml-5.2.2/lib/haml/parser.rb:473
|
|
2460
|
-
def comment(text); end
|
|
2461
|
-
|
|
2462
|
-
# @return [Boolean]
|
|
2463
|
-
#
|
|
2464
|
-
# source://haml-5.2.2/lib/haml/parser.rb:246
|
|
2465
|
-
def continuation_script?(text); end
|
|
2466
|
-
|
|
2467
|
-
# Renders a line that creates an XHTML tag and has an implicit div because of
|
|
2468
|
-
# `.` or `#`.
|
|
2469
|
-
#
|
|
2470
|
-
# source://haml-5.2.2/lib/haml/parser.rb:467
|
|
2471
|
-
def div(line); end
|
|
2472
|
-
|
|
2473
|
-
# Renders an XHTML doctype or XML shebang.
|
|
2474
|
-
#
|
|
2475
|
-
# @raise [SyntaxError]
|
|
2476
|
-
#
|
|
2477
|
-
# source://haml-5.2.2/lib/haml/parser.rb:499
|
|
2478
|
-
def doctype(text); end
|
|
2479
|
-
|
|
2480
|
-
# @raise [Error]
|
|
2481
|
-
#
|
|
2482
|
-
# source://haml-5.2.2/lib/haml/parser.rb:505
|
|
2483
|
-
def filter(name); end
|
|
2484
|
-
|
|
2485
|
-
# Same semantics as block_opened?, except that block_opened? uses Line#tabs,
|
|
2486
|
-
# which doesn't interact well with filter lines
|
|
2487
|
-
#
|
|
2488
|
-
# @return [Boolean]
|
|
2489
|
-
#
|
|
2490
|
-
# source://haml-5.2.2/lib/haml/parser.rb:848
|
|
2491
|
-
def filter_opened?; end
|
|
2492
|
-
|
|
2493
|
-
# @return [Boolean]
|
|
2494
|
-
#
|
|
2495
|
-
# source://haml-5.2.2/lib/haml/parser.rb:852
|
|
2496
|
-
def flat?; end
|
|
2497
|
-
|
|
2498
|
-
# @raise [SyntaxError]
|
|
2499
|
-
#
|
|
2500
|
-
# source://haml-5.2.2/lib/haml/parser.rb:331
|
|
2501
|
-
def flat_script(line, escape_html = T.unsafe(nil)); end
|
|
2502
|
-
|
|
2503
|
-
# source://haml-5.2.2/lib/haml/parser.rb:376
|
|
2504
|
-
def haml_comment(text); end
|
|
2505
|
-
|
|
2506
|
-
# source://haml-5.2.2/lib/haml/parser.rb:777
|
|
2507
|
-
def handle_multiline(line); end
|
|
2508
|
-
|
|
2509
|
-
# source://haml-5.2.2/lib/haml/parser.rb:795
|
|
2510
|
-
def handle_ruby_multiline(line); end
|
|
2511
|
-
|
|
2512
|
-
# Checks whether or not `line` is in a multiline sequence.
|
|
2513
|
-
#
|
|
2514
|
-
# @return [Boolean]
|
|
2515
|
-
#
|
|
2516
|
-
# source://haml-5.2.2/lib/haml/parser.rb:791
|
|
2517
|
-
def is_multiline?(text); end
|
|
2518
|
-
|
|
2519
|
-
# `text' is a Ruby multiline block if it:
|
|
2520
|
-
# - ends with a comma
|
|
2521
|
-
# - but not "?," which is a character literal
|
|
2522
|
-
# (however, "x?," is a method call and not a literal)
|
|
2523
|
-
# - and not "?\," which is a character literal
|
|
2524
|
-
#
|
|
2525
|
-
# @return [Boolean]
|
|
2526
|
-
#
|
|
2527
|
-
# source://haml-5.2.2/lib/haml/parser.rb:814
|
|
2528
|
-
def is_ruby_multiline?(text); end
|
|
2529
|
-
|
|
2530
|
-
# @return [Boolean]
|
|
2531
|
-
#
|
|
2532
|
-
# source://haml-5.2.2/lib/haml/parser.rb:250
|
|
2533
|
-
def mid_block_keyword?(text); end
|
|
2534
|
-
|
|
2535
|
-
# source://haml-5.2.2/lib/haml/parser.rb:755
|
|
2536
|
-
def next_line; end
|
|
2537
|
-
|
|
2538
|
-
# source://haml-5.2.2/lib/haml/parser.rb:726
|
|
2539
|
-
def parse_new_attribute(scanner); end
|
|
2540
|
-
|
|
2541
|
-
# @return [Array<Hash,String,nil>] - [static_attributes (Hash), dynamic_attributes (nil or String starting with `{` and ending with `}`)]
|
|
2542
|
-
# @return [String] rest
|
|
2543
|
-
# @return [Integer] last_line
|
|
2544
|
-
#
|
|
2545
|
-
# source://haml-5.2.2/lib/haml/parser.rb:685
|
|
2546
|
-
def parse_new_attributes(text); end
|
|
2547
|
-
|
|
2548
|
-
# @return [String] attributes_hash - Hash literal starting with `{` and ending with `}`
|
|
2549
|
-
# @return [String] rest
|
|
2550
|
-
# @return [Integer] last_line
|
|
2551
|
-
#
|
|
2552
|
-
# source://haml-5.2.2/lib/haml/parser.rb:657
|
|
2553
|
-
def parse_old_attributes(text); end
|
|
2554
|
-
|
|
2555
|
-
# This method doesn't use Haml::AttributeParser because currently it depends on Ripper and Rubinius doesn't provide it.
|
|
2556
|
-
# Ideally this logic should be placed in Haml::AttributeParser instead of here and this method should use it.
|
|
2557
|
-
#
|
|
2558
|
-
# @param text [String] - Hash literal or text inside old attributes
|
|
2559
|
-
# @return [Hash, nil] - Return nil if text is not static Hash literal
|
|
2560
|
-
#
|
|
2561
|
-
# source://haml-5.2.2/lib/haml/parser.rb:584
|
|
2562
|
-
def parse_static_hash(text); end
|
|
2563
|
-
|
|
2564
|
-
# Parses a line into tag_name, attributes, attributes_hash, object_ref, action, value
|
|
2565
|
-
#
|
|
2566
|
-
# @raise [SyntaxError]
|
|
2567
|
-
#
|
|
2568
|
-
# source://haml-5.2.2/lib/haml/parser.rb:602
|
|
2569
|
-
def parse_tag(text); end
|
|
2570
|
-
|
|
2571
|
-
# source://haml-5.2.2/lib/haml/parser.rb:305
|
|
2572
|
-
def plain(line, escape_html = T.unsafe(nil)); end
|
|
2573
|
-
|
|
2574
|
-
# Processes and deals with lowering indentation.
|
|
2575
|
-
#
|
|
2576
|
-
# source://haml-5.2.2/lib/haml/parser.rb:239
|
|
2577
|
-
def process_indent(line); end
|
|
2578
|
-
|
|
2579
|
-
# Processes a single line of Haml.
|
|
2580
|
-
#
|
|
2581
|
-
# This method doesn't return anything; it simply processes the line and
|
|
2582
|
-
# adds the appropriate code to `@precompiled`.
|
|
2583
|
-
#
|
|
2584
|
-
# source://haml-5.2.2/lib/haml/parser.rb:258
|
|
2585
|
-
def process_line(line); end
|
|
2586
|
-
|
|
2587
|
-
# source://haml-5.2.2/lib/haml/parser.rb:300
|
|
2588
|
-
def push(node); end
|
|
2589
|
-
|
|
2590
|
-
# @raise [SyntaxError]
|
|
2591
|
-
#
|
|
2592
|
-
# source://haml-5.2.2/lib/haml/parser.rb:319
|
|
2593
|
-
def script(line, escape_html = T.unsafe(nil), preserve = T.unsafe(nil)); end
|
|
2594
|
-
|
|
2595
|
-
# @raise [SyntaxError]
|
|
2596
|
-
#
|
|
2597
|
-
# source://haml-5.2.2/lib/haml/parser.rb:336
|
|
2598
|
-
def silent_script(line); end
|
|
2599
|
-
|
|
2600
|
-
# @raise [SyntaxError]
|
|
2601
|
-
#
|
|
2602
|
-
# source://haml-5.2.2/lib/haml/parser.rb:389
|
|
2603
|
-
def tag(line); end
|
|
2604
|
-
|
|
2605
|
-
class << self
|
|
2606
|
-
# This is a class method so it can be accessed from {Haml::Helpers}.
|
|
2607
|
-
#
|
|
2608
|
-
# Iterates through the classes and ids supplied through `.`
|
|
2609
|
-
# and `#` syntax, and returns a hash with them as attributes,
|
|
2610
|
-
# that can then be merged with another attributes hash.
|
|
2611
|
-
#
|
|
2612
|
-
# source://haml-5.2.2/lib/haml/parser.rb:560
|
|
2613
|
-
def parse_class_and_id(list); end
|
|
2614
|
-
end
|
|
2615
|
-
end
|
|
2616
|
-
|
|
2617
|
-
# source://haml-5.2.2/lib/haml/parser.rb:83
|
|
2618
|
-
Haml::Parser::BLOCK_KEYWORD_REGEX = T.let(T.unsafe(nil), Regexp)
|
|
2619
|
-
|
|
2620
|
-
# Regex to check for blocks with spaces around arguments. Not to be confused
|
|
2621
|
-
# with multiline script.
|
|
2622
|
-
# For example:
|
|
2623
|
-
# foo.each do | bar |
|
|
2624
|
-
# = bar
|
|
2625
|
-
#
|
|
2626
|
-
# source://haml-5.2.2/lib/haml/parser.rb:77
|
|
2627
|
-
Haml::Parser::BLOCK_WITH_SPACES = T.let(T.unsafe(nil), Regexp)
|
|
2628
|
-
|
|
2629
|
-
# source://haml-5.2.2/lib/haml/parser.rb:92
|
|
2630
|
-
Haml::Parser::CLASS_KEY = T.let(T.unsafe(nil), String)
|
|
2631
|
-
|
|
2632
|
-
# Designates an XHTML/XML comment.
|
|
2633
|
-
#
|
|
2634
|
-
# source://haml-5.2.2/lib/haml/parser.rb:22
|
|
2635
|
-
Haml::Parser::COMMENT = T.let(T.unsafe(nil), String)
|
|
2636
|
-
|
|
2637
|
-
# Designates a `<div>` element with the given class.
|
|
2638
|
-
#
|
|
2639
|
-
# source://haml-5.2.2/lib/haml/parser.rb:16
|
|
2640
|
-
Haml::Parser::DIV_CLASS = T.let(T.unsafe(nil), String)
|
|
2641
|
-
|
|
2642
|
-
# Designates a `<div>` element with the given id.
|
|
2643
|
-
#
|
|
2644
|
-
# source://haml-5.2.2/lib/haml/parser.rb:19
|
|
2645
|
-
Haml::Parser::DIV_ID = T.let(T.unsafe(nil), String)
|
|
2646
|
-
|
|
2647
|
-
# Designates an XHTML doctype or script that is never HTML-escaped.
|
|
2648
|
-
#
|
|
2649
|
-
# source://haml-5.2.2/lib/haml/parser.rb:25
|
|
2650
|
-
Haml::Parser::DOCTYPE = T.let(T.unsafe(nil), String)
|
|
2651
|
-
|
|
2652
|
-
# The Regex that matches a Doctype command.
|
|
2653
|
-
#
|
|
2654
|
-
# source://haml-5.2.2/lib/haml/parser.rb:86
|
|
2655
|
-
Haml::Parser::DOCTYPE_REGEX = T.let(T.unsafe(nil), Regexp)
|
|
2656
|
-
|
|
2657
|
-
# @param new [String] - Hash literal including dynamic values.
|
|
2658
|
-
# @param old [String] - Hash literal including dynamic values or Ruby literal of multiple Hashes which MUST be interpreted as method's last arguments.
|
|
2659
|
-
#
|
|
2660
|
-
# source://haml-5.2.2/lib/haml/parser.rb:215
|
|
2661
|
-
class Haml::Parser::DynamicAttributes < ::Struct
|
|
2662
|
-
# Returns the value of attribute new
|
|
2663
|
-
#
|
|
2664
|
-
# @return [Object] the current value of new
|
|
2665
|
-
def new; end
|
|
2666
|
-
|
|
2667
|
-
# Sets the attribute new
|
|
2668
|
-
#
|
|
2669
|
-
# @param value [Object] the value to set the attribute new to.
|
|
2670
|
-
# @return [Object] the newly set value
|
|
2671
|
-
def new=(_); end
|
|
2672
|
-
|
|
2673
|
-
# Returns the value of attribute old
|
|
2674
|
-
#
|
|
2675
|
-
# @return [Object] the current value of old
|
|
2676
|
-
def old; end
|
|
2677
|
-
|
|
2678
|
-
# Sets the attribute old
|
|
2679
|
-
#
|
|
2680
|
-
# @param value [Object] the value to set the attribute old to.
|
|
2681
|
-
# @return [Object] the newly set value
|
|
2682
|
-
#
|
|
2683
|
-
# source://haml-5.2.2/lib/haml/parser.rb:217
|
|
2684
|
-
def old=(value); end
|
|
2685
|
-
|
|
2686
|
-
# This will be a literal for Haml::Buffer#attributes's last argument, `attributes_hashes`.
|
|
2687
|
-
#
|
|
2688
|
-
# source://haml-5.2.2/lib/haml/parser.rb:225
|
|
2689
|
-
def to_literal; end
|
|
2690
|
-
|
|
2691
|
-
private
|
|
2692
|
-
|
|
2693
|
-
# For `%foo{ { foo: 1 }, bar: 2 }`, :old is "{ { foo: 1 }, bar: 2 }" and this method returns " { foo: 1 }, bar: 2 " for last argument.
|
|
2694
|
-
#
|
|
2695
|
-
# source://haml-5.2.2/lib/haml/parser.rb:232
|
|
2696
|
-
def stripped_old; end
|
|
2697
|
-
|
|
2698
|
-
class << self
|
|
2699
|
-
def [](*_arg0); end
|
|
2700
|
-
def inspect; end
|
|
2701
|
-
def keyword_init?; end
|
|
2702
|
-
def members; end
|
|
2703
|
-
def new(*_arg0); end
|
|
2704
|
-
end
|
|
2705
|
-
end
|
|
2706
|
-
|
|
2707
|
-
# Designates an XHTML/XML element.
|
|
2708
|
-
#
|
|
2709
|
-
# source://haml-5.2.2/lib/haml/parser.rb:13
|
|
2710
|
-
Haml::Parser::ELEMENT = T.let(T.unsafe(nil), String)
|
|
2711
|
-
|
|
2712
|
-
# Designates a non-parsed line.
|
|
2713
|
-
#
|
|
2714
|
-
# source://haml-5.2.2/lib/haml/parser.rb:43
|
|
2715
|
-
Haml::Parser::ESCAPE = T.let(T.unsafe(nil), String)
|
|
2716
|
-
|
|
2717
|
-
# Designates a block of filtered text.
|
|
2718
|
-
#
|
|
2719
|
-
# source://haml-5.2.2/lib/haml/parser.rb:46
|
|
2720
|
-
Haml::Parser::FILTER = T.let(T.unsafe(nil), String)
|
|
2721
|
-
|
|
2722
|
-
# Designates script, the result of which is flattened and output.
|
|
2723
|
-
#
|
|
2724
|
-
# source://haml-5.2.2/lib/haml/parser.rb:34
|
|
2725
|
-
Haml::Parser::FLAT_SCRIPT = T.let(T.unsafe(nil), String)
|
|
2726
|
-
|
|
2727
|
-
# source://haml-5.2.2/lib/haml/parser.rb:91
|
|
2728
|
-
Haml::Parser::ID_KEY = T.let(T.unsafe(nil), String)
|
|
2729
|
-
|
|
2730
|
-
# The Regex that matches a literal string or symbol value
|
|
2731
|
-
#
|
|
2732
|
-
# source://haml-5.2.2/lib/haml/parser.rb:89
|
|
2733
|
-
Haml::Parser::LITERAL_VALUE_REGEX = T.let(T.unsafe(nil), Regexp)
|
|
2734
|
-
|
|
2735
|
-
# @private
|
|
2736
|
-
#
|
|
2737
|
-
# source://haml-5.2.2/lib/haml/parser.rb:186
|
|
2738
|
-
class Haml::Parser::Line < ::Struct
|
|
2739
|
-
# Returns the value of attribute eod
|
|
2740
|
-
#
|
|
2741
|
-
# @return [Object] the current value of eod
|
|
2742
|
-
def eod; end
|
|
2743
|
-
|
|
2744
|
-
# Sets the attribute eod
|
|
2745
|
-
#
|
|
2746
|
-
# @param value [Object] the value to set the attribute eod to.
|
|
2747
|
-
# @return [Object] the newly set value
|
|
2748
|
-
def eod=(_); end
|
|
2749
|
-
|
|
2750
|
-
# Returns the value of attribute eod
|
|
2751
|
-
#
|
|
2752
|
-
# @return [Object] the current value of eod
|
|
2753
|
-
def eod?; end
|
|
2754
|
-
|
|
2755
|
-
# Returns the value of attribute full
|
|
2756
|
-
#
|
|
2757
|
-
# @return [Object] the current value of full
|
|
2758
|
-
def full; end
|
|
2759
|
-
|
|
2760
|
-
# Sets the attribute full
|
|
2761
|
-
#
|
|
2762
|
-
# @param value [Object] the value to set the attribute full to.
|
|
2763
|
-
# @return [Object] the newly set value
|
|
2764
|
-
def full=(_); end
|
|
2765
|
-
|
|
2766
|
-
# Returns the value of attribute index
|
|
2767
|
-
#
|
|
2768
|
-
# @return [Object] the current value of index
|
|
2769
|
-
def index; end
|
|
2770
|
-
|
|
2771
|
-
# Sets the attribute index
|
|
2772
|
-
#
|
|
2773
|
-
# @param value [Object] the value to set the attribute index to.
|
|
2774
|
-
# @return [Object] the newly set value
|
|
2775
|
-
def index=(_); end
|
|
2776
|
-
|
|
2777
|
-
# Returns the value of attribute parser
|
|
2778
|
-
#
|
|
2779
|
-
# @return [Object] the current value of parser
|
|
2780
|
-
def parser; end
|
|
2781
|
-
|
|
2782
|
-
# Sets the attribute parser
|
|
2783
|
-
#
|
|
2784
|
-
# @param value [Object] the value to set the attribute parser to.
|
|
2785
|
-
# @return [Object] the newly set value
|
|
2786
|
-
def parser=(_); end
|
|
2787
|
-
|
|
2788
|
-
# source://haml-5.2.2/lib/haml/parser.rb:194
|
|
2789
|
-
def strip!(from); end
|
|
2790
|
-
|
|
2791
|
-
# @private
|
|
2792
|
-
#
|
|
2793
|
-
# source://haml-5.2.2/lib/haml/parser.rb:190
|
|
2794
|
-
def tabs; end
|
|
2795
|
-
|
|
2796
|
-
# Returns the value of attribute text
|
|
2797
|
-
#
|
|
2798
|
-
# @return [Object] the current value of text
|
|
2799
|
-
def text; end
|
|
2800
|
-
|
|
2801
|
-
# Sets the attribute text
|
|
2802
|
-
#
|
|
2803
|
-
# @param value [Object] the value to set the attribute text to.
|
|
2804
|
-
# @return [Object] the newly set value
|
|
2805
|
-
def text=(_); end
|
|
2806
|
-
|
|
2807
|
-
# Returns the value of attribute whitespace
|
|
2808
|
-
#
|
|
2809
|
-
# @return [Object] the current value of whitespace
|
|
2810
|
-
def whitespace; end
|
|
2811
|
-
|
|
2812
|
-
# Sets the attribute whitespace
|
|
2813
|
-
#
|
|
2814
|
-
# @param value [Object] the value to set the attribute whitespace to.
|
|
2815
|
-
# @return [Object] the newly set value
|
|
2816
|
-
def whitespace=(_); end
|
|
2817
|
-
|
|
2818
|
-
class << self
|
|
2819
|
-
def [](*_arg0); end
|
|
2820
|
-
def inspect; end
|
|
2821
|
-
def keyword_init?; end
|
|
2822
|
-
def members; end
|
|
2823
|
-
def new(*_arg0); end
|
|
2824
|
-
end
|
|
2825
|
-
end
|
|
2826
|
-
|
|
2827
|
-
# Used for scanning old attributes, substituting the first '{'
|
|
2828
|
-
#
|
|
2829
|
-
# source://haml-5.2.2/lib/haml/parser.rb:95
|
|
2830
|
-
Haml::Parser::METHOD_CALL_PREFIX = T.let(T.unsafe(nil), String)
|
|
2831
|
-
|
|
2832
|
-
# source://haml-5.2.2/lib/haml/parser.rb:79
|
|
2833
|
-
Haml::Parser::MID_BLOCK_KEYWORDS = T.let(T.unsafe(nil), Array)
|
|
2834
|
-
|
|
2835
|
-
# The value of the character that designates that a line is part
|
|
2836
|
-
# of a multiline string.
|
|
2837
|
-
#
|
|
2838
|
-
# source://haml-5.2.2/lib/haml/parser.rb:69
|
|
2839
|
-
Haml::Parser::MULTILINE_CHAR_VALUE = T.let(T.unsafe(nil), String)
|
|
2840
|
-
|
|
2841
|
-
# Designates a non-parsed line. Not actually a character.
|
|
2842
|
-
#
|
|
2843
|
-
# source://haml-5.2.2/lib/haml/parser.rb:49
|
|
2844
|
-
Haml::Parser::PLAIN_TEXT = T.let(T.unsafe(nil), Integer)
|
|
2845
|
-
|
|
2846
|
-
# @private
|
|
2847
|
-
#
|
|
2848
|
-
# source://haml-5.2.2/lib/haml/parser.rb:202
|
|
2849
|
-
class Haml::Parser::ParseNode < ::Struct
|
|
2850
|
-
# @return [ParseNode] a new instance of ParseNode
|
|
2851
|
-
#
|
|
2852
|
-
# source://haml-5.2.2/lib/haml/parser.rb:203
|
|
2853
|
-
def initialize(*args); end
|
|
2854
|
-
|
|
2855
|
-
# Returns the value of attribute children
|
|
2856
|
-
#
|
|
2857
|
-
# @return [Object] the current value of children
|
|
2858
|
-
def children; end
|
|
2859
|
-
|
|
2860
|
-
# Sets the attribute children
|
|
2861
|
-
#
|
|
2862
|
-
# @param value [Object] the value to set the attribute children to.
|
|
2863
|
-
# @return [Object] the newly set value
|
|
2864
|
-
def children=(_); end
|
|
2865
|
-
|
|
2866
|
-
# source://haml-5.2.2/lib/haml/parser.rb:208
|
|
2867
|
-
def inspect; end
|
|
2868
|
-
|
|
2869
|
-
# Returns the value of attribute line
|
|
2870
|
-
#
|
|
2871
|
-
# @return [Object] the current value of line
|
|
2872
|
-
def line; end
|
|
2873
|
-
|
|
2874
|
-
# Sets the attribute line
|
|
2875
|
-
#
|
|
2876
|
-
# @param value [Object] the value to set the attribute line to.
|
|
2877
|
-
# @return [Object] the newly set value
|
|
2878
|
-
def line=(_); end
|
|
2879
|
-
|
|
2880
|
-
# Returns the value of attribute parent
|
|
2881
|
-
#
|
|
2882
|
-
# @return [Object] the current value of parent
|
|
2883
|
-
def parent; end
|
|
2884
|
-
|
|
2885
|
-
# Sets the attribute parent
|
|
2886
|
-
#
|
|
2887
|
-
# @param value [Object] the value to set the attribute parent to.
|
|
2888
|
-
# @return [Object] the newly set value
|
|
2889
|
-
def parent=(_); end
|
|
2890
|
-
|
|
2891
|
-
# Returns the value of attribute type
|
|
2892
|
-
#
|
|
2893
|
-
# @return [Object] the current value of type
|
|
2894
|
-
def type; end
|
|
2895
|
-
|
|
2896
|
-
# Sets the attribute type
|
|
2897
|
-
#
|
|
2898
|
-
# @param value [Object] the value to set the attribute type to.
|
|
2899
|
-
# @return [Object] the newly set value
|
|
2900
|
-
def type=(_); end
|
|
2901
|
-
|
|
2902
|
-
# Returns the value of attribute value
|
|
2903
|
-
#
|
|
2904
|
-
# @return [Object] the current value of value
|
|
2905
|
-
def value; end
|
|
2906
|
-
|
|
2907
|
-
# Sets the attribute value
|
|
2908
|
-
#
|
|
2909
|
-
# @param value [Object] the value to set the attribute value to.
|
|
2910
|
-
# @return [Object] the newly set value
|
|
2911
|
-
def value=(_); end
|
|
2912
|
-
|
|
2913
|
-
class << self
|
|
2914
|
-
def [](*_arg0); end
|
|
2915
|
-
def inspect; end
|
|
2916
|
-
def keyword_init?; end
|
|
2917
|
-
def members; end
|
|
2918
|
-
def new(*_arg0); end
|
|
2919
|
-
end
|
|
2920
|
-
end
|
|
2921
|
-
|
|
2922
|
-
# Designates script that is always HTML-escaped.
|
|
2923
|
-
#
|
|
2924
|
-
# source://haml-5.2.2/lib/haml/parser.rb:31
|
|
2925
|
-
Haml::Parser::SANITIZE = T.let(T.unsafe(nil), String)
|
|
2926
|
-
|
|
2927
|
-
# Designates script, the result of which is output.
|
|
2928
|
-
#
|
|
2929
|
-
# source://haml-5.2.2/lib/haml/parser.rb:28
|
|
2930
|
-
Haml::Parser::SCRIPT = T.let(T.unsafe(nil), String)
|
|
2931
|
-
|
|
2932
|
-
# When following SILENT_SCRIPT, designates a comment that is not output.
|
|
2933
|
-
#
|
|
2934
|
-
# source://haml-5.2.2/lib/haml/parser.rb:40
|
|
2935
|
-
Haml::Parser::SILENT_COMMENT = T.let(T.unsafe(nil), String)
|
|
2936
|
-
|
|
2937
|
-
# Designates script which is run but not output.
|
|
2938
|
-
#
|
|
2939
|
-
# source://haml-5.2.2/lib/haml/parser.rb:37
|
|
2940
|
-
Haml::Parser::SILENT_SCRIPT = T.let(T.unsafe(nil), String)
|
|
2941
|
-
|
|
2942
|
-
# Keeps track of the ASCII values of the characters that begin a
|
|
2943
|
-
# specially-interpreted line.
|
|
2944
|
-
#
|
|
2945
|
-
# source://haml-5.2.2/lib/haml/parser.rb:53
|
|
2946
|
-
Haml::Parser::SPECIAL_CHARACTERS = T.let(T.unsafe(nil), Array)
|
|
2947
|
-
|
|
2948
|
-
# source://haml-5.2.2/lib/haml/parser.rb:80
|
|
2949
|
-
Haml::Parser::START_BLOCK_KEYWORDS = T.let(T.unsafe(nil), Array)
|
|
2950
|
-
|
|
2951
|
-
# Try to parse assignments to block starters as best as possible
|
|
2952
|
-
#
|
|
2953
|
-
# source://haml-5.2.2/lib/haml/parser.rb:82
|
|
2954
|
-
Haml::Parser::START_BLOCK_KEYWORD_REGEX = T.let(T.unsafe(nil), Regexp)
|
|
2955
|
-
|
|
2956
|
-
# SyntaxError is the type of exception raised when Haml encounters an
|
|
2957
|
-
# ill-formatted document.
|
|
2958
|
-
# It's not particularly interesting,
|
|
2959
|
-
# except in that it's a subclass of {Haml::Error}.
|
|
2960
|
-
#
|
|
2961
|
-
# source://haml-5.2.2/lib/haml/error.rb:62
|
|
2962
|
-
class Haml::SyntaxError < ::Haml::Error; end
|
|
2963
|
-
|
|
2964
|
-
# source://haml-5.2.2/lib/haml/temple_engine.rb:8
|
|
2965
|
-
class Haml::TempleEngine < ::Temple::Engine
|
|
2966
|
-
# source://haml-5.2.2/lib/haml/temple_engine.rb:41
|
|
2967
|
-
def compile(template); end
|
|
2968
|
-
|
|
2969
|
-
# The source code that is evaluated to produce the Haml document.
|
|
2970
|
-
#
|
|
2971
|
-
# This is automatically converted to the correct encoding
|
|
2972
|
-
# (see {file:REFERENCE.md#encodings the `:encoding` option}).
|
|
2973
|
-
#
|
|
2974
|
-
# @return [String]
|
|
2975
|
-
#
|
|
2976
|
-
# source://haml-5.2.2/lib/haml/temple_engine.rb:52
|
|
2977
|
-
def precompiled; end
|
|
2978
|
-
|
|
2979
|
-
# The source code that is evaluated to produce the Haml document.
|
|
2980
|
-
#
|
|
2981
|
-
# This is automatically converted to the correct encoding
|
|
2982
|
-
# (see {file:REFERENCE.md#encodings the `:encoding` option}).
|
|
2983
|
-
#
|
|
2984
|
-
# @return [String]
|
|
2985
|
-
#
|
|
2986
|
-
# source://haml-5.2.2/lib/haml/temple_engine.rb:68
|
|
2987
|
-
def precompiled_with_ambles(local_names, after_preamble: T.unsafe(nil), before_postamble: T.unsafe(nil)); end
|
|
2988
|
-
|
|
2989
|
-
# source://haml-5.2.2/lib/haml/temple_engine.rb:58
|
|
2990
|
-
def precompiled_with_return_value; end
|
|
2991
|
-
|
|
2992
|
-
private
|
|
2993
|
-
|
|
2994
|
-
# source://haml-5.2.2/lib/haml/temple_engine.rb:88
|
|
2995
|
-
def initialize_encoding(template, given_value); end
|
|
2996
|
-
|
|
2997
|
-
# source://haml-5.2.2/lib/haml/temple_engine.rb:113
|
|
2998
|
-
def inspect_obj(obj); end
|
|
2999
|
-
|
|
3000
|
-
# source://haml-5.2.2/lib/haml/temple_engine.rb:102
|
|
3001
|
-
def locals_code(names); end
|
|
3002
|
-
|
|
3003
|
-
# Returns the string used as the return value of the precompiled method.
|
|
3004
|
-
# This method exists so it can be monkeypatched to return modified values.
|
|
3005
|
-
#
|
|
3006
|
-
# source://haml-5.2.2/lib/haml/temple_engine.rb:98
|
|
3007
|
-
def precompiled_method_return_value; end
|
|
3008
|
-
end
|
|
3009
|
-
|
|
3010
|
-
# A module to count lines of expected code. This would be faster than actual code generation
|
|
3011
|
-
# and counting newlines in it.
|
|
3012
|
-
#
|
|
3013
|
-
# source://haml-5.2.2/lib/haml/temple_line_counter.rb:6
|
|
3014
|
-
module Haml::TempleLineCounter
|
|
3015
|
-
class << self
|
|
3016
|
-
# source://haml-5.2.2/lib/haml/temple_line_counter.rb:9
|
|
3017
|
-
def count_lines(exp); end
|
|
3018
|
-
end
|
|
3019
|
-
end
|
|
3020
|
-
|
|
3021
|
-
# source://haml-5.2.2/lib/haml/temple_line_counter.rb:7
|
|
3022
|
-
class Haml::TempleLineCounter::UnexpectedExpression < ::StandardError; end
|
|
3023
|
-
|
|
3024
|
-
# A module containing various useful functions.
|
|
3025
|
-
#
|
|
3026
|
-
# source://haml-5.2.2/lib/haml/util.rb:14
|
|
3027
|
-
module Haml::Util
|
|
3028
|
-
extend ::Haml::Util
|
|
3029
|
-
|
|
3030
|
-
# Moves a scanner through a balanced pair of characters.
|
|
3031
|
-
# For example:
|
|
3032
|
-
#
|
|
3033
|
-
# Foo (Bar (Baz bang) bop) (Bang (bop bip))
|
|
3034
|
-
# ^ ^
|
|
3035
|
-
# from to
|
|
3036
|
-
#
|
|
3037
|
-
# @param scanner [StringScanner] The string scanner to move
|
|
3038
|
-
# @param start [String] The character opening the balanced pair.
|
|
3039
|
-
# @param finish [String] The character closing the balanced pair.
|
|
3040
|
-
# @param count [Fixnum] The number of opening characters matched
|
|
3041
|
-
# before calling this method
|
|
3042
|
-
# @return [(String, String)] The string matched within the balanced pair
|
|
3043
|
-
# and the rest of the string.
|
|
3044
|
-
# `["Foo (Bar (Baz bang) bop)", " (Bang (bop bip))"]` in the example above.
|
|
3045
|
-
#
|
|
3046
|
-
# source://haml-5.2.2/lib/haml/util.rb:168
|
|
3047
|
-
def balance(scanner, start, finish, count = T.unsafe(nil)); end
|
|
3048
|
-
|
|
3049
|
-
# Checks that the encoding of a string is valid
|
|
3050
|
-
# and cleans up potential encoding gotchas like the UTF-8 BOM.
|
|
3051
|
-
# If it's not, yields an error string describing the invalid character
|
|
3052
|
-
# and the line on which it occurs.
|
|
3053
|
-
#
|
|
3054
|
-
# @param str [String] The string of which to check the encoding
|
|
3055
|
-
# @return [String] `str`, potentially with encoding gotchas like BOMs removed
|
|
3056
|
-
# @yield [msg] A block in which an encoding error can be raised.
|
|
3057
|
-
# Only yields if there is an encoding error
|
|
3058
|
-
# @yieldparam msg [String] The error message to be raised
|
|
3059
|
-
#
|
|
3060
|
-
# source://haml-5.2.2/lib/haml/util.rb:62
|
|
3061
|
-
def check_encoding(str); end
|
|
3062
|
-
|
|
3063
|
-
# Like {\#check\_encoding}, but also checks for a Ruby-style `-# coding:` comment
|
|
3064
|
-
# at the beginning of the template and uses that encoding if it exists.
|
|
3065
|
-
#
|
|
3066
|
-
# The Haml encoding rules are simple.
|
|
3067
|
-
# If a `-# coding:` comment exists,
|
|
3068
|
-
# we assume that that's the original encoding of the document.
|
|
3069
|
-
# Otherwise, we use whatever encoding Ruby has.
|
|
3070
|
-
#
|
|
3071
|
-
# Haml uses the same rules for parsing coding comments as Ruby.
|
|
3072
|
-
# This means that it can understand Emacs-style comments
|
|
3073
|
-
# and also that it cannot understand non-ASCII-compatible encodings
|
|
3074
|
-
# such as `UTF-16` and `UTF-32`.
|
|
3075
|
-
#
|
|
3076
|
-
# @param str [String] The Haml template of which to check the encoding
|
|
3077
|
-
# @raise [ArgumentError] if the document declares an unknown encoding
|
|
3078
|
-
# @return [String] The original string encoded properly
|
|
3079
|
-
# @yield [msg] A block in which an encoding error can be raised.
|
|
3080
|
-
# Only yields if there is an encoding error
|
|
3081
|
-
# @yieldparam msg [String] The error message to be raised
|
|
3082
|
-
#
|
|
3083
|
-
# source://haml-5.2.2/lib/haml/util.rb:109
|
|
3084
|
-
def check_haml_encoding(str, &block); end
|
|
3085
|
-
|
|
3086
|
-
# @return [Boolean]
|
|
3087
|
-
#
|
|
3088
|
-
# source://haml-5.2.2/lib/haml/util.rb:197
|
|
3089
|
-
def contains_interpolation?(str); end
|
|
3090
|
-
|
|
3091
|
-
# Scans through a string looking for the interoplation-opening `#{`
|
|
3092
|
-
# and, when it's found, yields the scanner to the calling code
|
|
3093
|
-
# so it can handle it properly.
|
|
3094
|
-
#
|
|
3095
|
-
# The scanner will have any backslashes immediately in front of the `#{`
|
|
3096
|
-
# as the second capture group (`scan[2]`),
|
|
3097
|
-
# and the text prior to that as the first (`scan[1]`).
|
|
3098
|
-
#
|
|
3099
|
-
# @return [String] The text remaining in the scanner after all `#{`s have been processed
|
|
3100
|
-
# @yieldparam scan [StringScanner] The scanner scanning through the string
|
|
3101
|
-
#
|
|
3102
|
-
# source://haml-5.2.2/lib/haml/util.rb:147
|
|
3103
|
-
def handle_interpolation(str); end
|
|
3104
|
-
|
|
3105
|
-
# Returns the given text, marked as being HTML-safe.
|
|
3106
|
-
# With older versions of the Rails XSS-safety mechanism,
|
|
3107
|
-
# this destructively modifies the HTML-safety of `text`.
|
|
3108
|
-
#
|
|
3109
|
-
# It only works if you are using ActiveSupport or the parameter `text`
|
|
3110
|
-
# implements the #html_safe method.
|
|
3111
|
-
#
|
|
3112
|
-
# @param text [String, nil]
|
|
3113
|
-
# @return [String, nil] `text`, marked as HTML-safe
|
|
3114
|
-
#
|
|
3115
|
-
# source://haml-5.2.2/lib/haml/util.rb:47
|
|
3116
|
-
def html_safe(text); end
|
|
3117
|
-
|
|
3118
|
-
# Formats a string for use in error messages about indentation.
|
|
3119
|
-
#
|
|
3120
|
-
# @param indentation [String] The string used for indentation
|
|
3121
|
-
# @return [String] The name of the indentation (e.g. `"12 spaces"`, `"1 tab"`)
|
|
3122
|
-
#
|
|
3123
|
-
# source://haml-5.2.2/lib/haml/util.rb:184
|
|
3124
|
-
def human_indentation(indentation); end
|
|
3125
|
-
|
|
3126
|
-
# Like `Object#inspect`, but preserves non-ASCII characters rather than escaping them.
|
|
3127
|
-
# This is necessary so that the precompiled Haml template can be `#encode`d into `@options[:encoding]`
|
|
3128
|
-
# before being evaluated.
|
|
3129
|
-
#
|
|
3130
|
-
# @param obj [Object]
|
|
3131
|
-
# @return [String]
|
|
3132
|
-
#
|
|
3133
|
-
# source://haml-5.2.2/lib/haml/util.rb:126
|
|
3134
|
-
def inspect_obj(obj); end
|
|
3135
|
-
|
|
3136
|
-
# Whether or not ActionView's XSS protection is available and enabled,
|
|
3137
|
-
# as is the default for Rails 3.0+, and optional for version 2.3.5+.
|
|
3138
|
-
# Overridden in haml/template.rb if this is the case.
|
|
3139
|
-
#
|
|
3140
|
-
# @return [Boolean]
|
|
3141
|
-
#
|
|
3142
|
-
# source://haml-5.2.2/lib/haml/util.rb:34
|
|
3143
|
-
def rails_xss_safe?; end
|
|
3144
|
-
|
|
3145
|
-
# Silence all output to STDERR within a block.
|
|
3146
|
-
#
|
|
3147
|
-
# @yield A block in which no output will be printed to STDERR
|
|
3148
|
-
#
|
|
3149
|
-
# source://haml-5.2.2/lib/haml/util.rb:20
|
|
3150
|
-
def silence_warnings; end
|
|
3151
|
-
|
|
3152
|
-
# source://haml-5.2.2/lib/haml/util.rb:201
|
|
3153
|
-
def unescape_interpolation(str, escape_html = T.unsafe(nil)); end
|
|
3154
|
-
|
|
3155
|
-
private
|
|
3156
|
-
|
|
3157
|
-
# Parses a magic comment at the beginning of a Haml file.
|
|
3158
|
-
# The parsing rules are basically the same as Ruby's.
|
|
3159
|
-
#
|
|
3160
|
-
# @return [(Boolean, String or nil)] Whether the document begins with a UTF-8 BOM,
|
|
3161
|
-
# and the declared encoding of the document (or nil if none is declared)
|
|
3162
|
-
#
|
|
3163
|
-
# source://haml-5.2.2/lib/haml/util.rb:233
|
|
3164
|
-
def parse_haml_magic_comment(str); end
|
|
3165
|
-
|
|
3166
|
-
# source://haml-5.2.2/lib/haml/util.rb:245
|
|
3167
|
-
def try_parse_haml_emacs_magic_comment(scanner); end
|
|
3168
|
-
end
|
|
3169
|
-
|
|
3170
|
-
# source://haml-5.2.2/lib/haml/version.rb:4
|
|
3171
|
-
Haml::VERSION = T.let(T.unsafe(nil), String)
|
|
3172
|
-
|
|
3173
|
-
# @private
|
|
3174
|
-
#
|
|
3175
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:699
|
|
3176
|
-
class Object < ::BasicObject
|
|
3177
|
-
include ::Kernel
|
|
3178
|
-
|
|
3179
|
-
# Haml overrides various `ActionView` helpers,
|
|
3180
|
-
# which call an \{#is\_haml?} method
|
|
3181
|
-
# to determine whether or not the current context object
|
|
3182
|
-
# is a proper Haml context.
|
|
3183
|
-
# Because `ActionView` helpers may be included in non-`ActionView::Base` classes,
|
|
3184
|
-
# it's a good idea to define \{#is\_haml?} for all objects.
|
|
3185
|
-
#
|
|
3186
|
-
# @return [Boolean]
|
|
3187
|
-
#
|
|
3188
|
-
# source://haml-5.2.2/lib/haml/helpers.rb:706
|
|
3189
|
-
def is_haml?; end
|
|
3190
|
-
end
|