Skip to content

Commit

Permalink
Showing 24 changed files with 240 additions and 128 deletions.
5 changes: 2 additions & 3 deletions bin/rake
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@

require 'rubygems'

version = ">= 0"
version = ">= 0.a"

if ARGV.first
str = ARGV.first
@@ -19,5 +19,4 @@ if ARGV.first
end
end

gem 'rake', version
load Gem.bin_path('rake', 'rake', version)
load Gem.activate_bin_path('rake', 'rake', version)
5 changes: 2 additions & 3 deletions bin/rdoc
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@

require 'rubygems'

version = ">= 0"
version = ">= 0.a"

if ARGV.first
str = ARGV.first
@@ -19,5 +19,4 @@ if ARGV.first
end
end

gem 'rdoc', version
load Gem.bin_path('rdoc', 'rdoc', version)
load Gem.activate_bin_path('rdoc', 'rdoc', version)
5 changes: 2 additions & 3 deletions bin/ri
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@

require 'rubygems'

version = ">= 0"
version = ">= 0.a"

if ARGV.first
str = ARGV.first
@@ -19,5 +19,4 @@ if ARGV.first
end
end

gem 'rdoc', version
load Gem.bin_path('rdoc', 'ri', version)
load Gem.activate_bin_path('rdoc', 'ri', version)
9 changes: 5 additions & 4 deletions lib/ruby/stdlib/rubygems.rb
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
require 'thread'

module Gem
VERSION = '2.6.2'
VERSION = '2.6.4'
end

# Must be first since it unloads the prelude from 1.9.2
@@ -254,7 +254,7 @@ def self.find_spec_for_exe name, exec_name, requirements
spec.executables.include? exec_name
} if exec_name

unless spec = specs.last
unless spec = specs.first
msg = "can't find gem #{name} (#{requirements}) with executable #{exec_name}"
raise Gem::GemNotFoundException, msg
end
@@ -374,8 +374,9 @@ def self.paths=(env)
when Array
unless Gem::Deprecate.skip
warn <<-eowarn
Array values in the parameter are deprecated. Please use a String or nil.
An Array was passed in from #{caller[3]}
Array values in the parameter to `Gem.paths=` are deprecated.
Please use a String or nil.
An Array (#{env.inspect}) was passed in from #{caller[3]}
eowarn
end
target[k] = v.join File::PATH_SEPARATOR
3 changes: 2 additions & 1 deletion lib/ruby/stdlib/rubygems/basic_specification.rb
Original file line number Diff line number Diff line change
@@ -306,6 +306,8 @@ def stubbed?
raise NotImplementedError
end

def this; self; end

private

def have_extensions?; !extensions.empty?; end
@@ -323,5 +325,4 @@ def have_file? file, suffixes
false
end
end

end
46 changes: 0 additions & 46 deletions lib/ruby/stdlib/rubygems/commands/install_command.rb
Original file line number Diff line number Diff line change
@@ -36,52 +36,6 @@ def initialize
add_version_option
add_prerelease_option "to be installed. (Only for listed gems)"

add_option(:"Install/Update", '-g', '--file [FILE]',
'Read from a gem dependencies API file and',
'install the listed gems') do |v,o|
v = Gem::GEM_DEP_FILES.find do |file|
File.exist? file
end unless v

unless v then
message = v ? v : "(tried #{Gem::GEM_DEP_FILES.join ', '})"

raise OptionParser::InvalidArgument,
"cannot find gem dependencies file #{message}"
end

o[:gemdeps] = v
end

add_option(:"Install/Update", '--without GROUPS', Array,
'Omit the named groups (comma separated)',
'when installing from a gem dependencies',
'file') do |v,o|
o[:without_groups].concat v.map { |without| without.intern }
end

add_option(:"Install/Update", '--default',
'Add the gem\'s full specification to',
'specifications/default and extract only its bin') do |v,o|
o[:install_as_default] = v
end

add_option(:"Install/Update", '--explain',
'Rather than install the gems, indicate which would',
'be installed') do |v,o|
o[:explain] = v
end

add_option(:"Install/Update", '--[no-]lock',
'Create a lock file (when used with -g/--file)') do |v,o|
o[:lock] = v
end

add_option(:"Install/Update", '--[no-]suggestions',
'Suggest alternates when gems are not found') do |v,o|
o[:suggest_alternate] = v
end

@installed_specs = []
end

3 changes: 1 addition & 2 deletions lib/ruby/stdlib/rubygems/commands/owner_command.rb
Original file line number Diff line number Diff line change
@@ -66,7 +66,7 @@ def show_owners name

say "Owners for gem: #{name}"
owners.each do |owner|
say "- #{owner['email']}"
say "- #{owner['email'] || owner['handle'] || owner['id']}"
end
end
end
@@ -97,4 +97,3 @@ def manage_owners method, name, owners
end

end

4 changes: 2 additions & 2 deletions lib/ruby/stdlib/rubygems/commands/pristine_command.rb
Original file line number Diff line number Diff line change
@@ -92,8 +92,8 @@ def execute
spec.extensions and not spec.extensions.empty?
end
else
get_all_gem_names.map do |gem_name|
Gem::Specification.find_all_by_name gem_name, options[:version]
get_all_gem_names.sort.map do |gem_name|
Gem::Specification.find_all_by_name(gem_name, options[:version]).reverse
end.flatten
end

15 changes: 12 additions & 3 deletions lib/ruby/stdlib/rubygems/commands/query_command.rb
Original file line number Diff line number Diff line change
@@ -247,7 +247,7 @@ def entry_details entry, detail_tuple, specs, platforms
spec_summary entry, spec
end

def entry_versions entry, name_tuples, platforms
def entry_versions entry, name_tuples, platforms, specs
return unless options[:versions]

list =
@@ -256,7 +256,16 @@ def entry_versions entry, name_tuples, platforms
else
platforms.sort.reverse.map do |version, pls|
if pls == [Gem::Platform::RUBY] then
version
if options[:domain] == :remote || specs.all? { |spec| spec.is_a? Gem::Source }
version
else
spec = specs.select { |s| s.version == version }
if spec.first.default_gem?
"default: #{version}"
else
version
end
end
else
ruby = pls.delete Gem::Platform::RUBY
platform_list = [ruby, *pls.sort].compact
@@ -277,7 +286,7 @@ def make_entry entry_tuples, platforms

entry = [name_tuples.first.name]

entry_versions entry, name_tuples, platforms
entry_versions entry, name_tuples, platforms, specs
entry_details entry, detail_tuple, specs, platforms

entry.join
2 changes: 1 addition & 1 deletion lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb
Original file line number Diff line number Diff line change
@@ -104,7 +104,7 @@ def require path

# Ok, now find a gem that has no conflicts, starting
# at the highest version.
valid = found_specs.reject { |s| s.has_conflicts? }.last
valid = found_specs.reject { |s| s.has_conflicts? }.first

unless valid then
le = Gem::LoadError.new "unable to find a version of '#{names.first}' to activate"
16 changes: 3 additions & 13 deletions lib/ruby/stdlib/rubygems/dependency.rb
Original file line number Diff line number Diff line change
@@ -286,9 +286,7 @@ def matching_specs platform_only = false
}
end

# `stubs_for` returns oldest first, but `matching_specs` is supposed to
# return newest first, so just reverse the list
matches.reverse
matches
end

##
@@ -307,18 +305,10 @@ def to_specs
specs = Gem::Specification.stubs_for name

if specs.empty?
total = Gem::Specification.stubs.size
msg = "Could not find '#{name}' (#{requirement}) among #{total} total gem(s)\n".dup
raise Gem::MissingSpecError.new name, requirement
else
specs = specs.map(&:full_name)
msg = "Could not find '#{name}' (#{requirement}) - did find: [#{specs.join ','}]\n".dup
raise Gem::MissingSpecVersionError.new name, requirement, specs
end
msg << "Checked in 'GEM_PATH=#{Gem.path.join(File::PATH_SEPARATOR)}', execute `gem env` for more information"

error = Gem::LoadError.new(msg)
error.name = self.name
error.requirement = self.requirement
raise error
end

# TODO: any other resolver validations should go here
44 changes: 44 additions & 0 deletions lib/ruby/stdlib/rubygems/errors.rb
Original file line number Diff line number Diff line change
@@ -20,6 +20,49 @@ class LoadError < ::LoadError
attr_accessor :requirement
end

##
# Raised when trying to activate a gem, and that gem does not exist on the
# system. Instead of rescuing from this class, make sure to rescue from the
# superclass Gem::LoadError to catch all types of load errors.
class MissingSpecError < Gem::LoadError
def initialize name, requirement
@name = name
@requirement = requirement
end

def message # :nodoc:
build_message +
"Checked in 'GEM_PATH=#{Gem.path.join(File::PATH_SEPARATOR)}', execute `gem env` for more information"
end

private

def build_message
total = Gem::Specification.stubs.size
"Could not find '#{name}' (#{requirement}) among #{total} total gem(s)\n"
end
end

##
# Raised when trying to activate a gem, and the gem exists on the system, but
# not the requested version. Instead of rescuing from this class, make sure to
# rescue from the superclass Gem::LoadError to catch all types of load errors.
class MissingSpecVersionError < MissingSpecError
attr_reader :specs

def initialize name, requirement, specs
super(name, requirement)
@specs = specs
end

private

def build_message
names = specs.map(&:full_name)
"Could not find '#{name}' (#{requirement}) - did find: [#{names.join ','}]\n"
end
end

# Raised when there are conflicting gem specs loaded

class ConflictError < LoadError
@@ -127,6 +170,7 @@ def initialize(source, error)
# An English description of the error.

def wordy
@source.uri.password = 'REDACTED' unless @source.uri.password.nil?
"Unable to download data from #{@source.uri} - #{@error.message}"
end

46 changes: 46 additions & 0 deletions lib/ruby/stdlib/rubygems/install_update_options.rb
Original file line number Diff line number Diff line change
@@ -180,6 +180,52 @@ def add_install_update_options
options[:post_install_message] = value
end

add_option(:"Install/Update", '-g', '--file [FILE]',
'Read from a gem dependencies API file and',
'install the listed gems') do |v,o|
v = Gem::GEM_DEP_FILES.find do |file|
File.exist? file
end unless v

unless v then
message = v ? v : "(tried #{Gem::GEM_DEP_FILES.join ', '})"

raise OptionParser::InvalidArgument,
"cannot find gem dependencies file #{message}"
end

options[:gemdeps] = v
end

add_option(:"Install/Update", '--without GROUPS', Array,
'Omit the named groups (comma separated)',
'when installing from a gem dependencies',
'file') do |v,o|
options[:without_groups].concat v.map { |without| without.intern }
end

add_option(:"Install/Update", '--default',
'Add the gem\'s full specification to',
'specifications/default and extract only its bin') do |v,o|
options[:install_as_default] = v
end

add_option(:"Install/Update", '--explain',
'Rather than install the gems, indicate which would',
'be installed') do |v,o|
options[:explain] = v
end

add_option(:"Install/Update", '--[no-]lock',
'Create a lock file (when used with -g/--file)') do |v,o|
options[:lock] = v
end

add_option(:"Install/Update", '--[no-]suggestions',
'Suggest alternates when gems are not found') do |v,o|
options[:suggest_alternate] = v
end

end

##
11 changes: 4 additions & 7 deletions lib/ruby/stdlib/rubygems/installer.rb
Original file line number Diff line number Diff line change
@@ -231,7 +231,7 @@ def check_executable_overwrite filename # :nodoc:
question = "#{spec.name}'s executable \"#{filename}\" conflicts with ".dup

if ruby_executable then
question << existing
question << (existing || 'an unknown executable')

return if ask_yes_no "#{question}\nOverwrite the executable?", false

@@ -509,12 +509,6 @@ def generate_bin_script(filename, bindir)
# the symlink if the gem being installed has a newer version.

def generate_bin_symlink(filename, bindir)
if Gem.win_platform? then
alert_warning "Unable to use symlinks on Windows, installing wrapper"
generate_bin_script filename, bindir
return
end

src = File.join gem_dir, spec.bindir, filename
dst = File.join bindir, formatted_program_filename(filename)

@@ -528,6 +522,9 @@ def generate_bin_symlink(filename, bindir)
end

FileUtils.symlink src, dst, :verbose => Gem.configuration.really_verbose
rescue NotImplementedError, SystemCallError
alert_warning "Unable to use symlinks, installing wrapper"
generate_bin_script filename, bindir
end

##
8 changes: 7 additions & 1 deletion lib/ruby/stdlib/rubygems/remote_fetcher.rb
Original file line number Diff line number Diff line change
@@ -27,7 +27,13 @@ class FetchError < Gem::Exception

def initialize(message, uri)
super message
@uri = uri
begin
uri = URI(uri)
uri.password = 'REDACTED' if uri.password
@uri = uri.to_s
rescue URI::InvalidURIError, ArgumentError
@uri = uri
end
end

def to_s # :nodoc:
2 changes: 1 addition & 1 deletion lib/ruby/stdlib/rubygems/request.rb
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ def proxy_uri; @connection_pool.proxy_uri; end
def cert_files; @connection_pool.cert_files; end

def self.get_cert_files
pattern = File.expand_path("./ssl_certs/*.pem", File.dirname(__FILE__))
pattern = File.expand_path("./ssl_certs/*/*.pem", File.dirname(__FILE__))
Dir.glob(pattern)
end

46 changes: 22 additions & 24 deletions lib/ruby/stdlib/rubygems/server.rb
Original file line number Diff line number Diff line change
@@ -34,17 +34,17 @@ class Gem::Server
include ERB::Util
include Gem::UserInteraction

SEARCH = <<-SEARCH
SEARCH = <<-ERB
<form class="headerSearch" name="headerSearchForm" method="get" action="/rdoc">
<div id="search" style="float:right">
<label for="q">Filter/Search</label>
<input id="q" type="text" style="width:10em" name="q">
<button type="submit" style="display:none"></button>
</div>
</form>
SEARCH
ERB

DOC_TEMPLATE = <<-'DOC_TEMPLATE'
DOC_TEMPLATE = <<-'ERB'
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
@@ -68,35 +68,33 @@ class Gem::Server
<h1>Summary</h1>
<p>There are <%=values["gem_count"]%> gems installed:</p>
<p>
<%= values["specs"].map { |v| "<a href=\"##{v["name"]}\">#{v["name"]}</a>" }.join ', ' %>.
<%= values["specs"].map { |v| "<a href\"##{u v["name"]}\">#{h v["name"]}</a>" }.join ', ' %>.
<h1>Gems</h1>
<dl>
<% values["specs"].each do |spec| %>
<dt>
<% if spec["first_name_entry"] then %>
<a name="<%=spec["name"]%>"></a>
<a name="<%=h spec["name"]%>"></a>
<% end %>
<b><%=spec["name"]%> <%=spec["version"]%></b>
<b><%=h spec["name"]%> <%=h spec["version"]%></b>
<% if spec["ri_installed"] then %>
<a href="<%=spec["doc_path"]%>">[rdoc]</a>
<% elsif spec["rdoc_installed"] then %>
<a href="<%=spec["doc_path"]%>">[rdoc]</a>
<% if spec["ri_installed"] || spec["rdoc_installed"] then %>
<a href="<%=u spec["doc_path"]%>">[rdoc]</a>
<% else %>
<span title="rdoc not installed">[rdoc]</span>
<% end %>
<% if spec["homepage"] then %>
<a href="<%=spec["homepage"]%>" title="<%=spec["homepage"]%>">[www]</a>
<a href="<%=u spec["homepage"]%>" title="<%=h spec["homepage"]%>">[www]</a>
<% else %>
<span title="no homepage available">[www]</span>
<% end %>
<% if spec["has_deps"] then %>
- depends on
<%= spec["dependencies"].map { |v| "<a href=\"##{v["name"]}\">#{v["name"]}</a>" }.join ', ' %>.
<%= spec["dependencies"].map { |v| "<a href=\"##{u v["name"]}>#{h v["name"]}</a>" }.join ', ' %>.
<% end %>
</dt>
<dd>
@@ -110,7 +108,7 @@ class Gem::Server
Executables are
<%end%>
<%= spec["executables"].map { |v| "<span class=\"context-item-name\">#{v["executable"]}</span>"}.join ', ' %>.
<%= spec["executables"].map { |v| "<span class=\"context-item-name\">#{h v["executable"]}</span>"}.join ', ' %>.
<%end%>
<br/>
@@ -127,10 +125,10 @@ class Gem::Server
</div>
</body>
</html>
DOC_TEMPLATE
ERB

# CSS is copy & paste from rdoc-style.css, RDoc V1.0.1 - 20041108
RDOC_CSS = <<-RDOC_CSS
RDOC_CSS = <<-CSS
body {
font-family: Verdana,Arial,Helvetica,sans-serif;
font-size: 90%;
@@ -338,9 +336,9 @@ class Gem::Server
.ruby-comment { color: #b22222; font-weight: bold; background: transparent; }
.ruby-regexp { color: #ffa07a; background: transparent; }
.ruby-value { color: #7fffd4; background: transparent; }
RDOC_CSS
CSS

RDOC_NO_DOCUMENTATION = <<-'NO_DOC'
RDOC_NO_DOCUMENTATION = <<-'ERB'
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -372,9 +370,9 @@ class Gem::Server
</div>
</body>
</html>
NO_DOC
ERB

RDOC_SEARCH_TEMPLATE = <<-'RDOC_SEARCH'
RDOC_SEARCH_TEMPLATE = <<-'ERB'
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -401,10 +399,10 @@ class Gem::Server
<% doc_items.each do |doc_item| %>
<dt>
<b><%=doc_item[:name]%></b>
<a href="<%=doc_item[:url]%>">[rdoc]</a>
<a href="<%=u doc_item[:url]%>">[rdoc]</a>
</dt>
<dd>
<%=doc_item[:summary]%>
<%=h doc_item[:summary]%>
<br/>
<br/>
</dd>
@@ -423,7 +421,7 @@ class Gem::Server
</div>
</body>
</html>
RDOC_SEARCH
ERB

def self.run(options)
new(options[:gemdir], options[:port], options[:daemon],
@@ -459,9 +457,9 @@ def add_date res

def doc_root gem_name
if have_rdoc_4_plus? then
"/doc_root/#{gem_name}/"
"/doc_root/#{u gem_name}/"
else
"/doc_root/#{gem_name}/rdoc/index.html"
"/doc_root/#{u gem_name}/rdoc/index.html"
end
end

6 changes: 3 additions & 3 deletions lib/ruby/stdlib/rubygems/specification.rb
Original file line number Diff line number Diff line change
@@ -849,7 +849,7 @@ def self.stubs_for name
pattern = "#{name}-*.gemspec"
stubs = default_stubs(pattern) + installed_stubs(dirs, pattern)
stubs = uniq_by(stubs) { |stub| stub.full_name }.group_by(&:name)
stubs.each_value { |v| sort_by!(v) { |i| i.version } }
stubs.each_value { |v| _resort!(v) }

@@stubs_by_name.merge! stubs
@@stubs_by_name[name] ||= EMPTY
@@ -1074,7 +1074,7 @@ def self.find_in_unresolved path
def self.find_in_unresolved_tree path
specs = unresolved_deps.values.map { |dep| dep.to_specs }.flatten

specs.reverse_each do |spec|
specs.each do |spec|
spec.traverse do |from_spec, dep, to_spec, trail|
if to_spec.has_conflicts? || to_spec.conficts_when_loaded_with?(trail)
:next
@@ -2613,7 +2613,7 @@ def traverse trail = [], visited = {}, &block
begin
dependencies.each do |dep|
next unless dep.runtime?
dep.to_specs.reverse_each do |dep_spec|
dep.to_specs.each do |dep_spec|
next if visited.has_key?(dep_spec)
visited[dep_spec] = true
trail.push(dep_spec)
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-----BEGIN CERTIFICATE-----
MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkGA1UEBhMCQkUx
GTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jvb3QgQ0ExGzAZBgNVBAMTEkds
b2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAwMDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNV
BAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYD
VQQDExJHbG9iYWxTaWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDa
DuaZjc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavpxy0Sy6sc
THAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp1Wrjsok6Vjk4bwY8iGlb
Kk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdGsnUOhugZitVtbNV4FpWi6cgKOOvyJBNP
c1STE4U6G7weNLWLBYy5d4ux2x8gkasJU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrX
gzT/LCrBbBlDSgeF59N89iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV
HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0BAQUF
AAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOzyj1hTdNGCbM+w6Dj
Y1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE38NflNUVyRRBnMRddWQVDf9VMOyG
j/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymPAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhH
hm4qxFYxldBniYUr+WymXUadDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveC
X4XSQRjbgbMEHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==
-----END CERTIFICATE-----
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
-----BEGIN CERTIFICATE-----
MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBs
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j
ZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAwMFoXDTMxMTExMDAwMDAwMFowbDEL
MAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3
LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFuY2Ug
RVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm
+9S75S0tMqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTW
PNt0OKRKzE0lgvdKpVMSOO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEM
xChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFB
Ik5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQNAQTXKFx01p8VdteZOE3
hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUeh10aUAsg
EsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQF
MAMBAf8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaA
FLE+w2kD+L9HAdSYJhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3Nec
nzyIZgYIVyHbIUf4KmeqvxgydkAQV8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6z
eM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFpmyPInngiK3BD41VHMWEZ71jF
hS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkKmNEVX58Svnw2
Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe
vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep
+OkuE6N36B9K
-----END CERTIFICATE-----
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
-----BEGIN CERTIFICATE-----
MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU
MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs
IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290
MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux
FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5h
bCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9v
dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvt
H7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9
uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX
mk6vBbOmcZSccbNQYArHE504B4YCqOmoaSYYkKtMsE8jqzpPhNjfzp/haW+710LX
a0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy2xSoRcRdKn23tNbE7qzN
E0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv77+ldU9U0
WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYD
VR0PBAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0
Jvf6xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRU
cnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsx
IjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJKoZIhvcN
AQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxH
YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5
6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC
Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX
c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a
mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=
-----END CERTIFICATE-----
3 changes: 0 additions & 3 deletions lib/ruby/stdlib/rubygems/stub_specification.rb
Original file line number Diff line number Diff line change
@@ -89,8 +89,6 @@ def activated?
end
end

def this; self; end

def default_gem?
@default_gem
end
@@ -212,4 +210,3 @@ def stubbed?
end

end

11 changes: 11 additions & 0 deletions lib/ruby/stdlib/rubygems/test_case.rb
Original file line number Diff line number Diff line change
@@ -256,6 +256,17 @@ def setup
@tempdir.untaint
end

# This makes the tempdir consistent on Windows.
# Dir.tmpdir may return short path name, but Dir[Dir.tmpdir] returns long
# path name. https://bugs.ruby-lang.org/issues/10819
# File.expand_path or File.realpath doesn't convert path name to long path
# name. Only Dir[] (= Dir.glob) works.
# Short and long path name is specific to Windows filesystem.
if win_platform?
@tempdir = Dir[@tempdir][0]
@tempdir.untaint
end

@gemhome = File.join @tempdir, 'gemhome'
@userhome = File.join @tempdir, 'userhome'
ENV["GEM_SPEC_CACHE"] = File.join @tempdir, 'spec_cache'
12 changes: 4 additions & 8 deletions lib/ruby/stdlib/rubygems/user_interaction.rb
Original file line number Diff line number Diff line change
@@ -5,6 +5,8 @@
# See LICENSE.txt for permissions.
#++

require 'rubygems/util'

begin
require 'io/console'
rescue LoadError
@@ -676,13 +678,8 @@ class Gem::SilentUI < Gem::StreamUI
def initialize
reader, writer = nil, nil

begin
reader = File.open('/dev/null', 'r')
writer = File.open('/dev/null', 'w')
rescue Errno::ENOENT
reader = File.open('nul', 'r')
writer = File.open('nul', 'w')
end
reader = File.open(Gem::Util::NULL_DEVICE, 'r')
writer = File.open(Gem::Util::NULL_DEVICE, 'w')

super reader, writer, writer, false
end
@@ -701,4 +698,3 @@ def progress_reporter(*args) # :nodoc:
SilentProgressReporter.new(@outs, *args)
end
end

0 comments on commit 9ee8643

Please sign in to comment.