rubygems-update 1.6.1 → 1.6.2

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.

data.tar.gz.sig CHANGED
Binary file
@@ -1,4 +1,12 @@
1
- === 1.6.1 / 2011-03-03
1
+ === 1.6.2 / 2011-03-08
2
+
3
+ Bug Fixes:
4
+
5
+ * require of an activated gem could cause activation conflicts. Fixes
6
+ Bug #29056 by Dave Verwer.
7
+ * `gem outdated` now works with up-to-date prerelease gems.
8
+
9
+ === 1.6.1 / 2011-03-03
2
10
 
3
11
  Bug Fixes:
4
12
 
@@ -23,8 +23,7 @@ See UPGRADING.rdoc for more details and alternative instructions.
23
23
 
24
24
  -----
25
25
 
26
- If you don't have any RubyGems install, there is still the pre-gem approach to
27
- getting software, doing it manually:
26
+ If you don't have RubyGems installed, your can still do it manually:
28
27
 
29
28
  * Download from: https://rubygems.org/pages/download
30
29
  * Unpack into a directory and cd there
@@ -38,11 +37,11 @@ For more details and other options, see:
38
37
 
39
38
  === Support Requests
40
39
 
41
- Are you unsure of how to use rubygems? Do you think you've found a bug and
40
+ Are you unsure of how to use RubyGems? Do you think you've found a bug and
42
41
  you're not sure? If that is the case, the best place for you is to file a
43
42
  support request at {help.rubygems.org}[http://help.rubygems.org].
44
43
 
45
- === Filing tickets
44
+ === Filing Tickets
46
45
 
47
46
  You're sure you've found a bug! But where do you let us know? The best place
48
47
  for letting the RubyGems team know about bugs you've found is {on the rubygems
@@ -118,7 +118,7 @@ require 'rbconfig'
118
118
  # -The RubyGems Team
119
119
 
120
120
  module Gem
121
- VERSION = '1.6.1'
121
+ VERSION = '1.6.2'
122
122
 
123
123
  ##
124
124
  # Raised when RubyGems is unable to load or activate a gem. Contains the
@@ -252,6 +252,7 @@ module Gem
252
252
  # list of candidate gems, then we have a version conflict.
253
253
  existing_spec = @loaded_specs[dep.name]
254
254
 
255
+ # TODO: unless dep.matches_spec? existing_spec then
255
256
  unless matches.any? { |spec| spec.version == existing_spec.version } then
256
257
  sources_message = sources.map { |spec| spec.full_name }
257
258
  stack_message = @loaded_stacks[dep.name].map { |spec| spec.full_name }
@@ -19,12 +19,13 @@ class Gem::Commands::OutdatedCommand < Gem::Command
19
19
  locals = Gem::SourceIndex.from_installed_gems
20
20
 
21
21
  locals.outdated.sort.each do |name|
22
- local = locals.find_name(name).last
23
-
24
- dep = Gem::Dependency.new local.name, ">= #{local.version}"
22
+ local = locals.find_name(name).last
23
+ dep = Gem::Dependency.new local.name, ">= #{local.version}"
25
24
  remotes = Gem::SpecFetcher.fetcher.fetch dep
26
- remote = remotes.last.first
27
25
 
26
+ next if remotes.empty?
27
+
28
+ remote = remotes.last.first
28
29
  say "#{local.name} (#{local.version} < #{remote.version})"
29
30
  end
30
31
  end
@@ -35,15 +35,20 @@ module Kernel
35
35
  if Gem.unresolved_deps.empty? or Gem.loaded_path? path then
36
36
  gem_original_require path
37
37
  else
38
- specs = Gem.searcher.find_in_unresolved path
39
- unless specs.empty? then
40
- specs = [specs.last]
41
- else
42
- specs = Gem.searcher.find_in_unresolved_tree path
43
- end
38
+ spec = Gem.searcher.find_active path
39
+
40
+ unless spec then
41
+ found_specs = Gem.searcher.find_in_unresolved path
42
+ unless found_specs.empty? then
43
+ found_specs = [found_specs.last]
44
+ else
45
+ found_specs = Gem.searcher.find_in_unresolved_tree path
46
+ end
44
47
 
45
- specs.each do |spec|
46
- Gem.activate spec.name, spec.version # FIX: this is dumb
48
+ found_specs.each do |found_spec|
49
+ # FIX: this is dumb, activate a spec instead of name/version
50
+ Gem.activate found_spec.name, found_spec.version
51
+ end
47
52
  end
48
53
 
49
54
  return gem_original_require path
@@ -50,6 +50,14 @@ class Gem::GemPathSearcher
50
50
  end
51
51
  end
52
52
 
53
+ def find_active(glob)
54
+ # HACK violation of encapsulation
55
+ @gemspecs.find do |spec|
56
+ # TODO: inverted responsibility
57
+ spec.loaded? and matching_file? spec, glob
58
+ end
59
+ end
60
+
53
61
  ##
54
62
  # Works like #find, but finds all gemspecs matching +glob+.
55
63
 
@@ -70,7 +70,8 @@ class Gem::SpecFetcher
70
70
  # Returns the local directory to write +uri+ to.
71
71
 
72
72
  def cache_dir(uri)
73
- escaped_path = uri.path.sub(%r[^/([a-z]):/]i, '/\\1-/') # Correct for windows paths
73
+ # Correct for windows paths
74
+ escaped_path = uri.path.sub(/^\/([a-z]):\//i, '/\\1-/')
74
75
  File.join @dir, "#{uri.host}%#{uri.port}", File.dirname(escaped_path)
75
76
  end
76
77
 
@@ -80,8 +81,14 @@ class Gem::SpecFetcher
80
81
  # false, all platforms are returned. If +prerelease+ is true,
81
82
  # prerelease versions are included.
82
83
 
83
- def fetch_with_errors(dependency, all = false, matching_platform = true, prerelease = false)
84
- specs_and_sources, errors = find_matching_with_errors dependency, all, matching_platform, prerelease
84
+ def fetch_with_errors(dependency,
85
+ all = false,
86
+ matching_platform = true,
87
+ prerelease = false)
88
+ specs_and_sources, errors = find_matching_with_errors(dependency,
89
+ all,
90
+ matching_platform,
91
+ prerelease)
85
92
 
86
93
  ss = specs_and_sources.map do |spec_tuple, source_uri|
87
94
  [fetch_spec(spec_tuple, URI.parse(source_uri)), source_uri]
@@ -168,6 +168,46 @@ class TestGem < Gem::TestCase
168
168
  end
169
169
  end
170
170
 
171
+ def test_require_already_activated
172
+ save_loaded_features do
173
+ a1 = new_spec "a", "1", nil, "lib/d.rb"
174
+
175
+ install_specs a1 # , a2, b1, b2, c1, c2
176
+
177
+ Gem.activate "a", "= 1"
178
+ assert_equal %w(a-1), loaded_spec_names
179
+ assert_equal [], unresolved_names
180
+
181
+ assert require "d"
182
+
183
+ assert_equal %w(a-1), loaded_spec_names
184
+ assert_equal [], unresolved_names
185
+ end
186
+ end
187
+
188
+ def test_require_already_activated_indirect_conflict
189
+ save_loaded_features do
190
+ a1 = new_spec "a", "1", "b" => "> 0"
191
+ a2 = new_spec "a", "2", "b" => "> 0"
192
+ b1 = new_spec "b", "1", "c" => ">= 1"
193
+ b2 = new_spec "b", "2", "c" => ">= 2"
194
+ c1 = new_spec "c", "1", nil, "lib/d.rb"
195
+ c2 = new_spec("c", "2", { "a" => "1" }, "lib/d.rb") # conflicts with a-2
196
+
197
+ install_specs a1, a2, b1, b2, c1, c2
198
+
199
+ Gem.activate "a", "= 1"
200
+ Gem.activate "c", "= 1"
201
+ assert_equal %w(a-1 c-1), loaded_spec_names
202
+ assert_equal ["b (> 0)"], unresolved_names
203
+
204
+ assert require "d"
205
+
206
+ assert_equal %w(a-1 c-1), loaded_spec_names
207
+ assert_equal ["b (> 0)"], unresolved_names
208
+ end
209
+ end
210
+
171
211
  def test_require_missing
172
212
  save_loaded_features do
173
213
  assert_raises ::LoadError do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubygems-update
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 6
9
- - 1
10
- version: 1.6.1
9
+ - 2
10
+ version: 1.6.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jim Weirich
@@ -38,7 +38,7 @@ cert_chain:
38
38
  x52qPcexcYZR7w==
39
39
  -----END CERTIFICATE-----
40
40
 
41
- date: 2011-03-03 00:00:00 -08:00
41
+ date: 2011-03-08 00:00:00 -08:00
42
42
  default_executable:
43
43
  dependencies:
44
44
  - !ruby/object:Gem::Dependency
@@ -110,12 +110,12 @@ dependencies:
110
110
  requirements:
111
111
  - - ">="
112
112
  - !ruby/object:Gem::Version
113
- hash: 43
113
+ hash: 41
114
114
  segments:
115
115
  - 2
116
116
  - 9
117
- - 0
118
- version: 2.9.0
117
+ - 1
118
+ version: 2.9.1
119
119
  type: :development
120
120
  version_requirements: *id005
121
121
  description: |-
@@ -134,8 +134,7 @@ description: |-
134
134
 
135
135
  -----
136
136
 
137
- If you don't have any RubyGems install, there is still the pre-gem approach to
138
- getting software, doing it manually:
137
+ If you don't have RubyGems installed, your can still do it manually:
139
138
 
140
139
  * Download from: https://rubygems.org/pages/download
141
140
  * Unpack into a directory and cd there
@@ -361,7 +360,7 @@ post_install_message:
361
360
  rdoc_options:
362
361
  - --main
363
362
  - README.rdoc
364
- - --title=RubyGems 1.6.1 Documentation
363
+ - --title=RubyGems 1.6.2 Documentation
365
364
  require_paths:
366
365
  - hide_lib_for_update
367
366
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -387,7 +386,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
387
386
  requirements: []
388
387
 
389
388
  rubyforge_project: rubygems
390
- rubygems_version: 1.6.0
389
+ rubygems_version: 1.6.1
391
390
  signing_key:
392
391
  specification_version: 3
393
392
  summary: RubyGems is a package management framework for Ruby
metadata.gz.sig CHANGED
Binary file