rubygems-update 1.5.3 → 1.6.0
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.
- data.tar.gz.sig +2 -1
- data/History.txt +60 -9
- data/Manifest.txt +1 -1
- data/Rakefile +0 -2
- data/lib/rubygems.rb +142 -65
- data/lib/rubygems/commands/owner_command.rb +3 -2
- data/lib/rubygems/commands/pristine_command.rb +5 -3
- data/lib/rubygems/commands/push_command.rb +8 -4
- data/lib/rubygems/commands/setup_command.rb +1 -2
- data/lib/rubygems/commands/uninstall_command.rb +5 -0
- data/lib/rubygems/commands/unpack_command.rb +10 -16
- data/lib/rubygems/config_file.rb +12 -5
- data/lib/rubygems/custom_require.rb +27 -7
- data/lib/rubygems/dependency.rb +33 -8
- data/lib/rubygems/dependency_installer.rb +21 -6
- data/lib/rubygems/dependency_list.rb +35 -3
- data/lib/rubygems/doc_manager.rb +6 -4
- data/lib/rubygems/gem_path_searcher.rb +45 -1
- data/lib/rubygems/gemcutter_utilities.rb +33 -0
- data/lib/rubygems/indexer.rb +1 -0
- data/lib/rubygems/installer.rb +11 -7
- data/lib/rubygems/installer_test_case.rb +23 -15
- data/lib/rubygems/mock_gem_ui.rb +1 -1
- data/lib/rubygems/remote_fetcher.rb +29 -10
- data/lib/rubygems/requirement.rb +1 -1
- data/lib/rubygems/security.rb +1 -0
- data/lib/rubygems/source_index.rb +3 -2
- data/lib/rubygems/spec_fetcher.rb +3 -1
- data/lib/rubygems/specification.rb +54 -12
- data/lib/rubygems/test_case.rb +99 -28
- data/lib/rubygems/test_utilities.rb +11 -1
- data/lib/rubygems/uninstaller.rb +22 -11
- data/lib/rubygems/user_interaction.rb +50 -29
- data/lib/rubygems/validator.rb +1 -1
- data/test/rubygems/fix_openssl_warnings.rb +12 -0
- data/test/rubygems/plugin/load/rubygems_plugin.rb +3 -1
- data/test/rubygems/test_gem.rb +384 -38
- data/test/rubygems/test_gem_builder.rb +1 -1
- data/test/rubygems/test_gem_command_manager.rb +2 -2
- data/test/rubygems/test_gem_commands_build_command.rb +1 -1
- data/test/rubygems/test_gem_commands_cert_command.rb +2 -1
- data/test/rubygems/test_gem_commands_dependency_command.rb +6 -5
- data/test/rubygems/test_gem_commands_fetch_command.rb +4 -4
- data/test/rubygems/test_gem_commands_install_command.rb +21 -18
- data/test/rubygems/test_gem_commands_lock_command.rb +1 -1
- data/test/rubygems/test_gem_commands_outdated_command.rb +2 -5
- data/test/rubygems/test_gem_commands_owner_command.rb +42 -0
- data/test/rubygems/test_gem_commands_pristine_command.rb +28 -8
- data/test/rubygems/test_gem_commands_push_command.rb +31 -5
- data/test/rubygems/test_gem_commands_specification_command.rb +8 -8
- data/test/rubygems/test_gem_commands_stale_command.rb +4 -2
- data/test/rubygems/test_gem_commands_uninstall_command.rb +23 -4
- data/test/rubygems/test_gem_commands_unpack_command.rb +10 -8
- data/test/rubygems/test_gem_commands_update_command.rb +16 -13
- data/test/rubygems/test_gem_commands_which_command.rb +1 -1
- data/test/rubygems/test_gem_config_file.rb +14 -0
- data/test/rubygems/test_gem_dependency.rb +39 -0
- data/test/rubygems/test_gem_dependency_installer.rb +213 -92
- data/test/rubygems/test_gem_dependency_list.rb +37 -17
- data/test/rubygems/test_gem_doc_manager.rb +5 -4
- data/test/rubygems/test_gem_format.rb +2 -2
- data/test/rubygems/test_gem_gemcutter_utilities.rb +48 -0
- data/test/rubygems/test_gem_indexer.rb +11 -10
- data/test/rubygems/test_gem_install_update_options.rb +0 -2
- data/test/rubygems/test_gem_installer.rb +151 -78
- data/test/rubygems/test_gem_package_tar_output.rb +3 -0
- data/test/rubygems/test_gem_remote_fetcher.rb +23 -14
- data/test/rubygems/test_gem_requirement.rb +4 -0
- data/test/rubygems/test_gem_security.rb +1 -0
- data/test/rubygems/test_gem_source_index.rb +17 -16
- data/test/rubygems/test_gem_spec_fetcher.rb +6 -1
- data/test/rubygems/test_gem_specification.rb +81 -31
- data/test/rubygems/test_gem_stream_ui.rb +11 -1
- data/test/rubygems/test_gem_uninstaller.rb +70 -10
- data/test/rubygems/test_gem_validator.rb +1 -1
- data/test/rubygems/test_kernel.rb +1 -1
- metadata +7 -7
- metadata.gz.sig +0 -0
- data/ChangeLog +0 -5811
data.tar.gz.sig
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
�Ѣ�X�;����vYṛ*�-N���j��|��q�Q6�c�����)8�R2�;��+H6KVQ,�PKɶ 5^���f:�]��Dw��1�';�`�O���
|
2
|
+
P��!��RB�s�!��Q.hO0�ƨy3m��ϚJ��g8"V�����8A'(#�ҥ!��1�(��怤:�v���v��y�AP�MAׁ�9r*O:!3}U���t6�����U�5�e;;�p��Xd�n�>�n�������S�읃�aE҂E;:^
|
data/History.txt
CHANGED
@@ -1,12 +1,59 @@
|
|
1
|
-
=== 1.
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
1
|
+
=== 1.6.0 / 2011-02-29
|
2
|
+
|
3
|
+
4 Deprecations:
|
4
|
+
|
5
|
+
* RubyGems no longer requires 'thread'. Rails < 3 will need to add require
|
6
|
+
'thread' to their applications.
|
7
|
+
* Gem.cache is deprecated. Use Gem.source_index.
|
8
|
+
* RbConfig.datadir is deprecated. Use Gem.datadir.
|
9
|
+
* Gem::LoadError#version_requirements has been removed. Use
|
10
|
+
Gem::LoadError#requirement.
|
11
|
+
|
12
|
+
2 Major Enhancements:
|
13
|
+
|
14
|
+
* Rewrote how Gem::activate (gem and require) resolves dependencies.
|
15
|
+
* Gem::LoadError#version_requirement has been removed. Use
|
16
|
+
Gem::LoadError#requirement.
|
17
|
+
|
18
|
+
17 Minor Enhancments:
|
19
|
+
|
20
|
+
* Added --key to `gem push` for setting alternate API keys.
|
21
|
+
* Added --format-executable support to gem uninstall.
|
22
|
+
* Added Gem::DependencyList#clear.
|
23
|
+
* Added Gem::DependencyList#remove_specs_unsatisfied_by
|
24
|
+
* Added Gem.latest_spec_for, latest_version_for, and latest_rubygems_version.
|
25
|
+
* Added Gem::Dependency#merge which merges requirements for two
|
26
|
+
dependencies.
|
27
|
+
* Added Gem::TestCase#util_spec for faster tests.
|
28
|
+
* Added Gem::Specification#dependent_specs.
|
29
|
+
* Added Gem::TestCase#new_spec and Gem::TestCase#install_specs.
|
30
|
+
* Added flag to include prerelease gems in Gem::SourceIndex#latest_specs.
|
31
|
+
* Gem.cache_dir always references the proper cache dir.
|
32
|
+
Pass true to support a user path.
|
33
|
+
* Gem.cache_gem, given a filename always references the cache gem.
|
34
|
+
Pass true to support a user path.
|
35
|
+
* Added Gem::Specification#conflicts
|
36
|
+
* Removed rdoc gem/require from test_case.rb.
|
37
|
+
* Rubygems will no longer let you push if you're using beta or unreleased
|
38
|
+
rubygems.
|
39
|
+
* Save RAM / GC churn by removing spec.files and rdoc options from
|
40
|
+
locally cached gem specifications.
|
41
|
+
* SpecFetcher.fetch_spec can now take a string source_uri.
|
42
|
+
|
43
|
+
10 Bug Fixes:
|
44
|
+
|
45
|
+
* Added missing require of Gem::RemoteFetcher to the unpack command.
|
46
|
+
* RubyGems now completely removes a previous install when reinstalling.
|
47
|
+
* Fixed Gem::Installer#generate_bin to only chmod files that exist.
|
48
|
+
* Fixed handling of Windows style file:/// uris.
|
49
|
+
* Fixed requires in tests. (shota)
|
50
|
+
* Fixed script generation on Windows.
|
51
|
+
* Fixed test issues if you have older rubygems installed.
|
52
|
+
* Gem::DependencyInstaller tests use Gem::Security, add the missing require.
|
53
|
+
* Gem::Security used FileUtils but didn't require it. Reported by Elia Schito.
|
54
|
+
* Gem::Uninstaller now respects --format-executable.
|
55
|
+
|
56
|
+
=== 1.5.3 / 2011-02-26
|
10
57
|
|
11
58
|
Bug Fixes:
|
12
59
|
|
@@ -21,6 +68,8 @@ Bug Fixes:
|
|
21
68
|
|
22
69
|
=== 1.5.1 / 2011-02-09
|
23
70
|
|
71
|
+
==== NOTE: `gem update --system` is broken. See UPGRADING.rdoc.
|
72
|
+
|
24
73
|
Minor Enhancement:
|
25
74
|
|
26
75
|
* Added ability to do gem update --system X.Y.Z.
|
@@ -36,6 +85,8 @@ Bug Fixes:
|
|
36
85
|
|
37
86
|
=== 1.5.0 / 2011-01-31
|
38
87
|
|
88
|
+
==== NOTE: `gem update --system` is broken. See UPGRADING.rdoc.
|
89
|
+
|
39
90
|
Major Enhancements:
|
40
91
|
|
41
92
|
* Finally fixed all known 1.9.x issues. Upgrading is now possible!
|
data/Manifest.txt
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
.autotest
|
2
2
|
.document
|
3
|
-
ChangeLog
|
4
3
|
GPL.txt
|
5
4
|
History.txt
|
6
5
|
LICENSE.txt
|
@@ -109,6 +108,7 @@ test/rubygems/bogussources.rb
|
|
109
108
|
test/rubygems/data/gem-private_key.pem
|
110
109
|
test/rubygems/data/gem-public_cert.pem
|
111
110
|
test/rubygems/fake_certlib/openssl.rb
|
111
|
+
test/rubygems/fix_openssl_warnings.rb
|
112
112
|
test/rubygems/foo/discover.rb
|
113
113
|
test/rubygems/functional.rb
|
114
114
|
test/rubygems/insure_session.rb
|
data/Rakefile
CHANGED
data/lib/rubygems.rb
CHANGED
@@ -26,8 +26,8 @@ if Gem::GEM_PRELUDE_SUCKAGE and defined?(Gem::QuickLoader) then
|
|
26
26
|
end
|
27
27
|
|
28
28
|
require 'rubygems/defaults'
|
29
|
+
require "rubygems/dependency_list"
|
29
30
|
require 'rbconfig'
|
30
|
-
require 'thread' # HACK: remove me for 1.5 - this is here just for rails
|
31
31
|
|
32
32
|
##
|
33
33
|
# RubyGems is the Ruby standard for publishing and managing third party
|
@@ -118,7 +118,7 @@ require 'thread' # HACK: remove me for 1.5 - this is here just for rails
|
|
118
118
|
# -The RubyGems Team
|
119
119
|
|
120
120
|
module Gem
|
121
|
-
|
121
|
+
VERSION = '1.6.0'
|
122
122
|
|
123
123
|
##
|
124
124
|
# Raised when RubyGems is unable to load or activate a gem. Contains the
|
@@ -131,25 +131,11 @@ module Gem
|
|
131
131
|
|
132
132
|
# Version requirement of gem
|
133
133
|
attr_accessor :requirement
|
134
|
+
end
|
134
135
|
|
135
|
-
|
136
|
-
warn "#{Gem.location_of_caller.join ':'}:Warning: " \
|
137
|
-
"Gem::LoadError#version_requirement is deprecated " \
|
138
|
-
"and will be removed on or after January 2011. " \
|
139
|
-
"Use #requirement."
|
140
|
-
|
141
|
-
requirement
|
142
|
-
end
|
143
|
-
|
144
|
-
def version_requirement= requirement
|
145
|
-
warn "#{Gem.location_of_caller.join ':'}:Warning: " \
|
146
|
-
"Gem::LoadError#version_requirement= is deprecated " \
|
147
|
-
"and will be removed on or after January 2011. " \
|
148
|
-
"Use #requirement."
|
136
|
+
# :stopdoc:
|
149
137
|
|
150
|
-
|
151
|
-
end
|
152
|
-
end
|
138
|
+
RubyGemsVersion = VERSION
|
153
139
|
|
154
140
|
RbConfigPriorities = %w[
|
155
141
|
EXEEXT RUBY_SO_NAME arch bindir datadir libdir ruby_install_name
|
@@ -174,6 +160,9 @@ module Gem
|
|
174
160
|
DIRECTORIES = %w[cache doc gems specifications] unless defined?(DIRECTORIES)
|
175
161
|
|
176
162
|
RubyGemsPackageVersion = VERSION
|
163
|
+
|
164
|
+
RUBYGEMS_DIR = File.dirname File.expand_path(__FILE__)
|
165
|
+
|
177
166
|
# :startdoc:
|
178
167
|
|
179
168
|
##
|
@@ -210,21 +199,30 @@ module Gem
|
|
210
199
|
# activated. Returns false if it can't find the path in a gem.
|
211
200
|
|
212
201
|
def self.try_activate path
|
202
|
+
# finds the _latest_ version... regardless of loaded specs and their deps
|
203
|
+
|
204
|
+
# TODO: use find_all and bork if ambiguous
|
205
|
+
|
213
206
|
spec = Gem.searcher.find path
|
214
207
|
return false unless spec
|
215
208
|
|
216
|
-
|
209
|
+
begin
|
210
|
+
Gem.activate spec.name, "= #{spec.version}"
|
211
|
+
rescue Gem::LoadError # this could fail due to gem dep collisions, go lax
|
212
|
+
Gem.activate spec.name
|
213
|
+
end
|
214
|
+
|
217
215
|
return true
|
218
216
|
end
|
219
217
|
|
220
218
|
##
|
221
|
-
# Activates an installed gem matching +
|
219
|
+
# Activates an installed gem matching +dep+. The gem must satisfy
|
222
220
|
# +requirements+.
|
223
221
|
#
|
224
222
|
# Returns true if the gem is activated, false if it is already
|
225
223
|
# loaded, or an exception otherwise.
|
226
224
|
#
|
227
|
-
# Gem#activate adds the library paths in +
|
225
|
+
# Gem#activate adds the library paths in +dep+ to $LOAD_PATH. Before a Gem
|
228
226
|
# is activated its required Gems are activated. If the version information
|
229
227
|
# is omitted, the highest version Gem of the supplied name is loaded. If a
|
230
228
|
# Gem is not found that meets the version requirements or a required Gem is
|
@@ -233,63 +231,78 @@ module Gem
|
|
233
231
|
# More information on version requirements can be found in the
|
234
232
|
# Gem::Requirement and Gem::Version documentation.
|
235
233
|
|
236
|
-
def self.activate(
|
234
|
+
def self.activate(dep, *requirements)
|
235
|
+
# TODO: remove options entirely
|
237
236
|
if requirements.last.is_a?(Hash)
|
238
237
|
options = requirements.pop
|
239
238
|
else
|
240
239
|
options = {}
|
241
240
|
end
|
242
241
|
|
243
|
-
|
244
|
-
|
245
|
-
if requirements.empty? then
|
246
|
-
requirements = Gem::Requirement.default
|
247
|
-
end
|
248
|
-
|
249
|
-
unless gem.respond_to?(:name) and
|
250
|
-
gem.respond_to?(:requirement) then
|
251
|
-
gem = Gem::Dependency.new(gem, requirements)
|
252
|
-
end
|
242
|
+
requirements = Gem::Requirement.default if requirements.empty?
|
243
|
+
dep = Gem::Dependency.new(dep, requirements) unless Gem::Dependency === dep
|
253
244
|
|
254
|
-
|
255
|
-
|
245
|
+
# TODO: remove sources entirely
|
246
|
+
sources = options[:sources] || []
|
247
|
+
matches = Gem.source_index.search dep, true
|
248
|
+
report_activate_error(dep) if matches.empty?
|
256
249
|
|
257
|
-
if @loaded_specs[
|
250
|
+
if @loaded_specs[dep.name] then
|
258
251
|
# This gem is already loaded. If the currently loaded gem is not in the
|
259
252
|
# list of candidate gems, then we have a version conflict.
|
260
|
-
existing_spec = @loaded_specs[
|
253
|
+
existing_spec = @loaded_specs[dep.name]
|
261
254
|
|
262
255
|
unless matches.any? { |spec| spec.version == existing_spec.version } then
|
263
|
-
|
264
|
-
|
256
|
+
sources_message = sources.map { |spec| spec.full_name }
|
257
|
+
stack_message = @loaded_stacks[dep.name].map { |spec| spec.full_name }
|
265
258
|
|
266
|
-
|
267
|
-
|
268
|
-
|
259
|
+
msg = "can't activate #{dep} for #{sources_message.inspect}, "
|
260
|
+
msg << "already activated #{existing_spec.full_name} for "
|
261
|
+
msg << "#{stack_message.inspect}"
|
269
262
|
|
270
|
-
|
271
|
-
|
272
|
-
|
263
|
+
e = Gem::LoadError.new msg
|
264
|
+
e.name = dep.name
|
265
|
+
e.requirement = dep.requirement
|
273
266
|
|
274
|
-
|
267
|
+
raise e
|
275
268
|
end
|
276
269
|
|
277
270
|
return false
|
278
271
|
end
|
279
272
|
|
280
|
-
# new load
|
281
273
|
spec = matches.last
|
274
|
+
|
275
|
+
conf = spec.conflicts
|
276
|
+
unless conf.empty? then
|
277
|
+
why = conf.map { |act,con|
|
278
|
+
"#{act.full_name} conflicts with #{con.join(", ")}"
|
279
|
+
}.join ", "
|
280
|
+
|
281
|
+
# TODO: improve message by saying who activated `con`
|
282
|
+
|
283
|
+
raise LoadError, "Unable to activate #{spec.full_name}, because #{why}"
|
284
|
+
end
|
285
|
+
|
282
286
|
return false if spec.loaded?
|
283
287
|
|
284
288
|
spec.loaded = true
|
285
|
-
@loaded_specs[spec.name]
|
289
|
+
@loaded_specs[spec.name] = spec
|
286
290
|
@loaded_stacks[spec.name] = sources.dup
|
287
291
|
|
288
|
-
|
289
|
-
|
290
|
-
|
292
|
+
spec.runtime_dependencies.each do |spec_dep|
|
293
|
+
next if Gem.loaded_specs.include? spec_dep.name
|
294
|
+
specs = Gem.source_index.search spec_dep, true
|
295
|
+
|
296
|
+
if specs.size == 1 then
|
297
|
+
self.activate spec_dep
|
298
|
+
else
|
299
|
+
name = spec_dep.name
|
300
|
+
unresolved_deps[name] = unresolved_deps[name].merge spec_dep
|
301
|
+
end
|
291
302
|
end
|
292
303
|
|
304
|
+
unresolved_deps.delete spec.name
|
305
|
+
|
293
306
|
require_paths = spec.require_paths.map do |path|
|
294
307
|
File.join spec.full_gem_path, path
|
295
308
|
end
|
@@ -308,6 +321,10 @@ module Gem
|
|
308
321
|
return true
|
309
322
|
end
|
310
323
|
|
324
|
+
def self.unresolved_deps
|
325
|
+
@unresolved_deps ||= Hash.new { |h, n| h[n] = Gem::Dependency.new n }
|
326
|
+
end
|
327
|
+
|
311
328
|
##
|
312
329
|
# An Array of all possible load paths for all versions of all gems in the
|
313
330
|
# Gem installation.
|
@@ -540,6 +557,7 @@ module Gem
|
|
540
557
|
# to be depending on HOME in those code samples. I propose that
|
541
558
|
# it should fallback to USERPROFILE and HOMEDRIVE + HOMEPATH (at
|
542
559
|
# least on Win32).
|
560
|
+
#++
|
543
561
|
|
544
562
|
def self.find_home
|
545
563
|
unless RUBY_VERSION > '1.9' then
|
@@ -716,6 +734,27 @@ module Gem
|
|
716
734
|
@gem_path
|
717
735
|
end
|
718
736
|
|
737
|
+
##
|
738
|
+
# Get the appropriate cache path.
|
739
|
+
#
|
740
|
+
# Pass a string to use a different base path, or nil/false (default) for
|
741
|
+
# Gem.dir.
|
742
|
+
#
|
743
|
+
|
744
|
+
def self.cache_dir(custom_dir=false)
|
745
|
+
File.join(custom_dir ? custom_dir : Gem.dir, 'cache')
|
746
|
+
end
|
747
|
+
|
748
|
+
##
|
749
|
+
# Given a gem path, find the gem in cache.
|
750
|
+
#
|
751
|
+
# Pass a string as the second argument to use a different base path, or
|
752
|
+
# nil/false (default) for Gem.dir.
|
753
|
+
|
754
|
+
def self.cache_gem(filename, user_dir=false)
|
755
|
+
File.join(cache_dir(user_dir), filename)
|
756
|
+
end
|
757
|
+
|
719
758
|
##
|
720
759
|
# Set array of platforms this RubyGems supports (primarily for testing).
|
721
760
|
|
@@ -781,17 +820,16 @@ module Gem
|
|
781
820
|
end
|
782
821
|
|
783
822
|
##
|
784
|
-
# The directory prefix this RubyGems was installed at.
|
823
|
+
# The directory prefix this RubyGems was installed at. If your
|
824
|
+
# prefix is in a standard location (ie, rubygems is installed where
|
825
|
+
# you'd expect it to be), then prefix returns nil.
|
785
826
|
|
786
827
|
def self.prefix
|
787
|
-
|
788
|
-
prefix = File.dirname dir
|
828
|
+
prefix = File.dirname RUBYGEMS_DIR
|
789
829
|
|
790
|
-
if prefix
|
791
|
-
prefix
|
792
|
-
'lib'
|
793
|
-
nil
|
794
|
-
else
|
830
|
+
if prefix != File.expand_path(ConfigMap[:sitelibdir]) and
|
831
|
+
prefix != File.expand_path(ConfigMap[:libdir]) and
|
832
|
+
'lib' == File.basename(RUBYGEMS_DIR) then
|
795
833
|
prefix
|
796
834
|
end
|
797
835
|
end
|
@@ -899,6 +937,29 @@ module Gem
|
|
899
937
|
@ruby
|
900
938
|
end
|
901
939
|
|
940
|
+
def self.latest_spec_for name
|
941
|
+
dependency = Gem::Dependency.new name
|
942
|
+
fetcher = Gem::SpecFetcher.fetcher
|
943
|
+
spec_tuples = fetcher.find_matching dependency
|
944
|
+
|
945
|
+
match = spec_tuples.select { |(n, _, p), _|
|
946
|
+
n == name and Gem::Platform.match p
|
947
|
+
}.sort_by { |(_, version, _), _|
|
948
|
+
version
|
949
|
+
}.last
|
950
|
+
|
951
|
+
match and fetcher.fetch_spec(*match)
|
952
|
+
end
|
953
|
+
|
954
|
+
def self.latest_version_for name
|
955
|
+
spec = latest_spec_for name
|
956
|
+
spec and spec.version
|
957
|
+
end
|
958
|
+
|
959
|
+
def self.latest_rubygems_version
|
960
|
+
latest_version_for "rubygems-update"
|
961
|
+
end
|
962
|
+
|
902
963
|
##
|
903
964
|
# A Gem::Version for the currently running ruby.
|
904
965
|
|
@@ -996,6 +1057,13 @@ module Gem
|
|
996
1057
|
@suffix_pattern ||= "{#{suffixes.join(',')}}"
|
997
1058
|
end
|
998
1059
|
|
1060
|
+
def self.loaded_path? path
|
1061
|
+
# TODO: ruby needs a feature to let us query what's loaded in 1.8 and 1.9
|
1062
|
+
$LOADED_FEATURES.find { |s|
|
1063
|
+
s =~ /(^|\/)#{Regexp.escape path}#{Regexp.union(*Gem.suffixes)}$/
|
1064
|
+
}
|
1065
|
+
end
|
1066
|
+
|
999
1067
|
##
|
1000
1068
|
# Suffixes for require-able paths.
|
1001
1069
|
|
@@ -1142,12 +1210,15 @@ module Gem
|
|
1142
1210
|
|
1143
1211
|
attr_reader :pre_uninstall_hooks
|
1144
1212
|
|
1145
|
-
|
1146
|
-
|
1147
|
-
alias cache source_index # an alias for the old name
|
1213
|
+
end
|
1148
1214
|
|
1149
|
-
|
1215
|
+
def self.cache # :nodoc:
|
1216
|
+
warn "#{Gem.location_of_caller.join ':'}:Warning: " \
|
1217
|
+
"Gem::cache is deprecated and will be removed on or after " \
|
1218
|
+
"August 2011. " \
|
1219
|
+
"Use Gem::source_index."
|
1150
1220
|
|
1221
|
+
source_index
|
1151
1222
|
end
|
1152
1223
|
|
1153
1224
|
##
|
@@ -1215,7 +1286,13 @@ end
|
|
1215
1286
|
# "#{ConfigMap[:datadir]}/#{package_name}".
|
1216
1287
|
|
1217
1288
|
def RbConfig.datadir(package_name)
|
1218
|
-
|
1289
|
+
warn "#{Gem.location_of_caller.join ':'}:Warning: " \
|
1290
|
+
"RbConfig.datadir is deprecated and will be removed on or after " \
|
1291
|
+
"August 2011. " \
|
1292
|
+
"Use Gem::datadir."
|
1293
|
+
|
1294
|
+
require 'rbconfig/datadir'
|
1295
|
+
|
1219
1296
|
Gem.datadir(package_name) ||
|
1220
1297
|
File.join(Gem::ConfigMap[:datadir], package_name)
|
1221
1298
|
end
|
@@ -1246,7 +1323,7 @@ end
|
|
1246
1323
|
##
|
1247
1324
|
# Enables the require hook for RubyGems.
|
1248
1325
|
|
1249
|
-
require 'rubygems/custom_require'
|
1326
|
+
require 'rubygems/custom_require'
|
1250
1327
|
|
1251
1328
|
Gem.clear_paths
|
1252
1329
|
|