rubygems-update 2.7.4 → 2.7.5

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rubygems-update might be problematic. Click here for more details.

Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +5 -8
  3. data/Manifest.txt +2 -1
  4. data/Rakefile +7 -0
  5. data/bundler/CHANGELOG.md +13 -0
  6. data/bundler/bundler.gemspec +2 -0
  7. data/bundler/lib/bundler/cli/gem.rb +1 -1
  8. data/bundler/lib/bundler/cli/init.rb +1 -5
  9. data/bundler/lib/bundler/cli/update.rb +3 -1
  10. data/bundler/lib/bundler/definition.rb +1 -1
  11. data/bundler/lib/bundler/resolver.rb +4 -1
  12. data/bundler/lib/bundler/source/rubygems.rb +2 -4
  13. data/bundler/lib/bundler/templates/.document +1 -0
  14. data/bundler/lib/bundler/templates/Executable +11 -3
  15. data/bundler/lib/bundler/templates/newgem/{.travis.yml.tt → travis.yml.tt} +0 -0
  16. data/bundler/lib/bundler/version.rb +1 -1
  17. data/lib/rubygems.rb +5 -5
  18. data/lib/rubygems/commands/generate_index_command.rb +1 -1
  19. data/lib/rubygems/commands/setup_command.rb +12 -6
  20. data/lib/rubygems/commands/unpack_command.rb +2 -2
  21. data/lib/rubygems/config_file.rb +1 -1
  22. data/lib/rubygems/ext/builder.rb +1 -1
  23. data/lib/rubygems/indexer.rb +5 -4
  24. data/lib/rubygems/installer.rb +9 -4
  25. data/lib/rubygems/package.rb +2 -2
  26. data/lib/rubygems/package/file_source.rb +2 -2
  27. data/lib/rubygems/package/old.rb +1 -1
  28. data/lib/rubygems/request_set/lockfile.rb +1 -1
  29. data/lib/rubygems/security.rb +1 -1
  30. data/lib/rubygems/security/trust_dir.rb +1 -1
  31. data/lib/rubygems/source.rb +1 -1
  32. data/lib/rubygems/specification.rb +4 -0
  33. data/lib/rubygems/stub_specification.rb +2 -0
  34. data/lib/rubygems/test_case.rb +14 -8
  35. data/lib/rubygems/test_utilities.rb +1 -1
  36. data/lib/rubygems/util.rb +2 -1
  37. data/lib/rubygems/validator.rb +3 -3
  38. data/test/rubygems/test_gem.rb +17 -14
  39. data/test/rubygems/test_gem_commands_cleanup_command.rb +1 -1
  40. data/test/rubygems/test_gem_commands_install_command.rb +1 -0
  41. data/test/rubygems/test_gem_commands_push_command.rb +5 -5
  42. data/test/rubygems/test_gem_commands_setup_command.rb +20 -20
  43. data/test/rubygems/test_gem_commands_uninstall_command.rb +2 -2
  44. data/test/rubygems/test_gem_dependency_installer.rb +1 -1
  45. data/test/rubygems/test_gem_doctor.rb +2 -2
  46. data/test/rubygems/test_gem_ext_builder.rb +6 -6
  47. data/test/rubygems/test_gem_gemcutter_utilities.rb +4 -4
  48. data/test/rubygems/test_gem_indexer.rb +1 -2
  49. data/test/rubygems/test_gem_install_update_options.rb +2 -0
  50. data/test/rubygems/test_gem_installer.rb +5 -1
  51. data/test/rubygems/test_gem_package.rb +15 -15
  52. data/test/rubygems/test_gem_package_old.rb +1 -1
  53. data/test/rubygems/test_gem_rdoc.rb +2 -0
  54. data/test/rubygems/test_gem_remote_fetcher.rb +1 -1
  55. data/test/rubygems/test_gem_request_connection_pools.rb +6 -7
  56. data/test/rubygems/test_gem_request_set.rb +7 -7
  57. data/test/rubygems/test_gem_request_set_lockfile.rb +4 -4
  58. data/test/rubygems/test_gem_request_set_lockfile_parser.rb +1 -1
  59. data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +1 -1
  60. data/test/rubygems/test_gem_resolver_git_specification.rb +1 -1
  61. data/test/rubygems/test_gem_server.rb +4 -4
  62. data/test/rubygems/test_gem_source.rb +3 -3
  63. data/test/rubygems/test_gem_source_git.rb +1 -1
  64. data/test/rubygems/test_gem_specification.rb +21 -17
  65. data/test/rubygems/test_gem_stub_specification.rb +7 -7
  66. data/test/rubygems/test_gem_util.rb +23 -0
  67. data/test/rubygems/test_gem_version.rb +11 -0
  68. data/test/rubygems/test_require.rb +15 -21
  69. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2fd65b08de35370803c876822126dbfa9022a6702679170bb7b0438d2fa2e6c9
4
- data.tar.gz: f3a0661f0e4df43931639f54ed9b27fe1c25d358f1fe336dfec1f836188a4887
3
+ metadata.gz: 95086df533cd20a4f5f170842e369a7a883a80653b84ff3398adffc7514299c5
4
+ data.tar.gz: c21e484af79d93bb72757b37903e990081436482f00cd63bd4b941699ba5eb88
5
5
  SHA512:
6
- metadata.gz: 65f66d7f93527f0bc04a19d788a7aeb43488348951b6d507f31dfbb97d80bba52a0c9dfc6eda7e8d4a1906ce2b39ed1d1182bc9e16031cf40d89e3ae2591dc14
7
- data.tar.gz: 8d069f6b20f3210fe3332343077b5cba38df8c601599479ad82f79075f6d132ce040163286a5588222b6b6b8c37a234d9eac9411e3734a6166033954f8b4b957
6
+ metadata.gz: 1a5b15531e1362e6f141956de530d446fc9c013b59e67573a6d3ada5630e67f90c8d6b732d1895ec0bc4233a292fc1316028049dee4dc1fe947034fe531ebf9b
7
+ data.tar.gz: 82ee7c7338628277e6127faeac9043b19bae6b57dee39dd48c8137f1c954866a6a6e43f6e44fbfa2428f86efe1d0d24ba724fa4f188ae4383117a3388beae171
data/.travis.yml CHANGED
@@ -21,6 +21,7 @@ rvm:
21
21
  - 2.2.9
22
22
  - 2.3.6
23
23
  - 2.4.3
24
+ - 2.5.0
24
25
  - ruby-head
25
26
  env:
26
27
  - "TEST_TOOL=rubygems YAML=syck"
@@ -44,15 +45,11 @@ matrix:
44
45
  env: "TEST_TOOL=rubygems YAML=syck"
45
46
  - rvm: 2.4.3
46
47
  env: "TEST_TOOL=rubygems YAML=syck"
48
+ - rvm: 2.5.0
49
+ env: "TEST_TOOL=rubygems YAML=syck"
47
50
  - rvm: ruby-head
48
51
  env: "TEST_TOOL=rubygems YAML=syck"
49
52
  allow_failures:
50
- - rvm: 1.8.7
51
- env: "TEST_TOOL=bundler RGV=master"
52
- - rvm: 1.9.3
53
- env: "TEST_TOOL=bundler RGV=master"
54
- - rvm: 2.0.0
55
- env: "TEST_TOOL=bundler RGV=master"
56
- - rvm: 2.1.10
57
- env: "TEST_TOOL=bundler RGV=master"
58
53
  - rvm: ruby-head
54
+ - rvm: 2.5.0
55
+ env: "TEST_TOOL=rubygems YAML=psych"
data/Manifest.txt CHANGED
@@ -144,12 +144,12 @@ bundler/lib/bundler/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem
144
144
  bundler/lib/bundler/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem
145
145
  bundler/lib/bundler/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem
146
146
  bundler/lib/bundler/stub_specification.rb
147
+ bundler/lib/bundler/templates/.document
147
148
  bundler/lib/bundler/templates/Executable
148
149
  bundler/lib/bundler/templates/Executable.bundler
149
150
  bundler/lib/bundler/templates/Executable.standalone
150
151
  bundler/lib/bundler/templates/Gemfile
151
152
  bundler/lib/bundler/templates/gems.rb
152
- bundler/lib/bundler/templates/newgem/.travis.yml.tt
153
153
  bundler/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt
154
154
  bundler/lib/bundler/templates/newgem/Gemfile.tt
155
155
  bundler/lib/bundler/templates/newgem/LICENSE.txt.tt
@@ -170,6 +170,7 @@ bundler/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt
170
170
  bundler/lib/bundler/templates/newgem/spec/spec_helper.rb.tt
171
171
  bundler/lib/bundler/templates/newgem/test/newgem_test.rb.tt
172
172
  bundler/lib/bundler/templates/newgem/test/test_helper.rb.tt
173
+ bundler/lib/bundler/templates/newgem/travis.yml.tt
173
174
  bundler/lib/bundler/ui.rb
174
175
  bundler/lib/bundler/ui/rg_proxy.rb
175
176
  bundler/lib/bundler/ui/shell.rb
data/Rakefile CHANGED
@@ -103,6 +103,13 @@ hoe.testlib = :minitest
103
103
  hoe.test_prelude = <<-RUBY.gsub("\n", ";")
104
104
  gem "minitest", "~> 4.0"
105
105
  $:.unshift #{File.expand_path("../bundler/lib", __FILE__).dump}
106
+ if "1.8" < RUBY_VERSION && RUBY_VERSION < "2.2"
107
+ module Gem
108
+ @path_to_default_spec_map.delete_if do |_path, spec|
109
+ spec.name == "bundler"
110
+ end
111
+ end
112
+ end
106
113
  RUBY
107
114
 
108
115
  Rake::Task['docs'].clear
data/bundler/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ ## 1.16.1 (2017-12-12)
2
+
3
+ Bugfixes:
4
+
5
+ - avoid hanging on complex resolver errors ([#6114](https://github.com/bundler/bundler/issues/6114), @halfbyte)
6
+ - avoid an error when running `bundle update --group` ([#6156](https://github.com/bundler/bundler/issues/6156), @mattbrictson)
7
+ - ensure the resolver prefers non-pre-release gems when possible ([#6181](https://github.com/bundler/bundler/issues/6181), @greysteil)
8
+ - include bundler's gemspec in the built gem ([#6165](https://github.com/bundler/bundler/issues/6165), @dr-itz)
9
+ - ensure locally installed specs are not overriden by those in remote sources during dependency resolution ([#6072](https://github.com/bundler/bundler/issues/6072), @indirect)
10
+ - ensure custom gemfiles are respected in generated binstubs (@pftg)
11
+ - fail gracefully when loading a bundler-generated binstub when `bin/bundle` was not generated by bundler ([#6149](https://github.com/bundler/bundler/issues/6149), @hsbt)
12
+ - allow `bundle init` to be run even when a parent directory contains a gemfile ([#6205](https://github.com/bundler/bundler/issues/6205), @colby-swandale)
13
+
1
14
  ## 1.16.0 (2017-10-31)
2
15
 
3
16
  Bugfixes:
@@ -48,6 +48,8 @@ Gem::Specification.new do |s|
48
48
  s.files += Dir.glob("man/**/*")
49
49
  # Include the CHANGELOG.md, LICENSE.md, README.md manually
50
50
  s.files += %w[CHANGELOG.md LICENSE.md README.md]
51
+ # include the gemspec itself because warbler breaks w/o it
52
+ s.files += %w[bundler.gemspec]
51
53
 
52
54
  s.bindir = "exe"
53
55
  s.executables = %w[bundle bundler]
@@ -83,7 +83,7 @@ module Bundler
83
83
  config[:test] = test_framework
84
84
  config[:test_framework_version] = TEST_FRAMEWORK_VERSIONS[test_framework]
85
85
 
86
- templates.merge!(".travis.yml.tt" => ".travis.yml")
86
+ templates.merge!("travis.yml.tt" => ".travis.yml")
87
87
 
88
88
  case test_framework
89
89
  when "rspec"
@@ -36,11 +36,7 @@ module Bundler
36
36
  private
37
37
 
38
38
  def gemfile
39
- @gemfile ||= begin
40
- Bundler.default_gemfile
41
- rescue GemfileNotFound
42
- Bundler.feature_flag.init_gems_rb? ? "gems.rb" : "Gemfile"
43
- end
39
+ @gemfile ||= Bundler.feature_flag.init_gems_rb? ? "gems.rb" : "Gemfile"
44
40
  end
45
41
  end
46
42
  end
@@ -68,7 +68,9 @@ module Bundler
68
68
 
69
69
  if locked_gems = Bundler.definition.locked_gems
70
70
  gems.each do |name|
71
- locked_version = locked_gems.specs.find {|s| s.name == name }.version
71
+ locked_version = locked_gems.specs.find {|s| s.name == name }
72
+ locked_version &&= locked_version.version
73
+ next unless locked_version
72
74
  new_version = Bundler.definition.specs[name].first
73
75
  new_version &&= new_version.version
74
76
  if !new_version
@@ -295,7 +295,7 @@ module Bundler
295
295
  end
296
296
 
297
297
  sources.all_sources.each do |source|
298
- source.double_check_for(unmet_dependency_names, :override_dupes)
298
+ source.double_check_for(unmet_dependency_names)
299
299
  end
300
300
 
301
301
  break if idxcount == idx.size
@@ -245,7 +245,8 @@ module Bundler
245
245
  if all <= 1
246
246
  all - 1_000_000
247
247
  else
248
- search = search_for(dependency).size
248
+ search = search_for(dependency)
249
+ search = @prerelease_specified[dependency.name] ? search.count : search.count {|s| !s.version.prerelease? }
249
250
  search - all
250
251
  end
251
252
  end
@@ -305,6 +306,8 @@ module Bundler
305
306
  :solver_name => "Bundler",
306
307
  :possibility_type => "gem",
307
308
  :reduce_trees => lambda do |trees|
309
+ # bail out if tree size is too big for Array#combination to make any sense
310
+ return trees if trees.size > 15
308
311
  maximal = 1.upto(trees.size).map do |size|
309
312
  trees.map(&:last).flatten(1).combination(size).to_a
310
313
  end.flatten(1).select do |deps|
@@ -252,10 +252,8 @@ module Bundler
252
252
  end
253
253
  end
254
254
 
255
- def double_check_for(unmet_dependency_names, override_dupes = false, index = specs)
255
+ def double_check_for(unmet_dependency_names)
256
256
  return unless @allow_remote
257
- raise ArgumentError, "missing index" unless index
258
-
259
257
  return unless api_fetchers.any?
260
258
 
261
259
  unmet_dependency_names = unmet_dependency_names.call
@@ -270,7 +268,7 @@ module Bundler
270
268
 
271
269
  Bundler.ui.debug "Double checking for #{unmet_dependency_names || "all specs (due to the size of the request)"} in #{self}"
272
270
 
273
- fetch_names(api_fetchers, unmet_dependency_names, index, override_dupes)
271
+ fetch_names(api_fetchers, unmet_dependency_names, specs, false)
274
272
  end
275
273
 
276
274
  def dependency_names_to_double_check
@@ -0,0 +1 @@
1
+ # Ignore all files in this directory
@@ -8,13 +8,21 @@
8
8
  # this file is here to facilitate running it.
9
9
  #
10
10
 
11
- bundle_binstub = File.expand_path("../bundle", __FILE__)
12
- load(bundle_binstub) if File.file?(bundle_binstub)
13
-
14
11
  require "pathname"
15
12
  ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../<%= relative_gemfile_path %>",
16
13
  Pathname.new(__FILE__).realpath)
17
14
 
15
+ bundle_binstub = File.expand_path("../bundle", __FILE__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
18
26
  require "rubygems"
19
27
  require "bundler/setup"
20
28
 
@@ -7,7 +7,7 @@ module Bundler
7
7
  # We're doing this because we might write tests that deal
8
8
  # with other versions of bundler and we are unsure how to
9
9
  # handle this better.
10
- VERSION = "1.16.0" unless defined?(::Bundler::VERSION)
10
+ VERSION = "1.16.1" unless defined?(::Bundler::VERSION)
11
11
 
12
12
  def self.overwrite_loaded_gem_version
13
13
  begin
data/lib/rubygems.rb CHANGED
@@ -10,7 +10,7 @@ require 'rbconfig'
10
10
  require 'thread'
11
11
 
12
12
  module Gem
13
- VERSION = "2.7.4"
13
+ VERSION = "2.7.5"
14
14
  end
15
15
 
16
16
  # Must be first since it unloads the prelude from 1.9.2
@@ -176,7 +176,7 @@ module Gem
176
176
  write_binary_errors
177
177
  end.freeze
178
178
 
179
- USE_BUNDLER_FOR_GEMDEPS = true # :nodoc:
179
+ USE_BUNDLER_FOR_GEMDEPS = !ENV['DONT_USE_BUNDLER_FOR_GEMDEPS'] # :nodoc:
180
180
 
181
181
  @@win_platform = nil
182
182
 
@@ -871,19 +871,19 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
871
871
  # Safely read a file in binary mode on all platforms.
872
872
 
873
873
  def self.read_binary(path)
874
- open path, 'rb+' do |f|
874
+ File.open path, 'rb+' do |f|
875
875
  f.flock(File::LOCK_EX)
876
876
  f.read
877
877
  end
878
878
  rescue *READ_BINARY_ERRORS
879
- open path, 'rb' do |f|
879
+ File.open path, 'rb' do |f|
880
880
  f.read
881
881
  end
882
882
  rescue Errno::ENOLCK # NFS
883
883
  if Thread.main != Thread.current
884
884
  raise
885
885
  else
886
- open path, 'rb' do |f|
886
+ File.open path, 'rb' do |f|
887
887
  f.read
888
888
  end
889
889
  end
@@ -68,7 +68,7 @@ Marshal::MINOR_VERSION constants. It is used to ensure compatibility.
68
68
 
69
69
  if not File.exist?(options[:directory]) or
70
70
  not File.directory?(options[:directory]) then
71
- alert_error "unknown directory name #{directory}."
71
+ alert_error "unknown directory name #{options[:directory]}."
72
72
  terminate_interaction 1
73
73
  else
74
74
  indexer = Gem::Indexer.new options.delete(:directory), options
@@ -350,7 +350,9 @@ By default, this RubyGems will install gem as:
350
350
  def install_default_bundler_gem
351
351
  return unless Gem::USE_BUNDLER_FOR_GEMDEPS
352
352
 
353
- mkdir_p Gem::Specification.default_specifications_dir
353
+ specs_dir = Gem::Specification.default_specifications_dir
354
+ File.join(options[:destdir], specs_dir) unless Gem.win_platform?
355
+ mkdir_p specs_dir
354
356
 
355
357
  # Workaround for non-git environment.
356
358
  gemspec = File.open('bundler/bundler.gemspec', 'rb'){|f| f.read.gsub(/`git ls-files -z`/, "''") }
@@ -361,11 +363,11 @@ By default, this RubyGems will install gem as:
361
363
  bundler_spec.executables -= %w[bundler bundle_ruby]
362
364
 
363
365
  # Remove bundler-*.gemspec in default specification directory.
364
- Dir.entries(Gem::Specification.default_specifications_dir).
366
+ Dir.entries(specs_dir).
365
367
  select {|gs| gs.start_with?("bundler-") }.
366
- each {|gs| File.delete(File.join(Gem::Specification.default_specifications_dir, gs)) }
368
+ each {|gs| File.delete(File.join(specs_dir, gs)) }
367
369
 
368
- default_spec_path = File.join(Gem::Specification.default_specifications_dir, "#{bundler_spec.full_name}.gemspec")
370
+ default_spec_path = File.join(specs_dir, "#{bundler_spec.full_name}.gemspec")
369
371
  Gem.write_binary(default_spec_path, bundler_spec.to_ruby)
370
372
 
371
373
  bundler_spec = Gem::Specification.load(default_spec_path)
@@ -383,8 +385,12 @@ By default, this RubyGems will install gem as:
383
385
  each {|default_gem| rm_r File.join(bundler_spec.gems_dir, default_gem) }
384
386
  end
385
387
 
386
- mkdir_p bundler_spec.bin_dir
387
- bundler_spec.executables.each {|e| cp File.join("bundler", bundler_spec.bindir, e), File.join(bundler_spec.bin_dir, e) }
388
+ bundler_bin_dir = File.join(Gem.default_dir, 'gems', bundler_spec.full_name, bundler_spec.bindir)
389
+ File.join(options[:destdir], bundler_bin_dir) unless Gem.win_platform?
390
+ mkdir_p bundler_bin_dir
391
+ bundler_spec.executables.each do |e|
392
+ cp File.join("bundler", bundler_spec.bindir, e), File.join(bundler_bin_dir, e)
393
+ end
388
394
 
389
395
  if Gem.win_platform?
390
396
  require 'rubygems/installer'
@@ -94,7 +94,7 @@ command help for an example.
94
94
 
95
95
  spec_file = File.basename spec.spec_file
96
96
 
97
- open spec_file, 'w' do |io|
97
+ File.open spec_file, 'w' do |io|
98
98
  io.write metadata
99
99
  end
100
100
  else
@@ -176,7 +176,7 @@ command help for an example.
176
176
 
177
177
  metadata = nil
178
178
 
179
- open path, Gem.binary_mode do |io|
179
+ File.open path, Gem.binary_mode do |io|
180
180
  tar = Gem::Package::TarReader.new io
181
181
  tar.each_entry do |entry|
182
182
  case entry.full_name
@@ -458,7 +458,7 @@ if you believe they were disclosed to a third party.
458
458
 
459
459
  # Writes out this config file, replacing its source.
460
460
  def write
461
- open config_file_name, 'w' do |io|
461
+ File.open config_file_name, 'w' do |io|
462
462
  io.write to_yaml
463
463
  end
464
464
  end
@@ -212,7 +212,7 @@ EOF
212
212
 
213
213
  FileUtils.mkdir_p @spec.extension_dir
214
214
 
215
- open destination, 'wb' do |io| io.puts output end
215
+ File.open destination, 'wb' do |io| io.puts output end
216
216
 
217
217
  destination
218
218
  end
@@ -2,6 +2,7 @@
2
2
  require 'rubygems'
3
3
  require 'rubygems/package'
4
4
  require 'time'
5
+ require 'tmpdir'
5
6
 
6
7
  begin
7
8
  gem 'builder'
@@ -64,7 +65,7 @@ class Gem::Indexer
64
65
  @build_modern = options[:build_modern]
65
66
 
66
67
  @dest_directory = directory
67
- @directory = File.join(Dir.tmpdir, "gem_generate_index_#{$$}")
68
+ @directory = Dir.mktmpdir 'gem_generate_index'
68
69
 
69
70
  marshal_name = "Marshal.#{Gem.marshal_version}"
70
71
 
@@ -123,7 +124,7 @@ class Gem::Indexer
123
124
  marshal_name = File.join @quick_marshal_dir, spec_file_name
124
125
 
125
126
  marshal_zipped = Gem.deflate Marshal.dump(spec)
126
- open marshal_name, 'wb' do |io| io.write marshal_zipped end
127
+ File.open marshal_name, 'wb' do |io| io.write marshal_zipped end
127
128
 
128
129
  files << marshal_name
129
130
 
@@ -261,7 +262,7 @@ class Gem::Indexer
261
262
 
262
263
  zipped = Gem.deflate data
263
264
 
264
- open "#{filename}.#{extension}", 'wb' do |io|
265
+ File.open "#{filename}.#{extension}", 'wb' do |io|
265
266
  io.write zipped
266
267
  end
267
268
  end
@@ -427,7 +428,7 @@ class Gem::Indexer
427
428
 
428
429
  specs_index = compact_specs specs_index.uniq.sort
429
430
 
430
- open dest, 'wb' do |io|
431
+ File.open dest, 'wb' do |io|
431
432
  Marshal.dump specs_index, io
432
433
  end
433
434
  end
@@ -206,7 +206,7 @@ class Gem::Installer
206
206
  ruby_executable = false
207
207
  existing = nil
208
208
 
209
- open generated_bin, 'rb' do |io|
209
+ File.open generated_bin, 'rb' do |io|
210
210
  next unless io.gets =~ /^#!/ # shebang
211
211
  io.gets # blankline
212
212
 
@@ -427,7 +427,7 @@ class Gem::Installer
427
427
  # specifications directory.
428
428
 
429
429
  def write_spec
430
- open spec_file, 'w' do |file|
430
+ File.open spec_file, 'w' do |file|
431
431
  spec.installed_by_version = Gem.rubygems_version
432
432
 
433
433
  file.puts spec.to_ruby_for_cache
@@ -464,7 +464,12 @@ class Gem::Installer
464
464
  def generate_bin # :nodoc:
465
465
  return if spec.executables.nil? or spec.executables.empty?
466
466
 
467
- Dir.mkdir @bin_dir unless File.exist? @bin_dir
467
+ begin
468
+ Dir.mkdir @bin_dir
469
+ rescue SystemCallError
470
+ raise unless File.directory? @bin_dir
471
+ end
472
+
468
473
  raise Gem::FilePermissionError.new(@bin_dir) unless File.writable? @bin_dir
469
474
 
470
475
  spec.executables.each do |filename|
@@ -863,7 +868,7 @@ TEXT
863
868
 
864
869
  build_info_file = File.join build_info_dir, "#{spec.full_name}.info"
865
870
 
866
- open build_info_file, 'w' do |io|
871
+ File.open build_info_file, 'w' do |io|
867
872
  @build_args.each do |arg|
868
873
  io.puts arg
869
874
  end