haml-edge 2.3.75 → 2.3.76
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.
- data/EDGE_GEM_VERSION +1 -1
- data/VERSION +1 -1
- data/lib/haml/engine.rb +3 -1
- data/test/haml/engine_test.rb +18 -2
- data/test/test_helper.rb +1 -0
- metadata +2 -2
data/EDGE_GEM_VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.3.
|
|
1
|
+
2.3.76
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.3.
|
|
1
|
+
2.3.76
|
data/lib/haml/engine.rb
CHANGED
|
@@ -58,7 +58,9 @@ module Haml
|
|
|
58
58
|
# @return [String]
|
|
59
59
|
def precompiled
|
|
60
60
|
return @precompiled if ruby1_8?
|
|
61
|
-
|
|
61
|
+
encoding = Encoding.find(@options[:encoding])
|
|
62
|
+
return @precompiled.force_encoding(encoding) if encoding == Encoding::BINARY
|
|
63
|
+
return @precompiled.encode(encoding)
|
|
62
64
|
end
|
|
63
65
|
|
|
64
66
|
# Precompiles the Haml template.
|
data/test/haml/engine_test.rb
CHANGED
|
@@ -837,12 +837,18 @@ HAML
|
|
|
837
837
|
line_no ||= key.split("\n").length
|
|
838
838
|
|
|
839
839
|
if expected_message == :compile
|
|
840
|
-
|
|
840
|
+
if Haml::Util.ruby1_8?
|
|
841
|
+
assert_match(/^compile error\n/, err.message, "Line: #{key}")
|
|
842
|
+
else
|
|
843
|
+
assert_match(/^#{Regexp.quote __FILE__}:#{line_no}: syntax error,/, err.message, "Line: #{key}")
|
|
844
|
+
end
|
|
841
845
|
else
|
|
842
846
|
assert_equal(expected_message, err.message, "Line: #{key}")
|
|
843
847
|
end
|
|
844
848
|
|
|
845
|
-
|
|
849
|
+
if Haml::Util.ruby1_8?
|
|
850
|
+
assert_match(/^#{Regexp.escape(__FILE__)}:#{line_no}/, err.backtrace[0], "Line: #{key}")
|
|
851
|
+
end
|
|
846
852
|
else
|
|
847
853
|
assert(false, "Exception not raised for\n#{key}")
|
|
848
854
|
end
|
|
@@ -1194,6 +1200,16 @@ HTML
|
|
|
1194
1200
|
HAML
|
|
1195
1201
|
end
|
|
1196
1202
|
|
|
1203
|
+
def test_fake_ascii_encoding
|
|
1204
|
+
assert_equal(<<HTML.force_encoding("ascii-8bit"), render(<<HAML, :encoding => "ascii-8bit"))
|
|
1205
|
+
<p>bâr</p>
|
|
1206
|
+
<p>föö</p>
|
|
1207
|
+
HTML
|
|
1208
|
+
%p bâr
|
|
1209
|
+
%p föö
|
|
1210
|
+
HAML
|
|
1211
|
+
end
|
|
1212
|
+
|
|
1197
1213
|
def test_convert_template_render_proc
|
|
1198
1214
|
assert_converts_template_properly {|e| e.render_proc.call}
|
|
1199
1215
|
end
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: haml-edge
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.3.
|
|
4
|
+
version: 2.3.76
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nathan Weizenbaum
|
|
@@ -10,7 +10,7 @@ autorequire:
|
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
12
|
|
|
13
|
-
date: 2009-11-
|
|
13
|
+
date: 2009-11-08 00:00:00 -05:00
|
|
14
14
|
default_executable:
|
|
15
15
|
dependencies:
|
|
16
16
|
- !ruby/object:Gem::Dependency
|