Module: ObserverPathnameExtension

Extended by:
Context, T::Helpers
Defined in:
extend/pathname/observer_pathname_extension.rb

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Context

current, current=, debug?, quiet?, verbose?, with_context

Class Attribute Details

.dInteger

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)


23
24
25
# File 'extend/pathname/observer_pathname_extension.rb', line 23

def d
  @d ||= 0
end

.nInteger

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)


15
16
17
# File 'extend/pathname/observer_pathname_extension.rb', line 15

def n
  @n ||= 0
end

Class Method Details

.countsArray<(Integer, Integer)>

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:

  • (Array<(Integer, Integer)>)


43
44
45
# File 'extend/pathname/observer_pathname_extension.rb', line 43

def counts
  [n, d]
end

.reset_counts!void

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.

This method returns an undefined value.



31
32
33
34
35
# File 'extend/pathname/observer_pathname_extension.rb', line 31

def reset_counts!
  @n = T.let(0, T.nilable(Integer))
  @d = T.let(0, T.nilable(Integer))
  @put_verbose_trimmed_warning = T.let(false, T.nilable(T::Boolean))
end

.totalInteger

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)


38
39
40
# File 'extend/pathname/observer_pathname_extension.rb', line 38

def total
  n + d
end

.verbose?Boolean

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:

  • (Boolean)


51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'extend/pathname/observer_pathname_extension.rb', line 51

def verbose?
  return super unless ENV["CI"]
  return false unless super

  if total < MAXIMUM_VERBOSE_OUTPUT
    true
  else
    unless @put_verbose_trimmed_warning
      puts "Only the first #{MAXIMUM_VERBOSE_OUTPUT} operations were output."
      @put_verbose_trimmed_warning = true
    end
    false
  end
end

Instance Method Details

#install_infovoid

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.

This method returns an undefined value.



95
96
97
98
# File 'extend/pathname/observer_pathname_extension.rb', line 95

def install_info
  super
  puts "info #{self}" if ObserverPathnameExtension.verbose?
end

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.

This method returns an undefined value.

Parameters:



88
89
90
91
92
# File 'extend/pathname/observer_pathname_extension.rb', line 88

def make_relative_symlink(src)
  super
  puts "ln -s #{src.relative_path_from(dirname)} #{basename}" if ObserverPathnameExtension.verbose?
  ObserverPathnameExtension.n += 1
end

#mkpathvoid

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.

This method returns an undefined value.



75
76
77
78
# File 'extend/pathname/observer_pathname_extension.rb', line 75

def mkpath
  super
  puts "mkdir -p #{self}" if ObserverPathnameExtension.verbose?
end

#rmdirvoid

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.

This method returns an undefined value.



81
82
83
84
85
# File 'extend/pathname/observer_pathname_extension.rb', line 81

def rmdir
  super
  puts "rmdir #{self}" if ObserverPathnameExtension.verbose?
  ObserverPathnameExtension.d += 1
end

#uninstall_infovoid

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.

This method returns an undefined value.



101
102
103
104
# File 'extend/pathname/observer_pathname_extension.rb', line 101

def uninstall_info
  super
  puts "uninfo #{self}" if ObserverPathnameExtension.verbose?
end

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.

This method returns an undefined value.



68
69
70
71
72
# File 'extend/pathname/observer_pathname_extension.rb', line 68

def unlink
  super
  puts "rm #{self}" if ObserverPathnameExtension.verbose?
  ObserverPathnameExtension.n += 1
end