Class: Homebrew::Cmd::Developer Private

Inherits:
AbstractCommand show all
Defined in:
sorbet/rbi/dsl/homebrew/cmd/developer.rbi,
cmd/developer.rb

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.

DO NOT EDIT MANUALLY This is an autogenerated file for dynamic methods in Homebrew::Cmd::Developer. Please instead update this file by running bin/tapioca dsl Homebrew::Cmd::Developer.

Defined Under Namespace

Classes: Args

Instance Method Summary collapse

Methods inherited from AbstractCommand

command, command_name, dev_cmd?, #initialize, parser

Constructor Details

This class inherits a constructor from Homebrew::AbstractCommand

Instance Method Details

#argsHomebrew::Cmd::Developer::Args

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.



9
# File 'sorbet/rbi/dsl/homebrew/cmd/developer.rbi', line 9

def args; end

#runvoid

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.



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'cmd/developer.rb', line 26

def run
  env_vars = []
  env_vars << "HOMEBREW_DEVELOPER" if Homebrew::EnvConfig.developer?
  env_vars << "HOMEBREW_UPDATE_TO_TAG" if Homebrew::EnvConfig.update_to_tag?
  env_vars.map! do |var|
    "#{Tty.bold}#{var}#{Tty.reset}"
  end

  case args.named.first
  when nil, "state"
    if env_vars.any?
      verb = (env_vars.count == 1) ? "is" : "are"
      puts "Developer mode is enabled because #{env_vars.to_sentence} #{verb} set."
    elsif Homebrew::Settings.read("devcmdrun") == "true"
      puts "Developer mode is enabled."
    else
      puts "Developer mode is disabled."
    end
  when "on"
    Homebrew::Settings.write "devcmdrun", true
  when "off"
    Homebrew::Settings.delete "devcmdrun"
    puts "To fully disable developer mode, you must unset #{env_vars.to_sentence}." if env_vars.any?
  else
    raise UsageError, "unknown subcommand: #{args.named.first}"
  end
end