haml 4.0.7 → 5.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +18 -0
  3. data/.gitmodules +3 -0
  4. data/.travis.yml +54 -0
  5. data/.yardopts +1 -1
  6. data/CHANGELOG.md +96 -4
  7. data/FAQ.md +4 -14
  8. data/Gemfile +19 -0
  9. data/MIT-LICENSE +1 -1
  10. data/README.md +80 -42
  11. data/REFERENCE.md +116 -64
  12. data/Rakefile +46 -54
  13. data/TODO +24 -0
  14. data/benchmark.rb +66 -0
  15. data/haml.gemspec +38 -0
  16. data/lib/haml/.gitattributes +1 -0
  17. data/lib/haml/attribute_builder.rb +163 -0
  18. data/lib/haml/attribute_compiler.rb +223 -0
  19. data/lib/haml/attribute_parser.rb +148 -0
  20. data/lib/haml/buffer.rb +22 -132
  21. data/lib/haml/compiler.rb +89 -298
  22. data/lib/haml/engine.rb +25 -41
  23. data/lib/haml/error.rb +3 -0
  24. data/lib/haml/escapable.rb +49 -0
  25. data/lib/haml/exec.rb +38 -19
  26. data/lib/haml/filters.rb +18 -24
  27. data/lib/haml/generator.rb +41 -0
  28. data/lib/haml/helpers/action_view_extensions.rb +3 -2
  29. data/lib/haml/helpers/action_view_mods.rb +42 -60
  30. data/lib/haml/helpers/action_view_xss_mods.rb +1 -0
  31. data/lib/haml/helpers/safe_erubi_template.rb +19 -0
  32. data/lib/haml/helpers/safe_erubis_template.rb +4 -1
  33. data/lib/haml/helpers/xss_mods.rb +18 -12
  34. data/lib/haml/helpers.rb +132 -89
  35. data/lib/haml/options.rb +41 -47
  36. data/lib/haml/parser.rb +278 -216
  37. data/lib/haml/{template/plugin.rb → plugin.rb} +8 -15
  38. data/lib/haml/railtie.rb +38 -12
  39. data/lib/haml/sass_rails_filter.rb +17 -4
  40. data/lib/haml/template/options.rb +12 -2
  41. data/lib/haml/template.rb +12 -6
  42. data/lib/haml/temple_engine.rb +121 -0
  43. data/lib/haml/temple_line_counter.rb +29 -0
  44. data/lib/haml/util.rb +80 -199
  45. data/lib/haml/version.rb +2 -1
  46. data/lib/haml.rb +1 -0
  47. data/yard/default/.gitignore +1 -0
  48. data/yard/default/fulldoc/html/css/common.sass +15 -0
  49. data/yard/default/layout/html/footer.erb +12 -0
  50. metadata +50 -111
  51. data/test/engine_test.rb +0 -2013
  52. data/test/erb/_av_partial_1.erb +0 -12
  53. data/test/erb/_av_partial_2.erb +0 -8
  54. data/test/erb/action_view.erb +0 -62
  55. data/test/erb/standard.erb +0 -55
  56. data/test/filters_test.rb +0 -254
  57. data/test/gemfiles/Gemfile.rails-3.0.x +0 -5
  58. data/test/gemfiles/Gemfile.rails-3.1.x +0 -6
  59. data/test/gemfiles/Gemfile.rails-3.2.x +0 -5
  60. data/test/gemfiles/Gemfile.rails-4.0.x +0 -5
  61. data/test/haml-spec/LICENSE +0 -14
  62. data/test/haml-spec/README.md +0 -106
  63. data/test/haml-spec/lua_haml_spec.lua +0 -38
  64. data/test/haml-spec/perl_haml_test.pl +0 -81
  65. data/test/haml-spec/ruby_haml_test.rb +0 -23
  66. data/test/haml-spec/tests.json +0 -660
  67. data/test/helper_test.rb +0 -583
  68. data/test/markaby/standard.mab +0 -52
  69. data/test/mocks/article.rb +0 -6
  70. data/test/parser_test.rb +0 -105
  71. data/test/results/content_for_layout.xhtml +0 -12
  72. data/test/results/eval_suppressed.xhtml +0 -9
  73. data/test/results/helpers.xhtml +0 -70
  74. data/test/results/helpful.xhtml +0 -10
  75. data/test/results/just_stuff.xhtml +0 -70
  76. data/test/results/list.xhtml +0 -12
  77. data/test/results/nuke_inner_whitespace.xhtml +0 -40
  78. data/test/results/nuke_outer_whitespace.xhtml +0 -148
  79. data/test/results/original_engine.xhtml +0 -20
  80. data/test/results/partial_layout.xhtml +0 -5
  81. data/test/results/partial_layout_erb.xhtml +0 -5
  82. data/test/results/partials.xhtml +0 -21
  83. data/test/results/render_layout.xhtml +0 -3
  84. data/test/results/silent_script.xhtml +0 -74
  85. data/test/results/standard.xhtml +0 -162
  86. data/test/results/tag_parsing.xhtml +0 -23
  87. data/test/results/very_basic.xhtml +0 -5
  88. data/test/results/whitespace_handling.xhtml +0 -90
  89. data/test/template_test.rb +0 -354
  90. data/test/templates/_av_partial_1.haml +0 -9
  91. data/test/templates/_av_partial_1_ugly.haml +0 -9
  92. data/test/templates/_av_partial_2.haml +0 -5
  93. data/test/templates/_av_partial_2_ugly.haml +0 -5
  94. data/test/templates/_layout.erb +0 -3
  95. data/test/templates/_layout_for_partial.haml +0 -3
  96. data/test/templates/_partial.haml +0 -8
  97. data/test/templates/_text_area.haml +0 -3
  98. data/test/templates/_text_area_helper.html.haml +0 -4
  99. data/test/templates/action_view.haml +0 -47
  100. data/test/templates/action_view_ugly.haml +0 -47
  101. data/test/templates/breakage.haml +0 -8
  102. data/test/templates/content_for_layout.haml +0 -8
  103. data/test/templates/eval_suppressed.haml +0 -11
  104. data/test/templates/helpers.haml +0 -55
  105. data/test/templates/helpful.haml +0 -11
  106. data/test/templates/just_stuff.haml +0 -85
  107. data/test/templates/list.haml +0 -12
  108. data/test/templates/nuke_inner_whitespace.haml +0 -32
  109. data/test/templates/nuke_outer_whitespace.haml +0 -144
  110. data/test/templates/original_engine.haml +0 -17
  111. data/test/templates/partial_layout.haml +0 -3
  112. data/test/templates/partial_layout_erb.erb +0 -4
  113. data/test/templates/partialize.haml +0 -1
  114. data/test/templates/partials.haml +0 -12
  115. data/test/templates/render_layout.haml +0 -2
  116. data/test/templates/silent_script.haml +0 -45
  117. data/test/templates/standard.haml +0 -43
  118. data/test/templates/standard_ugly.haml +0 -43
  119. data/test/templates/tag_parsing.haml +0 -21
  120. data/test/templates/very_basic.haml +0 -4
  121. data/test/templates/whitespace_handling.haml +0 -87
  122. data/test/test_helper.rb +0 -81
  123. data/test/util_test.rb +0 -63
data/lib/haml/util.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: false
2
+
1
3
  begin
2
4
  require 'erubis/tiny'
3
5
  rescue LoadError
@@ -12,38 +14,6 @@ module Haml
12
14
  module Util
13
15
  extend self
14
16
 
15
- # Computes the powerset of the given array.
16
- # This is the set of all subsets of the array.
17
- #
18
- # @example
19
- # powerset([1, 2, 3]) #=>
20
- # Set[Set[], Set[1], Set[2], Set[3], Set[1, 2], Set[2, 3], Set[1, 3], Set[1, 2, 3]]
21
- # @param arr [Enumerable]
22
- # @return [Set<Set>] The subsets of `arr`
23
- def powerset(arr)
24
- arr.inject([Set.new].to_set) do |powerset, el|
25
- new_powerset = Set.new
26
- powerset.each do |subset|
27
- new_powerset << subset
28
- new_powerset << subset + [el]
29
- end
30
- new_powerset
31
- end
32
- end
33
-
34
- # Returns information about the caller of the previous method.
35
- #
36
- # @param entry [String] An entry in the `#caller` list, or a similarly formatted string
37
- # @return [[String, Fixnum, (String, nil)]] An array containing the filename, line, and method name of the caller.
38
- # The method name may be nil
39
- def caller_info(entry = caller[1])
40
- info = entry.scan(/^(.*?):(-?.*?)(?::.*`(.+)')?$/).first
41
- info[1] = info[1].to_i
42
- # This is added by Rubinius to designate a block, but we don't care about it.
43
- info[2].sub!(/ \{\}\Z/, '') if info[2]
44
- info
45
- end
46
-
47
17
  # Silence all output to STDERR within a block.
48
18
  #
49
19
  # @yield A block in which no output will be printed to STDERR
@@ -54,19 +24,6 @@ module Haml
54
24
  $stderr = the_real_stderr
55
25
  end
56
26
 
57
- # Returns an ActionView::Template* class.
58
- # In pre-3.0 versions of Rails, most of these classes
59
- # were of the form `ActionView::TemplateFoo`,
60
- # while afterwards they were of the form `ActionView;:Template::Foo`.
61
- #
62
- # @param name [#to_s] The name of the class to get.
63
- # For example, `:Error` will return `ActionView::TemplateError`
64
- # or `ActionView::Template::Error`.
65
- def av_template_class(name)
66
- return ActionView.const_get("Template#{name}") if ActionView.const_defined?("Template#{name}")
67
- return ActionView::Template.const_get(name.to_s)
68
- end
69
-
70
27
  ## Rails XSS Safety
71
28
 
72
29
  # Whether or not ActionView's XSS protection is available and enabled,
@@ -82,6 +39,9 @@ module Haml
82
39
  # With older versions of the Rails XSS-safety mechanism,
83
40
  # this destructively modifies the HTML-safety of `text`.
84
41
  #
42
+ # It only works if you are using ActiveSupport or the parameter `text`
43
+ # implements the #html_safe method.
44
+ #
85
45
  # @param text [String, nil]
86
46
  # @return [String, nil] `text`, marked as HTML-safe
87
47
  def html_safe(text)
@@ -89,174 +49,89 @@ module Haml
89
49
  text.html_safe
90
50
  end
91
51
 
92
- # Checks that the encoding of a string is valid in Ruby 1.9
52
+ # Checks that the encoding of a string is valid
93
53
  # and cleans up potential encoding gotchas like the UTF-8 BOM.
94
54
  # If it's not, yields an error string describing the invalid character
95
- # and the line on which it occurrs.
55
+ # and the line on which it occurs.
96
56
  #
97
57
  # @param str [String] The string of which to check the encoding
98
58
  # @yield [msg] A block in which an encoding error can be raised.
99
59
  # Only yields if there is an encoding error
100
60
  # @yieldparam msg [String] The error message to be raised
101
61
  # @return [String] `str`, potentially with encoding gotchas like BOMs removed
102
- if RUBY_VERSION < "1.9"
103
- def check_encoding(str)
104
- str.gsub(/\A\xEF\xBB\xBF/, '') # Get rid of the UTF-8 BOM
105
- end
106
- else
107
-
108
- def check_encoding(str)
109
- if str.valid_encoding?
110
- # Get rid of the Unicode BOM if possible
111
- if str.encoding.name =~ /^UTF-(8|16|32)(BE|LE)?$/
112
- return str.gsub(Regexp.new("\\A\uFEFF".encode(str.encoding.name)), '')
113
- else
114
- return str
115
- end
62
+ def check_encoding(str)
63
+ if str.valid_encoding?
64
+ # Get rid of the Unicode BOM if possible
65
+ # Shortcut for UTF-8 which might be the majority case
66
+ if str.encoding == Encoding::UTF_8
67
+ return str.gsub(/\A\uFEFF/, '')
68
+ elsif str.encoding.name =~ /^UTF-(16|32)(BE|LE)?$/
69
+ return str.gsub(Regexp.new("\\A\uFEFF".encode(str.encoding)), '')
70
+ else
71
+ return str
116
72
  end
73
+ end
117
74
 
118
- encoding = str.encoding
119
- newlines = Regexp.new("\r\n|\r|\n".encode(encoding).force_encoding("binary"))
120
- str.force_encoding("binary").split(newlines).each_with_index do |line, i|
121
- begin
122
- line.encode(encoding)
123
- rescue Encoding::UndefinedConversionError => e
124
- yield <<MSG.rstrip, i + 1
75
+ encoding = str.encoding
76
+ newlines = Regexp.new("\r\n|\r|\n".encode(encoding).force_encoding(Encoding::ASCII_8BIT))
77
+ str.force_encoding(Encoding::ASCII_8BIT).split(newlines).each_with_index do |line, i|
78
+ begin
79
+ line.encode(encoding)
80
+ rescue Encoding::UndefinedConversionError => e
81
+ yield <<MSG.rstrip, i + 1
125
82
  Invalid #{encoding.name} character #{e.error_char.dump}
126
83
  MSG
127
- end
128
84
  end
129
- return str
130
85
  end
86
+ return str
131
87
  end
132
88
 
133
- if RUBY_VERSION < "1.9"
134
- # Like {\#check\_encoding}, but also checks for a Ruby-style `-# coding:` comment
135
- # at the beginning of the template and uses that encoding if it exists.
136
- #
137
- # The Haml encoding rules are simple.
138
- # If a `-# coding:` comment exists,
139
- # we assume that that's the original encoding of the document.
140
- # Otherwise, we use whatever encoding Ruby has.
141
- #
142
- # Haml uses the same rules for parsing coding comments as Ruby.
143
- # This means that it can understand Emacs-style comments
144
- # (e.g. `-*- encoding: "utf-8" -*-`),
145
- # and also that it cannot understand non-ASCII-compatible encodings
146
- # such as `UTF-16` and `UTF-32`.
147
- #
148
- # @param str [String] The Haml template of which to check the encoding
149
- # @yield [msg] A block in which an encoding error can be raised.
150
- # Only yields if there is an encoding error
151
- # @yieldparam msg [String] The error message to be raised
152
- # @return [String] The original string encoded properly
153
- # @raise [ArgumentError] if the document declares an unknown encoding
154
- def check_haml_encoding(str, &block)
155
- check_encoding(str, &block)
156
- end
157
- else
158
- def check_haml_encoding(str, &block)
159
- str = str.dup if str.frozen?
160
-
161
- bom, encoding = parse_haml_magic_comment(str)
162
- if encoding; str.force_encoding(encoding)
163
- elsif bom; str.force_encoding("UTF-8")
164
- end
165
-
166
- return check_encoding(str, &block)
167
- end
168
- end
169
-
170
- if RUBY_VERSION < "1.9.2"
171
- def inspect_obj(obj)
172
- return obj.inspect
173
- end
174
- else
175
- # Like `Object#inspect`, but preserves non-ASCII characters rather than escaping them under Ruby 1.9.2.
176
- # This is necessary so that the precompiled Haml template can be `#encode`d into `@options[:encoding]`
177
- # before being evaluated.
178
- #
179
- # @param obj {Object}
180
- # @return {String}
181
- def inspect_obj(obj)
182
- return ':' + inspect_obj(obj.to_s) if obj.is_a?(Symbol)
183
- return obj.inspect unless obj.is_a?(String)
184
- '"' + obj.gsub(/[\x00-\x7F]+/) {|s| s.inspect[1...-1]} + '"'
185
- end
186
- end
187
-
188
- ## Static Method Stuff
189
-
190
- # The context in which the ERB for \{#def\_static\_method} will be run.
191
- class StaticConditionalContext
192
- # @param set [#include?] The set of variables that are defined for this context.
193
- def initialize(set)
194
- @set = set
195
- end
196
-
197
- # Checks whether or not a variable is defined for this context.
198
- #
199
- # @param name [Symbol] The name of the variable
200
- # @return [Boolean]
201
- def method_missing(name, *args, &block)
202
- super unless args.empty? && block.nil?
203
- @set.include?(name)
204
- end
205
- end
206
-
207
- # This is used for methods in {Haml::Buffer} that need to be very fast,
208
- # and take a lot of boolean parameters
209
- # that are known at compile-time.
210
- # Instead of passing the parameters in normally,
211
- # a separate method is defined for every possible combination of those parameters;
212
- # these are then called using \{#static\_method\_name}.
89
+ # Like {\#check\_encoding}, but also checks for a Ruby-style `-# coding:` comment
90
+ # at the beginning of the template and uses that encoding if it exists.
213
91
  #
214
- # To define a static method, an ERB template for the method is provided.
215
- # All conditionals based on the static parameters
216
- # are done as embedded Ruby within this template.
217
- # For example:
218
- #
219
- # def_static_method(Foo, :my_static_method, [:foo, :bar], :baz, :bang, <<RUBY)
220
- # <% if baz && bang %>
221
- # return foo + bar
222
- # <% elsif baz || bang %>
223
- # return foo - bar
224
- # <% else %>
225
- # return 17
226
- # <% end %>
227
- # RUBY
92
+ # The Haml encoding rules are simple.
93
+ # If a `-# coding:` comment exists,
94
+ # we assume that that's the original encoding of the document.
95
+ # Otherwise, we use whatever encoding Ruby has.
228
96
  #
229
- # \{#static\_method\_name} can be used to call static methods.
97
+ # Haml uses the same rules for parsing coding comments as Ruby.
98
+ # This means that it can understand Emacs-style comments
99
+ # (e.g. `-*- encoding: "utf-8" -*-`),
100
+ # and also that it cannot understand non-ASCII-compatible encodings
101
+ # such as `UTF-16` and `UTF-32`.
230
102
  #
231
- # @overload def_static_method(klass, name, args, *vars, erb)
232
- # @param klass [Module] The class on which to define the static method
233
- # @param name [#to_s] The (base) name of the static method
234
- # @param args [Array<Symbol>] The names of the arguments to the defined methods
235
- # (**not** to the ERB template)
236
- # @param vars [Array<Symbol>] The names of the static boolean variables
237
- # to be made available to the ERB template
238
- def def_static_method(klass, name, args, *vars)
239
- erb = vars.pop
240
- info = caller_info
241
- powerset(vars).each do |set|
242
- context = StaticConditionalContext.new(set).instance_eval {binding}
243
- method_content = (defined?(Erubis::TinyEruby) && Erubis::TinyEruby || ERB).new(erb).result(context)
103
+ # @param str [String] The Haml template of which to check the encoding
104
+ # @yield [msg] A block in which an encoding error can be raised.
105
+ # Only yields if there is an encoding error
106
+ # @yieldparam msg [String] The error message to be raised
107
+ # @return [String] The original string encoded properly
108
+ # @raise [ArgumentError] if the document declares an unknown encoding
109
+ def check_haml_encoding(str, &block)
110
+ str = str.dup if str.frozen?
244
111
 
245
- klass.class_eval(<<METHOD, info[0], info[1])
246
- def #{static_method_name(name, *vars.map {|v| set.include?(v)})}(#{args.join(', ')})
247
- #{method_content}
248
- end
249
- METHOD
112
+ bom, encoding = parse_haml_magic_comment(str)
113
+ if encoding; str.force_encoding(encoding)
114
+ elsif bom; str.force_encoding(Encoding::UTF_8)
250
115
  end
116
+
117
+ return check_encoding(str, &block)
251
118
  end
252
119
 
253
- # Computes the name for a method defined via \{#def\_static\_method}.
120
+ # Like `Object#inspect`, but preserves non-ASCII characters rather than escaping them.
121
+ # This is necessary so that the precompiled Haml template can be `#encode`d into `@options[:encoding]`
122
+ # before being evaluated.
254
123
  #
255
- # @param name [String] The base name of the static method
256
- # @param vars [Array<Boolean>] The static variable assignment
257
- # @return [String] The real name of the static method
258
- def static_method_name(name, *vars)
259
- :"#{name}_#{vars.map {|v| !!v}.join('_')}"
124
+ # @param obj {Object}
125
+ # @return {String}
126
+ def inspect_obj(obj)
127
+ case obj
128
+ when String
129
+ %Q!"#{obj.gsub(/[\x00-\x7F]+/) {|s| s.dump[1...-1]}}"!
130
+ when Symbol
131
+ ":#{inspect_obj(obj.to_s)}"
132
+ else
133
+ obj.inspect
134
+ end
260
135
  end
261
136
 
262
137
  # Scans through a string looking for the interoplation-opening `#{`
@@ -271,7 +146,7 @@ METHOD
271
146
  # @return [String] The text remaining in the scanner after all `#{`s have been processed
272
147
  def handle_interpolation(str)
273
148
  scan = StringScanner.new(str)
274
- yield scan while scan.scan(/(.*?)(\\*)\#\{/)
149
+ yield scan while scan.scan(/(.*?)(\\*)#([\{@$])/)
275
150
  scan.rest
276
151
  end
277
152
 
@@ -283,10 +158,8 @@ METHOD
283
158
  # from to
284
159
  #
285
160
  # @param scanner [StringScanner] The string scanner to move
286
- # @param start [Character] The character opening the balanced pair.
287
- # A `Fixnum` in 1.8, a `String` in 1.9
288
- # @param finish [Character] The character closing the balanced pair.
289
- # A `Fixnum` in 1.8, a `String` in 1.9
161
+ # @param start [String] The character opening the balanced pair.
162
+ # @param finish [String] The character closing the balanced pair.
290
163
  # @param count [Fixnum] The number of opening characters matched
291
164
  # before calling this method
292
165
  # @return [(String, String)] The string matched within the balanced pair
@@ -322,20 +195,28 @@ METHOD
322
195
  end
323
196
 
324
197
  def contains_interpolation?(str)
325
- str.include?('#{')
198
+ /#[\{$@]/ === str
326
199
  end
327
200
 
328
201
  def unescape_interpolation(str, escape_html = nil)
329
202
  res = ''
330
203
  rest = Haml::Util.handle_interpolation str.dump do |scan|
331
204
  escapes = (scan[2].size - 1) / 2
205
+ char = scan[3] # '{', '@' or '$'
332
206
  res << scan.matched[0...-3 - escapes]
333
207
  if escapes % 2 == 1
334
- res << '#{'
208
+ res << "\##{char}"
335
209
  else
336
- content = eval('"' + balance(scan, ?{, ?}, 1)[0][0...-1] + '"')
210
+ interpolated = if char == '{'
211
+ balance(scan, ?{, ?}, 1)[0][0...-1]
212
+ else
213
+ scan.scan(/\w+/)
214
+ end
215
+ content = eval('"' + interpolated + '"')
216
+ content.prepend(char) if char == '@' || char == '$'
337
217
  content = "Haml::Helpers.html_escape((#{content}))" if escape_html
338
- res << '#{' + content + "}"# Use eval to get rid of string escapes
218
+
219
+ res << "\#{#{content}}"
339
220
  end
340
221
  end
341
222
  res + rest
@@ -350,7 +231,7 @@ METHOD
350
231
  # Whether the document begins with a UTF-8 BOM,
351
232
  # and the declared encoding of the document (or nil if none is declared)
352
233
  def parse_haml_magic_comment(str)
353
- scanner = StringScanner.new(str.dup.force_encoding("BINARY"))
234
+ scanner = StringScanner.new(str.dup.force_encoding(Encoding::ASCII_8BIT))
354
235
  bom = scanner.scan(/\xEF\xBB\xBF/n)
355
236
  return bom unless scanner.scan(/-\s*#\s*/n)
356
237
  if coding = try_parse_haml_emacs_magic_comment(scanner)
data/lib/haml/version.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Haml
2
- VERSION = '4.0.7'
3
+ VERSION = "5.0.4"
3
4
  end
data/lib/haml.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'haml/version'
2
3
 
3
4
  # The module that contains everything Haml-related:
@@ -0,0 +1 @@
1
+ *.css
@@ -0,0 +1,15 @@
1
+ #filecontents
2
+ *:target, dt:target + dd
3
+ background-color: #ccf
4
+ border: 1px solid #88b
5
+ dt
6
+ font-weight: bold
7
+ dd
8
+ margin:
9
+ left: 0
10
+ bottom: 0.7em
11
+ padding-left: 3em
12
+ dt:target
13
+ border-bottom-style: none
14
+ & + dd
15
+ border-top-style: none
@@ -0,0 +1,12 @@
1
+ <%= superb :footer %>
2
+ <% if ENV["ANALYTICS"] %>
3
+ <script type="text/javascript">
4
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
5
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
6
+ </script>
7
+ <script type="text/javascript">
8
+ try {
9
+ var pageTracker = _gat._getTracker("<%= ENV["ANALYTICS"] %>");
10
+ pageTracker._trackPageview();
11
+ } catch(err) {}</script>
12
+ <% end %>
metadata CHANGED
@@ -1,17 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haml
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.7
4
+ version: 5.0.4
5
5
  platform: ruby
6
6
  authors:
7
- - Nathan Weizenbaum
7
+ - Natalie Weizenbaum
8
8
  - Hampton Catlin
9
9
  - Norman Clarke
10
+ - Akira Matsuda
10
11
  autorequire:
11
12
  bindir: bin
12
13
  cert_chain: []
13
- date: 2015-08-10 00:00:00.000000000 Z
14
+ date: 2017-10-13 00:00:00.000000000 Z
14
15
  dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: temple
18
+ requirement: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 0.8.0
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 0.8.0
15
30
  - !ruby/object:Gem::Dependency
16
31
  name: tilt
17
32
  requirement: !ruby/object:Gem::Requirement
@@ -32,14 +47,14 @@ dependencies:
32
47
  requirements:
33
48
  - - ">="
34
49
  - !ruby/object:Gem::Version
35
- version: 3.0.0
50
+ version: 4.0.0
36
51
  type: :development
37
52
  prerelease: false
38
53
  version_requirements: !ruby/object:Gem::Requirement
39
54
  requirements:
40
55
  - - ">="
41
56
  - !ruby/object:Gem::Version
42
- version: 3.0.0
57
+ version: 4.0.0
43
58
  - !ruby/object:Gem::Dependency
44
59
  name: rbench
45
60
  requirement: !ruby/object:Gem::Requirement
@@ -60,28 +75,28 @@ dependencies:
60
75
  requirements:
61
76
  - - ">="
62
77
  - !ruby/object:Gem::Version
63
- version: '0'
78
+ version: '4.0'
64
79
  type: :development
65
80
  prerelease: false
66
81
  version_requirements: !ruby/object:Gem::Requirement
67
82
  requirements:
68
83
  - - ">="
69
84
  - !ruby/object:Gem::Version
70
- version: '0'
85
+ version: '4.0'
71
86
  - !ruby/object:Gem::Dependency
72
87
  name: nokogiri
73
88
  requirement: !ruby/object:Gem::Requirement
74
89
  requirements:
75
- - - "~>"
90
+ - - ">="
76
91
  - !ruby/object:Gem::Version
77
- version: 1.5.10
92
+ version: '0'
78
93
  type: :development
79
94
  prerelease: false
80
95
  version_requirements: !ruby/object:Gem::Requirement
81
96
  requirements:
82
- - - "~>"
97
+ - - ">="
83
98
  - !ruby/object:Gem::Version
84
- version: 1.5.10
99
+ version: '0'
85
100
  description: |
86
101
  Haml (HTML Abstraction Markup Language) is a layer on top of HTML or XML that's
87
102
  designed to express the structure of documents in a non-repetitive, elegant, and
@@ -96,129 +111,60 @@ executables:
96
111
  extensions: []
97
112
  extra_rdoc_files: []
98
113
  files:
114
+ - ".gitignore"
115
+ - ".gitmodules"
116
+ - ".travis.yml"
99
117
  - ".yardopts"
100
118
  - CHANGELOG.md
101
119
  - FAQ.md
120
+ - Gemfile
102
121
  - MIT-LICENSE
103
122
  - README.md
104
123
  - REFERENCE.md
105
124
  - Rakefile
125
+ - TODO
126
+ - benchmark.rb
106
127
  - bin/haml
128
+ - haml.gemspec
107
129
  - lib/haml.rb
130
+ - lib/haml/.gitattributes
131
+ - lib/haml/attribute_builder.rb
132
+ - lib/haml/attribute_compiler.rb
133
+ - lib/haml/attribute_parser.rb
108
134
  - lib/haml/buffer.rb
109
135
  - lib/haml/compiler.rb
110
136
  - lib/haml/engine.rb
111
137
  - lib/haml/error.rb
138
+ - lib/haml/escapable.rb
112
139
  - lib/haml/exec.rb
113
140
  - lib/haml/filters.rb
141
+ - lib/haml/generator.rb
114
142
  - lib/haml/helpers.rb
115
143
  - lib/haml/helpers/action_view_extensions.rb
116
144
  - lib/haml/helpers/action_view_mods.rb
117
145
  - lib/haml/helpers/action_view_xss_mods.rb
146
+ - lib/haml/helpers/safe_erubi_template.rb
118
147
  - lib/haml/helpers/safe_erubis_template.rb
119
148
  - lib/haml/helpers/xss_mods.rb
120
149
  - lib/haml/options.rb
121
150
  - lib/haml/parser.rb
151
+ - lib/haml/plugin.rb
122
152
  - lib/haml/railtie.rb
123
153
  - lib/haml/sass_rails_filter.rb
124
154
  - lib/haml/template.rb
125
155
  - lib/haml/template/options.rb
126
- - lib/haml/template/plugin.rb
156
+ - lib/haml/temple_engine.rb
157
+ - lib/haml/temple_line_counter.rb
127
158
  - lib/haml/util.rb
128
159
  - lib/haml/version.rb
129
- - test/engine_test.rb
130
- - test/erb/_av_partial_1.erb
131
- - test/erb/_av_partial_2.erb
132
- - test/erb/action_view.erb
133
- - test/erb/standard.erb
134
- - test/filters_test.rb
135
- - test/gemfiles/Gemfile.rails-3.0.x
136
- - test/gemfiles/Gemfile.rails-3.1.x
137
- - test/gemfiles/Gemfile.rails-3.2.x
138
- - test/gemfiles/Gemfile.rails-4.0.x
139
- - test/haml-spec/LICENSE
140
- - test/haml-spec/README.md
141
- - test/haml-spec/lua_haml_spec.lua
142
- - test/haml-spec/perl_haml_test.pl
143
- - test/haml-spec/ruby_haml_test.rb
144
- - test/haml-spec/tests.json
145
- - test/helper_test.rb
146
- - test/markaby/standard.mab
147
- - test/mocks/article.rb
148
- - test/parser_test.rb
149
- - test/results/content_for_layout.xhtml
150
- - test/results/eval_suppressed.xhtml
151
- - test/results/helpers.xhtml
152
- - test/results/helpful.xhtml
153
- - test/results/just_stuff.xhtml
154
- - test/results/list.xhtml
155
- - test/results/nuke_inner_whitespace.xhtml
156
- - test/results/nuke_outer_whitespace.xhtml
157
- - test/results/original_engine.xhtml
158
- - test/results/partial_layout.xhtml
159
- - test/results/partial_layout_erb.xhtml
160
- - test/results/partials.xhtml
161
- - test/results/render_layout.xhtml
162
- - test/results/silent_script.xhtml
163
- - test/results/standard.xhtml
164
- - test/results/tag_parsing.xhtml
165
- - test/results/very_basic.xhtml
166
- - test/results/whitespace_handling.xhtml
167
- - test/template_test.rb
168
- - test/templates/_av_partial_1.haml
169
- - test/templates/_av_partial_1_ugly.haml
170
- - test/templates/_av_partial_2.haml
171
- - test/templates/_av_partial_2_ugly.haml
172
- - test/templates/_layout.erb
173
- - test/templates/_layout_for_partial.haml
174
- - test/templates/_partial.haml
175
- - test/templates/_text_area.haml
176
- - test/templates/_text_area_helper.html.haml
177
- - test/templates/action_view.haml
178
- - test/templates/action_view_ugly.haml
179
- - test/templates/breakage.haml
180
- - test/templates/content_for_layout.haml
181
- - test/templates/eval_suppressed.haml
182
- - test/templates/helpers.haml
183
- - test/templates/helpful.haml
184
- - test/templates/just_stuff.haml
185
- - test/templates/list.haml
186
- - test/templates/nuke_inner_whitespace.haml
187
- - test/templates/nuke_outer_whitespace.haml
188
- - test/templates/original_engine.haml
189
- - test/templates/partial_layout.haml
190
- - test/templates/partial_layout_erb.erb
191
- - test/templates/partialize.haml
192
- - test/templates/partials.haml
193
- - test/templates/render_layout.haml
194
- - test/templates/silent_script.haml
195
- - test/templates/standard.haml
196
- - test/templates/standard_ugly.haml
197
- - test/templates/tag_parsing.haml
198
- - test/templates/very_basic.haml
199
- - test/templates/whitespace_handling.haml
200
- - test/test_helper.rb
201
- - test/util_test.rb
160
+ - yard/default/.gitignore
161
+ - yard/default/fulldoc/html/css/common.sass
162
+ - yard/default/layout/html/footer.erb
202
163
  homepage: http://haml.info/
203
164
  licenses:
204
165
  - MIT
205
166
  metadata: {}
206
- post_install_message: |2+
207
-
208
- HEADS UP! Haml 4.0 has many improvements, but also has changes that may break
209
- your application:
210
-
211
- * Support for Ruby 1.8.6 dropped
212
- * Support for Rails 2 dropped
213
- * Sass filter now always outputs <style> tags
214
- * Data attributes are now hyphenated, not underscored
215
- * html2haml utility moved to the html2haml gem
216
- * Textile and Maruku filters moved to the haml-contrib gem
217
-
218
- For more info see:
219
-
220
- http://rubydoc.info/github/haml/haml/file/CHANGELOG.md
221
-
167
+ post_install_message:
222
168
  rdoc_options: []
223
169
  require_paths:
224
170
  - lib
@@ -226,7 +172,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
226
172
  requirements:
227
173
  - - ">="
228
174
  - !ruby/object:Gem::Version
229
- version: '0'
175
+ version: 2.0.0
230
176
  required_rubygems_version: !ruby/object:Gem::Requirement
231
177
  requirements:
232
178
  - - ">="
@@ -234,15 +180,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
234
180
  version: '0'
235
181
  requirements: []
236
182
  rubyforge_project:
237
- rubygems_version: 2.4.7
183
+ rubygems_version: 2.6.14
238
184
  signing_key:
239
185
  specification_version: 4
240
186
  summary: An elegant, structured (X)HTML/XML templating engine.
241
- test_files:
242
- - test/engine_test.rb
243
- - test/filters_test.rb
244
- - test/haml-spec/ruby_haml_test.rb
245
- - test/helper_test.rb
246
- - test/parser_test.rb
247
- - test/template_test.rb
248
- - test/util_test.rb
187
+ test_files: []