Skip to content

Commit

Permalink
env
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus committed Apr 30, 2024
1 parent 4e0f68c commit a719b3f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Library/Homebrew/exceptions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ def initialize(formulae)
end
end

# Raised by {Homebrew.install}, {Homebrew.reinstall} and {Homebrew.upgrade}
# Raised by `Homebrew.install`, `Homebrew.reinstall` and `Homebrew.upgrade`
# if the user passes any flags/environment that would case a bottle-only
# installation on a system without build tools to fail.
class BuildFlagsError < RuntimeError
Expand Down
12 changes: 8 additions & 4 deletions Library/Homebrew/extend/ENV.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ def superenv?(env)
private :superenv?
end

# `ENV` is not actually a class, but this makes YARD happy
# @see https://rubydoc.info/stdlib/core/ENV `ENV` core documentation
#
# @!parse
# class ENV; end
# # `ENV` is not actually a class, but this makes YARD happy
# # @see https://rubydoc.info/stdlib/core/ENV
# # <code>ENV</code> core documentation
# # @see Superenv
# # @see Stdenv
# class ENV; end

module EnvActivation
sig { params(env: T.nilable(String)).void }
def activate_extensions!(env: nil)
Expand Down Expand Up @@ -74,4 +77,5 @@ def clear_sensitive_environment!
end
end


ENV.extend(EnvActivation)
2 changes: 2 additions & 0 deletions Library/Homebrew/extend/ENV.rbi
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# typed: strict

# @!visibility private
module EnvMethods
include Kernel

Expand Down Expand Up @@ -39,6 +40,7 @@ module EnvActivation
include Superenv
end

# @!visibility private
class Sorbet
module Private
module Static
Expand Down
1 change: 1 addition & 0 deletions Library/Homebrew/extend/ENV/shared.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module SharedEnvExtension
include EnvMethods
end

# @!visibility private
class Sorbet
module Private
module Static
Expand Down

0 comments on commit a719b3f

Please sign in to comment.