brew/Library/Homebrew/compat/requirements/xcode_requirement.rb
Mike McQuaid 5bea36799b
compat/requirements: add odeprecated.
These can be enabled now Homebrew/homebrew-core has been fixed
(in https://github.com/Homebrew/homebrew-core/pull/32968).
2018-10-23 11:09:04 +01:00

22 lines
435 B
Ruby

require "requirement"
class XcodeRequirement < Requirement
module Compat
def initialize(tags = [])
@version = if tags.first.to_s.match?(/(\d\.)+\d/)
tags.shift
else
tags.find do |tag|
next unless tag.to_s.match?(/(\d\.)+\d/)
odeprecated('depends_on :xcode => [..., "X.Y.Z"]')
tags.delete(tag)
end
end
super(tags)
end
end
prepend Compat
end