Fix tools/version.rb:80:in 'Object#get_version': undefined method 'sub!' for an instance of Hash (NoMethodError) (#13992)

This commit is contained in:
Ed Reel
2025-12-26 21:33:39 -06:00
committed by GitHub
parent 472e89f722
commit f81a458776

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
# version.rb version 3.20 (for Chromebrew)
# version.rb version 3.21 (for Chromebrew)
OPTIONS = %w[-h --help -j --json -u --update-package-files -v --verbose -vv]
@@ -75,7 +75,7 @@ def get_version(name, homepage, source)
puts json if VERY_VERBOSE
return json['latest_version'] if json['stable_versions'][0].nil?
return json['stable_versions'][0]
elsif !source.nil?
elsif !source.nil? && !source.is_a?(Hash)
# If anitya has failed, we have a variety of fallbacks as a last resort.
source.sub!('www.', '')
url = URI.parse(source)