Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions lib/rubygems/commands/install_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ def initialize
:without_groups => [],
})

defaults.merge!(install_update_options)

super 'install', 'Install a gem into the local repository', defaults

add_install_update_options
Expand All @@ -43,8 +45,9 @@ def arguments # :nodoc:
end

def defaults_str # :nodoc:
"--both --version '#{Gem::Requirement.default}' --document --no-force\n" +
"--install-dir #{Gem.dir} --lock"
"--both --version '#{Gem::Requirement.default}' --no-force\n" +
"--install-dir #{Gem.dir} --lock\n" +
install_update_defaults_str
end

def description # :nodoc:
Expand Down
13 changes: 9 additions & 4 deletions lib/rubygems/commands/update_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ class Gem::Commands::UpdateCommand < Gem::Command
attr_reader :updated # :nodoc:

def initialize
super 'update', 'Update installed gems to the latest version',
:document => %w[rdoc ri],
:force => false
options = {
:force => false,
}

options.merge!(install_update_options)

super 'update', 'Update installed gems to the latest version', options

add_install_update_options

Expand Down Expand Up @@ -51,7 +55,8 @@ def arguments # :nodoc:
end

def defaults_str # :nodoc:
"--document --no-force --install-dir #{Gem.dir}"
"--no-force --install-dir #{Gem.dir}\n" +
install_update_defaults_str
end

def description # :nodoc:
Expand Down
13 changes: 11 additions & 2 deletions lib/rubygems/install_update_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,19 @@ def add_install_update_options
end

##
# Default options for the gem install command.
# Default options for the gem install and update commands.

def install_update_options
{
:document => %w[ri],
}
end

##
# Default description for the gem install and update commands.

def install_update_defaults_str
'--document=rdoc,ri --wrappers'
'--document=ri'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know what this --wrappers thing is?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value of --wrappers is true on DependencyInstaller. I remove it with the other options.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I understood, I was just asking if you now what it does. I think it's about creating binstubs wrappers instead of symlinks, but not sure. Anyways, I was just curious.

end

end
2 changes: 1 addition & 1 deletion test/rubygems/test_gem_command_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def test_process_args_update

#check defaults
@command_manager.process_args %w[update]
assert_includes check_options[:document], 'rdoc'
assert_includes check_options[:document], 'ri'

#check settings
check_options = nil
Expand Down
4 changes: 2 additions & 2 deletions test/rubygems/test_gem_commands_update_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ def test_handle_options_system

expected = {
:args => [],
:document => %w[rdoc ri],
:document => %w[ri],
:force => false,
:system => true,
}
Expand All @@ -571,7 +571,7 @@ def test_handle_options_system_specific

expected = {
:args => [],
:document => %w[rdoc ri],
:document => %w[ri],
:force => false,
:system => "1.3.7",
}
Expand Down