Module: Utils::Output Private

Extended by:
Mixin
Defined in:
utils/output.rb

Overview

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.

Helper methods for outputting messages in Homebrew's formats.

Defined Under Namespace

Modules: Mixin

Class Method Summary collapse

Methods included from Mixin

issue_reporting_message, odebug, odeprecated, odie, odisabled, ofail, oh1, oh1_title, ohai, ohai_title, onoe, opoo, opoo_outside_github_actions, opoo_without_github_actions_annotation, pretty_cannot_install, pretty_deprecated, pretty_disabled, pretty_duration, pretty_install_status, pretty_installed, pretty_uninstalled, pretty_unmarked, pretty_upgradable, pretty_warning

Class Method Details

.redirect_stdout(file, &_block) ⇒ T.type_parameter(:U)

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.

Parameters:

Returns:

  • (T.type_parameter(:U))


12
13
14
15
16
17
18
19
# File 'utils/output.rb', line 12

def self.redirect_stdout(file, &_block)
  out = $stdout.dup
  $stdout.reopen(file)
  yield
ensure
  $stdout.reopen(out)
  out.close
end