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.

Constant Summary

Constants included from Kernel

Kernel::IGNORE_INTERRUPTS_MUTEX

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.



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

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.



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

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