rubygems-update 1.8.12 → 1.8.13

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.

@@ -1,5 +1,16 @@
1
1
  # coding: UTF-8
2
2
 
3
+ === 1.8.13 / 2011-12-21
4
+
5
+ * 1 bug fix:
6
+
7
+ * Check loaded_specs properly when trying to satisfy a dep
8
+
9
+ * 2 minor enhancements:
10
+
11
+ * Remove using #loaded_path? for performance
12
+ * Remove Zlib workaround for Windows build.
13
+
3
14
  === 1.8.12 / 2011-12-02
4
15
 
5
16
  * Bug fix:
@@ -118,7 +118,7 @@ require "rubygems/deprecate"
118
118
  # -The RubyGems Team
119
119
 
120
120
  module Gem
121
- VERSION = '1.8.12'
121
+ VERSION = '1.8.13'
122
122
 
123
123
  ##
124
124
  # Raised when RubyGems is unable to load or activate a gem. Contains the
@@ -980,9 +980,8 @@ module Gem
980
980
 
981
981
  def self.loaded_path? path
982
982
  # TODO: ruby needs a feature to let us query what's loaded in 1.8 and 1.9
983
- $LOADED_FEATURES.find { |s|
984
- s =~ /(^|\/)#{Regexp.escape path}#{Regexp.union(*Gem.suffixes)}$/
985
- }
983
+ re = /(^|\/)#{Regexp.escape path}#{Regexp.union(*Gem.suffixes)}$/
984
+ $LOADED_FEATURES.any? { |s| s =~ re }
986
985
  end
987
986
 
988
987
  ##
@@ -32,7 +32,7 @@ module Kernel
32
32
  # that file has already been loaded is preserved.
33
33
 
34
34
  def require path
35
- if Gem.unresolved_deps.empty? or Gem.loaded_path? path then
35
+ if Gem.unresolved_deps.empty? then
36
36
  gem_original_require path
37
37
  else
38
38
  spec = Gem::Specification.find { |s|
@@ -210,21 +210,25 @@ class Gem::Package::TarInput
210
210
  # the unpacking speed) we threw our hands in the air and declared that
211
211
  # this method would use the String IO approach on all platforms at all
212
212
  # times. And that's the way it is.
213
-
213
+ #
214
+ # Revisited. Here's the beginning of the long story.
215
+ # http://osdir.com/ml/lang.ruby.gems.devel/2007-06/msg00045.html
216
+ #
217
+ # StringIO wraping has never worked as a workaround by definition. Skipping
218
+ # initial 10 bytes and passing -MAX_WBITS to Zlib::Inflate luckily works as
219
+ # gzip reader, but it only works if the GZip header is 10 bytes long (see
220
+ # below) and it does not check inflated stream consistency (CRC value in the
221
+ # Gzip trailer.)
222
+ #
223
+ # RubyGems generated Gzip Header: 10 bytes
224
+ # magic(2) + method(1) + flag(1) + mtime(4) + exflag(1) + os(1) +
225
+ # orig_name(0) + comment(0)
226
+ #
227
+ # Ideally, it must return a GZipReader without meaningless buffering. We
228
+ # have lots of CRuby committers around so let's fix windows build when we
229
+ # received an error.
214
230
  def zipped_stream(entry)
215
- if defined? Rubinius or defined? Maglev then
216
- # these implementations have working Zlib
217
- zis = Zlib::GzipReader.new entry
218
- dis = zis.read
219
- is = StringIO.new(dis)
220
- else
221
- # This is Jamis Buck's Zlib workaround for some unknown issue
222
- entry.read(10) # skip the gzip header
223
- zis = Zlib::Inflate.new(-Zlib::MAX_WBITS)
224
- is = StringIO.new(zis.inflate(entry.read))
225
- end
226
- ensure
227
- zis.finish if zis
231
+ Zlib::GzipReader.new entry
228
232
  end
229
233
 
230
234
  end
@@ -756,8 +756,16 @@ class Gem::Specification
756
756
 
757
757
  def activate_dependencies
758
758
  self.runtime_dependencies.each do |spec_dep|
759
- # TODO: check for conflicts! not just name!
760
- next if Gem.loaded_specs.include? spec_dep.name
759
+ if loaded = Gem.loaded_specs[spec_dep.name]
760
+ next if spec_dep.matches_spec? loaded
761
+
762
+ msg = "can't satisfy '#{spec_dep}', already activated '#{loaded.full_name}'"
763
+ e = Gem::LoadError.new msg
764
+ e.name = spec_dep.name
765
+
766
+ raise e
767
+ end
768
+
761
769
  specs = spec_dep.to_specs
762
770
 
763
771
  if specs.size == 1 then
@@ -499,8 +499,11 @@ class Gem::TestCase < MiniTest::Unit::TestCase
499
499
 
500
500
  if deps then
501
501
  block = proc do |s|
502
- deps.each do |n, req|
503
- s.add_dependency n, (req || '>= 0')
502
+ # Since Hash#each is unordered in 1.8, sort
503
+ # the keys and iterate that way so the tests are
504
+ # deteriminstic on all implementations.
505
+ deps.keys.sort.each do |n|
506
+ s.add_dependency n, (deps[n] || '>= 0')
504
507
  end
505
508
  end
506
509
  end
@@ -520,8 +523,11 @@ class Gem::TestCase < MiniTest::Unit::TestCase
520
523
 
521
524
  if deps then
522
525
  block = proc do |s|
523
- deps.each do |n, req|
524
- s.add_dependency n, (req || '>= 0')
526
+ # Since Hash#each is unordered in 1.8, sort
527
+ # the keys and iterate that way so the tests are
528
+ # deteriminstic on all implementations.
529
+ deps.keys.sort.each do |n|
530
+ s.add_dependency n, (deps[n] || '>= 0')
525
531
  end
526
532
  end
527
533
  end
@@ -351,6 +351,29 @@ class TestGem < Gem::TestCase
351
351
  end
352
352
  end
353
353
 
354
+ ##
355
+ # [A] depends on
356
+ # [C] = 1.0 depends on
357
+ # [B] = 2.0
358
+ # [B] ~> 1.0 (satisfied by 1.0)
359
+
360
+ def test_self_activate_checks_dependencies
361
+ a, _ = util_spec 'a', '1.0'
362
+ a.add_dependency 'c', '= 1.0'
363
+ a.add_dependency 'b', '~> 1.0'
364
+
365
+ util_spec 'b', '1.0'
366
+ util_spec 'b', '2.0'
367
+ c, _ = util_spec 'c', '1.0', 'b' => '= 2.0'
368
+
369
+ e = assert_raises Gem::LoadError do
370
+ assert_activate nil, a, c, "b"
371
+ end
372
+
373
+ expected = "can't satisfy 'b (~> 1.0)', already activated 'b-2.0'"
374
+ assert_equal expected, e.message
375
+ end
376
+
354
377
  ##
355
378
  # [A] depends on
356
379
  # [B] ~> 1.0 (satisfied by 1.0)
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: 47
4
+ hash: 45
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 8
9
- - 12
10
- version: 1.8.12
9
+ - 13
10
+ version: 1.8.13
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jim Weirich
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-12-02 00:00:00 Z
20
+ date: 2011-12-22 00:00:00 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: minitest
@@ -25,14 +25,13 @@ dependencies:
25
25
  requirement: &id001 !ruby/object:Gem::Requirement
26
26
  none: false
27
27
  requirements:
28
- - - ">="
28
+ - - ~>
29
29
  - !ruby/object:Gem::Version
30
- hash: 11
30
+ hash: 17
31
31
  segments:
32
32
  - 2
33
- - 1
34
- - 0
35
- version: 2.1.0
33
+ - 9
34
+ version: "2.9"
36
35
  type: :development
37
36
  version_requirements: *id001
38
37
  - !ruby/object:Gem::Dependency
@@ -141,21 +140,6 @@ dependencies:
141
140
  version: "2.12"
142
141
  type: :development
143
142
  version_requirements: *id008
144
- - !ruby/object:Gem::Dependency
145
- name: rdoc
146
- prerelease: false
147
- requirement: &id009 !ruby/object:Gem::Requirement
148
- none: false
149
- requirements:
150
- - - ~>
151
- - !ruby/object:Gem::Version
152
- hash: 19
153
- segments:
154
- - 3
155
- - 10
156
- version: "3.10"
157
- type: :development
158
- version_requirements: *id009
159
143
  description: |-
160
144
  RubyGems is a package management framework for Ruby.
161
145
 
@@ -399,7 +383,7 @@ post_install_message:
399
383
  rdoc_options:
400
384
  - --main
401
385
  - README.rdoc
402
- - --title=RubyGems 1.8.12 Documentation
386
+ - --title=RubyGems 1.8.13 Documentation
403
387
  require_paths:
404
388
  - hide_lib_for_update
405
389
  required_ruby_version: !ruby/object:Gem::Requirement