Class: Requirements Private

Inherits:
SimpleDelegator
  • Object
show all
Includes:
Kernel
Defined in:
dependencies.rb,
dependencies.rbi

Overview

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

A collection of requirements.

Instance Method Summary collapse

Methods included from Kernel

#disk_usage_readable, #ensure_executable!, #ensure_formula_installed!, #exec_browser, #exec_editor, #ignore_interrupts, #interactive_shell, #number_readable, #odebug, #odeprecated, #odie, #odisabled, #ofail, #oh1, #oh1_title, #ohai, #ohai_title, #onoe, #opoo, #paths, #pretty_duration, #pretty_installed, #pretty_outdated, #pretty_uninstalled, #quiet_system, #redact_secrets, #redirect_stdout, #require?, #safe_system, #tap_and_name_comparison, #truncate_text_to_approximate_size, #which, #which_all, #which_editor, #with_custom_locale, #with_env, #with_homebrew_path

Constructor Details

#initialize(*args) ⇒ Requirements

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 a new instance of Requirements.



50
51
52
# File 'dependencies.rb', line 50

def initialize(*args)
  super(Set.new(args))
end

Instance Method Details

#<<(other) ⇒ Object

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.



54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'dependencies.rb', line 54

def <<(other)
  if other.is_a?(Object) && other.is_a?(Comparable)
    __getobj__.grep(other.class) do |req|
      return self if req > other

      __getobj__.delete(req)
    end
  end
  # see https://sorbet.org/docs/faq#how-can-i-fix-type-errors-that-arise-from-super
  T.bind(self, T.untyped)
  super
  self
end

#inspectString

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:



69
70
71
# File 'dependencies.rb', line 69

def inspect
  "#<#{self.class.name}: {#{__getobj__.to_a.join(", ")}}>"
end