haml-edge 2.3.75 → 2.3.76

Sign up to get free protection for your applications and to get access to all the features.
data/EDGE_GEM_VERSION CHANGED
@@ -1 +1 @@
1
- 2.3.75
1
+ 2.3.76
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.3.75
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
- return @precompiled.encode(Encoding.find(@options[:encoding]))
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.
@@ -837,12 +837,18 @@ HAML
837
837
  line_no ||= key.split("\n").length
838
838
 
839
839
  if expected_message == :compile
840
- assert_match(/^compile error\n/, err.message, "Line: #{key}")
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
- assert_match(/^#{Regexp.escape(__FILE__)}:#{line_no}/, err.backtrace[0], "Line: #{key}")
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
@@ -13,6 +13,7 @@ class Test::Unit::TestCase
13
13
  def munge_filename(opts)
14
14
  return if opts[:filename]
15
15
  test_name = Haml::Util.caller_info(caller[1])[2]
16
+ test_name.sub!(/^block in /, '')
16
17
  opts[:filename] = "#{test_name}_inline.sass"
17
18
  end
18
19
 
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.75
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-06 00:00:00 -05:00
13
+ date: 2009-11-08 00:00:00 -05:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency