@@ -9,44 +9,14 @@ require "rake/testtask"
99require_relative "spec/support/rubygems_ext"
1010
1111desc "Setup Rubygems dev environment"
12- task setup : [ :"dev:deps" , "vendor:compact_index" ] do
12+ task setup : [ :"dev:deps" ] do
1313 Dir . glob ( "tool/bundler/*_gems.rb" ) . each do |file |
1414 name = File . basename ( file , ".rb" )
1515 next if name == "dev_gems"
1616 Spec ::Rubygems . dev_bundle "lock" , gemfile : file
1717 end
1818end
1919
20- namespace :vendor do
21- # Pinned to rubygems/rubygems.org#6504 so `rake setup` stays reproducible.
22- # Override with REF=<sha> to test against a newer compact_index.
23- desc "Sync vendored compact_index from rubygems/rubygems.org"
24- task :compact_index do
25- require "open-uri"
26- require "fileutils"
27-
28- ref = ENV [ "REF" ] || "7c68a7b39761c61a66f9299f85b889ec39afc02c"
29- repo = "rubygems/rubygems.org"
30- paths = %w[
31- lib/compact_index.rb
32- lib/compact_index/dependency.rb
33- lib/compact_index/gem.rb
34- lib/compact_index/gem_version.rb
35- lib/compact_index/versions_file.rb
36- ]
37-
38- target_root = Spec ::Path . tmp_root . join ( "compact_index" )
39- paths . each do |path |
40- url = "https://raw.githubusercontent.com/#{ repo } /#{ ref } /#{ path } "
41- puts "Fetching #{ url } "
42- content = URI . parse ( url ) . open ( &:read )
43- target = File . join ( target_root , path )
44- FileUtils . mkdir_p ( File . dirname ( target ) )
45- File . write ( target , content )
46- end
47- end
48- end
49-
5020desc "Update Rubygems dev environment"
5121task :update do
5222 Spec ::Rubygems . dev_bundle "update" , "--all"
0 commit comments