Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

rbx in 1.9 mode does not support the bom|utf-8 encoding

  • Loading branch information...
commit 975479f81d63bcea86336c7fb4fdc94c987ffa49 1 parent d0486d0
@dsander authored
Showing with 3 additions and 3 deletions.
  1. +2 −2 lib/hoe.rb
  2. +1 −1  test/test_hoe.rb
View
4 lib/hoe.rb 100644 → 100755
@@ -834,10 +834,10 @@ class File
# Like File::read, but strips out a BOM marker if it exists.
def self.read_utf path
r19 = "<3".respond_to? :encoding
- opt = r19 ? "r:bom|utf-8" : "rb"
+ opt = (r19 && RUBY_ENGINE != 'rbx') ? "r:bom|utf-8" : "rb"
open path, opt do |f|
- if r19 then
+ if r19 && RUBY_ENGINE != 'rbx' then
f.read
else
f.read.sub %r/\A\xEF\xBB\xBF/, ''
View
2  test/test_hoe.rb 100644 → 100755
@@ -221,7 +221,7 @@ def test_file_read_utf
content = File.read_utf io.path
assert_equal 'BOM', content
- if content.respond_to? :encoding then
+ if content.respond_to?(:encoding) && RUBY_ENGINE != 'rbx' then
assert_equal Encoding::UTF_8, content.encoding
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.