diff --git a/lib/bundle/bundle.rb b/lib/bundle/bundle.rb index bb374b167..3068dfbf2 100644 --- a/lib/bundle/bundle.rb +++ b/lib/bundle/bundle.rb @@ -67,7 +67,8 @@ def exchange_uid_if_needed!(&block) Process::Sys.seteuid(uid) end - return_value = with_env("HOME" => Etc.getpwuid(Process.uid)&.dir, &block) + home = T.must(Etc.getpwuid(Process.uid)).dir + return_value = with_env("HOME" => home, &block) if process_reexchangeable Process::UID.re_exchange diff --git a/lib/bundle/dsl.rb b/lib/bundle/dsl.rb index d289ff42b..c7fcb96d9 100644 --- a/lib/bundle/dsl.rb +++ b/lib/bundle/dsl.rb @@ -103,9 +103,9 @@ def self.sanitize_brew_name(name) Regexp.last_match(1) elsif name =~ HOMEBREW_TAP_FORMULA_REGEX user = Regexp.last_match(1) - repo = Regexp.last_match(2) + repo = T.must(Regexp.last_match(2)) name = Regexp.last_match(3) - "#{user}/#{repo&.sub("homebrew-", "")}/#{name}" + "#{user}/#{repo.sub("homebrew-", "")}/#{name}" else name end diff --git a/lib/bundle/mac_app_store_dumper.rb b/lib/bundle/mac_app_store_dumper.rb index 59e8f235b..260646d0a 100644 --- a/lib/bundle/mac_app_store_dumper.rb +++ b/lib/bundle/mac_app_store_dumper.rb @@ -18,7 +18,10 @@ def apps # Only add the application details should we have a valid match. # Strip unprintable characters - [app_details[:id], app_details[:name]&.gsub(/[[:cntrl:]]|[\p{C}]/, "")] if app_details + if app_details + name = T.must(app_details[:name]) + [app_details[:id], name.gsub(/[[:cntrl:]]|[\p{C}]/, "")] + end end else []