rubygems-update 2.1.11 → 2.2.0.rc.1
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.autotest +37 -12
- data/History.txt +99 -2
- data/MIT.txt +1 -0
- data/Manifest.txt +59 -19
- data/Rakefile +4 -6
- data/lib/gauntlet_rubygems.rb +1 -1
- data/lib/rubygems.rb +102 -80
- data/lib/rubygems/available_set.rb +2 -2
- data/lib/rubygems/basic_specification.rb +97 -8
- data/lib/rubygems/commands/install_command.rb +58 -15
- data/lib/rubygems/commands/list_command.rb +1 -7
- data/lib/rubygems/commands/outdated_command.rb +1 -1
- data/lib/rubygems/commands/pristine_command.rb +14 -1
- data/lib/rubygems/commands/push_command.rb +9 -4
- data/lib/rubygems/commands/query_command.rb +33 -17
- data/lib/rubygems/commands/search_command.rb +0 -6
- data/lib/rubygems/commands/specification_command.rb +1 -1
- data/lib/rubygems/commands/unpack_command.rb +1 -1
- data/lib/rubygems/commands/update_command.rb +4 -1
- data/lib/rubygems/commands/which_command.rb +5 -8
- data/lib/rubygems/compatibility.rb +3 -0
- data/lib/rubygems/core_ext/kernel_gem.rb +6 -0
- data/lib/rubygems/defaults.rb +19 -0
- data/lib/rubygems/dependency_installer.rb +28 -9
- data/lib/rubygems/doctor.rb +17 -11
- data/lib/rubygems/errors.rb +16 -3
- data/lib/rubygems/exceptions.rb +52 -5
- data/lib/rubygems/ext.rb +1 -2
- data/lib/rubygems/ext/build_error.rb +6 -0
- data/lib/rubygems/ext/builder.rb +50 -17
- data/lib/rubygems/ext/cmake_builder.rb +1 -1
- data/lib/rubygems/ext/configure_builder.rb +1 -3
- data/lib/rubygems/ext/ext_conf_builder.rb +9 -3
- data/lib/rubygems/ext/rake_builder.rb +2 -5
- data/lib/rubygems/gemcutter_utilities.rb +8 -1
- data/lib/rubygems/installer.rb +14 -4
- data/lib/rubygems/installer_test_case.rb +0 -5
- data/lib/rubygems/package.rb +11 -2
- data/lib/rubygems/psych_additions.rb +1 -1
- data/lib/rubygems/rdoc.rb +1 -1
- data/lib/rubygems/remote_fetcher.rb +3 -3
- data/lib/rubygems/request.rb +16 -8
- data/lib/rubygems/request_set.rb +133 -42
- data/lib/rubygems/request_set/gem_dependency_api.rb +493 -11
- data/lib/rubygems/request_set/lockfile.rb +579 -0
- data/lib/rubygems/requirement.rb +58 -30
- data/lib/rubygems/resolver.rb +471 -0
- data/lib/rubygems/resolver/activation_request.rb +165 -0
- data/lib/rubygems/resolver/api_set.rb +110 -0
- data/lib/rubygems/resolver/api_specification.rb +79 -0
- data/lib/rubygems/resolver/best_set.rb +31 -0
- data/lib/rubygems/resolver/composed_set.rb +39 -0
- data/lib/rubygems/resolver/conflict.rb +122 -0
- data/lib/rubygems/{dependency_resolver → resolver}/current_set.rb +1 -4
- data/lib/rubygems/{dependency_resolver → resolver}/dependency_request.rb +37 -7
- data/lib/rubygems/resolver/git_set.rb +119 -0
- data/lib/rubygems/resolver/git_specification.rb +35 -0
- data/lib/rubygems/resolver/index_set.rb +74 -0
- data/lib/rubygems/resolver/index_specification.rb +69 -0
- data/lib/rubygems/resolver/installed_specification.rb +40 -0
- data/lib/rubygems/{dependency_resolver → resolver}/installer_set.rb +18 -17
- data/lib/rubygems/resolver/local_specification.rb +16 -0
- data/lib/rubygems/resolver/lock_set.rb +78 -0
- data/lib/rubygems/resolver/lock_specification.rb +58 -0
- data/lib/rubygems/resolver/requirement_list.rb +81 -0
- data/lib/rubygems/resolver/set.rb +27 -0
- data/lib/rubygems/resolver/spec_specification.rb +58 -0
- data/lib/rubygems/resolver/specification.rb +89 -0
- data/lib/rubygems/resolver/stats.rb +44 -0
- data/lib/rubygems/resolver/vendor_set.rb +83 -0
- data/lib/rubygems/resolver/vendor_specification.rb +24 -0
- data/lib/rubygems/security/trust_dir.rb +16 -2
- data/lib/rubygems/source.rb +71 -18
- data/lib/rubygems/source/git.rb +218 -0
- data/lib/rubygems/source/installed.rb +8 -1
- data/lib/rubygems/source/local.rb +14 -8
- data/lib/rubygems/source/lock.rb +48 -0
- data/lib/rubygems/source/specific_file.rb +14 -3
- data/lib/rubygems/source/vendor.rb +27 -0
- data/lib/rubygems/source_list.rb +74 -12
- data/lib/rubygems/spec_fetcher.rb +36 -4
- data/lib/rubygems/specification.rb +214 -65
- data/lib/rubygems/stub_specification.rb +57 -1
- data/lib/rubygems/syck_hack.rb +3 -3
- data/lib/rubygems/test_case.rb +226 -59
- data/lib/rubygems/test_utilities.rb +198 -0
- data/lib/rubygems/uninstaller.rb +22 -10
- data/lib/rubygems/uri_formatter.rb +20 -0
- data/lib/rubygems/user_interaction.rb +193 -71
- data/lib/rubygems/util.rb +121 -0
- data/lib/rubygems/util/list.rb +4 -0
- data/lib/rubygems/util/stringio.rb +34 -0
- data/lib/rubygems/validator.rb +6 -2
- data/lib/rubygems/version.rb +4 -8
- data/test/rubygems/test_bundled_ca.rb +1 -1
- data/test/rubygems/test_gem.rb +137 -29
- data/test/rubygems/test_gem_available_set.rb +19 -0
- data/test/rubygems/test_gem_commands_build_command.rb +1 -1
- data/test/rubygems/test_gem_commands_cert_command.rb +2 -2
- data/test/rubygems/test_gem_commands_cleanup_command.rb +13 -13
- data/test/rubygems/test_gem_commands_dependency_command.rb +24 -34
- data/test/rubygems/test_gem_commands_fetch_command.rb +43 -48
- data/test/rubygems/test_gem_commands_install_command.rb +244 -279
- data/test/rubygems/test_gem_commands_list_command.rb +3 -3
- data/test/rubygems/test_gem_commands_outdated_command.rb +7 -12
- data/test/rubygems/test_gem_commands_pristine_command.rb +73 -27
- data/test/rubygems/test_gem_commands_push_command.rb +76 -8
- data/test/rubygems/test_gem_commands_query_command.rb +239 -49
- data/test/rubygems/test_gem_commands_sources_command.rb +10 -43
- data/test/rubygems/test_gem_commands_specification_command.rb +24 -47
- data/test/rubygems/test_gem_commands_stale_command.rb +2 -2
- data/test/rubygems/test_gem_commands_uninstall_command.rb +3 -3
- data/test/rubygems/test_gem_commands_unpack_command.rb +16 -30
- data/test/rubygems/test_gem_commands_update_command.rb +149 -134
- data/test/rubygems/test_gem_commands_which_command.rb +4 -2
- data/test/rubygems/test_gem_dependency_installer.rb +68 -0
- data/test/rubygems/test_gem_dependency_list.rb +17 -17
- data/test/rubygems/test_gem_dependency_resolution_error.rb +28 -0
- data/test/rubygems/test_gem_doctor.rb +1 -1
- data/test/rubygems/test_gem_ext_builder.rb +178 -8
- data/test/rubygems/test_gem_ext_cmake_builder.rb +1 -7
- data/test/rubygems/test_gem_ext_configure_builder.rb +8 -10
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +18 -21
- data/test/rubygems/test_gem_ext_rake_builder.rb +1 -3
- data/test/rubygems/test_gem_impossible_dependencies_error.rb +10 -6
- data/test/rubygems/test_gem_indexer.rb +6 -6
- data/test/rubygems/test_gem_installer.rb +29 -10
- data/test/rubygems/test_gem_local_remote_options.rb +1 -1
- data/test/rubygems/test_gem_package.rb +18 -0
- data/test/rubygems/test_gem_rdoc.rb +1 -1
- data/test/rubygems/test_gem_remote_fetcher.rb +1 -1
- data/test/rubygems/test_gem_request.rb +37 -10
- data/test/rubygems/test_gem_request_set.rb +271 -9
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +684 -0
- data/test/rubygems/test_gem_request_set_lockfile.rb +849 -0
- data/test/rubygems/test_gem_requirement.rb +21 -0
- data/test/rubygems/{test_gem_dependency_resolver.rb → test_gem_resolver.rb} +231 -70
- data/test/rubygems/test_gem_resolver_activation_request.rb +63 -0
- data/test/rubygems/test_gem_resolver_api_set.rb +167 -0
- data/test/rubygems/test_gem_resolver_api_specification.rb +104 -0
- data/test/rubygems/test_gem_resolver_best_set.rb +30 -0
- data/test/rubygems/test_gem_resolver_conflict.rb +75 -0
- data/test/rubygems/test_gem_resolver_dependency_request.rb +20 -0
- data/test/rubygems/test_gem_resolver_git_set.rb +148 -0
- data/test/rubygems/test_gem_resolver_git_specification.rb +100 -0
- data/test/rubygems/test_gem_resolver_index_set.rb +28 -0
- data/test/rubygems/test_gem_resolver_index_specification.rb +89 -0
- data/test/rubygems/test_gem_resolver_installed_specification.rb +49 -0
- data/test/rubygems/test_gem_resolver_installer_set.rb +22 -0
- data/test/rubygems/test_gem_resolver_local_specification.rb +45 -0
- data/test/rubygems/test_gem_resolver_lock_set.rb +57 -0
- data/test/rubygems/test_gem_resolver_lock_specification.rb +87 -0
- data/test/rubygems/test_gem_resolver_requirement_list.rb +20 -0
- data/test/rubygems/test_gem_resolver_specification.rb +32 -0
- data/test/rubygems/test_gem_resolver_vendor_set.rb +67 -0
- data/test/rubygems/test_gem_resolver_vendor_specification.rb +83 -0
- data/test/rubygems/test_gem_server.rb +4 -4
- data/test/rubygems/test_gem_source.rb +54 -64
- data/test/rubygems/test_gem_source_git.rb +231 -0
- data/test/rubygems/test_gem_source_list.rb +24 -0
- data/test/rubygems/test_gem_source_local.rb +1 -1
- data/test/rubygems/test_gem_source_lock.rb +114 -0
- data/test/rubygems/test_gem_source_vendor.rb +27 -0
- data/test/rubygems/test_gem_spec_fetcher.rb +116 -61
- data/test/rubygems/test_gem_specification.rb +526 -94
- data/test/rubygems/test_gem_stub_specification.rb +123 -10
- data/test/rubygems/test_gem_uninstaller.rb +28 -2
- data/test/rubygems/test_gem_util.rb +31 -0
- data/test/rubygems/test_gem_validator.rb +9 -0
- data/util/update_bundled_ca_certificates.rb +8 -1
- metadata +89 -29
- metadata.gz.sig +2 -4
- data/lib/rubygems/dependency_resolver.rb +0 -254
- data/lib/rubygems/dependency_resolver/activation_request.rb +0 -109
- data/lib/rubygems/dependency_resolver/api_set.rb +0 -65
- data/lib/rubygems/dependency_resolver/api_specification.rb +0 -39
- data/lib/rubygems/dependency_resolver/composed_set.rb +0 -18
- data/lib/rubygems/dependency_resolver/dependency_conflict.rb +0 -85
- data/lib/rubygems/dependency_resolver/index_set.rb +0 -64
- data/lib/rubygems/dependency_resolver/index_specification.rb +0 -60
- data/lib/rubygems/dependency_resolver/installed_specification.rb +0 -52
- data/test/rubygems/test_gem_dependency_resolver_api_specification.rb +0 -33
- data/test/rubygems/test_gem_dependency_resolver_dependency_conflict.rb +0 -36
- data/test/rubygems/test_gem_dependency_resolver_index_set.rb +0 -53
- data/test/rubygems/test_gem_dependency_resolver_index_specification.rb +0 -73
- data/test/rubygems/test_gem_dependency_resolver_installed_specification.rb +0 -19
- data/test/rubygems/test_gem_dependency_resolver_installer_set.rb +0 -28
@@ -134,7 +134,7 @@ command help for an example.
|
|
134
134
|
|
135
135
|
specs = dependency.matching_specs
|
136
136
|
|
137
|
-
selected = specs.
|
137
|
+
selected = specs.max_by { |s| s.version }
|
138
138
|
|
139
139
|
return Gem::RemoteFetcher.fetcher.download_to_cache(dependency) unless
|
140
140
|
selected
|
@@ -138,7 +138,7 @@ command to remove old versions.
|
|
138
138
|
g.name == spec.name and g.match_platform?
|
139
139
|
end
|
140
140
|
|
141
|
-
highest_remote_gem = matching_gems.
|
141
|
+
highest_remote_gem = matching_gems.max_by { |g,_| g.version }
|
142
142
|
|
143
143
|
highest_remote_gem ||= [Gem::NameTuple.null]
|
144
144
|
|
@@ -248,6 +248,9 @@ command to remove old versions.
|
|
248
248
|
args << '--no-rdoc' unless options[:document].include? 'rdoc'
|
249
249
|
args << '--no-ri' unless options[:document].include? 'ri'
|
250
250
|
args << '--no-format-executable' if options[:no_format_executable]
|
251
|
+
args << '--previous-version' << Gem::VERSION if
|
252
|
+
options[:system] == true or
|
253
|
+
Gem::Version.new(options[:system]) >= Gem::Version.new(2)
|
251
254
|
args
|
252
255
|
end
|
253
256
|
|
@@ -35,7 +35,7 @@ requiring to see why it does not behave as you expect.
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def execute
|
38
|
-
found =
|
38
|
+
found = true
|
39
39
|
|
40
40
|
options[:args].each do |arg|
|
41
41
|
arg = arg.sub(/#{Regexp.union(*Gem.suffixes)}$/, '')
|
@@ -45,9 +45,9 @@ requiring to see why it does not behave as you expect.
|
|
45
45
|
|
46
46
|
if spec then
|
47
47
|
if options[:search_gems_first] then
|
48
|
-
dirs =
|
48
|
+
dirs = spec.full_require_paths + $LOAD_PATH
|
49
49
|
else
|
50
|
-
dirs = $LOAD_PATH +
|
50
|
+
dirs = $LOAD_PATH + spec.full_require_paths
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
@@ -56,9 +56,10 @@ requiring to see why it does not behave as you expect.
|
|
56
56
|
|
57
57
|
if paths.empty? then
|
58
58
|
alert_error "Can't find ruby library file or shared library #{arg}"
|
59
|
+
|
60
|
+
found &&= false
|
59
61
|
else
|
60
62
|
say paths
|
61
|
-
found = true
|
62
63
|
end
|
63
64
|
end
|
64
65
|
|
@@ -81,10 +82,6 @@ requiring to see why it does not behave as you expect.
|
|
81
82
|
result
|
82
83
|
end
|
83
84
|
|
84
|
-
def gem_paths(spec)
|
85
|
-
spec.require_paths.collect { |d| File.join spec.full_gem_path, d }
|
86
|
-
end
|
87
|
-
|
88
85
|
def usage # :nodoc:
|
89
86
|
"#{program_name} FILE [FILE ...]"
|
90
87
|
end
|
@@ -1,3 +1,9 @@
|
|
1
|
+
##
|
2
|
+
# RubyGems adds the #gem method to allow activation of specific gem versions
|
3
|
+
# and overrides the #require method on Kernel to make gems appear as if they
|
4
|
+
# live on the <code>$LOAD_PATH</code>. See the documentation of these methods
|
5
|
+
# for further detail.
|
6
|
+
|
1
7
|
module Kernel
|
2
8
|
|
3
9
|
# REFACTOR: This should be pulled out into some kind of hacks file.
|
data/lib/rubygems/defaults.rb
CHANGED
@@ -51,6 +51,17 @@ module Gem
|
|
51
51
|
@default_dir ||= File.join(*path)
|
52
52
|
end
|
53
53
|
|
54
|
+
##
|
55
|
+
# Returns binary extensions dir for specified RubyGems base dir or nil
|
56
|
+
# if such directory cannot be determined.
|
57
|
+
#
|
58
|
+
# By default, the binary extensions are located side by side with their
|
59
|
+
# Ruby counterparts, therefore nil is returned
|
60
|
+
|
61
|
+
def self.default_ext_dir_for base_dir
|
62
|
+
nil
|
63
|
+
end
|
64
|
+
|
54
65
|
##
|
55
66
|
# Paths where RubyGems' .rb files and bin files are installed
|
56
67
|
|
@@ -141,4 +152,12 @@ module Gem
|
|
141
152
|
def self.default_gems_use_full_paths?
|
142
153
|
ruby_engine != 'ruby'
|
143
154
|
end
|
155
|
+
|
156
|
+
##
|
157
|
+
# Install extensions into lib as well as into the extension directory.
|
158
|
+
|
159
|
+
def self.install_extension_in_lib # :nodoc:
|
160
|
+
true
|
161
|
+
end
|
162
|
+
|
144
163
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'rubygems/dependency_list'
|
3
|
-
require 'rubygems/dependency_resolver'
|
4
3
|
require 'rubygems/package'
|
5
4
|
require 'rubygems/installer'
|
6
5
|
require 'rubygems/spec_fetcher'
|
@@ -196,7 +195,7 @@ class Gem::DependencyInstaller
|
|
196
195
|
# sources. Gems are sorted with newer gems preferred over older gems, and
|
197
196
|
# local gems preferred over remote gems.
|
198
197
|
|
199
|
-
def find_gems_with_sources dep # :nodoc:
|
198
|
+
def find_gems_with_sources dep, best_only=false # :nodoc:
|
200
199
|
set = Gem::AvailableSet.new
|
201
200
|
|
202
201
|
if consider_local?
|
@@ -211,7 +210,26 @@ class Gem::DependencyInstaller
|
|
211
210
|
|
212
211
|
if consider_remote?
|
213
212
|
begin
|
214
|
-
|
213
|
+
# TODO this is pulled from #spec_for_dependency to allow
|
214
|
+
# us to filter tuples before fetching specs.
|
215
|
+
#
|
216
|
+
tuples, errors = Gem::SpecFetcher.fetcher.search_for_dependency dep
|
217
|
+
|
218
|
+
if best_only && !tuples.empty?
|
219
|
+
tuples.sort! { |a,b| b[0].version <=> a[0].version }
|
220
|
+
tuples = [tuples.first]
|
221
|
+
end
|
222
|
+
|
223
|
+
specs = []
|
224
|
+
tuples.each do |tup, source|
|
225
|
+
begin
|
226
|
+
spec = source.fetch_spec(tup)
|
227
|
+
rescue Gem::RemoteFetcher::FetchError => e
|
228
|
+
errors << Gem::SourceFetchProblem.new(source, e)
|
229
|
+
else
|
230
|
+
specs << [spec, source]
|
231
|
+
end
|
232
|
+
end
|
215
233
|
|
216
234
|
if @errors
|
217
235
|
@errors += errors
|
@@ -219,7 +237,7 @@ class Gem::DependencyInstaller
|
|
219
237
|
@errors = errors
|
220
238
|
end
|
221
239
|
|
222
|
-
set <<
|
240
|
+
set << specs
|
223
241
|
|
224
242
|
rescue Gem::RemoteFetcher::FetchError => e
|
225
243
|
# FIX if there is a problem talking to the network, we either need to always tell
|
@@ -271,7 +289,7 @@ class Gem::DependencyInstaller
|
|
271
289
|
dep = Gem::Dependency.new gem_name, version
|
272
290
|
dep.prerelease = true if prerelease
|
273
291
|
|
274
|
-
set = find_gems_with_sources(dep)
|
292
|
+
set = find_gems_with_sources(dep, true)
|
275
293
|
set.match_platform!
|
276
294
|
end
|
277
295
|
|
@@ -286,7 +304,7 @@ class Gem::DependencyInstaller
|
|
286
304
|
# Gathers all dependencies necessary for the installation from local and
|
287
305
|
# remote sources unless the ignore_dependencies was given.
|
288
306
|
#--
|
289
|
-
# TODO remove
|
307
|
+
# TODO remove at RubyGems 3
|
290
308
|
|
291
309
|
def gather_dependencies # :nodoc:
|
292
310
|
specs = @available.all_specs
|
@@ -402,16 +420,17 @@ class Gem::DependencyInstaller
|
|
402
420
|
request_set = as.to_request_set install_development_deps
|
403
421
|
request_set.soft_missing = @force
|
404
422
|
|
405
|
-
installer_set = Gem::
|
423
|
+
installer_set = Gem::Resolver::InstallerSet.new @domain
|
406
424
|
installer_set.always_install.concat request_set.always_install
|
407
425
|
installer_set.ignore_installed = @only_install_dir
|
408
426
|
|
409
427
|
if @ignore_dependencies then
|
410
428
|
installer_set.ignore_dependencies = true
|
411
|
-
request_set.
|
429
|
+
request_set.ignore_dependencies = true
|
430
|
+
request_set.soft_missing = true
|
412
431
|
end
|
413
432
|
|
414
|
-
composed_set = Gem::
|
433
|
+
composed_set = Gem::Resolver.compose_sets as, installer_set
|
415
434
|
|
416
435
|
request_set.resolve composed_set
|
417
436
|
|
data/lib/rubygems/doctor.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'rubygems/user_interaction'
|
3
|
-
require 'pathname'
|
4
3
|
|
5
4
|
##
|
6
5
|
# Cleans up after a partially-failed uninstall or for an invalid
|
@@ -24,13 +23,17 @@ class Gem::Doctor
|
|
24
23
|
['build_info', '.info'],
|
25
24
|
['cache', '.gem'],
|
26
25
|
['doc', ''],
|
26
|
+
['extensions', ''],
|
27
27
|
['gems', ''],
|
28
28
|
]
|
29
29
|
|
30
|
-
|
31
|
-
Gem::REPOSITORY_SUBDIRECTORIES.sort
|
30
|
+
missing =
|
31
|
+
Gem::REPOSITORY_SUBDIRECTORIES.sort -
|
32
32
|
REPOSITORY_EXTENSION_MAP.map { |(k,_)| k }.sort
|
33
33
|
|
34
|
+
raise "Update REPOSITORY_EXTENSION_MAP, missing: #{missing.join ', '}" unless
|
35
|
+
missing.empty?
|
36
|
+
|
34
37
|
##
|
35
38
|
# Creates a new Gem::Doctor that will clean up +gem_repository+. Only one
|
36
39
|
# gem repository may be cleaned at a time.
|
@@ -38,7 +41,7 @@ class Gem::Doctor
|
|
38
41
|
# If +dry_run+ is true no files or directories will be removed.
|
39
42
|
|
40
43
|
def initialize gem_repository, dry_run = false
|
41
|
-
@gem_repository =
|
44
|
+
@gem_repository = gem_repository
|
42
45
|
@dry_run = dry_run
|
43
46
|
|
44
47
|
@installed_specs = nil
|
@@ -96,26 +99,29 @@ class Gem::Doctor
|
|
96
99
|
# Removes files in +sub_directory+ with +extension+
|
97
100
|
|
98
101
|
def doctor_child sub_directory, extension # :nodoc:
|
99
|
-
directory = @gem_repository
|
102
|
+
directory = File.join(@gem_repository, sub_directory)
|
103
|
+
|
104
|
+
Dir.entries(directory).sort.each do |ent|
|
105
|
+
next if ent == "." || ent == ".."
|
100
106
|
|
101
|
-
|
102
|
-
next unless
|
107
|
+
child = File.join(directory, ent)
|
108
|
+
next unless File.exists?(child)
|
103
109
|
|
104
|
-
basename =
|
110
|
+
basename = File.basename(child, extension)
|
105
111
|
next if installed_specs.include? basename
|
106
112
|
next if /^rubygems-\d/ =~ basename
|
107
113
|
next if 'specifications' == sub_directory and 'default' == basename
|
108
114
|
|
109
|
-
type =
|
115
|
+
type = File.directory?(child) ? 'directory' : 'file'
|
110
116
|
|
111
117
|
action = if @dry_run then
|
112
118
|
'Extra'
|
113
119
|
else
|
114
|
-
child
|
120
|
+
FileUtils.rm_r(child)
|
115
121
|
'Removed'
|
116
122
|
end
|
117
123
|
|
118
|
-
say "#{action} #{type} #{sub_directory}/#{
|
124
|
+
say "#{action} #{type} #{sub_directory}/#{File.basename(child)}"
|
119
125
|
end
|
120
126
|
rescue Errno::ENOENT
|
121
127
|
# ignore
|
data/lib/rubygems/errors.rb
CHANGED
@@ -19,8 +19,6 @@ module Gem
|
|
19
19
|
attr_accessor :requirement
|
20
20
|
end
|
21
21
|
|
22
|
-
# FIX: does this need to exist? The subclass is the only other reference
|
23
|
-
# I can find.
|
24
22
|
class ErrorReason; end
|
25
23
|
|
26
24
|
# Generated when trying to lookup a gem to indicate that the gem
|
@@ -75,12 +73,27 @@ module Gem
|
|
75
73
|
# data from a source
|
76
74
|
|
77
75
|
class SourceFetchProblem < ErrorReason
|
76
|
+
|
77
|
+
##
|
78
|
+
# Creates a new SourceFetchProblem for the given +source+ and +error+.
|
79
|
+
|
78
80
|
def initialize(source, error)
|
79
81
|
@source = source
|
80
82
|
@error = error
|
81
83
|
end
|
82
84
|
|
83
|
-
|
85
|
+
##
|
86
|
+
# The source that had the fetch problem.
|
87
|
+
|
88
|
+
attr_reader :source
|
89
|
+
|
90
|
+
##
|
91
|
+
# The fetch error which is an Exception subclass.
|
92
|
+
|
93
|
+
attr_reader :error
|
94
|
+
|
95
|
+
##
|
96
|
+
# An English description of the error.
|
84
97
|
|
85
98
|
def wordy
|
86
99
|
"Unable to download data from #{@source.uri} - #{@error.message}"
|
data/lib/rubygems/exceptions.rb
CHANGED
@@ -23,7 +23,7 @@ class Gem::DependencyError < Gem::Exception; end
|
|
23
23
|
class Gem::DependencyRemovalException < Gem::Exception; end
|
24
24
|
|
25
25
|
##
|
26
|
-
# Raised by Gem::
|
26
|
+
# Raised by Gem::Resolver when a Gem::Dependency::Conflict reaches the
|
27
27
|
# toplevel. Indicates which dependencies were incompatible through #conflict
|
28
28
|
# and #conflicting_dependencies
|
29
29
|
|
@@ -35,7 +35,7 @@ class Gem::DependencyResolutionError < Gem::Exception
|
|
35
35
|
@conflict = conflict
|
36
36
|
a, b = conflicting_dependencies
|
37
37
|
|
38
|
-
super "
|
38
|
+
super "conflicting dependencies #{a} and #{b}\n#{@conflict.explanation}"
|
39
39
|
end
|
40
40
|
|
41
41
|
def conflicting_dependencies
|
@@ -81,7 +81,16 @@ end
|
|
81
81
|
|
82
82
|
class Gem::GemNotFoundException < Gem::Exception; end
|
83
83
|
|
84
|
+
##
|
85
|
+
# Raised by the DependencyInstaller when a specific gem cannot be found
|
86
|
+
|
84
87
|
class Gem::SpecificGemNotFoundException < Gem::GemNotFoundException
|
88
|
+
|
89
|
+
##
|
90
|
+
# Creates a new SpecificGemNotFoundException for a gem with the given +name+
|
91
|
+
# and +version+. Any +errors+ encountered when attempting to find the gem
|
92
|
+
# are also stored.
|
93
|
+
|
85
94
|
def initialize(name, version, errors=nil)
|
86
95
|
super "Could not find a valid gem '#{name}' (#{version}) locally or in a repository"
|
87
96
|
|
@@ -90,11 +99,25 @@ class Gem::SpecificGemNotFoundException < Gem::GemNotFoundException
|
|
90
99
|
@errors = errors
|
91
100
|
end
|
92
101
|
|
93
|
-
|
102
|
+
##
|
103
|
+
# The name of the gem that could not be found.
|
104
|
+
|
105
|
+
attr_reader :name
|
106
|
+
|
107
|
+
##
|
108
|
+
# The version of the gem that could not be found.
|
109
|
+
|
110
|
+
attr_reader :version
|
111
|
+
|
112
|
+
##
|
113
|
+
# Errors encountered attempting to find the gem.
|
114
|
+
|
115
|
+
attr_reader :errors
|
116
|
+
|
94
117
|
end
|
95
118
|
|
96
119
|
##
|
97
|
-
# Raised by Gem::
|
120
|
+
# Raised by Gem::Resolver when dependencies conflict and create the
|
98
121
|
# inability to find a valid possible spec for a request.
|
99
122
|
|
100
123
|
class Gem::ImpossibleDependenciesError < Gem::Exception
|
@@ -154,6 +177,15 @@ class Gem::RemoteInstallationSkipped < Gem::Exception; end
|
|
154
177
|
# Represents an error communicating via HTTP.
|
155
178
|
class Gem::RemoteSourceException < Gem::Exception; end
|
156
179
|
|
180
|
+
##
|
181
|
+
# Raised when a gem dependencies file specifies a ruby version that does not
|
182
|
+
# match the current version.
|
183
|
+
|
184
|
+
class Gem::RubyVersionMismatch < Gem::Exception; end
|
185
|
+
|
186
|
+
##
|
187
|
+
# Raised by Gem::Validator when something is not right in a gem.
|
188
|
+
|
157
189
|
class Gem::VerificationError < Gem::Exception; end
|
158
190
|
|
159
191
|
##
|
@@ -161,8 +193,15 @@ class Gem::VerificationError < Gem::Exception; end
|
|
161
193
|
# exit_code
|
162
194
|
|
163
195
|
class Gem::SystemExitException < SystemExit
|
196
|
+
|
197
|
+
##
|
198
|
+
# The exit code for the process
|
199
|
+
|
164
200
|
attr_accessor :exit_code
|
165
201
|
|
202
|
+
##
|
203
|
+
# Creates a new SystemExitException with the given +exit_code+
|
204
|
+
|
166
205
|
def initialize(exit_code)
|
167
206
|
@exit_code = exit_code
|
168
207
|
|
@@ -172,13 +211,21 @@ class Gem::SystemExitException < SystemExit
|
|
172
211
|
end
|
173
212
|
|
174
213
|
##
|
175
|
-
# Raised by
|
214
|
+
# Raised by Resolver when a dependency requests a gem for which
|
176
215
|
# there is no spec.
|
177
216
|
|
178
217
|
class Gem::UnsatisfiableDependencyError < Gem::Exception
|
179
218
|
|
219
|
+
##
|
220
|
+
# The unsatisfiable dependency. This is a
|
221
|
+
# Gem::Resolver::DependencyRequest, not a Gem::Dependency
|
222
|
+
|
180
223
|
attr_reader :dependency
|
181
224
|
|
225
|
+
##
|
226
|
+
# Creates a new UnsatisfiableDependencyError for the unsatisfiable
|
227
|
+
# Gem::Resolver::DependencyRequest +dep+
|
228
|
+
|
182
229
|
def initialize dep, platform_mismatch=nil
|
183
230
|
if platform_mismatch and !platform_mismatch.empty?
|
184
231
|
plats = platform_mismatch.map { |x| x.platform.to_s }.sort.uniq
|