Skip to content

Commit ad5dc28

Browse files
committed
Revert r44778 ruby#9375
It breaks test-all if all tests are in a single process git-svn-id: svn+ssh://svn.ruby-lang.org/ruby/branches/ruby_2_1@44786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 905fb0d commit ad5dc28

30 files changed

Lines changed: 163 additions & 256 deletions

ChangeLog

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
Fri Jan 31 18:13:43 2014 Eric Hodel <drbrain@segment7.net>
2-
3-
* lib/rubygems: Update to RubyGems master 21e409d / RubyGems 2.2.1.
4-
5-
See http://rubygems.rubyforge.org/rubygems-update/History_txt.html
6-
for a list of bug fixes.
7-
8-
* test/rubygems: ditto.
9-
101
Fri Jan 31 12:10:16 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
112

123
* proc.c (mnew_from_me): keep iclass as-is, to make inheritance

NEWS

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,6 @@ String
276276
* Improved, iterative resolver (compared to RubyGems 2.1 and earlier)
277277
* Support for a sharing a GEM_HOME across ruby platforms and versions
278278

279-
* Updated to 2.2.1. Fixes some minor bugs and performance regressions.
280-
281279
For a complete list of enhancements and bug fixes see:
282280
https://github.com/rubygems/rubygems/tree/master/History.txt
283281

lib/rubygems.rb

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
require 'rbconfig'
99

1010
module Gem
11-
VERSION = '2.2.1'
11+
VERSION = '2.2.0'
1212
end
1313

1414
# Must be first since it unloads the prelude from 1.9.2
@@ -572,7 +572,7 @@ def self.host= host
572572
# gem's paths are inserted before site lib directory by default.
573573

574574
def self.load_path_insert_index
575-
index = $LOAD_PATH.index RbConfig::CONFIG['sitelibdir']
575+
index = $LOAD_PATH.index ConfigMap[:sitelibdir]
576576

577577
index
578578
end
@@ -743,8 +743,8 @@ def self.pre_uninstall(&hook)
743743
def self.prefix
744744
prefix = File.dirname RUBYGEMS_DIR
745745

746-
if prefix != File.expand_path(RbConfig::CONFIG['sitelibdir']) and
747-
prefix != File.expand_path(RbConfig::CONFIG['libdir']) and
746+
if prefix != File.expand_path(ConfigMap[:sitelibdir]) and
747+
prefix != File.expand_path(ConfigMap[:libdir]) and
748748
'lib' == File.basename(RUBYGEMS_DIR) then
749749
prefix
750750
end
@@ -765,19 +765,15 @@ def self.read_binary(path)
765765
f.flock(File::LOCK_EX)
766766
f.read
767767
end
768-
rescue Errno::EACCES
769-
open path, 'rb' do |f|
770-
f.read
771-
end
772768
end
773769

774770
##
775771
# The path to the running Ruby interpreter.
776772

777773
def self.ruby
778774
if @ruby.nil? then
779-
@ruby = File.join(RbConfig::CONFIG['bindir'],
780-
"#{RbConfig::CONFIG['ruby_install_name']}#{RbConfig::CONFIG['EXEEXT']}")
775+
@ruby = File.join(ConfigMap[:bindir],
776+
"#{ConfigMap[:ruby_install_name]}#{ConfigMap[:EXEEXT]}")
781777

782778
@ruby = "\"#{@ruby}\"" if @ruby =~ /\s/
783779
end
@@ -789,7 +785,8 @@ def self.ruby
789785
# Returns a String containing the API compatibility version of Ruby
790786

791787
def self.ruby_api_version
792-
@ruby_api_version ||= RbConfig::CONFIG['ruby_version'].dup
788+
@ruby_api_version ||=
789+
"#{ConfigMap[:MAJOR]}.#{ConfigMap[:MINOR]}.#{ConfigMap[:TEENY]}"
793790
end
794791

795792
##

lib/rubygems/basic_specification.rb

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -206,24 +206,6 @@ def require_paths
206206
[relative_extension_dir].concat @require_paths
207207
end
208208

209-
##
210-
# Returns the paths to the source files for use with analysis and
211-
# documentation tools. These paths are relative to full_gem_path.
212-
213-
def source_paths
214-
paths = raw_require_paths.dup
215-
216-
if @extensions then
217-
ext_dirs = @extensions.map do |extension|
218-
extension.split(File::SEPARATOR, 2).first
219-
end.uniq
220-
221-
paths.concat ext_dirs
222-
end
223-
224-
paths.uniq
225-
end
226-
227209
##
228210
# Return a Gem::Specification from this gem
229211

lib/rubygems/commands/contents_command.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ def files_in_default_gem spec
9494
spec.files.sort.map do |file|
9595
case file
9696
when /\A#{spec.bindir}\//
97-
[RbConfig::CONFIG['bindir'], $POSTMATCH]
97+
[Gem::ConfigMap[:bindir], $POSTMATCH]
9898
when /\.so\z/
99-
[RbConfig::CONFIG['archdir'], file]
99+
[Gem::ConfigMap[:archdir], file]
100100
else
101-
[RbConfig::CONFIG['rubylibdir'], file]
101+
[Gem::ConfigMap[:rubylibdir], file]
102102
end
103103
end
104104
end

lib/rubygems/commands/install_command.rb

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -228,25 +228,21 @@ def install_gem name, version # :nodoc:
228228
def install_gem_without_dependencies name, req # :nodoc:
229229
gem = nil
230230

231-
if local? then
232-
if name =~ /\.gem$/ and File.file? name then
233-
source = Gem::Source::SpecificFile.new name
234-
spec = source.spec
235-
else
236-
source = Gem::Source::Local.new
237-
spec = source.find_gem name, req
238-
end
239-
gem = source.download spec if spec
240-
end
241-
242-
if remote? and not gem then
231+
if remote? then
243232
dependency = Gem::Dependency.new name, req
244233
dependency.prerelease = options[:prerelease]
245234

246235
fetcher = Gem::RemoteFetcher.fetcher
247236
gem = fetcher.download_to_cache dependency
248237
end
249238

239+
if local? and not gem then
240+
source = Gem::Source::Local.new
241+
spec = source.find_gem name, req
242+
243+
gem = source.download spec
244+
end
245+
250246
inst = Gem::Installer.new gem, options
251247
inst.install
252248

lib/rubygems/commands/setup_command.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def initialize
1313

1414
super 'setup', 'Install RubyGems',
1515
:format_executable => true, :document => %w[ri],
16-
:site_or_vendor => 'sitelibdir',
16+
:site_or_vendor => :sitelibdir,
1717
:destdir => '', :prefix => '', :previous_version => ''
1818

1919
add_option '--previous-version=VERSION',
@@ -36,7 +36,7 @@ def initialize
3636

3737
add_option '--[no-]vendor',
3838
'Install into vendorlibdir not sitelibdir' do |vendor, options|
39-
options[:site_or_vendor] = vendor ? 'vendorlibdir' : 'sitelibdir'
39+
options[:site_or_vendor] = vendor ? :vendorlibdir : :sitelibdir
4040
end
4141

4242
add_option '--[no-]format-executable',
@@ -343,19 +343,19 @@ def generate_default_dirs(install_destdir)
343343
site_or_vendor = options[:site_or_vendor]
344344

345345
if prefix.empty? then
346-
lib_dir = RbConfig::CONFIG[site_or_vendor]
347-
bin_dir = RbConfig::CONFIG['bindir']
346+
lib_dir = Gem::ConfigMap[site_or_vendor]
347+
bin_dir = Gem::ConfigMap[:bindir]
348348
else
349349
# Apple installed RubyGems into libdir, and RubyGems <= 1.1.0 gets
350350
# confused about installation location, so switch back to
351351
# sitelibdir/vendorlibdir.
352352
if defined?(APPLE_GEM_HOME) and
353353
# just in case Apple and RubyGems don't get this patched up proper.
354-
(prefix == RbConfig::CONFIG['libdir'] or
354+
(prefix == Gem::ConfigMap[:libdir] or
355355
# this one is important
356-
prefix == File.join(RbConfig::CONFIG['libdir'], 'ruby')) then
357-
lib_dir = RbConfig::CONFIG[site_or_vendor]
358-
bin_dir = RbConfig::CONFIG['bindir']
356+
prefix == File.join(Gem::ConfigMap[:libdir], 'ruby')) then
357+
lib_dir = Gem::ConfigMap[site_or_vendor]
358+
bin_dir = Gem::ConfigMap[:bindir]
359359
else
360360
lib_dir = File.join prefix, 'lib'
361361
bin_dir = File.join prefix, 'bin'

lib/rubygems/compatibility.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ class << Gem
3333
module Gem
3434
RubyGemsVersion = VERSION
3535

36-
# TODO remove at RubyGems 3
37-
3836
RbConfigPriorities = %w[
3937
MAJOR
4038
MINOR
@@ -47,7 +45,7 @@ module Gem
4745
unless defined?(ConfigMap)
4846
##
4947
# Configuration settings from ::RbConfig
50-
ConfigMap = Hash.new do |cm, key| # TODO remove at RubyGems 3
48+
ConfigMap = Hash.new do |cm, key|
5149
cm[key] = RbConfig::CONFIG[key.to_s]
5250
end
5351
else

lib/rubygems/defaults.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,22 @@ def self.default_spec_cache_dir
2929
def self.default_dir
3030
path = if defined? RUBY_FRAMEWORK_VERSION then
3131
[
32-
File.dirname(RbConfig::CONFIG['sitedir']),
32+
File.dirname(ConfigMap[:sitedir]),
3333
'Gems',
34-
RbConfig::CONFIG['ruby_version']
34+
ConfigMap[:ruby_version]
3535
]
36-
elsif RbConfig::CONFIG['rubylibprefix'] then
36+
elsif ConfigMap[:rubylibprefix] then
3737
[
38-
RbConfig::CONFIG['rubylibprefix'],
38+
ConfigMap[:rubylibprefix],
3939
'gems',
40-
RbConfig::CONFIG['ruby_version']
40+
ConfigMap[:ruby_version]
4141
]
4242
else
4343
[
44-
RbConfig::CONFIG['libdir'],
44+
ConfigMap[:libdir],
4545
ruby_engine,
4646
'gems',
47-
RbConfig::CONFIG['ruby_version']
47+
ConfigMap[:ruby_version]
4848
]
4949
end
5050

@@ -74,7 +74,7 @@ def self.default_rubygems_dirs
7474

7575
def self.user_dir
7676
parts = [Gem.user_home, '.gem', ruby_engine]
77-
parts << RbConfig::CONFIG['ruby_version'] unless RbConfig::CONFIG['ruby_version'].empty?
77+
parts << ConfigMap[:ruby_version] unless ConfigMap[:ruby_version].empty?
7878
File.join parts
7979
end
8080

@@ -100,7 +100,7 @@ def self.default_path
100100
# Deduce Ruby's --program-prefix and --program-suffix from its install name
101101

102102
def self.default_exec_format
103-
exec_format = RbConfig::CONFIG['ruby_install_name'].sub('ruby', '%s') rescue '%s'
103+
exec_format = ConfigMap[:ruby_install_name].sub('ruby', '%s') rescue '%s'
104104

105105
unless exec_format =~ /%s/ then
106106
raise Gem::Exception,
@@ -117,7 +117,7 @@ def self.default_bindir
117117
if defined? RUBY_FRAMEWORK_VERSION then # mac framework support
118118
'/usr/bin'
119119
else # generic install
120-
RbConfig::CONFIG['bindir']
120+
ConfigMap[:bindir]
121121
end
122122
end
123123

lib/rubygems/deprecate.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def deprecate name, repl, year, month
5050
class_eval {
5151
old = "_deprecated_#{name}"
5252
alias_method old, name
53-
define_method name do |*args, &block|
53+
define_method name do |*args, &block| # TODO: really works on 1.8.7?
5454
klass = self.kind_of? Module
5555
target = klass ? "#{self}." : "#{self.class}#"
5656
msg = [ "NOTE: #{target}#{name} is deprecated",

0 commit comments

Comments
 (0)