diff options
| author | Markus Reiter | 2016-10-08 19:20:54 +0200 |
|---|---|---|
| committer | Markus Reiter | 2016-10-09 15:34:12 +0200 |
| commit | 8ded5b690f1c31e79c4cb51e7bd90fcca35b535f (patch) | |
| tree | fb988dfb1e8fe8ffb37591299a7ac25887e4e0b3 /Library | |
| parent | 67a7d1a64a0d69d60a6cdd17a8296c8cce215b7f (diff) | |
| download | brew-8ded5b690f1c31e79c4cb51e7bd90fcca35b535f.tar.bz2 | |
No need to check if `Encoding` is defined.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/cask_loader.rb | 9 |
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 |
