summaryrefslogtreecommitdiff
path: root/lib/rubygems/commands/pristine_command.rb
diff options
context:
space:
mode:
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