[Haml] Handle frozen template strings.

Closes gh-197
This commit is contained in:
Nathan Weizenbaum 2010-06-22 15:20:33 -07:00
parent 5a82246393
commit 2e30ee55c9
2 changed files with 5 additions and 0 deletions

View File

@ -10,6 +10,10 @@
Support for Rails 3 versions prior to beta 4 has been removed.
Upgrade to Rails 3.0.0.beta4 if you haven't already.
### Minor Improvements
* Properly process frozen strings with encoding declarations.
## 3.0.12
[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.12).

View File

@ -441,6 +441,7 @@ MSG
# @raise [ArgumentError] if the document declares an unknown encoding
def check_haml_encoding(str, &block)
return check_encoding(str, &block) if ruby1_8?
str = str.dup if str.frozen?
bom, encoding = parse_haml_magic_comment(str)
if encoding; str.force_encoding(encoding)