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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/History.txt +7 -0
- data/lib/rubygems.rb +1 -1
- data/lib/rubygems/commands/uninstall_command.rb +4 -0
- data/lib/rubygems/defaults.rb +3 -1
- data/lib/rubygems/install_update_options.rb +4 -0
- data/test/rubygems/test_gem.rb +22 -0
- data/test/rubygems/test_gem_commands_uninstall_command.rb +18 -0
- data/test/rubygems/test_gem_install_update_options.rb +18 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfb3f2be16ac3c109c54b92dab14a6e2aff80f78
|
4
|
+
data.tar.gz: 723dbd0b9f74a8859078e4669a8b99e0f6cf6090
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef957d7732b7d0b8188c0bd6c7614c59f0092df36725464475eee3fcfd77ff059d0c835c1c461d66827a021da6659421aef071a0ffe01341736c16cee2cea58d
|
7
|
+
data.tar.gz: e5269c767f58470e66fcfe30eee0cd68ff2d1edf8de55e2d761c51828da542e7be48f211a9bc004f4e7b6f5a27db7380e8e3caecec05870af800502a45ce49b2
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/History.txt
CHANGED
data/lib/rubygems.rb
CHANGED
@@ -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
|
data/lib/rubygems/defaults.rb
CHANGED
@@ -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
|
data/test/rubygems/test_gem.rb
CHANGED
@@ -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
metadata.gz.sig
CHANGED
Binary file
|