rubygems-update 1.8.20 → 1.8.21

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/History.txt CHANGED
@@ -1,5 +1,12 @@
1
1
  # coding: UTF-8
2
2
 
3
+ === 1.8.21 / 2012-03-22
4
+
5
+ * 2 bug fixes:
6
+
7
+ * Add workaround for buggy yaml output from 1.9.2
8
+ * Force 1.9.1 to remove it's prelude code. Fixes #305
9
+
3
10
  === 1.8.20 / 2012-03-21
4
11
 
5
12
  * 4 bug fixes:
data/Rakefile CHANGED
@@ -56,6 +56,8 @@ hoe = Hoe.spec 'rubygems-update' do
56
56
  rdoc_options << "--title=RubyGems #{self.version} Documentation"
57
57
  end
58
58
 
59
+ self.rsync_args += " --no-p"
60
+
59
61
  # FIX: this exists because update --system installs the gem and
60
62
  # doesn't uninstall it. It should uninstall or better, not install
61
63
  # in the first place.
@@ -82,7 +84,7 @@ end
82
84
 
83
85
  task :prerelease => [:clobber, :check_manifest, :test]
84
86
 
85
- task :postrelease => :publish_docs
87
+ task :postrelease => [:publish_docs, :upload]
86
88
 
87
89
  pkg_dir_path = "pkg/rubygems-update-#{hoe.version}"
88
90
  task :package do
data/bin/gem CHANGED
@@ -5,6 +5,15 @@
5
5
  # See LICENSE.txt for permissions.
6
6
  #++
7
7
 
8
+ # The prelude in 1.9.1 injects rubygems.rb into $LOADED_FEATURES
9
+ # which prevents the `require 'rubygems'` from actually loading
10
+ # the site's version of rubygems. So we have to use it's API
11
+ # to get it's prelude out of the way.
12
+ #
13
+ if RUBY_VERSION =~ /^1\.9\.1/ && defined?(Gem::QuickLoader)
14
+ Gem::QuickLoader.load_full_rubygems_library
15
+ end
16
+
8
17
  require 'rubygems'
9
18
  require 'rubygems/gem_runner'
10
19
  require 'rubygems/exceptions'
data/lib/rubygems.rb CHANGED
@@ -120,7 +120,7 @@ require "rubygems/deprecate"
120
120
  # -The RubyGems Team
121
121
 
122
122
  module Gem
123
- VERSION = '1.8.20'
123
+ VERSION = '1.8.21'
124
124
 
125
125
  ##
126
126
  # Raised when RubyGems is unable to load or activate a gem. Contains the
@@ -25,6 +25,8 @@
25
25
  # +:sources+:: Sets Gem::sources
26
26
  # +:verbose+:: See #verbose
27
27
 
28
+ require 'rbconfig'
29
+
28
30
  class Gem::ConfigFile
29
31
 
30
32
  DEFAULT_BACKTRACE = false
@@ -11,6 +11,17 @@ module Gem
11
11
  # Noop this out so there are no anchors
12
12
  def register(target, obj)
13
13
  end
14
+
15
+ # This is ported over from the yaml_tree in 1.9.3
16
+ def format_time time
17
+ if time.utc?
18
+ time.strftime("%Y-%m-%d %H:%M:%S.%9N Z")
19
+ else
20
+ time.strftime("%Y-%m-%d %H:%M:%S.%9N %:z")
21
+ end
22
+ end
23
+
24
+ private :format_time
14
25
  end
15
26
  end
16
27
  end
@@ -2,26 +2,23 @@ require 'rubygems/installer_test_case'
2
2
 
3
3
  class TestGemInstaller < Gem::InstallerTestCase
4
4
 
5
- def setup
6
- super
5
+ def util_setup_install
6
+ @gemhome = @installer_tmp
7
+ Gem.use_paths @installer_tmp
7
8
 
8
- if __name__ !~ /^test_install(_|$)/ then
9
- @gemhome = @installer_tmp
10
- Gem.use_paths @installer_tmp
9
+ @spec = Gem::Specification.find_by_name 'a'
10
+ @user_spec = Gem::Specification.find_by_name 'b'
11
11
 
12
- @spec = Gem::Specification.find_by_name 'a'
13
- @user_spec = Gem::Specification.find_by_name 'b'
14
-
15
- @installer.spec = @spec
16
- @installer.gem_home = @installer_tmp
17
- @installer.gem_dir = @spec.gem_dir
18
- @user_installer.spec = @user_spec
19
- @user_installer.gem_home = @installer_tmp
20
- end
12
+ @installer.spec = @spec
13
+ @installer.gem_home = @installer_tmp
14
+ @installer.gem_dir = @spec.gem_dir
15
+ @user_installer.spec = @user_spec
16
+ @user_installer.gem_home = @installer_tmp
21
17
  end
22
18
 
23
-
24
19
  def test_app_script_text
20
+ util_setup_install
21
+
25
22
  @spec.version = 2
26
23
  util_make_exec @spec, ''
27
24
 
@@ -52,6 +49,8 @@ load Gem.bin_path('a', 'executable', version)
52
49
  end
53
50
 
54
51
  def test_build_extensions_none
52
+ util_setup_install
53
+
55
54
  use_ui @ui do
56
55
  @installer.build_extensions
57
56
  end
@@ -63,6 +62,8 @@ load Gem.bin_path('a', 'executable', version)
63
62
  end
64
63
 
65
64
  def test_build_extensions_extconf_bad
65
+ util_setup_install
66
+
66
67
  @spec.extensions << 'extconf.rb'
67
68
 
68
69
  e = assert_raises Gem::Installer::ExtensionBuildError do
@@ -86,6 +87,8 @@ load Gem.bin_path('a', 'executable', version)
86
87
  end
87
88
 
88
89
  def test_build_extensions_unsupported
90
+ util_setup_install
91
+
89
92
  gem_make_out = File.join @gemhome, 'gems', @spec.full_name, 'gem_make.out'
90
93
  @spec.extensions << nil
91
94
 
@@ -107,6 +110,8 @@ load Gem.bin_path('a', 'executable', version)
107
110
  end
108
111
 
109
112
  def test_ensure_dependency
113
+ util_setup_install
114
+
110
115
  dep = Gem::Dependency.new 'a', '>= 2'
111
116
  assert @installer.ensure_dependency(@spec, dep)
112
117
 
@@ -119,6 +124,8 @@ load Gem.bin_path('a', 'executable', version)
119
124
  end
120
125
 
121
126
  def test_extract_files
127
+ util_setup_install
128
+
122
129
  format = Object.new
123
130
  def format.file_entries
124
131
  [[{'size' => 7, 'mode' => 0400, 'path' => 'thefile'}, 'content']]
@@ -137,6 +144,8 @@ load Gem.bin_path('a', 'executable', version)
137
144
  end
138
145
 
139
146
  def test_extract_files_bad_dest
147
+ util_setup_install
148
+
140
149
  @installer.gem_dir = 'somedir'
141
150
  @installer.format = nil
142
151
  e = assert_raises ArgumentError do
@@ -147,6 +156,8 @@ load Gem.bin_path('a', 'executable', version)
147
156
  end
148
157
 
149
158
  def test_extract_files_relative
159
+ util_setup_install
160
+
150
161
  format = Object.new
151
162
  def format.file_entries
152
163
  [[{'size' => 10, 'mode' => 0644, 'path' => '../thefile'}, '../thefile']]
@@ -166,6 +177,8 @@ load Gem.bin_path('a', 'executable', version)
166
177
  end
167
178
 
168
179
  def test_extract_files_absolute
180
+ util_setup_install
181
+
169
182
  format = Object.new
170
183
  def format.file_entries
171
184
  [[{'size' => 8, 'mode' => 0644, 'path' => '/thefile'}, '/thefile']]
@@ -183,6 +196,8 @@ load Gem.bin_path('a', 'executable', version)
183
196
  end
184
197
 
185
198
  def test_generate_bin_bindir
199
+ util_setup_install
200
+
186
201
  @installer.wrappers = true
187
202
 
188
203
  @spec.executables = %w[executable]
@@ -208,6 +223,8 @@ load Gem.bin_path('a', 'executable', version)
208
223
  end
209
224
 
210
225
  def test_generate_bin_bindir_with_user_install_warning
226
+ util_setup_install
227
+
211
228
  bin_dir = Gem.win_platform? ? File.expand_path(ENV["WINDIR"]) : "/usr/bin"
212
229
 
213
230
  options = {
@@ -227,6 +244,8 @@ load Gem.bin_path('a', 'executable', version)
227
244
  end
228
245
 
229
246
  def test_generate_bin_script
247
+ util_setup_install
248
+
230
249
  @installer.wrappers = true
231
250
  util_make_exec
232
251
  @installer.gem_dir = util_gem_dir
@@ -242,6 +261,8 @@ load Gem.bin_path('a', 'executable', version)
242
261
  end
243
262
 
244
263
  def test_generate_bin_script_format
264
+ util_setup_install
265
+
245
266
  @installer.format_executable = true
246
267
  @installer.wrappers = true
247
268
  util_make_exec
@@ -257,6 +278,8 @@ load Gem.bin_path('a', 'executable', version)
257
278
  end
258
279
 
259
280
  def test_generate_bin_script_format_disabled
281
+ util_setup_install
282
+
260
283
  @installer.wrappers = true
261
284
  util_make_exec
262
285
  @installer.gem_dir = util_gem_dir
@@ -271,6 +294,8 @@ load Gem.bin_path('a', 'executable', version)
271
294
  end
272
295
 
273
296
  def test_generate_bin_script_install_dir
297
+ util_setup_install
298
+
274
299
  @installer.wrappers = true
275
300
  @spec.executables = %w[executable]
276
301
 
@@ -295,6 +320,8 @@ load Gem.bin_path('a', 'executable', version)
295
320
  end
296
321
 
297
322
  def test_generate_bin_script_no_execs
323
+ util_setup_install
324
+
298
325
  util_execless
299
326
 
300
327
  @installer.wrappers = true
@@ -304,6 +331,8 @@ load Gem.bin_path('a', 'executable', version)
304
331
  end
305
332
 
306
333
  def test_generate_bin_script_no_perms
334
+ util_setup_install
335
+
307
336
  @installer.wrappers = true
308
337
  util_make_exec
309
338
 
@@ -323,6 +352,8 @@ load Gem.bin_path('a', 'executable', version)
323
352
  end
324
353
 
325
354
  def test_generate_bin_script_no_shebang
355
+ util_setup_install
356
+
326
357
  @installer.wrappers = true
327
358
  @spec.executables = %w[executable]
328
359
 
@@ -346,6 +377,8 @@ load Gem.bin_path('a', 'executable', version)
346
377
  end
347
378
 
348
379
  def test_generate_bin_script_wrappers
380
+ util_setup_install
381
+
349
382
  @installer.wrappers = true
350
383
  util_make_exec
351
384
  @installer.gem_dir = util_gem_dir
@@ -371,6 +404,8 @@ load Gem.bin_path('a', 'executable', version)
371
404
  end
372
405
 
373
406
  def test_generate_bin_symlink
407
+ util_setup_install
408
+
374
409
  return if win_platform? #Windows FS do not support symlinks
375
410
 
376
411
  @installer.wrappers = false
@@ -386,6 +421,8 @@ load Gem.bin_path('a', 'executable', version)
386
421
  end
387
422
 
388
423
  def test_generate_bin_symlink_no_execs
424
+ util_setup_install
425
+
389
426
  util_execless
390
427
 
391
428
  @installer.wrappers = false
@@ -395,6 +432,8 @@ load Gem.bin_path('a', 'executable', version)
395
432
  end
396
433
 
397
434
  def test_generate_bin_symlink_no_perms
435
+ util_setup_install
436
+
398
437
  @installer.wrappers = false
399
438
  util_make_exec
400
439
  @installer.gem_dir = util_gem_dir
@@ -415,6 +454,8 @@ load Gem.bin_path('a', 'executable', version)
415
454
  end
416
455
 
417
456
  def test_generate_bin_symlink_update_newer
457
+ util_setup_install
458
+
418
459
  return if win_platform? #Windows FS do not support symlinks
419
460
 
420
461
  @installer.wrappers = false
@@ -446,6 +487,8 @@ load Gem.bin_path('a', 'executable', version)
446
487
  end
447
488
 
448
489
  def test_generate_bin_symlink_update_older
490
+ util_setup_install
491
+
449
492
  return if win_platform? #Windows FS do not support symlinks
450
493
 
451
494
  @installer.wrappers = false
@@ -482,6 +525,8 @@ load Gem.bin_path('a', 'executable', version)
482
525
  end
483
526
 
484
527
  def test_generate_bin_symlink_update_remove_wrapper
528
+ util_setup_install
529
+
485
530
  return if win_platform? #Windows FS do not support symlinks
486
531
 
487
532
  @installer.wrappers = true
@@ -513,6 +558,8 @@ load Gem.bin_path('a', 'executable', version)
513
558
  end
514
559
 
515
560
  def test_generate_bin_symlink_win32
561
+ util_setup_install
562
+
516
563
  old_win_platform = Gem.win_platform?
517
564
  Gem.win_platform = true
518
565
  @installer.wrappers = false
@@ -537,6 +584,8 @@ load Gem.bin_path('a', 'executable', version)
537
584
  end
538
585
 
539
586
  def test_generate_bin_uses_default_shebang
587
+ util_setup_install
588
+
540
589
  return if win_platform? #Windows FS do not support symlinks
541
590
 
542
591
  @installer.wrappers = true
@@ -889,6 +938,8 @@ load Gem.bin_path('a', 'executable', version)
889
938
  end
890
939
 
891
940
  def test_installation_satisfies_dependency_eh
941
+ util_setup_install
942
+
892
943
  dep = Gem::Dependency.new 'a', '>= 2'
893
944
  assert @installer.installation_satisfies_dependency?(dep)
894
945
 
@@ -897,6 +948,8 @@ load Gem.bin_path('a', 'executable', version)
897
948
  end
898
949
 
899
950
  def test_shebang
951
+ util_setup_install
952
+
900
953
  util_make_exec @spec, "#!/usr/bin/ruby"
901
954
 
902
955
  shebang = @installer.shebang 'executable'
@@ -905,6 +958,8 @@ load Gem.bin_path('a', 'executable', version)
905
958
  end
906
959
 
907
960
  def test_shebang_arguments
961
+ util_setup_install
962
+
908
963
  util_make_exec @spec, "#!/usr/bin/ruby -ws"
909
964
 
910
965
  shebang = @installer.shebang 'executable'
@@ -913,6 +968,8 @@ load Gem.bin_path('a', 'executable', version)
913
968
  end
914
969
 
915
970
  def test_shebang_empty
971
+ util_setup_install
972
+
916
973
  util_make_exec @spec, ''
917
974
 
918
975
  shebang = @installer.shebang 'executable'
@@ -920,6 +977,8 @@ load Gem.bin_path('a', 'executable', version)
920
977
  end
921
978
 
922
979
  def test_shebang_env
980
+ util_setup_install
981
+
923
982
  util_make_exec @spec, "#!/usr/bin/env ruby"
924
983
 
925
984
  shebang = @installer.shebang 'executable'
@@ -928,6 +987,8 @@ load Gem.bin_path('a', 'executable', version)
928
987
  end
929
988
 
930
989
  def test_shebang_env_arguments
990
+ util_setup_install
991
+
931
992
  util_make_exec @spec, "#!/usr/bin/env ruby -ws"
932
993
 
933
994
  shebang = @installer.shebang 'executable'
@@ -936,6 +997,8 @@ load Gem.bin_path('a', 'executable', version)
936
997
  end
937
998
 
938
999
  def test_shebang_env_shebang
1000
+ util_setup_install
1001
+
939
1002
  util_make_exec @spec, ''
940
1003
  @installer.env_shebang = true
941
1004
 
@@ -948,6 +1011,8 @@ load Gem.bin_path('a', 'executable', version)
948
1011
  end
949
1012
 
950
1013
  def test_shebang_nested
1014
+ util_setup_install
1015
+
951
1016
  util_make_exec @spec, "#!/opt/local/ruby/bin/ruby"
952
1017
 
953
1018
  shebang = @installer.shebang 'executable'
@@ -956,6 +1021,8 @@ load Gem.bin_path('a', 'executable', version)
956
1021
  end
957
1022
 
958
1023
  def test_shebang_nested_arguments
1024
+ util_setup_install
1025
+
959
1026
  util_make_exec @spec, "#!/opt/local/ruby/bin/ruby -ws"
960
1027
 
961
1028
  shebang = @installer.shebang 'executable'
@@ -964,6 +1031,8 @@ load Gem.bin_path('a', 'executable', version)
964
1031
  end
965
1032
 
966
1033
  def test_shebang_version
1034
+ util_setup_install
1035
+
967
1036
  util_make_exec @spec, "#!/usr/bin/ruby18"
968
1037
 
969
1038
  shebang = @installer.shebang 'executable'
@@ -972,6 +1041,8 @@ load Gem.bin_path('a', 'executable', version)
972
1041
  end
973
1042
 
974
1043
  def test_shebang_version_arguments
1044
+ util_setup_install
1045
+
975
1046
  util_make_exec @spec, "#!/usr/bin/ruby18 -ws"
976
1047
 
977
1048
  shebang = @installer.shebang 'executable'
@@ -980,6 +1051,8 @@ load Gem.bin_path('a', 'executable', version)
980
1051
  end
981
1052
 
982
1053
  def test_shebang_version_env
1054
+ util_setup_install
1055
+
983
1056
  util_make_exec @spec, "#!/usr/bin/env ruby18"
984
1057
 
985
1058
  shebang = @installer.shebang 'executable'
@@ -988,6 +1061,8 @@ load Gem.bin_path('a', 'executable', version)
988
1061
  end
989
1062
 
990
1063
  def test_shebang_version_env_arguments
1064
+ util_setup_install
1065
+
991
1066
  util_make_exec @spec, "#!/usr/bin/env ruby18 -ws"
992
1067
 
993
1068
  shebang = @installer.shebang 'executable'
@@ -996,6 +1071,8 @@ load Gem.bin_path('a', 'executable', version)
996
1071
  end
997
1072
 
998
1073
  def test_unpack
1074
+ util_setup_install
1075
+
999
1076
  util_setup_gem
1000
1077
 
1001
1078
  dest = File.join @gemhome, 'gems', @spec.full_name
@@ -1007,6 +1084,8 @@ load Gem.bin_path('a', 'executable', version)
1007
1084
  end
1008
1085
 
1009
1086
  def test_write_spec
1087
+ util_setup_install
1088
+
1010
1089
  spec_dir = File.join @gemhome, 'specifications'
1011
1090
  spec_file = File.join spec_dir, @spec.spec_name
1012
1091
  FileUtils.rm spec_file
@@ -1022,6 +1101,8 @@ load Gem.bin_path('a', 'executable', version)
1022
1101
  end
1023
1102
 
1024
1103
  def test_write_spec_writes_cached_spec
1104
+ util_setup_install
1105
+
1025
1106
  spec_dir = File.join @gemhome, 'specifications'
1026
1107
  spec_file = File.join spec_dir, @spec.spec_name
1027
1108
  FileUtils.rm spec_file
@@ -1041,6 +1122,8 @@ load Gem.bin_path('a', 'executable', version)
1041
1122
  end
1042
1123
 
1043
1124
  def test_dir
1125
+ util_setup_install
1126
+
1044
1127
  assert_match @installer.dir, %r!/installer/gems/a-2$!
1045
1128
  end
1046
1129
 
@@ -416,6 +416,17 @@ dependencies: []
416
416
  assert_equal nil, data.rubyforge_project
417
417
  end
418
418
 
419
+ def test_emits_zulu_timestamps_properly
420
+ skip "bug only on 1.9.2" unless RUBY_VERSION =~ /1\.9\.2/
421
+
422
+ t = Time.utc(2012, 3, 12)
423
+ @a2.date = t
424
+
425
+ yaml = with_psych { @a2.to_yaml }
426
+
427
+ assert_match %r!date: 2012-03-12 00:00:00\.000000000 Z!, yaml
428
+ end
429
+
419
430
  def test_initialize
420
431
  spec = Gem::Specification.new do |s|
421
432
  s.name = "blah"
@@ -1683,6 +1694,24 @@ end
1683
1694
  end
1684
1695
  end
1685
1696
 
1697
+ def with_psych
1698
+ begin
1699
+ require "yaml"
1700
+ old_engine = YAML::ENGINE.yamler
1701
+ YAML::ENGINE.yamler = 'psych'
1702
+ rescue NameError
1703
+ # probably on 1.8, ignore
1704
+ end
1705
+
1706
+ yield
1707
+ ensure
1708
+ begin
1709
+ YAML::ENGINE.yamler = old_engine
1710
+ rescue NameError
1711
+ # ignore
1712
+ end
1713
+ end
1714
+
1686
1715
  def silence_warnings
1687
1716
  old_verbose, $VERBOSE = $VERBOSE, false
1688
1717
  yield
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: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 8
9
- - 20
10
- version: 1.8.20
9
+ - 21
10
+ version: 1.8.21
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: 2012-03-21 00:00:00 Z
20
+ date: 2012-03-22 00:00:00 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: minitest
@@ -387,7 +387,7 @@ post_install_message:
387
387
  rdoc_options:
388
388
  - --main
389
389
  - README.rdoc
390
- - --title=RubyGems 1.8.20 Documentation
390
+ - --title=RubyGems 1.8.21 Documentation
391
391
  require_paths:
392
392
  - hide_lib_for_update
393
393
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -413,7 +413,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
413
413
  requirements: []
414
414
 
415
415
  rubyforge_project: rubygems
416
- rubygems_version: 1.8.18
416
+ rubygems_version: 1.8.20
417
417
  signing_key:
418
418
  specification_version: 3
419
419
  summary: RubyGems is a package management framework for Ruby