aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/testing_env.rb
diff options
context:
space:
mode:
authorJack Nagel2014-06-08 20:00:52 -0500
committerJack Nagel2014-06-08 20:00:52 -0500
commitd27dc1d02f0195855e5bd9f1c8ba61bb37c483d3 (patch)
tree0f20be12d69c6b83c826b70d07a66c6fadfa0efd /Library/Homebrew/test/testing_env.rb
parent6d0f0cb195a0e3db68c33a65f09ad482af6ecb95 (diff)
downloadbrew-d27dc1d02f0195855e5bd9f1c8ba61bb37c483d3.tar.bz2
Work around encoding issue in Pathname#inspect on Ruby 2.0
Pathname#inspect on Ruby 2.0 throws away the encoding of the object's underlying string and returns a string tagged as ASCII-8BIT. If you simply write puts Pathname.new("some string with non-ascii bytes").inspect no error will be raised, because the implementation of Pathname#inspect does not call into Object#inspect. However, if you wrap that pathname object in an array first, then puts [Pathname.new("some string with non-ascii bytes")].inspect will raise Encoding::CompatibilityError: "inspected result must be ASCII only or use the same encoding with default external". Raising an error in this codepath is new in Ruby 2.0, and this specific bug is fixed in Ruby 2.1. I've opened a bug upstream: https://bugs.ruby-lang.org/issues/9915 Fixes Homebrew/homebrew#29947.
Diffstat (limited to 'Library/Homebrew/test/testing_env.rb')
0 files changed, 0 insertions, 0 deletions