Skip to content

Commit 7b38343

Browse files
committed
* lib/rubygems: RubyGems 2.2.2 which contains the following bug fixes:
http://rubygems.rubyforge.org/rubygems-update/History_txt.html#label-2.2.2+%2F+2014-02-05 https://bugs.ruby-lang.org/issues/9489 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@44858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent c464602 commit 7b38343

64 files changed

Lines changed: 927 additions & 292 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Thu Feb 6 11:27:39 2014 Eric Hodel <drbrain@segment7.net>
2+
3+
* lib/rubygems: RubyGems 2.2.2 which contains the following bug fixes:
4+
http://rubygems.rubyforge.org/rubygems-update/History_txt.html#label-2.2.2+%2F+2014-02-05
5+
https://bugs.ruby-lang.org/issues/9489
6+
17
Thu Feb 6 11:23:59 2014 Koichi Sasada <ko1@atdot.net>
28

39
* gc.c (ruby_gc_set_params): if RUBY_GC_OLDMALLOC_LIMIT is provided,

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ 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.2. Fixes some minor bugs and performance regressions.
280+
279281
For a complete list of enhancements and bug fixes see:
280282
https://github.com/rubygems/rubygems/tree/master/History.txt
281283

lib/rubygems.rb

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

1010
module Gem
11-
VERSION = '2.2.0'
11+
VERSION = '2.2.2'
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 ConfigMap[:sitelibdir]
575+
index = $LOAD_PATH.index RbConfig::CONFIG['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(ConfigMap[:sitelibdir]) and
747-
prefix != File.expand_path(ConfigMap[:libdir]) and
746+
if prefix != File.expand_path(RbConfig::CONFIG['sitelibdir']) and
747+
prefix != File.expand_path(RbConfig::CONFIG['libdir']) and
748748
'lib' == File.basename(RUBYGEMS_DIR) then
749749
prefix
750750
end
@@ -765,15 +765,19 @@ 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
768772
end
769773

770774
##
771775
# The path to the running Ruby interpreter.
772776

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

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

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

792795
##

lib/rubygems/available_set.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ class Gem::AvailableSet
44

55
Tuple = Struct.new(:spec, :source)
66

7+
attr_accessor :remote # :nodoc:
8+
79
def initialize
810
@set = []
911
@sorted = nil
12+
@remote = true
1013
end
1114

1215
attr_reader :set

lib/rubygems/basic_specification.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,24 @@ 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+
209227
##
210228
# Return a Gem::Specification from this gem
211229

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-
[Gem::ConfigMap[:bindir], $POSTMATCH]
97+
[RbConfig::CONFIG['bindir'], $POSTMATCH]
9898
when /\.so\z/
99-
[Gem::ConfigMap[:archdir], file]
99+
[RbConfig::CONFIG['archdir'], file]
100100
else
101-
[Gem::ConfigMap[:rubylibdir], file]
101+
[RbConfig::CONFIG['rubylibdir'], file]
102102
end
103103
end
104104
end

lib/rubygems/commands/generate_index_command.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def description # :nodoc:
6262
end
6363

6464
def execute
65-
# This is always true becasue it's the only way now.
65+
# This is always true because it's the only way now.
6666
options[:build_modern] = true
6767

6868
if not File.exist?(options[:directory]) or

lib/rubygems/commands/install_command.rb

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

231-
if remote? then
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
232243
dependency = Gem::Dependency.new name, req
233244
dependency.prerelease = options[:prerelease]
234245

235246
fetcher = Gem::RemoteFetcher.fetcher
236247
gem = fetcher.download_to_cache dependency
237248
end
238249

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-
246250
inst = Gem::Installer.new gem, options
247251
inst.install
248252

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 = Gem::ConfigMap[site_or_vendor]
347-
bin_dir = Gem::ConfigMap[:bindir]
346+
lib_dir = RbConfig::CONFIG[site_or_vendor]
347+
bin_dir = RbConfig::CONFIG['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 == Gem::ConfigMap[:libdir] or
354+
(prefix == RbConfig::CONFIG['libdir'] or
355355
# this one is important
356-
prefix == File.join(Gem::ConfigMap[:libdir], 'ruby')) then
357-
lib_dir = Gem::ConfigMap[site_or_vendor]
358-
bin_dir = Gem::ConfigMap[:bindir]
356+
prefix == File.join(RbConfig::CONFIG['libdir'], 'ruby')) then
357+
lib_dir = RbConfig::CONFIG[site_or_vendor]
358+
bin_dir = RbConfig::CONFIG['bindir']
359359
else
360360
lib_dir = File.join prefix, 'lib'
361361
bin_dir = File.join prefix, 'bin'

lib/rubygems/compatibility.rb

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

36+
# TODO remove at RubyGems 3
37+
3638
RbConfigPriorities = %w[
3739
MAJOR
3840
MINOR
@@ -45,7 +47,7 @@ module Gem
4547
unless defined?(ConfigMap)
4648
##
4749
# Configuration settings from ::RbConfig
48-
ConfigMap = Hash.new do |cm, key|
50+
ConfigMap = Hash.new do |cm, key| # TODO remove at RubyGems 3
4951
cm[key] = RbConfig::CONFIG[key.to_s]
5052
end
5153
else

0 commit comments

Comments
 (0)