summaryrefslogtreecommitdiff
path: root/tool/outdate-bundled-gems.rb
diff options
context:
space:
mode:
Diffstat (limited to 'tool/outdate-bundled-gems.rb')
-rwxr-xr-xtool/outdate-bundled-gems.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/tool/outdate-bundled-gems.rb b/tool/outdate-bundled-gems.rb
index 3c519cc461..bf6b268700 100755
--- a/tool/outdate-bundled-gems.rb
+++ b/tool/outdate-bundled-gems.rb
@@ -109,20 +109,21 @@ curdir.glob(".bundle/{extensions,.timestamp}/*/") do |dir|
end
end
-version = RbConfig::CONFIG['ruby_version']
+baseruby_version = RbConfig::CONFIG['ruby_version'] # This may not have "-static"
curdir.glob(".bundle/{extensions,.timestamp}/#{platform}/*/") do |dir|
- unless File.basename(dir).start_with?(version)
+ version = File.basename(dir).split('-', 2).first # Remove "-static" if exists
+ unless version == baseruby_version
curdir.rmdir(dir)
end
end
-curdir.glob(".bundle/extensions/#{platform}/#{version}/*/") do |dir|
+curdir.glob(".bundle/extensions/#{platform}/#{baseruby_version}/*/") do |dir|
unless curdir.exist?(".bundle/specifications/#{File.basename(dir)}.gemspec")
curdir.rmdir(dir)
end
end
-curdir.glob(".bundle/.timestamp/#{platform}/#{version}/.*.time") do |stamp|
+curdir.glob(".bundle/.timestamp/#{platform}/#{baseruby_version}/.*.time") do |stamp|
unless curdir.directory?(File.join(".bundle", stamp[%r[/\.([^/]+)\.time\z], 1].gsub('.-.', '/')))
curdir.unlink(stamp)
end