diff options
Diffstat (limited to 'Library/Homebrew/cask/lib/hbc/utils.rb')
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/utils.rb | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/utils.rb b/Library/Homebrew/cask/lib/hbc/utils.rb index 6b839345a..3fc817dd5 100644 --- a/Library/Homebrew/cask/lib/hbc/utils.rb +++ b/Library/Homebrew/cask/lib/hbc/utils.rb @@ -89,27 +89,6 @@ module Hbc Etc.getpwuid(Process.euid).name end - # paths that "look" descendant (textually) will still - # return false unless both the given paths exist - def self.file_is_descendant(file, dir) - file = Pathname.new(file) - dir = Pathname.new(dir) - return false unless file.exist? && dir.exist? - unless dir.directory? - onoe "Argument must be a directory: '#{dir}'" - return false - end - unless file.absolute? && dir.absolute? - onoe "Both arguments must be absolute: '#{file}', '#{dir}'" - return false - end - while file.parent != file - return true if File.identical?(file, dir) - file = file.parent - end - false - end - def self.path_occupied?(path) File.exist?(path) || File.symlink?(path) end @@ -144,18 +123,5 @@ module Hbc timestamp.concat(fraction) container_path.join(timestamp) end - - def self.size_in_bytes(files) - Array(files).reduce(0) { |acc, elem| acc + (File.size?(elem) || 0) } - end - - def self.capture_stderr - previous_stderr = $stderr - $stderr = StringIO.new - yield - $stderr.string - ensure - $stderr = previous_stderr - end end end |
