aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cask/lib/hbc/cask_loader.rb9
1 files changed, 1 insertions, 8 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/cask_loader.rb b/Library/Homebrew/cask/lib/hbc/cask_loader.rb
index f91ad241f..3875b30df 100644
--- a/Library/Homebrew/cask/lib/hbc/cask_loader.rb
+++ b/Library/Homebrew/cask/lib/hbc/cask_loader.rb
@@ -6,14 +6,7 @@ module Hbc
raise CaskError, "File '#{path}' is not a plain file" unless path.file?
token = path.basename(".rb").to_s
-
- content = File.open(path, "rb") do |caskfile|
- if defined?(Encoding)
- caskfile.read.force_encoding("UTF-8")
- else
- caskfile.read
- end
- end
+ content = IO.read(path).force_encoding("UTF-8")
new(token, content, path).load
end