Lazy-load development_tools in fetch_json_api_file

This commit is contained in:
Kevin Montag 2024-07-18 23:02:51 +02:00
parent 74a84a0d12
commit 06a50eaceb

View File

@ -4,7 +4,6 @@
require "api/analytics"
require "api/cask"
require "api/formula"
require "development_tools"
require "warnings"
Warnings.ignore :default_gems do
require "base64" # TODO: Add this to the Gemfile or remove it before moving to Ruby 3.4.
@ -41,6 +40,9 @@ module Homebrew
}
def self.fetch_json_api_file(endpoint, target: HOMEBREW_CACHE_API/endpoint,
stale_seconds: Homebrew::EnvConfig.api_auto_update_secs.to_i)
# Lazy-load dependency.
require "development_tools"
retry_count = 0
url = "#{Homebrew::EnvConfig.api_domain}/#{endpoint}"
default_url = "#{HOMEBREW_API_DEFAULT_DOMAIN}/#{endpoint}"