diff --git a/.gitignore b/.gitignore index e8f39b6cb4..21d9e83424 100644 --- a/.gitignore +++ b/.gitignore @@ -180,6 +180,7 @@ lcov*.info # /gems /gems/*.gem +/gems/src /gems/*-* # /spec/bundler diff --git a/Makefile.in b/Makefile.in index 033de4c78b..6578ef432a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -474,6 +474,20 @@ ext/extinit.$(OBJEXT): ext/extinit.c $(SETUP) enc/encinit.$(OBJEXT): enc/encinit.c $(SETUP) +test-bundled-gems-precheck: $(arch)-fake.rb programs + +yes-test-bundled-gems-prepare: test-bundled-gems-precheck + $(Q) $(BASERUBY) $(srcdir)/tool/fetch-bundled_gems.rb $(srcdir) + $(XRUBY) -C "$(srcdir)" bin/gem install --no-ri --no-rdoc \ + --install-dir spec/rspec --conservative 'minitest:~> 5' 'test-unit' 'rake' 'hoe' 'yard' 'packnga' + +test-bundled-gems: $(TEST_RUNNABLE)-test-bundled-gems +yes-test-bundled-gems: yes-test-bundled-gems-prepare + for gem in minitest test-unit xmlrpc net-telnet did_you_mean power_assert rake; do \ + $(XRUBY) -C $(srcdir)/gems/src/$$gem -Ilib ../../../spec/rspec/bin/rake; \ + done +no-test-bundled-gems: + test-bundler-precheck: $(arch)-fake.rb programs yes-test-bundler-prepare: test-bundler-precheck diff --git a/gems/bundled_gems b/gems/bundled_gems index 1c7d4977ef..de7753abdf 100644 --- a/gems/bundled_gems +++ b/gems/bundled_gems @@ -1,7 +1,7 @@ -did_you_mean 1.1.2 -minitest 5.10.3 -net-telnet 0.1.1 -power_assert 1.1.0 -rake 12.1.0 -test-unit 3.2.5 -xmlrpc 0.3.0 +did_you_mean 1.1.2 https://github.com/yuki24/did_you_mean +minitest 5.10.3 https://github.com/seattlerb/minitest +net-telnet 0.1.1 https://github.com/ruby/net-telnet +power_assert 1.1.0 https://github.com/k-tsj/power_assert +rake 12.1.0 https://github.com/ruby/rake +test-unit 3.2.5 https://github.com/test-unit/test-unit +xmlrpc 0.3.0 https://github.com/ruby/xmlrpc diff --git a/tool/fetch-bundled_gems.rb b/tool/fetch-bundled_gems.rb new file mode 100644 index 0000000000..a0d7181b68 --- /dev/null +++ b/tool/fetch-bundled_gems.rb @@ -0,0 +1,17 @@ +require 'fileutils' + +File.readlines("#{ARGV[0]}/gems/bundled_gems").each do |gem| + n, v, u = gem.split + + v = "v" + v + + case n + when "minitest" + v = "master" + when "test-unit" + v = v[1..-1] + end + + FileUtils.mkdir_p "#{ARGV[0]}/gems/src" + `#{ARGV[0]}/tool/git-refresh -C #{ARGV[0]}/gems/src --branch #{v} #{u} #{n}` +end diff --git a/tool/make-snapshot b/tool/make-snapshot index a005ebf297..29d9d5b0bd 100755 --- a/tool/make-snapshot +++ b/tool/make-snapshot @@ -369,7 +369,8 @@ _touch-unicode-files: if File.exist?("gems/bundled_gems") gems = Dir.glob("gems/*.gem") gems -= File.readlines("gems/bundled_gems").map {|line| - 'gems/'+line.split(' ').join('-')+'.gem' + n, v, _ = line.split(' ') + "gems/#{n}-#{v}.gem" } FileUtils.rm_f(gems) else