merge revision(s) 39621,39622: [Backport #7991]

* lib/rubygems/commands/setup_command.rb:  Install .pem files.

	* test/rubygems/test_gem_commands_setup_command.rb:  Test for the
	  above.

	* lib/rubygems/spec_fetcher.rb:  Test HTTPS upgrade with URI::HTTPS,
	  not URI::HTTP.  Fixes bug in automatic HTTPS upgrade.

	* test/rubygems/test_gem_spec_fetcher.rb:  Test for the above.

	* lib/rubygems.rb:  Version 2.0.2

	* lib/rubygems/test_utilities.rb:  Ensure scheme and uri class match.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@39800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nagachika 2013-03-17 15:07:00 +00:00
parent c071b47a22
commit cae2f1eb8b
8 changed files with 92 additions and 8 deletions

View file

@ -77,6 +77,8 @@ class Gem::Commands::SetupCommand < Gem::Command
options[:document].uniq!
end
@verbose = nil
end
def check_ruby_version
@ -279,18 +281,27 @@ TEXT
end
end
def install_file file, dest_dir
dest_file = File.join dest_dir, file
dest_dir = File.dirname dest_file
mkdir_p dest_dir unless File.directory? dest_dir
install file, dest_file, :mode => 0644
end
def install_lib(lib_dir)
say "Installing RubyGems" if @verbose
lib_files = rb_files_in 'lib'
pem_files = pem_files_in 'lib'
Dir.chdir 'lib' do
lib_files.each do |lib_file|
dest_file = File.join lib_dir, lib_file
dest_dir = File.dirname dest_file
mkdir_p dest_dir unless File.directory? dest_dir
install_file lib_file, lib_dir
end
install lib_file, dest_file, :mode => 0644
pem_files.each do |pem_file|
install_file pem_file, lib_dir
end
end
end
@ -381,6 +392,12 @@ TEXT
[lib_dir, bin_dir]
end
def pem_files_in dir
Dir.chdir dir do
Dir[File.join('**', '*pem')]
end
end
def rb_files_in dir
Dir.chdir dir do
Dir[File.join('**', '*rb')]