Merge pull request #10488 from Bo98/arch-deprecations

Deprecate additional arch functions
This commit is contained in:
Mike McQuaid 2021-02-02 16:52:38 +00:00 committed by GitHub
commit cf4763e02c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 0 deletions

View File

@ -80,6 +80,8 @@ module Hardware
end
def universal_archs
odeprecated "Hardware::CPU.universal_archs"
[arch].extend ArchitectureListExtension
end

View File

@ -1,6 +1,8 @@
# typed: false
# frozen_string_literal: true
# TODO: (3.2) remove this module when the linked deprecated functions are removed.
require "hardware"
module ArchitectureListExtension

View File

@ -67,6 +67,7 @@ module MachOShim
end
def archs
# TODO: (3.2) remove ArchitectureListExtension
mach_data.map { |m| m.fetch :arch }.extend(ArchitectureListExtension)
end

View File

@ -384,6 +384,8 @@ module Kernel
# Returns array of architectures that the given command or library is built for.
def archs_for_command(cmd)
odeprecated "archs_for_command"
cmd = which(cmd) unless Pathname.new(cmd).absolute?
Pathname.new(cmd).archs
end