diff options
author | Benoit Daloze <eregontp@gmail.com> | 2018-08-11 22:59:21 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2018-08-11 22:59:21 +0200 |
commit | 7c0139a1e01cadd54502475e4405447aeb159e88 (patch) | |
tree | 43f2901b022c41fd4dfbd949c5509fd212f1beb4 /lib/bundler.rb | |
parent | 6476c457ae6ee01b7f859b9aebd8d8992daed6e5 (diff) | |
download | bundler-7c0139a1e01cadd54502475e4405447aeb159e88.tar.gz |
Read text files as UTF-8 rather than binary
* Non-US-ASCII characters make little sense in a binary encoding.
* Reuse helper for load_gemspec_uncached, see
https://github.com/bundler/bundler/pull/6599/files
Diffstat (limited to 'lib/bundler.rb')
-rw-r--r-- | lib/bundler.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb index 6b62ac9b1c..5da316ec4d 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -424,7 +424,7 @@ EOF def read_file(file) SharedHelpers.filesystem_access(file, :read) do - File.open(file, "rb", &:read) + File.open(file, "r:UTF-8", &:read) end end @@ -445,7 +445,7 @@ EOF def load_gemspec_uncached(file, validate = false) path = Pathname.new(file) - contents = File.open(file, "r:UTF-8", &:read) + contents = read_file(file) spec = if contents.start_with?("---") # YAML header eval_yaml_gemspec(path, contents) else |