module XcodeTrashRemover::SizeHelper
Public Instance Methods
dir_size(dir_path)
click to toggle source
# File lib/xcode_trash_remover/size_helper.rb, line 7 def dir_size(dir_path) dir_path << '/' unless dir_path.end_with?('/') total_size = 0 if File.directory?(dir_path) Dir["#{dir_path}**/*"].each do |f| total_size += File.size(f) if File.file?(f) && File.size?(f) end end total_size end