summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-22 00:27:02 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-22 00:27:02 +0000
commit615ac3593499f54fde4b1eb0fba66b6bd944821b ()
tree1f0b0e97ee3dd51798658d53cee7eec976a83a97
parentff31b35f6a66f3c1548e3356d506ff65a574be7f (diff)
Merge rubygems master branch from .com/rubygems/rubygems.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--lib/rubygems.rb12
-rw-r--r--lib/rubygems/bundler_version_finder.rb6
-rw-r--r--lib/rubygems/command.rb2
-rw-r--r--lib/rubygems/command_manager.rb4
-rw-r--r--lib/rubygems/commands/build_command.rb6
-rw-r--r--lib/rubygems/commands/cert_command.rb16
-rw-r--r--lib/rubygems/commands/help_command.rb8
-rw-r--r--lib/rubygems/commands/setup_command.rb6
-rw-r--r--lib/rubygems/commands/uninstall_command.rb2
-rw-r--r--lib/rubygems/commands/update_command.rb6
-rw-r--r--lib/rubygems/compatibility.rb2
-rw-r--r--lib/rubygems/config_file.rb25
-rw-r--r--lib/rubygems/defaults.rb8
-rw-r--r--lib/rubygems/dependency.rb2
-rw-r--r--lib/rubygems/doctor.rb2
-rw-r--r--lib/rubygems/ext/builder.rb15
-rw-r--r--lib/rubygems/ext/ext_conf_builder.rb2
-rw-r--r--lib/rubygems/ext/rake_builder.rb10
-rw-r--r--lib/rubygems/install_update_options.rb24
-rw-r--r--lib/rubygems/installer.rb2
-rw-r--r--lib/rubygems/package.rb19
-rw-r--r--lib/rubygems/package/tar_header.rb2
-rw-r--r--lib/rubygems/platform.rb4
-rw-r--r--lib/rubygems/remote_fetcher.rb30
-rw-r--r--lib/rubygems/request_set/gem_dependency_api.rb8
-rw-r--r--lib/rubygems/requirement.rb6
-rw-r--r--lib/rubygems/resolver/source_set.rb2
-rw-r--r--lib/rubygems/resolver/stats.rb2
-rw-r--r--lib/rubygems/safe_yaml.rb4
-rw-r--r--lib/rubygems/security.rb2
-rw-r--r--lib/rubygems/security/policies.rb2
-rw-r--r--lib/rubygems/security/policy.rb6
-rw-r--r--lib/rubygems/security/signer.rb26
-rw-r--r--lib/rubygems/security/trust_dir.rb2
-rw-r--r--lib/rubygems/server.rb10
-rw-r--r--lib/rubygems/source.rb29
-rw-r--r--lib/rubygems/spec_fetcher.rb6
-rw-r--r--lib/rubygems/specification.rb65
-rw-r--r--lib/rubygems/specification_policy.rb26
-rw-r--r--lib/rubygems/stub_specification.rb8
-rw-r--r--lib/rubygems/test_case.rb2
-rw-r--r--lib/rubygems/test_utilities.rb14
-rw-r--r--lib/rubygems/text.rb2
-rw-r--r--lib/rubygems/uninstaller.rb4
-rw-r--r--lib/rubygems/version.rb2
-rw-r--r--test/rubygems/simple_gem.rb2
-rw-r--r--test/rubygems/test_gem.rb19
-rw-r--r--test/rubygems/test_gem_command_manager.rb4
-rw-r--r--test/rubygems/test_gem_commands_build_command.rb79
-rw-r--r--test/rubygems/test_gem_commands_cert_command.rb33
-rw-r--r--test/rubygems/test_gem_commands_install_command.rb2
-rw-r--r--test/rubygems/test_gem_commands_pristine_command.rb12
-rw-r--r--test/rubygems/test_gem_commands_setup_command.rb2
-rw-r--r--test/rubygems/test_gem_config_file.rb3
-rw-r--r--test/rubygems/test_gem_dependency_list.rb4
-rw-r--r--test/rubygems/test_gem_ext_rake_builder.rb19
-rw-r--r--test/rubygems/test_gem_install_update_options.rb21
-rw-r--r--test/rubygems/test_gem_path_support.rb20
-rw-r--r--test/rubygems/test_gem_remote_fetcher.rb104
-rw-r--r--test/rubygems/test_gem_source.rb12
-rw-r--r--test/rubygems/test_gem_specification.rb12
-rw-r--r--test/rubygems/test_gem_util.rb5
62 files changed, 386 insertions, 410 deletions
@@ -9,7 +9,7 @@
require 'rbconfig'
module Gem
- VERSION = "3.0.0.beta1"
end
# Must be first since it unloads the prelude from 1.9.2
@@ -126,14 +126,14 @@ module Gem
/mingw/i,
/mswin/i,
/wince/i,
- ]
GEM_DEP_FILES = %w[
gem.deps.rb
gems.rb
Gemfile
Isolate
- ]
##
# Subdirectories in a gem repository
@@ -145,7 +145,7 @@ module Gem
extensions
gems
specifications
- ]
##
# Subdirectories in a gem repository for default gems
@@ -153,7 +153,7 @@ module Gem
REPOSITORY_DEFAULT_GEM_SUBDIRECTORIES = %w[
gems
specifications/default
- ]
##
# Exception classes used in a Gem.read_binary +rescue+ statement. Not all of
@@ -1342,7 +1342,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
##
# Location of Marshal quick gemspecs on remote repositories
- MARSHAL_SPEC_DIR = "quick/Marshal.#{Gem.marshal_version}/"
autoload :BundlerVersionFinder, 'rubygems/bundler_version_finder'
autoload :ConfigFile, 'rubygems/config_file'
@@ -104,9 +104,9 @@ To install the missing version, run `gem install bundler:#{vr.first}`
return unless gemfile
lockfile = case gemfile
- when "gems.rb" then "gems.locked"
- else "#{gemfile}.lock"
- end.dup.untaint
return unless File.file?(lockfile)
@@ -570,7 +570,7 @@ class Gem::Command
# :stopdoc:
- HELP = <<-HELP
RubyGems is a sophisticated package manager for Ruby. This is a
basic help message containing pointers to more information.
@@ -69,11 +69,11 @@ class Gem::CommandManager
:update,
:which,
:yank,
- ]
ALIAS_COMMANDS = {
'i' => 'install'
- }
##
# Return the authoritative instance of the command manager.
@@ -55,7 +55,11 @@ with gem spec:
spec = Gem::Specification.load File.basename(gemspec)
if spec then
- Gem::Package.build spec, options[:force], options[:strict]
else
alert_error "Error loading gemspec. Aborting."
terminate_interaction 1
@@ -149,15 +149,15 @@ class Gem::Commands::CertCommand < Gem::Command
end
def build_cert email, key # :nodoc:
- expiration_length_days = options[:expiration_length_days]
- age =
- if expiration_length_days.nil? || expiration_length_days == 0
- Gem::Security::ONE_YEAR
- else
- Gem::Security::ONE_DAY * expiration_length_days
- end
- cert = Gem::Security.create_cert_email email, key, age
Gem::Security.write cert, "gem-public_cert.pem"
end
@@ -4,7 +4,7 @@ require 'rubygems/command'
class Gem::Commands::HelpCommand < Gem::Command
# :stopdoc:
- EXAMPLES = <<-EOF
Some examples of 'gem' usage.
* Install 'rake', either from local directory or remote server:
@@ -53,7 +53,7 @@ Some examples of 'gem' usage.
gem update --system
EOF
- GEM_DEPENDENCIES = <<-EOF
A gem dependencies file allows installation of a consistent set of gems across
multiple environments. The RubyGems implementation is designed to be
compatible with Bundler's Gemfile format. You can see additional
@@ -230,7 +230,7 @@ default. This may be overridden with the :development_group option:
EOF
- PLATFORMS = <<-'EOF'
RubyGems platforms are composed of three parts, a CPU, an OS, and a
version. These values are taken from values in rbconfig.rb. You can view
your current platform by running `gem environment`.
@@ -277,7 +277,7 @@ platform.
["examples", EXAMPLES],
["gem_dependencies", GEM_DEPENDENCIES],
["platforms", PLATFORMS],
- ]
# :startdoc:
def initialize
@@ -9,7 +9,7 @@ class Gem::Commands::SetupCommand < Gem::Command
HISTORY_HEADER = /^===\s*[\d.a-zA-Z]+\s*\/\s*\d{4}-\d{2}-\d{2}\s*$/
VERSION_MATCHER = /^===\s*([\d.a-zA-Z]+)\s*\/\s*\d{4}-\d{2}-\d{2}\s*$/
- ENV_PATHS = %w[/usr/bin/env /bin/env]
def initialize
require 'tmpdir'
@@ -84,8 +84,8 @@ class Gem::Commands::SetupCommand < Gem::Command
add_option '--[no-]regenerate-binstubs',
'Regenerate gem binstubs' do |value, options|
- options[:regenerate_binstubs] = value
- end
add_option('-E', '--[no-]env-shebang',
'Rewrite executables with a shebang',
@@ -20,7 +20,7 @@ class Gem::Commands::UninstallCommand < Gem::Command
add_option('-a', '--[no-]all',
'Uninstall all matching versions'
- ) do |value, options|
options[:all] = value
end
@@ -168,12 +168,8 @@ command to remove old versions.
Dir.chdir update_dir do
say "Installing RubyGems #{version}"
- # Make sure old rubygems isn't loaded
- old = ENV["RUBYOPT"]
- ENV.delete("RUBYOPT") if old
- installed = system Gem.ruby, 'setup.rb', *args
say "RubyGems system software updated" if installed
- ENV["RUBYOPT"] = old if old
end
end
@@ -22,7 +22,7 @@ module Gem
EXEEXT RUBY_SO_NAME arch bindir datadir libdir ruby_install_name
ruby_version rubylibprefix sitedir sitelibdir vendordir vendorlibdir
rubylibdir
- ]
unless defined?(ConfigMap)
##
@@ -45,6 +45,7 @@ class Gem::ConfigFile
DEFAULT_VERBOSITY = true
DEFAULT_UPDATE_SOURCES = true
DEFAULT_CONCURRENT_DOWNLOADS = 8
##
# For Ruby packagers to set configuration defaults. Set in
@@ -136,6 +137,11 @@ class Gem::ConfigFile
attr_accessor :sources
##
# Path name of directory or file of openssl client certificate, used for remote https connection with client authentication
attr_reader :ssl_client_cert
@@ -185,6 +191,7 @@ class Gem::ConfigFile
@verbose = DEFAULT_VERBOSITY
@update_sources = DEFAULT_UPDATE_SOURCES
@concurrent_downloads = DEFAULT_CONCURRENT_DOWNLOADS
operating_system_config = Marshal.load Marshal.dump(OPERATING_SYSTEM_DEFAULTS)
platform_config = Marshal.load Marshal.dump(PLATFORM_DEFAULTS)
@@ -202,15 +209,15 @@ class Gem::ConfigFile
end
# HACK these override command-line args, which is bad
- @backtrace = @hash[:backtrace] if @hash.key? :backtrace
- @bulk_threshold = @hash[:bulk_threshold] if @hash.key? :bulk_threshold
- @home = @hash[:gemhome] if @hash.key? :gemhome
- @path = @hash[:gempath] if @hash.key? :gempath
- @update_sources = @hash[:update_sources] if @hash.key? :update_sources
- @verbose = @hash[:verbose] if @hash.key? :verbose
- @concurrent_downloads = @hash[:concurrent_downloads] if @hash.key? :concurrent_downloads
- @disable_default_gem_server = @hash[:disable_default_gem_server] if @hash.key? :disable_default_gem_server
- @sources = @hash[:sources] if @hash.key? :sources
@ssl_verify_mode = @hash[:ssl_verify_mode] if @hash.key? :ssl_verify_mode
@ssl_ca_cert = @hash[:ssl_ca_cert] if @hash.key? :ssl_ca_cert
@@ -1,6 +1,6 @@
# frozen_string_literal: true
module Gem
- DEFAULT_HOST = "https://rubygems.org"
@post_install_hooks ||= []
@done_installing_hooks ||= []
@@ -36,9 +36,9 @@ module Gem
]
elsif RbConfig::CONFIG['rubylibprefix'] then
[
- RbConfig::CONFIG['rubylibprefix'],
- 'gems',
- RbConfig::CONFIG['ruby_version']
]
else
[
@@ -19,7 +19,7 @@ class Gem::Dependency
TYPES = [
:development,
:runtime,
- ]
##
# Dependency name or regular expression.
@@ -26,7 +26,7 @@ class Gem::Doctor
['doc', ''],
['extensions', ''],
['gems', ''],
- ]
missing =
Gem::REPOSITORY_SUBDIRECTORIES.sort -
@@ -148,9 +148,21 @@ EOF
def build_extension extension, dest_path # :nodoc:
results = []
extension ||= '' # I wish I knew why this line existed
extension_dir =
- File.expand_path File.join @gem_dir, File.dirname(extension)
lib_dir = File.join @spec.full_gem_path, @spec.raw_require_paths.first
builder = builder_for extension
@@ -200,6 +212,7 @@ EOF
FileUtils.rm_f @spec.gem_build_complete_path
@ran_rake = false # only run rake once
@spec.extensions.each do |extension|
@@ -38,7 +38,7 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
destdir = ENV["DESTDIR"]
begin
- cmd = [Gem.ruby, "-r", get_relative_path(siteconf.path), File.basename(extension), *args].join ' '
begin
run cmd, results
@@ -5,6 +5,8 @@
# See LICENSE.txt for permissions.
#++
class Gem::Ext::RakeBuilder < Gem::Ext::Builder
def self.build(extension, dest_path, results, args=[], lib_dir=nil)
@@ -14,9 +16,6 @@ class Gem::Ext::RakeBuilder < Gem::Ext::Builder
run cmd, results
end
- # Deal with possible spaces in the path, e.g. C:/Program Files
- dest_path = '"' + dest_path.to_s + '"' if dest_path.to_s.include?(' ')
-
rake = ENV['rake']
rake ||= begin
@@ -26,9 +25,8 @@ class Gem::Ext::RakeBuilder < Gem::Ext::Builder
rake ||= Gem.default_exec_format % 'rake'
- cmd = "#{rake} RUBYARCHDIR=#{dest_path} RUBYLIBDIR=#{dest_path}" # ENV is frozen
-
- run cmd, results
results
end
@@ -63,30 +63,6 @@ module Gem::InstallUpdateOptions
options[:document] = []
end
- add_option(:Deprecated, '--[no-]rdoc',
- 'Generate RDoc for installed gems',
- 'Use --document instead') do |value, options|
- if value then
- options[:document] << 'rdoc'
- else
- options[:document].delete 'rdoc'
- end
-
- options[:document].uniq!
- end
-
- add_option(:Deprecated, '--[no-]ri',
- 'Generate ri data for installed gems.',
- 'Use --document instead') do |value, options|
- if value then
- options[:document] << 'ri'
- else
- options[:document].delete 'ri'
- end
-
- options[:document].uniq!
- end
-
add_option(:"Install/Update", '-E', '--[no-]env-shebang',
"Rewrite the shebang line on installed",
"scripts to use /usr/bin/env") do |value, options|
@@ -34,7 +34,7 @@ class Gem::Installer
# Paths where env(1) might live. Some systems are broken and have it in
# /bin
- ENV_PATHS = %w[/usr/bin/env /bin/env]
##
# Deprecated in favor of Gem::Ext::BuildError
@@ -119,7 +119,7 @@ class Gem::Package
# Permission for other files
attr_accessor :data_mode
- def self.build spec, skip_validation=false, strict_validation=false
gem_file = spec.file_name
package = new gem_file
@@ -263,7 +263,11 @@ class Gem::Package
@spec.mark_version
@spec.validate true, strict_validation unless skip_validation
- setup_signer
@gem.with_write_io do |gem_io|
Gem::Package::TarWriter.new gem_io do |gem|
@@ -521,10 +525,17 @@ EOM
# Prepares the gem for signing and checksum generation. If a signing
# certificate and key are not present only checksum generation is set up.
- def setup_signer
passphrase = ENV['GEM_PRIVATE_KEY_PASSPHRASE']
if @spec.signing_key then
- @signer = Gem::Security::Signer.new @spec.signing_key, @spec.cert_chain, passphrase
@spec.signing_key = nil
@spec.cert_chain = @signer.cert_chain.map { |cert| cert.to_s }
else
@@ -50,7 +50,7 @@ class Gem::Package::TarHeader
:uid,
:uname,
:version,
- ]
##
# Pack format for a tar header
@@ -195,12 +195,12 @@ class Gem::Platform
# A pure-Ruby gem that may use Gem::Specification#extensions to build
# binary files.
- RUBY = 'ruby'
##
# A platform-specific gem that is built for the packaging Ruby's platform.
# This will be replaced with Gem::Platform::local.
- CURRENT = 'current'
end
@@ -71,13 +71,10 @@ class Gem::RemoteFetcher
# HTTP_PROXY_PASS)
# * <tt>:no_proxy</tt>: ignore environment variables and _don't_ use a proxy
#
- # +dns+: An object to use for DNS resolution of the API endpoint.
- # By default, use Resolv::DNS.
- #
# +headers+: A set of additional HTTP headers to be sent to the server when
# fetching the gem.
- def initialize(proxy=nil, dns=Resolv::DNS.new, headers={})
require 'net/http'
require 'stringio'
require 'time'
@@ -90,35 +87,10 @@ class Gem::RemoteFetcher
@pool_lock = Mutex.new
@cert_files = Gem::Request.get_cert_files
- @dns = dns
@headers = headers
end
##
- # Given a source at +uri+, calculate what hostname to actually
- # connect to query the data for it.
-
- def api_endpoint(uri)
- host = uri.host
-
- begin
- res = @dns.getresource "_rubygems._tcp.#{host}",
- Resolv::DNS::Resource::IN::SRV
- rescue Resolv::ResolvError => e
- verbose "Getting SRV record failed: #{e}"
- uri
- else
- target = res.target.to_s.strip
-
- if URI("http://" + target).host.end_with?(".#{host}")
- return URI.parse "#{uri.scheme}://#{target}#{uri.path}"
- end
-
- uri
- end
- end
-
- ##
# Given a name and requirement, downloads this gem into cache and returns the
# filename. Returns nil if the gem cannot be located.
#--
@@ -48,7 +48,7 @@ class Gem::RequestSet::GemDependencyAPI
:ruby_19 => %w[ruby rbx maglev],
:ruby_20 => %w[ruby rbx maglev],
:ruby_21 => %w[ruby rbx maglev],
- }
mswin = Gem::Platform.new 'x86-mswin32'
mswin64 = Gem::Platform.new 'x64-mswin64'
@@ -88,7 +88,7 @@ class Gem::RequestSet::GemDependencyAPI
:x64_mingw => x64_mingw,
:x64_mingw_20 => x64_mingw,
:x64_mingw_21 => x64_mingw
- }
gt_eq_0 = Gem::Requirement.new '>= 0'
tilde_gt_1_8_0 = Gem::Requirement.new '~> 1.8.0'
@@ -129,7 +129,7 @@ class Gem::RequestSet::GemDependencyAPI
:x64_mingw => gt_eq_0,
:x64_mingw_20 => tilde_gt_2_0_0,
:x64_mingw_21 => tilde_gt_2_1_0,
- }
WINDOWS = { # :nodoc:
:mingw => :only,
@@ -160,7 +160,7 @@ class Gem::RequestSet::GemDependencyAPI
:x64_mingw => :only,
:x64_mingw_20 => :only,
:x64_mingw_21 => :only,
- }
##
# The gems required by #gem statements in the gem.deps.rb file
@@ -22,12 +22,12 @@ class Gem::Requirement
">=" => lambda { |v, r| v >= r },
"<=" => lambda { |v, r| v <= r },
"~>" => lambda { |v, r| v >= r && v.release < r.bump }
- }
SOURCE_SET_REQUIREMENT = Struct.new(:for_lockfile).new "!" # :nodoc:
quoted = OPS.keys.map { |k| Regexp.quote k }.join "|"
- PATTERN_RAW = "\\s*(#{quoted})?\\s*(#{Gem::Version::VERSION_PATTERN})\\s*" # :nodoc:
##
# A regular expression that matches a requirement
@@ -37,7 +37,7 @@ class Gem::Requirement
##
# The default requirement matches any version
- DefaultRequirement = [">=", Gem::Version.new(0)]
##
# Raised when a bad requirement is encountered
@@ -37,7 +37,7 @@ class Gem::Resolver::SourceSet < Gem::Resolver::Set
@links[name] = source
end
-private
def get_set(name)
link = @links[name]
@@ -32,7 +32,7 @@ class Gem::Resolver::Stats
@iterations += 1
end
- PATTERN = "%20s: %d\n"
def display
$stdout.puts "=== Resolver Statistics ==="
@@ -19,12 +19,12 @@ module Gem
Gem::Version::Requirement
YAML::Syck::DefaultKey
Syck::DefaultKey
- )
WHITELISTED_SYMBOLS = %w(
development
runtime
- )
if ::YAML.respond_to? :safe_load
def self.safe_load input
@@ -401,7 +401,7 @@ module Gem::Security
'keyUsage' =>
'keyEncipherment,dataEncipherment,digitalSignature',
'subjectKeyIdentifier' => 'hash',
- }
def self.alt_name_or_x509_entry certificate, x509_entry
alt_name = certificate.extensions.find do |extension|
@@ -110,7 +110,7 @@ module Gem::Security
'MediumSecurity' => MediumSecurity,
'HighSecurity' => HighSecurity,
# SigningPolicy is not intended for use by `gem -P` so do not list it
- }
end
@@ -196,9 +196,9 @@ class Gem::Security::Policy
def inspect # :nodoc:
("[Policy: %s - data: %p signer: %p chain: %p root: %p " +
"signed-only: %p trusted-only: %p]") % [
- @name, @verify_chain, @verify_data, @verify_root, @verify_signer,
- @only_signed, @only_trusted,
- ]
end
##
@@ -30,6 +30,15 @@ class Gem::Security::Signer
attr_reader :digest_name # :nodoc:
##
# Attemps to re-sign an expired cert with a given private key
def self.re_sign_cert(expired_cert, expired_cert_path, private_key)
return unless expired_cert.not_after < Time.now
@@ -40,7 +49,11 @@ class Gem::Security::Signer
Gem::Security.write(expired_cert, new_expired_cert_path)
- re_signed_cert = Gem::Security.re_sign(expired_cert, private_key)
Gem::Security.write(re_signed_cert, expired_cert_path)
@@ -52,10 +65,11 @@ class Gem::Security::Signer
# +chain+ containing X509 certificates, encoding certificates or paths to
# certificates.
- def initialize key, cert_chain, passphrase = nil
@cert_chain = cert_chain
@key = key
@passphrase = passphrase
unless @key then
default_key = File.join Gem.default_key_path
@@ -130,7 +144,9 @@ class Gem::Security::Signer
raise Gem::Security::Exception, 'no certs provided' if @cert_chain.empty?
if @cert_chain.length == 1 and @cert_chain.last.not_after < Time.now then
- re_sign_key
end
full_name = extract_name @cert_chain.last
@@ -154,7 +170,7 @@ class Gem::Security::Signer
# be saved as ~/.gem/gem-public_cert.pem.expired.%Y%m%d%H%M%S where the
# expiry time (not after) is used for the timestamp.
- def re_sign_key # :nodoc:
old_cert = @cert_chain.last
disk_cert_path = File.join(Gem.default_cert_path)
@@ -174,7 +190,7 @@ class Gem::Security::Signer
unless File.exist?(old_cert_path)
Gem::Security.write(old_cert, old_cert_path)
- cert = Gem::Security.re_sign(old_cert, @key)
Gem::Security.write(cert, disk_cert_path)
@@ -11,7 +11,7 @@ class Gem::Security::TrustDir
DEFAULT_PERMISSIONS = {
:trust_dir => 0700,
:trusted_cert => 0600,
- }
##
# The directory where trusted certificates will be stored.
@@ -35,7 +35,7 @@ class Gem::Server
include ERB::Util
include Gem::UserInteraction
- SEARCH = <<-ERB
<form class="headerSearch" name="headerSearchForm" method="get" action="/rdoc">
<div id="search" style="float:right">
<label for="q">Filter/Search</label>
@@ -45,7 +45,7 @@ class Gem::Server
</form>
ERB
- DOC_TEMPLATE = <<-'ERB'
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
@@ -129,7 +129,7 @@ class Gem::Server
ERB
# CSS is copy & paste from rdoc-style.css, RDoc V1.0.1 - 20041108
- RDOC_CSS = <<-CSS
body {
font-family: Verdana,Arial,Helvetica,sans-serif;
font-size: 90%;
@@ -339,7 +339,7 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; }
.ruby-value { color: #7fffd4; background: transparent; }
CSS
- 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">
@@ -373,7 +373,7 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; }
</html>
ERB
- 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">
@@ -16,7 +16,7 @@ class Gem::Source
:released => 'specs',
:latest => 'latest_specs',
:prerelease => 'prerelease_specs',
- }
##
# The URI this source will fetch gems from.
@@ -36,15 +36,6 @@ class Gem::Source
end
@uri = uri
- @api_uri = nil
- end
-
- ##
- # Use an SRV record on the host to look up the true endpoint for the index.
-
- def api_uri # :nodoc:
- require 'rubygems/remote_fetcher'
- @api_uri ||= Gem::RemoteFetcher.fetcher.api_endpoint uri
end
##
@@ -87,9 +78,9 @@ class Gem::Source
# Returns a Set that can fetch specifications from this source.
def dependency_resolver_set # :nodoc:
- return Gem::Resolver::IndexSet.new self if 'file' == api_uri.scheme
- bundler_api_uri = api_uri + './api/v1/dependencies'
begin
fetcher = Gem::RemoteFetcher.fetcher
@@ -140,9 +131,9 @@ class Gem::Source
spec_file_name = name_tuple.spec_name
- uri = api_uri + "#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}"
- cache_dir = cache_dir uri
local_spec = File.join cache_dir, spec_file_name
@@ -152,9 +143,9 @@ class Gem::Source
return spec if spec
end
- uri.path << '.rz'
- spec = fetcher.fetch_path uri
spec = Gem::Util.inflate spec
if update_cache? then
@@ -184,7 +175,7 @@ class Gem::Source
file = FILES[type]
fetcher = Gem::RemoteFetcher.fetcher
file_name = "#{file}.#{Gem.marshal_version}"
- spec_path = api_uri + "#{file_name}.gz"
cache_dir = cache_dir spec_path
local_file = File.join(cache_dir, file_name)
retried = false
@@ -212,7 +203,7 @@ class Gem::Source
def download(spec, dir=Dir.pwd)
fetcher = Gem::RemoteFetcher.fetcher
- fetcher.download spec, api_uri.to_s, dir
end
def pretty_print q # :nodoc:
@@ -220,7 +211,7 @@ class Gem::Source
q.breakable
q.text @uri.to_s
- if api = api_uri
q.breakable
q.text 'API URI: '
q.text api.to_s
@@ -203,9 +203,9 @@ class Gem::SpecFetcher
matches = if matches.empty? && type != :prerelease
suggest_gems_from_name gem_name, :prerelease
- else
- matches.uniq.sort_by { |name, dist| dist }
- end
matches.first(5).map { |name, dist| name }
end
@@ -1,5 +1,5 @@
-# -*- coding: utf-8 -*-
# frozen_string_literal: true
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
@@ -89,13 +89,13 @@ class Gem::Specification < Gem::BasicSpecification
'Added "required_rubygems_version"',
'Now forward-compatible with future versions',
],
- 3 => [
- 'Added Fixnum validation to the specification_version'
],
- 4 => [
'Added sandboxed freeform metadata to the specification version.'
]
- }
MARSHAL_FIELDS = { # :nodoc:
-1 => 16,
@@ -103,12 +103,14 @@ class Gem::Specification < Gem::BasicSpecification
2 => 16,
3 => 17,
4 => 18,
- }
today = Time.now.utc
TODAY = Time.utc(today.year, today.month, today.day) # :nodoc:
LOAD_CACHE = {} # :nodoc:
private_constant :LOAD_CACHE if defined? private_constant
@@ -163,19 +165,21 @@ class Gem::Specification < Gem::BasicSpecification
:version => nil,
}.freeze
INITIALIZE_CODE_FOR_DEFAULTS = { } # :nodoc:
@@default_value.each do |k,v|
INITIALIZE_CODE_FOR_DEFAULTS[k] = case v
- when [], {}, true, false, nil, Numeric, Symbol
- v.inspect
- when String
- v.dump
- when Numeric
- "default_value(:#{k})"
- else
- "default_value(:#{k}).dup"
- end
end
@@attributes = @@default_value.keys.sort_by { |s| s.to_s }
@@ -260,22 +264,11 @@ class Gem::Specification < Gem::BasicSpecification
].flatten.compact.uniq.sort
end
- ######################################################################
- # :section: Recommended gemspec attributes
-
##
- # Singular writer for #authors
#
- # Usage:
- #
- # spec.author = 'John Jones'
-
- def author= o
- self.authors = [o]
- end
-
- ##
- # Sets the list of authors, ensuring it is an array.
#
# Usage:
#
@@ -285,6 +278,9 @@ class Gem::Specification < Gem::BasicSpecification
@authors = Array(value).flatten.grep(String)
end
##
# A long description of this gem
#
@@ -404,6 +400,17 @@ class Gem::Specification < Gem::BasicSpecification
# :section: Optional gemspec attributes
##
# The path in the gem for executable scripts. Usually 'bin'
#
# Usage:
@@ -4,6 +4,8 @@ require 'uri'
class Gem::SpecificationPolicy < SimpleDelegator
VALID_NAME_PATTERN = /\A[a-zA-Z0-9\.\-\_]+\z/ # :nodoc:
VALID_URI_PATTERN = %r{\Ahttps?:\/\/([^\s:@]+:[^\s:@]*@)?[A-Za-z\d\-]+(\.[A-Za-z\d\-]+)+\.?(:\d{1,5})?([\/?]\S*)?\z} # :nodoc:
METADATA_LINK_KEYS = %w[
@@ -14,7 +16,7 @@ class Gem::SpecificationPolicy < SimpleDelegator
mailing_list_uri
source_code_uri
wiki_uri
- ] # :nodoc:
def initialize(specification)
@warnings = 0
@@ -219,12 +221,14 @@ open-ended dependency on #{dep} is not recommended
end
def validate_name
- if !name.is_a?(String) then
error "invalid value for attribute name: \"#{name.inspect}\" must be a string"
- elsif name !~ /[a-zA-Z]/ then
error "invalid value for attribute name: #{name.dump} must include at least one letter"
- elsif name !~ VALID_NAME_PATTERN then
error "invalid value for attribute name: #{name.dump} can only include letters, numbers, dashes, and underscores"
end
end
@@ -257,9 +261,9 @@ open-ended dependency on #{dep} is not recommended
def validate_platform
case platform
- when Gem::Platform, Gem::Platform::RUBY then # ok
- else
- error "invalid platform #{platform.inspect}, see Gem::Platform"
end
end
@@ -272,10 +276,10 @@ open-ended dependency on #{dep} is not recommended
def validate_array_attribute(field)
val = self.send(field)
klass = case field
- when :dependencies then
- Gem::Dependency
- else
- String
end
unless Array === val and val.all? {|x| x.kind_of?(klass)} then
@@ -6,10 +6,10 @@
class Gem::StubSpecification < Gem::BasicSpecification
# :nodoc:
- PREFIX = "# stub: "
# :nodoc:
- OPEN_MODE = 'r:UTF-8:-'
class StubLine # :nodoc: all
attr_reader :name, :version, :platform, :require_paths, :extensions,
@@ -22,7 +22,7 @@ class Gem::StubSpecification < Gem::BasicSpecification
'lib' => 'lib'.freeze,
'test' => 'test'.freeze,
'ext' => 'ext'.freeze,
- }
# These are common require path lists. This hash is used to optimize
# and consolidate require_path objects. Most specs just specify "lib"
@@ -30,7 +30,7 @@ class Gem::StubSpecification < Gem::BasicSpecification
# a require path list for that case.
REQUIRE_PATH_LIST = { # :nodoc:
'lib' => ['lib'].freeze
- }
def initialize data, extensions
parts = data[PREFIX.length..-1].split(" ".freeze, 4)
@@ -1540,7 +1540,7 @@ Also, a list:
# :stopdoc:
# only available in RubyGems tests
- PRIVATE_KEY_PASSPHRASE = 'Foo bar'
begin
PRIVATE_KEY = load_key 'private'
@@ -25,17 +25,11 @@ class Gem::FakeFetcher
attr_reader :data
attr_reader :last_request
- attr_reader :api_endpoints
attr_accessor :paths
def initialize
@data = {}
@paths = []
- @api_endpoints = {}
- end
-
- def api_endpoint(uri)
- @api_endpoints[uri] || uri
end
def find_data(path)
@@ -111,14 +105,6 @@ class Gem::FakeFetcher
q.breakable
q.pp @data.keys
-
- unless @api_endpoints.empty? then
- q.breakable
- q.text 'API endpoints:'
-
- q.breakable
- q.pp @api_endpoints.keys
- end
end
end
@@ -73,7 +73,7 @@ module Gem::Text
d[j+1] + 1, # insertion
e + 1, # deletion
d[j] + cost # substitution
- )
d[j] = e
e = x
end
@@ -315,8 +315,8 @@ class Gem::Uninstaller
msg << ''
siblings = Gem::Specification.select do |s|
- s.name == spec.name && s.full_name != spec.full_name
- end
spec.dependent_gems.each do |dep_spec, dep, satlist|
unless siblings.any? { |s| s.satisfies_requirement? dep }
@@ -154,7 +154,7 @@ class Gem::Version
include Comparable
- VERSION_PATTERN = '[0-9]+(?>\.[0-9a-zA-Z]+)*(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?' # :nodoc:
ANCHORED_VERSION_PATTERN = /\A\s*(#{VERSION_PATTERN})?\s*\z/ # :nodoc:
##
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-SIMPLE_GEM = <<-GEMDATA
MD5SUM = "989bf34a1cbecd52e0ea66b662b3a405"
if $0 == __FILE__
require 'optparse'
@@ -14,7 +14,7 @@ end
class TestGem < Gem::TestCase
- PLUGINS_LOADED = []
def setup
super
@@ -1494,7 +1494,7 @@ class TestGem < Gem::TestCase
if Gem::USE_BUNDLER_FOR_GEMDEPS
BUNDLER_LIB_PATH = File.expand_path $LOAD_PATH.find {|lp| File.file?(File.join(lp, "bundler.rb")) }.dup.untaint
- BUNDLER_FULL_NAME = "bundler-#{Bundler::VERSION}"
end
def add_bundler_full_name(names)
@@ -1757,19 +1757,20 @@ class TestGem < Gem::TestCase
else
platform = " #{platform}"
end
- expected = if Gem::USE_BUNDLER_FOR_GEMDEPS
- <<-EXPECTED
Could not find gem 'a#{platform}' in any of the gem sources listed in your Gemfile.
You may need to `gem install -g` to install missing gems
- EXPECTED
- else
- <<-EXPECTED
Unable to resolve dependency: user requested 'a (>= 0)'
You may need to `gem install -g` to install missing gems
- EXPECTED
- end
assert_output nil, expected do
Gem.use_gemdeps
@@ -126,7 +126,7 @@ class TestGemCommandManager < Gem::TestCase
#check settings
check_options = nil
@command_manager.process_args %w[
- install --force --local --rdoc --install-dir .
--version 3.0 --no-wrapper --bindir .
]
assert_equal %w[rdoc ri], check_options[:document].sort
@@ -260,7 +260,7 @@ class TestGemCommandManager < Gem::TestCase
#check settings
check_options = nil
- @command_manager.process_args %w[update --force --rdoc --install-dir .]
assert_includes check_options[:document], 'ri'
assert_equal true, check_options[:force]
assert_equal Dir.pwd, check_options[:install_dir]
@@ -6,6 +6,12 @@ require 'rubygems/package'
class TestGemCommandsBuildCommand < Gem::TestCase
def setup
super
@@ -50,6 +56,32 @@ class TestGemCommandsBuildCommand < Gem::TestCase
util_test_build_gem @gem
end
def test_execute_strict_without_warnings
gemspec_file = File.join(@tempdir, @gem.spec_name)
@@ -221,9 +253,6 @@ class TestGemCommandsBuildCommand < Gem::TestCase
util_test_build_gem @gem
end
- CERT_FILE = cert_path 'public3072'
- SIGNING_KEY = key_path 'private3072'
-
def test_build_signed_gem
skip 'openssl is missing' unless defined?(OpenSSL::SSL)
@@ -251,4 +280,48 @@ class TestGemCommandsBuildCommand < Gem::TestCase
assert gem.verify
end
end
@@ -159,7 +159,7 @@ Added '/CN=alternate/DC=example'
@cmd.handle_options %W[
--days 26
- ]
@build_ui = Gem::MockGemUi.new "#{passphrase}\n#{passphrase}"
@@ -615,6 +615,37 @@ ERROR: --private-key not specified and ~/.gem/gem-private_key.pem does not exis
assert_equal '', @ui.error
end
def test_handle_options
@cmd.handle_options %W[
--add #{PUBLIC_CERT_FILE}
@@ -55,7 +55,7 @@ class TestGemCommandsInstallCommand < Gem::TestCase
a2_pre = specs['a-2.a']
@cmd.handle_options [a2_pre.name, '--version', a2_pre.version.to_s,
- "--no-ri", "--no-rdoc"]
assert @cmd.options[:prerelease]
assert @cmd.options[:version].satisfied_by?(a2_pre.version)
@@ -495,11 +495,13 @@ class TestGemCommandsPristineCommand < Gem::TestCase
@cmd.execute
end
- assert_equal([
- "Restoring gems to pristine condition...",
- "Skipped default-2.0.0.0, it is a default gem",
- ],
- @ui.output.split("\n"))
assert_empty(@ui.error)
end
@@ -10,7 +10,7 @@ class TestGemCommandsSetupCommand < Gem::TestCase
if File.exist?(bundler_gemspec)
BUNDLER_VERS = File.read(bundler_gemspec).match(/VERSION = "(#{Gem::Version::VERSION_PATTERN})"/)[1]
else
- BUNDLER_VERS = "1.16.2"
end
def setup
@@ -44,6 +44,7 @@ class TestGemConfigFile < Gem::TestCase
assert_equal Gem::ConfigFile::DEFAULT_BULK_THRESHOLD, @cfg.bulk_threshold
assert_equal true, @cfg.verbose
assert_equal [@gem_repo], Gem.sources
File.open @temp_conf, 'w' do |fp|
fp.puts ":backtrace: true"
@@ -58,6 +59,7 @@ class TestGemConfigFile < Gem::TestCase
fp.puts "- /var/ruby/1.8/gem_home"
fp.puts ":ssl_verify_mode: 0"
fp.puts ":ssl_ca_cert: /etc/ssl/certs"
end
util_config_file
@@ -71,6 +73,7 @@ class TestGemConfigFile < Gem::TestCase
@cfg.path)
assert_equal 0, @cfg.ssl_verify_mode
assert_equal '/etc/ssl/certs', @cfg.ssl_ca_cert
end
def test_initialize_handle_arguments_config_file
@@ -136,8 +136,8 @@ class TestGemDependencyList < Gem::TestCase
exp = {
"b" => [
- Gem::Dependency.new("a", ">= 1")
- ]
}
assert_equal exp, @deplist.why_not_ok?
@@ -26,7 +26,7 @@ class TestGemExtRakeBuilder < Gem::TestCase
refute_match %r%^rake failed:%, output
assert_match %r%^#{Regexp.escape @@ruby} mkrf_conf\.rb%, output
- assert_match %r%^#{Regexp.escape rake} RUBYARCHDIR=#{Regexp.escape @dest_path} RUBYLIBDIR=#{Regexp.escape @dest_path}%, output
end
end
@@ -47,7 +47,22 @@ class TestGemExtRakeBuilder < Gem::TestCase
refute_match %r%^rake failed:%, output
assert_match %r%^#{Regexp.escape @@ruby} mkrf_conf\.rb%, output
- assert_match %r%^#{Regexp.escape rake} RUBYARCHDIR=#{Regexp.escape @dest_path} RUBYLIBDIR=#{Regexp.escape @dest_path}%, output
end
end
@@ -21,8 +21,7 @@ class TestGemInstallUpdateOptions < Gem::InstallerTestCase
--build-root build_root
--format-exec
--ignore-dependencies
- --rdoc
- --ri
-E
-f
-i /install_to
@@ -92,24 +91,6 @@ class TestGemInstallUpdateOptions < Gem::InstallerTestCase
assert_equal %w[ri], @cmd.options[:document]
end
- def test_rdoc
- @cmd.handle_options %w[--rdoc]
-
- assert_equal %w[rdoc ri], @cmd.options[:document].sort
- end
-
- def test_rdoc_no
- @cmd.handle_options %w[--no-rdoc]
-
- assert_equal %w[ri], @cmd.options[:document]
- end
-
- def test_ri
- @cmd.handle_options %w[--no-ri]
-
- assert_equal %w[], @cmd.options[:document]
- end
-
def test_security_policy
skip 'openssl is missing' unless defined?(OpenSSL::SSL)
@@ -44,10 +44,10 @@ class TestGemPathSupport < Gem::TestCase
assert_equal ENV["GEM_HOME"], ps.home
expected = [
- File.join(@tempdir, 'foo'),
- File.join(@tempdir, 'bar'),
- ENV["GEM_HOME"],
- ]
assert_equal expected, ps.path
end
@@ -63,9 +63,9 @@ class TestGemPathSupport < Gem::TestCase
assert_equal ENV["GEM_HOME"], ps.home
expected = [
- File.join(@tempdir, 'foo'),
- File.join(@tempdir, 'bar'),
- ] + Gem.default_path << ENV["GEM_HOME"]
assert_equal expected, ps.path
end
@@ -81,9 +81,9 @@ class TestGemPathSupport < Gem::TestCase
assert_equal ENV["GEM_HOME"], ps.home
expected = [
- File.join(@tempdir, 'foo'),
- File.join(@tempdir, 'bar'),
- ] + Gem.default_path << ENV["GEM_HOME"]
assert_equal expected, ps.path
end
@@ -35,7 +35,7 @@ class TestGemRemoteFetcher < Gem::TestCase
include Gem::DefaultUserInteraction
- SERVER_DATA = <<-EOY
--- !ruby/object:Gem::Cache
gems:
rake-0.4.11: !ruby/object:Gem::Specification
@@ -185,106 +185,6 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
end
end
- def test_api_endpoint
- uri = URI.parse "http://example.com/foo"
- target = MiniTest::Mock.new
- target.expect :target, "gems.example.com"
-
- dns = MiniTest::Mock.new
- dns.expect :getresource, target, [String, Object]
-
- fetch = Gem::RemoteFetcher.new nil, dns
- assert_equal URI.parse("http://gems.example.com/foo"), fetch.api_endpoint(uri)
-
- target.verify
- dns.verify
- end
-
- def test_api_endpoint_ignores_trans_domain_values
- uri = URI.parse "http://gems.example.com/foo"
- target = MiniTest::Mock.new
- target.expect :target, "blah.com"
-
- dns = MiniTest::Mock.new
- dns.expect :getresource, target, [String, Object]
-
- fetch = Gem::RemoteFetcher.new nil, dns
- assert_equal URI.parse("http://gems.example.com/foo"), fetch.api_endpoint(uri)
-
- target.verify
- dns.verify
- end
-
- def test_api_endpoint_ignores_trans_domain_values_that_starts_with_original
- uri = URI.parse "http://example.com/foo"
- target = MiniTest::Mock.new
- target.expect :target, "example.combadguy.com"
-
- dns = MiniTest::Mock.new
- dns.expect :getresource, target, [String, Object]
-
- fetch = Gem::RemoteFetcher.new nil, dns
- assert_equal URI.parse("http://example.com/foo"), fetch.api_endpoint(uri)
-
- target.verify
- dns.verify
- end
-
- def test_api_endpoint_ignores_trans_domain_values_that_end_with_original
- uri = URI.parse "http://example.com/foo"
- target = MiniTest::Mock.new
- target.expect :target, "badexample.com"
-
- dns = MiniTest::Mock.new
- dns.expect :getresource, target, [String, Object]
-
- fetch = Gem::RemoteFetcher.new nil, dns
- assert_equal URI.parse("http://example.com/foo"), fetch.api_endpoint(uri)
-
- target.verify
- dns.verify
- end
-
- def test_api_endpoint_ignores_trans_domain_values_that_end_with_original_in_path
- uri = URI.parse "http://example.com/foo"
- target = MiniTest::Mock.new
- target.expect :target, "evil.com/a.example.com"
-
- dns = MiniTest::Mock.new
- dns.expect :getresource, target, [String, Object]
-
- fetch = Gem::RemoteFetcher.new nil, dns
- assert_equal URI.parse("http://example.com/foo"), fetch.api_endpoint(uri)
-
- target.verify
- dns.verify
- end
-
- def test_api_endpoint_timeout_warning
- uri = URI.parse "http://gems.example.com/foo"
-
- dns = MiniTest::Mock.new
- def dns.getresource arg, *rest
- raise Resolv::ResolvError.new('timeout!')
- end
-
- fetch = Gem::RemoteFetcher.new nil, dns
- begin
- old_verbose, Gem.configuration.verbose = Gem.configuration.verbose, 1
- endpoint = use_ui @stub_ui do
- fetch.api_endpoint(uri)
- end
- ensure
- Gem.configuration.verbose = old_verbose
- end
-
- assert_equal uri, endpoint
-
- assert_equal "Getting SRV record failed: timeout!\n", @stub_ui.output
-
- dns.verify
- end
-
def test_cache_update_path
uri = URI 'http://example/file'
path = File.join @tempdir, 'file'
@@ -1064,7 +964,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
:DocumentRoot => nil,
:Logger => null_logger,
:AccessLog => null_logger
- )
s.mount_proc("/kill") { |req, res| s.shutdown }
s.mount_proc("/yaml") { |req, res|
if req["X-Captain"]
@@ -36,18 +36,6 @@ class TestGemSource < Gem::TestCase
assert_equal repository, source.uri
end
- def test_api_uri
- assert_equal @source.api_uri, @source.uri
- end
-
- def test_api_uri_resolved_from_remote_fetcher
- uri = URI.parse "http://gem.example/foo"
- @fetcher.api_endpoints[uri] = URI.parse "http://api.blah"
-
- src = Gem::Source.new uri
- assert_equal URI.parse("http://api.blah"), src.api_uri
- end
-
def test_cache_dir_escapes_windows_paths
uri = URI.parse("file:///C:/WINDOWS/Temp/gem_repo")
root = Gem.spec_cache_dir
@@ -9,7 +9,7 @@ require 'rubygems/installer'
class TestGemSpecification < Gem::TestCase
- LEGACY_YAML_SPEC = <<-EOF
--- !ruby/object:Gem::Specification
rubygems_version: "1.0"
name: keyedlist
@@ -28,7 +28,7 @@ email: [email protected]
has_rdoc: true
EOF
- LEGACY_RUBY_SPEC = <<-EOF
Gem::Specification.new do |s|
s.name = %q{keyedlist}
s.version = %q{0.4.0}
@@ -3428,10 +3428,10 @@ Did you mean 'Ruby'?
end
expected = %W[
- a-2
- a-2-x86-my_platform-1
- a-3-x86-other_platform-1
- ]
latest_specs = Gem::Specification.latest_specs.map(&:full_name).sort
@@ -5,7 +5,8 @@ require 'rubygems/util'
class TestGemUtil < Gem::TestCase
def test_class_popen
- assert_equal "0\n", Gem::Util.popen(Gem.ruby, '-e', 'p 0')
assert_raises Errno::ECHILD do
Process.wait(-1)
@@ -14,7 +15,7 @@ class TestGemUtil < Gem::TestCase
def test_silent_system
assert_silent do
- Gem::Util.silent_system Gem.ruby, '-e', 'puts "hello"; warn "hello"'
end
end