Skip to content

Commit

Permalink
Merge pull request #104 from ruby/use-net-http
Browse files Browse the repository at this point in the history
Check package location directly instead of release list of www.
  • Loading branch information
hsbt committed Sep 3, 2024
2 parents 6209d14 + e554f7c commit f90120f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,11 @@ end

def ruby_version_exist?(version)
return true if version.start_with?("master")

require "net/http"
require "uri"
ver2 = version.split('.')[0,2].join('.')
ruby_versions[ver2]&.include?(version)
Net::HTTP.get_response(URI.parse("https://cache.ruby-lang.org/pub/ruby/#{ver2}/ruby-#{version}.tar.gz")).code == "200"
end

namespace :debug do
Expand Down

0 comments on commit f90120f

Please sign in to comment.