Skip to content

Commit

Permalink
Merge pull request Homebrew#16404 from dduugg/resolve-sorbet-violation
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMcQuaid authored Dec 27, 2023
2 parents 500a6b1 + a218ebb commit dbb800b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion Library/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ Sorbet/StrictSigil:
Sorbet/TrueSigil:
Enabled: true
Exclude:
- "Homebrew/standalone/init.rb" # loaded before sorbet-runtime
- "Taps/**/*"
- "/**/{Formula,Casks}/**/*.rb"
- "**/{Formula,Casks}/**/*.rb"
Expand Down
7 changes: 5 additions & 2 deletions Library/Homebrew/standalone/init.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true

# This file is included before any other files. It intentionally has typing disabled and has minimal use of `require`.
Expand All @@ -9,6 +9,8 @@
true
else
ruby_major, ruby_minor, = RUBY_VERSION.split(".").map(&:to_i)
raise "Could not parse Ruby requirements" if !ruby_major || !ruby_minor || !required_ruby_major

if ruby_major < required_ruby_major || (ruby_major == required_ruby_major && ruby_minor < required_ruby_minor)
raise "Homebrew must be run under Ruby #{required_ruby_major}.#{required_ruby_minor}! " \
"You're running #{RUBY_VERSION}."
Expand All @@ -25,7 +27,8 @@
$LOAD_PATH.reject! { |path| path.start_with?(RbConfig::CONFIG["sitedir"]) }

require "pathname"
HOMEBREW_LIBRARY_PATH = Pathname(__dir__).parent.realpath.freeze
dir = __dir__ || raise("__dir__ is not defined")
HOMEBREW_LIBRARY_PATH = Pathname(dir).parent.realpath.freeze

require_relative "../utils/gems"
Homebrew.setup_gem_environment!(setup_path: false)
Expand Down

0 comments on commit dbb800b

Please sign in to comment.