summaryrefslogtreecommitdiff
path: root/lib/rubygems/commands/pristine_command.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2020-02-01 11:14:04 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-02-01 11:14:57 +0900
commit600a715c9bde99fe2e9a669465d78833445273e8 (patch)
tree8244622e8cc02b40dd0dad29d30fc60a11342396 /lib/rubygems/commands/pristine_command.rb
parentadc303131187654d8ce83f3db17eefa3d5bae26c (diff)
Merge the current master branch of rubygems/rubygems.
Just started to develop RubyGems 3.2.0.
Diffstat (limited to 'lib/rubygems/commands/pristine_command.rb')
-rw-r--r--lib/rubygems/commands/pristine_command.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/rubygems/commands/pristine_command.rb b/lib/rubygems/commands/pristine_command.rb
index 2248a821c8..d10060923f 100644
--- a/lib/rubygems/commands/pristine_command.rb
+++ b/lib/rubygems/commands/pristine_command.rb
@@ -40,6 +40,11 @@ class Gem::Commands::PristineCommand < Gem::Command
options[:only_executables] = value
end
+ add_option('--only-plugins',
+ 'Only restore plugins') do |value, options|
+ options[:only_plugins] = value
+ end
+
add_option('-E', '--[no-]env-shebang',
'Rewrite executables with a shebang',
'of /usr/bin/env') do |value, options|
@@ -126,14 +131,14 @@ extensions will be restored.
end
end
- unless spec.extensions.empty? or options[:extensions] or options[:only_executables]
+ unless spec.extensions.empty? or options[:extensions] or options[:only_executables] or options[:only_plugins]
say "Skipped #{spec.full_name}, it needs to compile an extension"
next
end
gem = spec.cache_file
- unless File.exist? gem or options[:only_executables]
+ unless File.exist? gem or options[:only_executables] or options[:only_plugins]
require 'rubygems/remote_fetcher'
say "Cached gem for #{spec.full_name} not found, attempting to fetch..."
@@ -172,6 +177,9 @@ extensions will be restored.
if options[:only_executables]
installer = Gem::Installer.for_spec(spec, installer_options)
installer.generate_bin
+ elsif options[:only_plugins]
+ installer = Gem::Installer.for_spec(spec)
+ installer.generate_plugins
else
installer = Gem::Installer.at(gem, installer_options)
installer.install