diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-03-08 18:23:10 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-03-10 03:51:16 +0000 |
commit | 15739c66b713a695b0dfc1e4c1bf01b7d2a04426 (patch) | |
tree | def3b086287ae31d81d6274007e58cabe4ca58db /lib | |
parent | 86d38b452005a9168eb2b5eaffd5fb3465313436 (diff) |
[rubygems/rubygems] Added only missing extensions option into pristine command
https://github.com/rubygems/rubygems/commit/cfd0e615d7
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rubygems/commands/pristine_command.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/rubygems/commands/pristine_command.rb b/lib/rubygems/commands/pristine_command.rb index 72db53ef37..b9941fabdf 100644 --- a/lib/rubygems/commands/pristine_command.rb +++ b/lib/rubygems/commands/pristine_command.rb @@ -34,6 +34,12 @@ class Gem::Commands::PristineCommand < Gem::Command options[:extensions] = value end + add_option("--only-missing-extensions", + "Only restore gems with missing extensions") do |value, options| + options[:extensions_set] = true + options[:only_missing_extensions] = value + end + add_option("--only-executables", "Only restore executables") do |value, options| options[:only_executables] = value @@ -107,6 +113,10 @@ extensions will be restored. Gem::Specification.select do |spec| spec.extensions && !spec.extensions.empty? end + elsif options[:only_missing_extensions] + Gem::Specification.select do |spec| + spec.missing_extensions? + end else get_all_gem_names.sort.map do |gem_name| Gem::Specification.find_all_by_name(gem_name, options[:version]).reverse |