Merge remote-tracking branch 'origin/master' into cask-upgrade/wildcards
This commit is contained in:
commit
d697037aca
@ -109,7 +109,7 @@ module Homebrew
|
|||||||
version ||= basename_str[/\A.*(?:--.*?)*--(.*?)#{Regexp.escape(pathname.extname)}\Z/, 1]
|
version ||= basename_str[/\A.*(?:--.*?)*--(.*?)#{Regexp.escape(pathname.extname)}\Z/, 1]
|
||||||
version ||= basename_str[/\A.*--?(.*?)#{Regexp.escape(pathname.extname)}\Z/, 1]
|
version ||= basename_str[/\A.*--?(.*?)#{Regexp.escape(pathname.extname)}\Z/, 1]
|
||||||
|
|
||||||
return false unless version
|
return false if version.blank?
|
||||||
|
|
||||||
version = Version.new(version)
|
version = Version.new(version)
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -535,7 +535,7 @@ class Version
|
|||||||
|
|
||||||
sig { returns(T::Boolean) }
|
sig { returns(T::Boolean) }
|
||||||
def null?
|
def null?
|
||||||
@version.nil?
|
version.nil?
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { params(comparator: String, other: Version).returns(T::Boolean) }
|
sig { params(comparator: String, other: Version).returns(T::Boolean) }
|
||||||
@ -703,7 +703,25 @@ class Version
|
|||||||
def to_s
|
def to_s
|
||||||
version.to_s
|
version.to_s
|
||||||
end
|
end
|
||||||
alias to_str to_s
|
|
||||||
|
sig { returns(String) }
|
||||||
|
def to_str
|
||||||
|
raise NoMethodError, "undefined method `to_str' for #{self.class}:NULL" if null?
|
||||||
|
|
||||||
|
T.must(version).to_str
|
||||||
|
end
|
||||||
|
|
||||||
|
sig { params(options: Hash).returns(String) }
|
||||||
|
def to_json(**options)
|
||||||
|
version.to_json(**options)
|
||||||
|
end
|
||||||
|
|
||||||
|
sig { params(method: T.any(Symbol, String), include_all: T::Boolean).returns(T::Boolean) }
|
||||||
|
def respond_to?(method, include_all = T.unsafe(nil))
|
||||||
|
return !null? if ["to_str", :to_str].include?(method)
|
||||||
|
|
||||||
|
super
|
||||||
|
end
|
||||||
|
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def inspect
|
def inspect
|
||||||
|
Loading…
x
Reference in New Issue
Block a user