rubygems-update 2.4.0 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


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

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d252b22411a732dda23b05c5127a9748c60875e1
4
- data.tar.gz: a97c4c16f3c1501d40dca2649eed2f84f4e81b02
3
+ metadata.gz: cfb3f2be16ac3c109c54b92dab14a6e2aff80f78
4
+ data.tar.gz: 723dbd0b9f74a8859078e4669a8b99e0f6cf6090
5
5
  SHA512:
6
- metadata.gz: 0050121aa08473845edf6930f719201d3d9fca03c206c5d22f48c900c2e13d260f7c06d8853de17365357e6b2bef0d8360b71bd96df11cb592b7de12ec17cf8a
7
- data.tar.gz: 538dcbc95cb5f02f70dcd6b8b3907f60cf1f813969ca84ccd38d331e41240eb86d4ac0ef471f78639ac90f01c1a5cf388816e876a130766eec5634dcd5aceebe
6
+ metadata.gz: ef957d7732b7d0b8188c0bd6c7614c59f0092df36725464475eee3fcfd77ff059d0c835c1c461d66827a021da6659421aef071a0ffe01341736c16cee2cea58d
7
+ data.tar.gz: e5269c767f58470e66fcfe30eee0cd68ff2d1edf8de55e2d761c51828da542e7be48f211a9bc004f4e7b6f5a27db7380e8e3caecec05870af800502a45ce49b2
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,5 +1,12 @@
1
1
  # coding: UTF-8
2
2
 
3
+ === 2.4.1 / 2014-07-17
4
+
5
+ Bug fixes:
6
+
7
+ * RubyGems can now be updated on Ruby implementations that do not support
8
+ vendordir in RbConfig::CONFIG. Issue #974 by net1957.
9
+
3
10
  === 2.4.0 / 2014-07-16
4
11
 
5
12
  Minor enhancements:
@@ -9,7 +9,7 @@ require 'rbconfig'
9
9
  require 'thread'
10
10
 
11
11
  module Gem
12
- VERSION = '2.4.0'
12
+ VERSION = '2.4.1'
13
13
  end
14
14
 
15
15
  # Must be first since it unloads the prelude from 1.9.2
@@ -80,6 +80,10 @@ class Gem::Commands::UninstallCommand < Gem::Command
80
80
  add_option('--vendor',
81
81
  'Uninstall gem from the vendor directory.',
82
82
  'Only for use by gem repackagers.') do |value, options|
83
+ unless Gem.vendor_dir then
84
+ raise OptionParser::InvalidOption.new 'your platform is not supported'
85
+ end
86
+
83
87
  alert_warning 'Use your OS package manager to uninstall vendor gems'
84
88
  options[:vendor] = true
85
89
  options[:install_dir] = Gem.vendor_dir
@@ -92,7 +92,7 @@ module Gem
92
92
  path = []
93
93
  path << user_dir if user_home && File.exist?(user_home)
94
94
  path << default_dir
95
- path << vendor_dir if File.directory? vendor_dir
95
+ path << vendor_dir if vendor_dir and File.directory? vendor_dir
96
96
  path
97
97
  end
98
98
 
@@ -168,6 +168,8 @@ module Gem
168
168
  return vendor_dir.dup
169
169
  end
170
170
 
171
+ return nil unless RbConfig::CONFIG.key? 'vendordir'
172
+
171
173
  File.join RbConfig::CONFIG['vendordir'], 'gems',
172
174
  RbConfig::CONFIG['ruby_version']
173
175
  end
@@ -68,6 +68,10 @@ module Gem::InstallUpdateOptions
68
68
  add_option(:"Install/Update", '--vendor',
69
69
  'Install gem into the vendor directory.',
70
70
  'Only for use by gem repackagers.') do |value, options|
71
+ unless Gem.vendor_dir then
72
+ raise OptionParser::InvalidOption.new 'your platform is not supported'
73
+ end
74
+
71
75
  options[:vendor] = true
72
76
  options[:install_dir] = Gem.vendor_dir
73
77
  end
@@ -244,6 +244,19 @@ class TestGem < Gem::TestCase
244
244
  RbConfig::CONFIG['vendordir'] = orig_vendordir
245
245
  end
246
246
 
247
+ def test_default_path_missing_vendor
248
+ orig_vendordir = RbConfig::CONFIG['vendordir']
249
+ RbConfig::CONFIG.delete 'vendordir'
250
+
251
+ FileUtils.rm_rf Gem.user_home
252
+
253
+ expected = [Gem.default_dir]
254
+
255
+ assert_equal expected, Gem.default_path
256
+ ensure
257
+ RbConfig::CONFIG['vendordir'] = orig_vendordir
258
+ end
259
+
247
260
  def test_default_path_user_home
248
261
  orig_vendordir = RbConfig::CONFIG['vendordir']
249
262
  RbConfig::CONFIG['vendordir'] = File.join @tempdir, 'vendor'
@@ -1037,6 +1050,15 @@ class TestGem < Gem::TestCase
1037
1050
  refute Gem.vendor_dir.frozen?
1038
1051
  end
1039
1052
 
1053
+ def test_self_vendor_dir_missing
1054
+ orig_vendordir = RbConfig::CONFIG['vendordir']
1055
+ RbConfig::CONFIG.delete 'vendordir'
1056
+
1057
+ assert_nil Gem.vendor_dir
1058
+ ensure
1059
+ RbConfig::CONFIG['vendordir'] = orig_vendordir
1060
+ end
1061
+
1040
1062
  def test_load_plugins
1041
1063
  skip 'Insecure operation - chdir' if RUBY_VERSION <= "1.8.7"
1042
1064
  plugin_path = File.join "lib", "rubygems_plugin.rb"
@@ -259,5 +259,23 @@ WARNING: Use your OS package manager to uninstall vendor gems
259
259
  assert_equal expected, @ui.error
260
260
  end
261
261
 
262
+ def test_handle_options_vendor_missing
263
+ orig_vendordir = RbConfig::CONFIG['vendordir']
264
+ RbConfig::CONFIG.delete 'vendordir'
265
+
266
+ e = assert_raises OptionParser::InvalidOption do
267
+ @cmd.handle_options %w[--vendor]
268
+ end
269
+
270
+ assert_equal 'invalid option: --vendor your platform is not supported',
271
+ e.message
272
+
273
+ refute @cmd.options[:vendor]
274
+ refute @cmd.options[:install_dir]
275
+
276
+ ensure
277
+ RbConfig::CONFIG['vendordir'] = orig_vendordir
278
+ end
279
+
262
280
  end
263
281
 
@@ -163,4 +163,22 @@ class TestGemInstallUpdateOptions < Gem::InstallerTestCase
163
163
  assert_equal Gem.vendor_dir, @cmd.options[:install_dir]
164
164
  end
165
165
 
166
+ def test_vendor_missing
167
+ orig_vendordir = RbConfig::CONFIG['vendordir']
168
+ RbConfig::CONFIG.delete 'vendordir'
169
+
170
+ e = assert_raises OptionParser::InvalidOption do
171
+ @cmd.handle_options %w[--vendor]
172
+ end
173
+
174
+ assert_equal 'invalid option: --vendor your platform is not supported',
175
+ e.message
176
+
177
+ refute @cmd.options[:vendor]
178
+ refute @cmd.options[:install_dir]
179
+
180
+ ensure
181
+ RbConfig::CONFIG['vendordir'] = orig_vendordir
182
+ end
183
+
166
184
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubygems-update
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Weirich
metadata.gz.sig CHANGED
Binary file