diff --git a/Library/Homebrew/cask/lib/hbc/cask_loader.rb b/Library/Homebrew/cask/lib/hbc/cask_loader.rb index f91ad241f1..3875b30df2 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