diff options
author | Yusuke Endoh <mame@ruby-lang.org> | 2023-02-17 12:50:48 +0900 |
---|---|---|
committer | Yusuke Endoh <mame@ruby-lang.org> | 2023-02-19 21:06:13 +0900 |
commit | 759d23584e8f0110e55c8c47db662b733e72e219 (patch) | |
tree | 8920b088d5c4a7ba432b5883e751c503daf13a26 /tool | |
parent | 8eaa346620c1699ee1c80e4e48c9689b019f334d (diff) | |
download | ruby-759d23584e8f0110e55c8c47db662b733e72e219.tar.gz |
Create a dummy minitest.gemspec for a bundled gem
To use the repository version of bundled gems, we need to build a gem by
"gem build", but the repository of minitest does not include
minitest.gemspec because it uses hoe.
This change creats a dummy minitest.gemspec to pass the CI.
Diffstat (limited to 'tool')
-rw-r--r-- | tool/lib/bundled_gem.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tool/lib/bundled_gem.rb b/tool/lib/bundled_gem.rb index 46183ba06c..6b6940b45d 100644 --- a/tool/lib/bundled_gem.rb +++ b/tool/lib/bundled_gem.rb @@ -18,6 +18,31 @@ module BundledGem outdir = File.expand_path(outdir) gemdir, gemfile = File.split(gemspec) Dir.chdir(gemdir) do + if gemspec == "gems/src/minitest/minitest.gemspec" && !File.exist?("minitest.gemspec") + # The repository of minitest does not include minitest.gemspec because it uses hoe. + # This creates a dummy gemspec. + File.write("minitest.gemspec", <<END) +Gem::Specification.new do |s| + s.name = "minitest" + s.version = #{ File.read("lib/minitest.rb")[/VERSION = "(.+?)"/, 1].dump } + + s.require_paths = ["lib"] + s.authors = ["Ryan Davis"] + s.date = "#{ Time.now.strftime("%Y-%m-%d") }" + s.description = "(dummy gemspec)" + s.email = ["ryand-ruby@zenspider.com"] + s.extra_rdoc_files = ["History.rdoc", "Manifest.txt", "README.rdoc"] + s.files = [#{ Dir.glob("**/*").reject {|s| File.directory?(s) }.map {|s| s.dump }.join(",") }] + s.homepage = "https://github.com/seattlerb/minitest" + s.licenses = ["MIT"] + s.rdoc_options = ["--main", "README.rdoc"] + s.summary = "(dummy gemspec)" + + s.add_development_dependency(%q<rdoc>, [">= 4.0", "< 7"]) + s.add_development_dependency(%q<hoe>, ["~> 4.0"]) +end +END + end spec = Gem::Specification.load(gemfile) abort "Failed to load #{gemspec}" unless spec abort "Unexpected version #{spec.version}" unless spec.version == Gem::Version.new(version) |