23 lines
503 B
Ruby
23 lines
503 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/)
|
||
|
# TODO: deprecate when Homebrew/homebrew-core is fixed.
|
||
|
# odeprecated('depends_on :xcode => [..., "X.Y.Z"]')
|
||
|
tags.delete(tag)
|
||
|
end
|
||
|
end
|
||
|
|
||
|
super(tags)
|
||
|
end
|
||
|
end
|
||
|
|
||
|
prepend Compat
|
||
|
end
|