rubygems-update 1.8.5 → 1.8.6

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,4 +1,26 @@
1
- === 1.8.5 / 2011-05-31
1
+ === 1.8.6 / 2011-07-25
2
+
3
+ * 1 major enhancement:
4
+
5
+ * Restore behavior of Gem::Specification#loaded? Ruby Bug #5032
6
+
7
+ * 1 minor enhancement:
8
+
9
+ * Add autorequires and delay startup of RubyGems until require is called.
10
+ See Ruby bug #4962
11
+
12
+ * 1 bug fix:
13
+
14
+ * Clean up SourceIndex.add_specs to not be so damn noisy. (tadman)
15
+ * Added missing APPLE_GEM_HOME in paths.
16
+ * Extend YAML::Syck::DefaultKey fixing to `marshal_dump` as well.
17
+ * Fix #29216: check correct bin_dir in check_that_user_bin_dir_is_in_path.
18
+ * Revert Gem.latest_load_paths to working order (PathSupport revert).
19
+ * Restore normalization of GEM_HOME.
20
+ * Handle the Syck DefaultKey problem once and for all.
21
+ * Fix SystemStackError occurring with "gem list -r -a" on 1.9.
22
+
23
+ === 1.8.5 / 2011-05-31
2
24
 
3
25
  * 2 minor enhancement:
4
26
 
@@ -26,8 +26,6 @@ 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"
30
- require 'rubygems/path_support'
31
29
  require 'rbconfig'
32
30
  require "rubygems/deprecate"
33
31
 
@@ -120,7 +118,7 @@ require "rubygems/deprecate"
120
118
  # -The RubyGems Team
121
119
 
122
120
  module Gem
123
- VERSION = '1.8.5'
121
+ VERSION = '1.8.6'
124
122
 
125
123
  ##
126
124
  # Raised when RubyGems is unable to load or activate a gem. Contains the
@@ -422,15 +420,15 @@ module Gem
422
420
  def self.each_load_path(partials)
423
421
  partials.each do |gp|
424
422
  base = File.basename gp
425
- specfn = dir.specifications.add(base + ".gemspec")
426
- if specfn.exist?
427
- spec = eval(specfn.read)
423
+ specfn = File.join(dir, "specifications", "#{base}.gemspec")
424
+ if File.exists? specfn
425
+ spec = eval(File.read(specfn))
428
426
  spec.require_paths.each do |rp|
429
- yield(gp.add(rp))
427
+ yield File.join(gp,rp)
430
428
  end
431
429
  else
432
- filename = dir.add(gp, 'lib')
433
- yield(filename) if filename.exist?
430
+ filename = File.join(gp, 'lib')
431
+ yield(filename) if File.exists? filename
434
432
  end
435
433
  end
436
434
  end
@@ -585,7 +583,7 @@ module Gem
585
583
 
586
584
  Gem.path.each do |gemdir|
587
585
  each_load_path(latest_partials(gemdir)) do |load_path|
588
- result << gemdir.add(load_path).expand_path
586
+ result << load_path
589
587
  end
590
588
  end
591
589
 
@@ -640,10 +638,23 @@ module Gem
640
638
  # Loads YAML, preferring Psych
641
639
 
642
640
  def self.load_yaml
643
- require 'psych'
644
- rescue ::LoadError
645
- ensure
646
- require 'yaml'
641
+ begin
642
+ require 'psych'
643
+ rescue ::LoadError
644
+ ensure
645
+ require 'yaml'
646
+ end
647
+
648
+ # Hack to handle syck's DefaultKey bug with psych.
649
+ # See the note at the top of lib/rubygems/requirement.rb for
650
+ # why we end up defining DefaultKey more than once.
651
+ if !defined? YAML::Syck
652
+ YAML.module_eval do
653
+ const_set 'Syck', Module.new {
654
+ const_set 'DefaultKey', Class.new
655
+ }
656
+ end
657
+ end
647
658
  end
648
659
 
649
660
  ##
@@ -1136,11 +1147,13 @@ module Gem
1136
1147
  autoload :Version, 'rubygems/version'
1137
1148
  autoload :Requirement, 'rubygems/requirement'
1138
1149
  autoload :Dependency, 'rubygems/dependency'
1150
+ autoload :DependencyList, 'rubygems/dependency_list'
1139
1151
  autoload :GemPathSearcher, 'rubygems/gem_path_searcher'
1140
1152
  autoload :SpecFetcher, 'rubygems/spec_fetcher'
1141
1153
  autoload :Specification, 'rubygems/specification'
1142
1154
  autoload :Cache, 'rubygems/source_index'
1143
1155
  autoload :SourceIndex, 'rubygems/source_index'
1156
+ autoload :PathSupport, 'rubygems/path_support'
1144
1157
  autoload :Platform, 'rubygems/platform'
1145
1158
  autoload :Builder, 'rubygems/builder'
1146
1159
  autoload :ConfigFile, 'rubygems/config_file'
@@ -1232,8 +1245,6 @@ end
1232
1245
 
1233
1246
  require 'rubygems/custom_require'
1234
1247
 
1235
- Gem.clear_paths
1236
-
1237
1248
  module Gem
1238
1249
  class << self
1239
1250
  extend Deprecate
@@ -44,7 +44,7 @@ class Gem::Commands::ServerCommand < Gem::Command
44
44
  options[:addresses].push(*address)
45
45
  end
46
46
 
47
- add_option '-l', '--launch[=COMMAND]',
47
+ add_option '-l', '--launch[=COMMAND]',
48
48
  'launches a browser window',
49
49
  "COMMAND defaults to 'start' on Windows",
50
50
  "and 'open' on all other platforms" do |launch, options|
@@ -13,7 +13,7 @@ class Gem::Ext::Builder
13
13
 
14
14
  def self.make(dest_path, results)
15
15
  unless File.exist? 'Makefile' then
16
- raise Gem::InstallError, "Makefile not found:\n\n#{results.join "\n"}"
16
+ raise Gem::InstallError, "Makefile not found:\n\n#{results.join "\n"}"
17
17
  end
18
18
 
19
19
  mf = File.read('Makefile')
@@ -433,7 +433,7 @@ class Gem::Installer
433
433
  end
434
434
 
435
435
  def check_that_user_bin_dir_is_in_path
436
- user_bin_dir = File.join gem_home, "bin"
436
+ user_bin_dir = @bin_dir || Gem.bindir(gem_home)
437
437
  unless ENV['PATH'].split(File::PATH_SEPARATOR).include? user_bin_dir then
438
438
  unless self.class.path_warning then
439
439
  alert_warning "You don't have #{user_bin_dir} in your PATH,\n\t gem executables will not run."
@@ -230,7 +230,7 @@ class Gem::Package::TarWriter
230
230
  name = newname
231
231
 
232
232
  if name.size > 100 or prefix.size > 155 then
233
- raise Gem::Package::TooLongFileName
233
+ raise Gem::Package::TooLongFileName
234
234
  end
235
235
  end
236
236
 
@@ -22,6 +22,11 @@ class Gem::PathSupport
22
22
 
23
23
  # note 'env' vs 'ENV'...
24
24
  @home = env["GEM_HOME"] || ENV["GEM_HOME"] || Gem.default_dir
25
+
26
+ if File::ALT_SEPARATOR then
27
+ @home = @home.gsub(File::ALT_SEPARATOR, File::SEPARATOR)
28
+ end
29
+
25
30
  self.path = env["GEM_PATH"] || ENV["GEM_PATH"]
26
31
  end
27
32
 
@@ -62,8 +67,8 @@ class Gem::PathSupport
62
67
  else
63
68
  gem_path = Gem.default_path + [@home]
64
69
 
65
- if defined?(Gem::APPLE_GEM_HOME)
66
- gem_path << Gem::APPLE_GEM_HOME
70
+ if defined?(APPLE_GEM_HOME)
71
+ gem_path << APPLE_GEM_HOME
67
72
  end
68
73
  end
69
74
 
@@ -1,5 +1,24 @@
1
1
  require "rubygems/version"
2
2
 
3
+ # Hack to handle syck's DefaultKey bug with psych
4
+ #
5
+ # Quick note! If/when psych loads in 1.9, it will redefine
6
+ # YAML to point to Psych by removing the YAML constant.
7
+ # Thusly, over in Gem.load_yaml, we define DefaultKey again
8
+ # after proper yaml library has been loaded.
9
+ #
10
+ # All this is so that there is always a YAML::Syck::DefaultKey
11
+ # class no matter if the full yaml library has loaded or not.
12
+ #
13
+ module YAML
14
+ if !defined? Syck
15
+ module Syck
16
+ class DefaultKey
17
+ end
18
+ end
19
+ end
20
+ end
21
+
3
22
  ##
4
23
  # A Requirement is a set of one or more version restrictions. It supports a
5
24
  # few (<tt>=, !=, >, <, >=, <=, ~></tt>) different restriction operators.
@@ -110,11 +129,15 @@ class Gem::Requirement
110
129
  end
111
130
 
112
131
  def marshal_dump # :nodoc:
132
+ fix_syck_default_key_in_requirements
133
+
113
134
  [@requirements]
114
135
  end
115
136
 
116
137
  def marshal_load array # :nodoc:
117
138
  @requirements = array[0]
139
+
140
+ fix_syck_default_key_in_requirements
118
141
  end
119
142
 
120
143
  def prerelease?
@@ -154,6 +177,17 @@ class Gem::Requirement
154
177
  def <=> other # :nodoc:
155
178
  to_s <=> other.to_s
156
179
  end
180
+
181
+ private
182
+
183
+ def fix_syck_default_key_in_requirements
184
+ # Fixup the Syck DefaultKey bug
185
+ @requirements.each do |r|
186
+ if r[0].kind_of? YAML::Syck::DefaultKey
187
+ r[0] = "="
188
+ end
189
+ end
190
+ end
157
191
  end
158
192
 
159
193
  # :stopdoc:
@@ -193,8 +193,10 @@ class Gem::SourceIndex
193
193
  # Add gem specifications to the source index.
194
194
 
195
195
  def add_specs(*gem_specs)
196
- gem_specs.each do |spec|
197
- add_spec spec
196
+ Deprecate.skip_during do
197
+ gem_specs.each do |spec|
198
+ add_spec spec
199
+ end
198
200
  end
199
201
  end
200
202
 
@@ -167,7 +167,7 @@ class Gem::SpecFetcher
167
167
 
168
168
  found.each do |source_uri, specs|
169
169
  uri_str = source_uri.to_s
170
- specs_and_sources.push(*specs.map { |spec| [spec, uri_str] })
170
+ specs_and_sources.concat(specs.map { |spec| [spec, uri_str] })
171
171
  end
172
172
 
173
173
  [specs_and_sources, errors]
@@ -213,9 +213,9 @@ class Gem::Specification
213
213
  ##
214
214
  # True when this gemspec has been activated. This attribute is not persisted.
215
215
 
216
- attr_accessor :loaded
216
+ attr_accessor :loaded # :nodoc:
217
217
 
218
- alias :loaded? :loaded
218
+ alias :loaded? :loaded # :nodoc:
219
219
 
220
220
  ##
221
221
  # True when this gemspec has been activated. This attribute is not persisted.
@@ -683,6 +683,7 @@ class Gem::Specification
683
683
  spec.instance_variable_set :@platform, array[16].to_s
684
684
  spec.instance_variable_set :@license, array[17]
685
685
  spec.instance_variable_set :@loaded, false
686
+ spec.instance_variable_set :@activated, false
686
687
 
687
688
  spec
688
689
  end
@@ -742,7 +743,8 @@ class Gem::Specification
742
743
  add_self_to_load_path
743
744
 
744
745
  Gem.loaded_specs[self.name] = self
745
- self.activated = true
746
+ @activated = true
747
+ @loaded = true
746
748
 
747
749
  return true
748
750
  end
@@ -1318,6 +1320,7 @@ class Gem::Specification
1318
1320
 
1319
1321
  def initialize name = nil, version = nil
1320
1322
  @loaded = false
1323
+ @activated = false
1321
1324
  @loaded_from = nil
1322
1325
  @original_platform = nil
1323
1326
 
@@ -2120,3 +2123,6 @@ class Gem::Specification
2120
2123
  # deprecate :file_name, :cache_file, 2011, 10
2121
2124
  # deprecate :full_gem_path, :cache_file, 2011, 10
2122
2125
  end
2126
+
2127
+ Gem.clear_paths
2128
+
@@ -712,7 +712,7 @@ class TestGem < Gem::TestCase
712
712
  def test_self_path_default
713
713
  util_path
714
714
 
715
- if defined? APPLE_GEM_HOME
715
+ if defined?(APPLE_GEM_HOME)
716
716
  orig_APPLE_GEM_HOME = APPLE_GEM_HOME
717
717
  Object.send :remove_const, :APPLE_GEM_HOME
718
718
  end
@@ -721,7 +721,7 @@ class TestGem < Gem::TestCase
721
721
 
722
722
  assert_equal [Gem.default_path, Gem.dir].flatten.uniq, Gem.path
723
723
  ensure
724
- Object.const_set :APPLE_GEM_HOME, orig_APPLE_GEM_HOME
724
+ Object.const_set :APPLE_GEM_HOME, orig_APPLE_GEM_HOME if orig_APPLE_GEM_HOME
725
725
  end
726
726
 
727
727
  unless win_platform?
@@ -730,11 +730,14 @@ class TestGem < Gem::TestCase
730
730
 
731
731
  Gem.clear_paths
732
732
  apple_gem_home = File.join @tempdir, 'apple_gem_home'
733
- Gem.const_set :APPLE_GEM_HOME, apple_gem_home
733
+
734
+ old, $-w = $-w, nil
735
+ Object.const_set :APPLE_GEM_HOME, apple_gem_home
736
+ $-w = old
734
737
 
735
738
  assert_includes Gem.path, apple_gem_home
736
739
  ensure
737
- Gem.send :remove_const, :APPLE_GEM_HOME
740
+ Object.send :remove_const, :APPLE_GEM_HOME
738
741
  end
739
742
 
740
743
  def test_self_path_APPLE_GEM_HOME_GEM_PATH
@@ -1070,6 +1073,23 @@ class TestGem < Gem::TestCase
1070
1073
  assert_equal :loaded, TEST_PLUGIN_EXCEPTION rescue nil
1071
1074
  end
1072
1075
 
1076
+ def test_latest_load_paths
1077
+ spec = quick_spec 'a', '4' do |s|
1078
+ s.require_paths = ["lib"]
1079
+ end
1080
+
1081
+ install_gem spec
1082
+
1083
+ # @exec_path = File.join spec.full_gem_path, spec.bindir, 'exec'
1084
+ # @abin_path = File.join spec.full_gem_path, spec.bindir, 'abin'
1085
+ # FileUtils.mkdir_p File.join(stem, "gems", "test-3")
1086
+
1087
+ Deprecate.skip_during do
1088
+ expected = [File.join(@gemhome, "gems", "a-4", "lib")]
1089
+ assert_equal expected, Gem.latest_load_paths
1090
+ end
1091
+ end
1092
+
1073
1093
  def with_plugin(path)
1074
1094
  test_plugin_path = File.expand_path("test/rubygems/plugin/#{path}",
1075
1095
  @@project_dir)
@@ -207,6 +207,24 @@ load Gem.bin_path('a', 'executable', version)
207
207
  assert_match %r|generated by RubyGems|, wrapper
208
208
  end
209
209
 
210
+ def test_generate_bin_bindir_with_user_install_warning
211
+
212
+ options = {
213
+ :bin_dir => "/usr/bin",
214
+ :install_dir => "/non/existant"
215
+ }
216
+
217
+ inst = Gem::Installer.new nil, options
218
+
219
+ Gem::Installer.path_warning = false
220
+
221
+ use_ui @ui do
222
+ inst.check_that_user_bin_dir_is_in_path
223
+ end
224
+
225
+ assert_equal "", @ui.error
226
+ end
227
+
210
228
  def test_generate_bin_script
211
229
  @installer.wrappers = true
212
230
  util_make_exec
@@ -28,6 +28,15 @@ class TestGemPathSupport < Gem::TestCase
28
28
  assert_equal expected, ps.path
29
29
  end
30
30
 
31
+ if defined?(File::ALT_SEPARATOR) and File::ALT_SEPARATOR
32
+ def test_initialize_home_normalize
33
+ alternate = @tempdir.gsub(File::SEPARATOR, File::ALT_SEPARATOR)
34
+ ps = Gem::PathSupport.new "GEM_HOME" => alternate
35
+
36
+ assert_equal @tempdir, ps.home, "normalize values"
37
+ end
38
+ end
39
+
31
40
  def test_initialize_path
32
41
  ps = Gem::PathSupport.new "GEM_PATH" => %W[#{@tempdir}/foo #{@tempdir}/bar]
33
42
 
@@ -319,6 +319,16 @@ end
319
319
  assert_equal 'old_platform', same_spec.original_platform
320
320
  end
321
321
 
322
+ def test_activate
323
+ @a2.activate
324
+
325
+ assert @a2.activated?
326
+
327
+ Deprecate.skip_during do
328
+ assert @a2.loaded?
329
+ end
330
+ end
331
+
322
332
  def test_add_dependency_with_explicit_type
323
333
  gem = quick_spec "awesome", "1.0" do |awesome|
324
334
  awesome.add_development_dependency "monkey"
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: 61
4
+ hash: 59
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 8
9
- - 5
10
- version: 1.8.5
9
+ - 6
10
+ version: 1.8.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jim Weirich
@@ -17,8 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-05-31 00:00:00 -07:00
21
- default_executable:
20
+ date: 2011-07-26 00:00:00 Z
22
21
  dependencies:
23
22
  - !ruby/object:Gem::Dependency
24
23
  name: minitest
@@ -379,7 +378,6 @@ files:
379
378
  - util/CL2notes
380
379
  - util/gem_prelude.rb
381
380
  - .gemtest
382
- has_rdoc: true
383
381
  homepage: http://rubygems.org
384
382
  licenses: []
385
383
 
@@ -387,7 +385,7 @@ post_install_message:
387
385
  rdoc_options:
388
386
  - --main
389
387
  - README.rdoc
390
- - --title=RubyGems 1.8.5 Documentation
388
+ - --title=RubyGems 1.8.6 Documentation
391
389
  require_paths:
392
390
  - hide_lib_for_update
393
391
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -413,7 +411,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
413
411
  requirements: []
414
412
 
415
413
  rubyforge_project: rubygems
416
- rubygems_version: 1.4.2
414
+ rubygems_version: 1.8.5
417
415
  signing_key:
418
416
  specification_version: 3
419
417
  summary: RubyGems is a package management framework for Ruby