summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-07-05 18:59:06 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-07-05 18:59:06 +0900
commit358f91bf6f9999ba4683f702bc47483789bd4e7e (patch)
treec81cd98acb3dd647b63aa1f2e99ad75d3053c63b /tool
parent41168f69fbeb32cfc88210911d62e419b8116589 (diff)
Skip comment and empty lines in gems/bundled_gems file
Diffstat (limited to 'tool')
-rwxr-xr-xtool/make-snapshot1
-rwxr-xr-xtool/rbinstall.rb1
-rw-r--r--tool/test-bundled-gems.rb1
3 files changed, 3 insertions, 0 deletions
diff --git a/tool/make-snapshot b/tool/make-snapshot
index 79289d6bfb..609f455435 100755
--- a/tool/make-snapshot
+++ b/tool/make-snapshot
@@ -502,6 +502,7 @@ touch-unicode-files:
if File.exist?("gems/bundled_gems")
gems = Dir.glob("gems/*.gem")
gems -= File.readlines("gems/bundled_gems").map {|line|
+ next if /^\s*(?:#|$)/ =~ line
name, version, _ = line.split(' ')
"gems/#{name}-#{version}.gem"
}
diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
index aadfd41ef8..eb13be9360 100755
--- a/tool/rbinstall.rb
+++ b/tool/rbinstall.rb
@@ -923,6 +923,7 @@ install?(:ext, :comm, :gem, :'bundled-gems') do
gem_ext_dir = "#$extout/gems/#{CONFIG['arch']}"
extensions_dir = Gem::StubSpecification.gemspec_stub("", gem_dir, gem_dir).extensions_dir
File.foreach("#{srcdir}/gems/bundled_gems") do |name|
+ next if /^\s*(?:#|$)/ =~ name
next unless /^(\S+)\s+(\S+).*/ =~ name
gem_name = "#$1-#$2"
path = "#{srcdir}/.bundle/gems/#{gem_name}/#$1.gemspec"
diff --git a/tool/test-bundled-gems.rb b/tool/test-bundled-gems.rb
index c7b7adedc3..5d21311e51 100644
--- a/tool/test-bundled-gems.rb
+++ b/tool/test-bundled-gems.rb
@@ -9,6 +9,7 @@ gem_dir = File.realpath('../../gems', __FILE__)
exit_code = 0
ruby = ENV['RUBY'] || RbConfig.ruby
File.foreach("#{gem_dir}/bundled_gems") do |line|
+ next if /^\s*(?:#|$)/ =~ line
gem = line.split.first
puts "\nTesting the #{gem} gem"