Module: DiskUsageExtension Private

Extended by:
T::Helpers
Included in:
Pathname
Defined in:
extend/pathname/disk_usage_extension.rb

This module is part of a private API. This module may only be used in the Homebrew/brew repository. Third parties should avoid using this module if possible, as it may be removed or changed without warning.

Instance Method Summary collapse

Instance Method Details

#abvString

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:



28
29
30
31
32
33
34
# File 'extend/pathname/disk_usage_extension.rb', line 28

def abv
  out = +""
  @file_count, @disk_usage = compute_disk_usage
  out << "#{number_readable(@file_count)} files, " if @file_count > 1
  out << disk_usage_readable(@disk_usage).to_s
  out.freeze
end

#disk_usageInteger

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:

  • (Integer)


10
11
12
13
14
15
16
# File 'extend/pathname/disk_usage_extension.rb', line 10

def disk_usage
  @disk_usage ||= T.let(nil, T.nilable(Integer))
  return @disk_usage unless @disk_usage.nil?

  @file_count, @disk_usage = compute_disk_usage
  @disk_usage
end

#file_countInteger

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:

  • (Integer)


19
20
21
22
23
24
25
# File 'extend/pathname/disk_usage_extension.rb', line 19

def file_count
  @file_count ||= T.let(nil, T.nilable(Integer))
  return @file_count unless @file_count.nil?

  @file_count, @disk_usage = compute_disk_usage
  @file_count
end