diff options
Diffstat (limited to 'lib/rubygems/commands/pristine_command.rb')
-rw-r--r-- | lib/rubygems/commands/pristine_command.rb | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/lib/rubygems/commands/pristine_command.rb b/lib/rubygems/commands/pristine_command.rb index e3771b7212..f7eb9014ea 100644 --- a/lib/rubygems/commands/pristine_command.rb +++ b/lib/rubygems/commands/pristine_command.rb @@ -1,5 +1,5 @@ require 'rubygems/command' -require 'rubygems/format' +require 'rubygems/package' require 'rubygems/installer' require 'rubygems/version_option' @@ -24,6 +24,11 @@ class Gem::Commands::PristineCommand < Gem::Command options[:extensions] = value end + add_option('--only-executables', + 'Only restore executables') do |value, options| + options[:only_executables] = value + end + add_version_option('restore to', 'pristine condition') end @@ -78,6 +83,11 @@ extensions. say "Restoring gems to pristine condition..." specs.each do |spec| + if spec.default_gem? + say "Skipped #{spec.full_name}, it is a default gem" + next + end + unless spec.extensions.empty? or options[:extensions] then say "Skipped #{spec.full_name}, it needs to compile an extension" next @@ -101,8 +111,13 @@ extensions. :wrappers => true, :force => true, :install_dir => spec.base_dir, - :env_shebang => installer_env_shebang) - installer.install + :env_shebang => installer_env_shebang, + :build_args => spec.build_args) + if options[:only_executables] then + installer.generate_bin + else + installer.install + end say "Restored #{spec.full_name}" end |