haml 5.2.2 → 6.0.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/.github/FUNDING.yml +1 -0
- data/.github/workflows/test.yml +13 -9
- data/.gitignore +16 -16
- data/CHANGELOG.md +14 -3
- data/Gemfile +18 -11
- data/MIT-LICENSE +1 -1
- data/README.md +13 -19
- data/Rakefile +94 -93
- data/bin/bench +66 -0
- data/bin/console +11 -0
- data/bin/ruby +3 -0
- data/bin/setup +7 -0
- data/bin/stackprof +27 -0
- data/bin/test +24 -0
- data/exe/haml +6 -0
- data/ext/haml/extconf.rb +10 -0
- data/ext/haml/haml.c +537 -0
- data/ext/haml/hescape.c +108 -0
- data/ext/haml/hescape.h +20 -0
- data/haml.gemspec +39 -37
- data/lib/haml/ambles.rb +20 -0
- data/lib/haml/attribute_builder.rb +135 -179
- data/lib/haml/attribute_compiler.rb +85 -194
- data/lib/haml/attribute_parser.rb +86 -126
- data/lib/haml/cli.rb +154 -0
- data/lib/haml/compiler/children_compiler.rb +126 -0
- data/lib/haml/compiler/comment_compiler.rb +39 -0
- data/lib/haml/compiler/doctype_compiler.rb +46 -0
- data/lib/haml/compiler/script_compiler.rb +116 -0
- data/lib/haml/compiler/silent_script_compiler.rb +24 -0
- data/lib/haml/compiler/tag_compiler.rb +76 -0
- data/lib/haml/compiler.rb +63 -296
- data/lib/haml/dynamic_merger.rb +67 -0
- data/lib/haml/engine.rb +42 -227
- data/lib/haml/error.rb +5 -4
- data/lib/haml/escapable.rb +6 -70
- data/lib/haml/filters/base.rb +12 -0
- data/lib/haml/filters/cdata.rb +20 -0
- data/lib/haml/filters/coffee.rb +17 -0
- data/lib/haml/filters/css.rb +33 -0
- data/lib/haml/filters/erb.rb +10 -0
- data/lib/haml/filters/escaped.rb +22 -0
- data/lib/haml/filters/javascript.rb +33 -0
- data/lib/haml/filters/less.rb +20 -0
- data/lib/haml/filters/markdown.rb +11 -0
- data/lib/haml/filters/plain.rb +29 -0
- data/lib/haml/filters/preserve.rb +22 -0
- data/lib/haml/filters/ruby.rb +10 -0
- data/lib/haml/filters/sass.rb +15 -0
- data/lib/haml/filters/scss.rb +15 -0
- data/lib/haml/filters/text_base.rb +25 -0
- data/lib/haml/filters/tilt_base.rb +49 -0
- data/lib/haml/filters.rb +54 -378
- data/lib/haml/force_escapable.rb +29 -0
- data/lib/haml/helpers.rb +3 -697
- data/lib/haml/html.rb +22 -0
- data/lib/haml/identity.rb +13 -0
- data/lib/haml/object_ref.rb +30 -0
- data/lib/haml/parser.rb +157 -22
- data/lib/haml/rails_helpers.rb +51 -0
- data/lib/haml/rails_template.rb +55 -0
- data/lib/haml/railtie.rb +7 -45
- data/lib/haml/ruby_expression.rb +32 -0
- data/lib/haml/string_splitter.rb +20 -0
- data/lib/haml/template.rb +15 -34
- data/lib/haml/temple_line_counter.rb +2 -1
- data/lib/haml/util.rb +17 -15
- data/lib/haml/version.rb +1 -2
- data/lib/haml.rb +8 -20
- metadata +205 -52
- data/.gitmodules +0 -3
- data/.yardopts +0 -22
- data/TODO +0 -24
- data/benchmark.rb +0 -70
- data/bin/haml +0 -9
- data/lib/haml/.gitattributes +0 -1
- data/lib/haml/buffer.rb +0 -182
- data/lib/haml/exec.rb +0 -347
- data/lib/haml/generator.rb +0 -42
- data/lib/haml/helpers/action_view_extensions.rb +0 -60
- data/lib/haml/helpers/action_view_mods.rb +0 -132
- data/lib/haml/helpers/action_view_xss_mods.rb +0 -60
- data/lib/haml/helpers/safe_erubi_template.rb +0 -20
- data/lib/haml/helpers/safe_erubis_template.rb +0 -33
- data/lib/haml/helpers/xss_mods.rb +0 -114
- data/lib/haml/options.rb +0 -273
- data/lib/haml/plugin.rb +0 -54
- data/lib/haml/sass_rails_filter.rb +0 -47
- data/lib/haml/template/options.rb +0 -27
- data/lib/haml/temple_engine.rb +0 -124
- data/yard/default/.gitignore +0 -1
- data/yard/default/fulldoc/html/css/common.sass +0 -15
- data/yard/default/layout/html/footer.erb +0 -12
data/lib/haml/util.rb
CHANGED
@@ -14,6 +14,22 @@ module Haml
|
|
14
14
|
module Util
|
15
15
|
extend self
|
16
16
|
|
17
|
+
# Java extension is not implemented for JRuby yet.
|
18
|
+
# TruffleRuby does not implement `rb_ary_sort_bang`, etc.
|
19
|
+
if /java/ === RUBY_PLATFORM || RUBY_ENGINE == 'truffleruby'
|
20
|
+
require 'cgi/escape'
|
21
|
+
|
22
|
+
def self.escape_html(html)
|
23
|
+
CGI.escapeHTML(html.to_s)
|
24
|
+
end
|
25
|
+
else
|
26
|
+
require 'haml/haml' # Haml::Util.escape_html
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.escape_html_safe(html)
|
30
|
+
html.html_safe? ? html : escape_html(html)
|
31
|
+
end
|
32
|
+
|
17
33
|
# Silence all output to STDERR within a block.
|
18
34
|
#
|
19
35
|
# @yield A block in which no output will be printed to STDERR
|
@@ -35,20 +51,6 @@ module Haml
|
|
35
51
|
false
|
36
52
|
end
|
37
53
|
|
38
|
-
# Returns the given text, marked as being HTML-safe.
|
39
|
-
# With older versions of the Rails XSS-safety mechanism,
|
40
|
-
# this destructively modifies the HTML-safety of `text`.
|
41
|
-
#
|
42
|
-
# It only works if you are using ActiveSupport or the parameter `text`
|
43
|
-
# implements the #html_safe method.
|
44
|
-
#
|
45
|
-
# @param text [String, nil]
|
46
|
-
# @return [String, nil] `text`, marked as HTML-safe
|
47
|
-
def html_safe(text)
|
48
|
-
return unless text
|
49
|
-
text.html_safe
|
50
|
-
end
|
51
|
-
|
52
54
|
# Checks that the encoding of a string is valid
|
53
55
|
# and cleans up potential encoding gotchas like the UTF-8 BOM.
|
54
56
|
# If it's not, yields an error string describing the invalid character
|
@@ -214,7 +216,7 @@ MSG
|
|
214
216
|
end
|
215
217
|
content = eval("\"#{interpolated}\"")
|
216
218
|
content = "#{char}#{content}" if char == '@' || char == '$'
|
217
|
-
content = "
|
219
|
+
content = "CGI.escapeHTML((#{content}).to_s)" if escape_html
|
218
220
|
|
219
221
|
res << "\#{#{content}}"
|
220
222
|
end
|
data/lib/haml/version.rb
CHANGED
data/lib/haml.rb
CHANGED
@@ -1,25 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
2
|
+
require 'haml/engine'
|
3
|
+
require 'haml/error'
|
3
4
|
require 'haml/version'
|
5
|
+
require 'haml/template'
|
4
6
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
# * {Haml::Options} is where Haml's runtime options are defined.
|
11
|
-
# * {Haml::Error} is raised when Haml encounters an error.
|
12
|
-
#
|
13
|
-
# Also see the {file:REFERENCE.md full Haml reference}.
|
14
|
-
module Haml
|
15
|
-
|
16
|
-
def self.init_rails(*args)
|
17
|
-
# Maintain this as a no-op for any libraries that may be depending on the
|
18
|
-
# previous definition here.
|
7
|
+
if File.basename($0) != 'haml'
|
8
|
+
begin
|
9
|
+
require 'rails'
|
10
|
+
require 'haml/railtie'
|
11
|
+
rescue LoadError
|
19
12
|
end
|
20
|
-
|
21
13
|
end
|
22
|
-
|
23
|
-
require 'haml/util'
|
24
|
-
require 'haml/engine'
|
25
|
-
require 'haml/railtie' if defined?(Rails::Railtie)
|
metadata
CHANGED
@@ -1,17 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: haml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 6.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Natalie Weizenbaum
|
8
8
|
- Hampton Catlin
|
9
9
|
- Norman Clarke
|
10
10
|
- Akira Matsuda
|
11
|
+
- Takashi Kokubun
|
11
12
|
autorequire:
|
12
|
-
bindir:
|
13
|
+
bindir: exe
|
13
14
|
cert_chain: []
|
14
|
-
date:
|
15
|
+
date: 2022-09-21 00:00:00.000000000 Z
|
15
16
|
dependencies:
|
16
17
|
- !ruby/object:Gem::Dependency
|
17
18
|
name: temple
|
@@ -19,14 +20,28 @@ dependencies:
|
|
19
20
|
requirements:
|
20
21
|
- - ">="
|
21
22
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.8.
|
23
|
+
version: 0.8.2
|
23
24
|
type: :runtime
|
24
25
|
prerelease: false
|
25
26
|
version_requirements: !ruby/object:Gem::Requirement
|
26
27
|
requirements:
|
27
28
|
- - ">="
|
28
29
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.8.
|
30
|
+
version: 0.8.2
|
31
|
+
- !ruby/object:Gem::Dependency
|
32
|
+
name: thor
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - ">="
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0'
|
30
45
|
- !ruby/object:Gem::Dependency
|
31
46
|
name: tilt
|
32
47
|
requirement: !ruby/object:Gem::Requirement
|
@@ -42,21 +57,77 @@ dependencies:
|
|
42
57
|
- !ruby/object:Gem::Version
|
43
58
|
version: '0'
|
44
59
|
- !ruby/object:Gem::Dependency
|
45
|
-
name:
|
60
|
+
name: benchmark_driver
|
61
|
+
requirement: !ruby/object:Gem::Requirement
|
62
|
+
requirements:
|
63
|
+
- - ">="
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
type: :development
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '0'
|
73
|
+
- !ruby/object:Gem::Dependency
|
74
|
+
name: bundler
|
75
|
+
requirement: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
80
|
+
type: :development
|
81
|
+
prerelease: false
|
82
|
+
version_requirements: !ruby/object:Gem::Requirement
|
83
|
+
requirements:
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0'
|
87
|
+
- !ruby/object:Gem::Dependency
|
88
|
+
name: coffee-script
|
89
|
+
requirement: !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
91
|
+
- - ">="
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
type: :development
|
95
|
+
prerelease: false
|
96
|
+
version_requirements: !ruby/object:Gem::Requirement
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '0'
|
101
|
+
- !ruby/object:Gem::Dependency
|
102
|
+
name: erubi
|
103
|
+
requirement: !ruby/object:Gem::Requirement
|
104
|
+
requirements:
|
105
|
+
- - ">="
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '0'
|
108
|
+
type: :development
|
109
|
+
prerelease: false
|
110
|
+
version_requirements: !ruby/object:Gem::Requirement
|
111
|
+
requirements:
|
112
|
+
- - ">="
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: '0'
|
115
|
+
- !ruby/object:Gem::Dependency
|
116
|
+
name: haml
|
46
117
|
requirement: !ruby/object:Gem::Requirement
|
47
118
|
requirements:
|
48
119
|
- - ">="
|
49
120
|
- !ruby/object:Gem::Version
|
50
|
-
version:
|
121
|
+
version: '5'
|
51
122
|
type: :development
|
52
123
|
prerelease: false
|
53
124
|
version_requirements: !ruby/object:Gem::Requirement
|
54
125
|
requirements:
|
55
126
|
- - ">="
|
56
127
|
- !ruby/object:Gem::Version
|
57
|
-
version:
|
128
|
+
version: '5'
|
58
129
|
- !ruby/object:Gem::Dependency
|
59
|
-
name:
|
130
|
+
name: less
|
60
131
|
requirement: !ruby/object:Gem::Requirement
|
61
132
|
requirements:
|
62
133
|
- - ">="
|
@@ -70,7 +141,21 @@ dependencies:
|
|
70
141
|
- !ruby/object:Gem::Version
|
71
142
|
version: '0'
|
72
143
|
- !ruby/object:Gem::Dependency
|
73
|
-
name: minitest
|
144
|
+
name: minitest-reporters
|
145
|
+
requirement: !ruby/object:Gem::Requirement
|
146
|
+
requirements:
|
147
|
+
- - "~>"
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '1.1'
|
150
|
+
type: :development
|
151
|
+
prerelease: false
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
requirements:
|
154
|
+
- - "~>"
|
155
|
+
- !ruby/object:Gem::Version
|
156
|
+
version: '1.1'
|
157
|
+
- !ruby/object:Gem::Dependency
|
158
|
+
name: rails
|
74
159
|
requirement: !ruby/object:Gem::Requirement
|
75
160
|
requirements:
|
76
161
|
- - ">="
|
@@ -84,7 +169,63 @@ dependencies:
|
|
84
169
|
- !ruby/object:Gem::Version
|
85
170
|
version: '4.0'
|
86
171
|
- !ruby/object:Gem::Dependency
|
87
|
-
name:
|
172
|
+
name: rake
|
173
|
+
requirement: !ruby/object:Gem::Requirement
|
174
|
+
requirements:
|
175
|
+
- - ">="
|
176
|
+
- !ruby/object:Gem::Version
|
177
|
+
version: '0'
|
178
|
+
type: :development
|
179
|
+
prerelease: false
|
180
|
+
version_requirements: !ruby/object:Gem::Requirement
|
181
|
+
requirements:
|
182
|
+
- - ">="
|
183
|
+
- !ruby/object:Gem::Version
|
184
|
+
version: '0'
|
185
|
+
- !ruby/object:Gem::Dependency
|
186
|
+
name: rake-compiler
|
187
|
+
requirement: !ruby/object:Gem::Requirement
|
188
|
+
requirements:
|
189
|
+
- - ">="
|
190
|
+
- !ruby/object:Gem::Version
|
191
|
+
version: '0'
|
192
|
+
type: :development
|
193
|
+
prerelease: false
|
194
|
+
version_requirements: !ruby/object:Gem::Requirement
|
195
|
+
requirements:
|
196
|
+
- - ">="
|
197
|
+
- !ruby/object:Gem::Version
|
198
|
+
version: '0'
|
199
|
+
- !ruby/object:Gem::Dependency
|
200
|
+
name: sass
|
201
|
+
requirement: !ruby/object:Gem::Requirement
|
202
|
+
requirements:
|
203
|
+
- - ">="
|
204
|
+
- !ruby/object:Gem::Version
|
205
|
+
version: '0'
|
206
|
+
type: :development
|
207
|
+
prerelease: false
|
208
|
+
version_requirements: !ruby/object:Gem::Requirement
|
209
|
+
requirements:
|
210
|
+
- - ">="
|
211
|
+
- !ruby/object:Gem::Version
|
212
|
+
version: '0'
|
213
|
+
- !ruby/object:Gem::Dependency
|
214
|
+
name: slim
|
215
|
+
requirement: !ruby/object:Gem::Requirement
|
216
|
+
requirements:
|
217
|
+
- - ">="
|
218
|
+
- !ruby/object:Gem::Version
|
219
|
+
version: '0'
|
220
|
+
type: :development
|
221
|
+
prerelease: false
|
222
|
+
version_requirements: !ruby/object:Gem::Requirement
|
223
|
+
requirements:
|
224
|
+
- - ">="
|
225
|
+
- !ruby/object:Gem::Version
|
226
|
+
version: '0'
|
227
|
+
- !ruby/object:Gem::Dependency
|
228
|
+
name: string_template
|
88
229
|
requirement: !ruby/object:Gem::Requirement
|
89
230
|
requirements:
|
90
231
|
- - ">="
|
@@ -98,7 +239,7 @@ dependencies:
|
|
98
239
|
- !ruby/object:Gem::Version
|
99
240
|
version: '0'
|
100
241
|
- !ruby/object:Gem::Dependency
|
101
|
-
name:
|
242
|
+
name: unindent
|
102
243
|
requirement: !ruby/object:Gem::Requirement
|
103
244
|
requirements:
|
104
245
|
- - ">="
|
@@ -111,24 +252,19 @@ dependencies:
|
|
111
252
|
- - ">="
|
112
253
|
- !ruby/object:Gem::Version
|
113
254
|
version: '0'
|
114
|
-
description:
|
115
|
-
Haml (HTML Abstraction Markup Language) is a layer on top of HTML or XML that's
|
116
|
-
designed to express the structure of documents in a non-repetitive, elegant, and
|
117
|
-
easy way by using indentation rather than closing tags and allowing Ruby to be
|
118
|
-
embedded with ease. It was originally envisioned as a plugin for Ruby on Rails,
|
119
|
-
but it can function as a stand-alone templating engine.
|
255
|
+
description: An elegant, structured (X)HTML/XML templating engine.
|
120
256
|
email:
|
121
257
|
- haml@googlegroups.com
|
122
258
|
- ronnie@dio.jp
|
123
259
|
executables:
|
124
260
|
- haml
|
125
|
-
extensions:
|
261
|
+
extensions:
|
262
|
+
- ext/haml/extconf.rb
|
126
263
|
extra_rdoc_files: []
|
127
264
|
files:
|
265
|
+
- ".github/FUNDING.yml"
|
128
266
|
- ".github/workflows/test.yml"
|
129
267
|
- ".gitignore"
|
130
|
-
- ".gitmodules"
|
131
|
-
- ".yardopts"
|
132
268
|
- CHANGELOG.md
|
133
269
|
- FAQ.md
|
134
270
|
- Gemfile
|
@@ -136,54 +272,71 @@ files:
|
|
136
272
|
- README.md
|
137
273
|
- REFERENCE.md
|
138
274
|
- Rakefile
|
139
|
-
-
|
140
|
-
-
|
141
|
-
- bin/
|
275
|
+
- bin/bench
|
276
|
+
- bin/console
|
277
|
+
- bin/ruby
|
278
|
+
- bin/setup
|
279
|
+
- bin/stackprof
|
280
|
+
- bin/test
|
281
|
+
- exe/haml
|
282
|
+
- ext/haml/extconf.rb
|
283
|
+
- ext/haml/haml.c
|
284
|
+
- ext/haml/hescape.c
|
285
|
+
- ext/haml/hescape.h
|
142
286
|
- haml.gemspec
|
143
287
|
- lib/haml.rb
|
144
|
-
- lib/haml
|
288
|
+
- lib/haml/ambles.rb
|
145
289
|
- lib/haml/attribute_builder.rb
|
146
290
|
- lib/haml/attribute_compiler.rb
|
147
291
|
- lib/haml/attribute_parser.rb
|
148
|
-
- lib/haml/
|
292
|
+
- lib/haml/cli.rb
|
149
293
|
- lib/haml/compiler.rb
|
294
|
+
- lib/haml/compiler/children_compiler.rb
|
295
|
+
- lib/haml/compiler/comment_compiler.rb
|
296
|
+
- lib/haml/compiler/doctype_compiler.rb
|
297
|
+
- lib/haml/compiler/script_compiler.rb
|
298
|
+
- lib/haml/compiler/silent_script_compiler.rb
|
299
|
+
- lib/haml/compiler/tag_compiler.rb
|
300
|
+
- lib/haml/dynamic_merger.rb
|
150
301
|
- lib/haml/engine.rb
|
151
302
|
- lib/haml/error.rb
|
152
303
|
- lib/haml/escapable.rb
|
153
|
-
- lib/haml/exec.rb
|
154
304
|
- lib/haml/filters.rb
|
155
|
-
- lib/haml/
|
305
|
+
- lib/haml/filters/base.rb
|
306
|
+
- lib/haml/filters/cdata.rb
|
307
|
+
- lib/haml/filters/coffee.rb
|
308
|
+
- lib/haml/filters/css.rb
|
309
|
+
- lib/haml/filters/erb.rb
|
310
|
+
- lib/haml/filters/escaped.rb
|
311
|
+
- lib/haml/filters/javascript.rb
|
312
|
+
- lib/haml/filters/less.rb
|
313
|
+
- lib/haml/filters/markdown.rb
|
314
|
+
- lib/haml/filters/plain.rb
|
315
|
+
- lib/haml/filters/preserve.rb
|
316
|
+
- lib/haml/filters/ruby.rb
|
317
|
+
- lib/haml/filters/sass.rb
|
318
|
+
- lib/haml/filters/scss.rb
|
319
|
+
- lib/haml/filters/text_base.rb
|
320
|
+
- lib/haml/filters/tilt_base.rb
|
321
|
+
- lib/haml/force_escapable.rb
|
156
322
|
- lib/haml/helpers.rb
|
157
|
-
- lib/haml/
|
158
|
-
- lib/haml/
|
159
|
-
- lib/haml/
|
160
|
-
- lib/haml/helpers/safe_erubi_template.rb
|
161
|
-
- lib/haml/helpers/safe_erubis_template.rb
|
162
|
-
- lib/haml/helpers/xss_mods.rb
|
163
|
-
- lib/haml/options.rb
|
323
|
+
- lib/haml/html.rb
|
324
|
+
- lib/haml/identity.rb
|
325
|
+
- lib/haml/object_ref.rb
|
164
326
|
- lib/haml/parser.rb
|
165
|
-
- lib/haml/
|
327
|
+
- lib/haml/rails_helpers.rb
|
328
|
+
- lib/haml/rails_template.rb
|
166
329
|
- lib/haml/railtie.rb
|
167
|
-
- lib/haml/
|
330
|
+
- lib/haml/ruby_expression.rb
|
331
|
+
- lib/haml/string_splitter.rb
|
168
332
|
- lib/haml/template.rb
|
169
|
-
- lib/haml/template/options.rb
|
170
|
-
- lib/haml/temple_engine.rb
|
171
333
|
- lib/haml/temple_line_counter.rb
|
172
334
|
- lib/haml/util.rb
|
173
335
|
- lib/haml/version.rb
|
174
|
-
|
175
|
-
- yard/default/fulldoc/html/css/common.sass
|
176
|
-
- yard/default/layout/html/footer.erb
|
177
|
-
homepage: http://haml.info/
|
336
|
+
homepage: https://haml.info
|
178
337
|
licenses:
|
179
338
|
- MIT
|
180
|
-
metadata:
|
181
|
-
bug_tracker_uri: https://github.com/haml/haml/issues
|
182
|
-
changelog_uri: https://github.com/haml/haml/blob/main/CHANGELOG.md
|
183
|
-
documentation_uri: http://haml.info/docs.html
|
184
|
-
homepage_uri: http://haml.info
|
185
|
-
mailing_list_uri: https://groups.google.com/forum/?fromgroups#!forum/haml
|
186
|
-
source_code_uri: https://github.com/haml/haml
|
339
|
+
metadata: {}
|
187
340
|
post_install_message:
|
188
341
|
rdoc_options: []
|
189
342
|
require_paths:
|
@@ -192,14 +345,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
192
345
|
requirements:
|
193
346
|
- - ">="
|
194
347
|
- !ruby/object:Gem::Version
|
195
|
-
version: 2.
|
348
|
+
version: 2.1.0
|
196
349
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
197
350
|
requirements:
|
198
351
|
- - ">="
|
199
352
|
- !ruby/object:Gem::Version
|
200
353
|
version: '0'
|
201
354
|
requirements: []
|
202
|
-
rubygems_version: 3.
|
355
|
+
rubygems_version: 3.3.7
|
203
356
|
signing_key:
|
204
357
|
specification_version: 4
|
205
358
|
summary: An elegant, structured (X)HTML/XML templating engine.
|
data/.gitmodules
DELETED
data/.yardopts
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
--charset utf-8
|
2
|
-
--readme README.md
|
3
|
-
--markup markdown
|
4
|
-
--markup-provider kramdown
|
5
|
-
--template-path yard
|
6
|
-
--default-return ""
|
7
|
-
--title "Haml Documentation"
|
8
|
-
--query 'object.type != :classvariable'
|
9
|
-
--query 'object.type != :constant || @api && @api.text == "public"'
|
10
|
-
--exclude lib/haml/plugin.rb
|
11
|
-
--exclude lib/haml/railtie.rb
|
12
|
-
--exclude lib/haml/helpers/action_view_mods.rb
|
13
|
-
--exclude lib/haml/helpers/xss_mods.rb
|
14
|
-
--hide-void-return
|
15
|
-
--protected
|
16
|
-
--no-private
|
17
|
-
--no-highlight
|
18
|
-
-
|
19
|
-
FAQ.md
|
20
|
-
CHANGELOG.md
|
21
|
-
REFERENCE.md
|
22
|
-
MIT-LICENSE
|
data/TODO
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
# -*- mode: org -*-
|
2
|
-
#+STARTUP: nofold
|
3
|
-
|
4
|
-
* Documentation
|
5
|
-
Redo tutorial?
|
6
|
-
Using helpers
|
7
|
-
haml_concat and haml_tag in particular
|
8
|
-
Syntax highlighting?
|
9
|
-
|
10
|
-
* Code
|
11
|
-
Keep track of error offsets everywhere
|
12
|
-
Use this to show error location in messages
|
13
|
-
** Haml
|
14
|
-
Support finer-grained HTML-escaping in filters
|
15
|
-
Speed
|
16
|
-
Make tags with dynamic attributes pre-render as much as possible
|
17
|
-
Including the attribute name where doable
|
18
|
-
:html improvements
|
19
|
-
Ignore closing tags where we can
|
20
|
-
http://code.google.com/speed/articles/optimizing-html.html
|
21
|
-
Requires Haml parsing refactor
|
22
|
-
Don't quote attributes that don't require it
|
23
|
-
http://www.w3.org/TR/REC-html40/intro/sgmltut.html#h-3.2.2
|
24
|
-
http://www.w3.org/TR/html5/syntax.html#attributes
|
data/benchmark.rb
DELETED
@@ -1,70 +0,0 @@
|
|
1
|
-
require "bundler/setup"
|
2
|
-
require "haml"
|
3
|
-
require "rbench"
|
4
|
-
|
5
|
-
times = (ARGV.first || 1000).to_i
|
6
|
-
|
7
|
-
if times == 0 # Invalid parameter
|
8
|
-
puts <<END
|
9
|
-
ruby #$0 [times=1000]
|
10
|
-
Benchmark Haml against various other templating languages.
|
11
|
-
END
|
12
|
-
exit 1
|
13
|
-
end
|
14
|
-
|
15
|
-
%w[erb erubi rails active_support action_controller
|
16
|
-
action_view action_pack haml/template rbench].each {|dep| require(dep)}
|
17
|
-
|
18
|
-
def view
|
19
|
-
base = ActionView::Base.new
|
20
|
-
base.view_paths << File.join(File.dirname(__FILE__), '/test')
|
21
|
-
base
|
22
|
-
end
|
23
|
-
|
24
|
-
def render(view, file)
|
25
|
-
view.render :file => file
|
26
|
-
end
|
27
|
-
|
28
|
-
RBench.run(times) do
|
29
|
-
column :haml, :title => "Haml"
|
30
|
-
column :erb, :title => "ERB"
|
31
|
-
column :erubi, :title => "Erubi"
|
32
|
-
|
33
|
-
template_name = 'standard'
|
34
|
-
haml_template = File.read("#{File.dirname(__FILE__)}/test/templates/#{template_name}.haml")
|
35
|
-
erb_template = File.read("#{File.dirname(__FILE__)}/test/erb/#{template_name}.erb")
|
36
|
-
|
37
|
-
report "Cached" do
|
38
|
-
obj = Object.new
|
39
|
-
|
40
|
-
Haml::Engine.new(haml_template).def_method(obj, :haml)
|
41
|
-
if ERB.instance_method(:initialize).parameters.assoc(:key) # Ruby 2.6+
|
42
|
-
obj.instance_eval("def erb; #{ERB.new(erb_template, trim_mode: '-').src}; end")
|
43
|
-
else
|
44
|
-
obj.instance_eval("def erb; #{ERB.new(erb_template, nil, '-').src}; end")
|
45
|
-
end
|
46
|
-
obj.instance_eval("def erubi; #{Erubi::Engine.new(erb_template).src}; end")
|
47
|
-
|
48
|
-
haml { obj.haml }
|
49
|
-
erb { obj.erb }
|
50
|
-
erubi { obj.erubi }
|
51
|
-
end
|
52
|
-
|
53
|
-
report "ActionView" do
|
54
|
-
# To cache the template
|
55
|
-
render view, 'templates/standard'
|
56
|
-
render view, 'erb/standard'
|
57
|
-
|
58
|
-
haml { render view, 'templates/standard' }
|
59
|
-
erubi { render view, 'erb/standard' }
|
60
|
-
end
|
61
|
-
|
62
|
-
report "ActionView with deep partials" do
|
63
|
-
# To cache the template
|
64
|
-
render view, 'templates/action_view'
|
65
|
-
render view, 'erb/action_view'
|
66
|
-
|
67
|
-
haml { render view, 'templates/action_view' }
|
68
|
-
erubi { render view, 'erb/action_view' }
|
69
|
-
end
|
70
|
-
end
|
data/bin/haml
DELETED
data/lib/haml/.gitattributes
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
version.rb merge=ours
|