rubygems-update 2.0.0.rc.2 → 2.0.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.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5da39433cc3801dbe2eb90b691a3922d3e0b8742
4
- data.tar.gz: e9dd3ab0d1d3d1ffd29ce830de603dcf38e0882f
3
+ metadata.gz: 3c9ce26cced47021965b48083bad67e6a3446f38
4
+ data.tar.gz: 43eddecbadeaaed4281749dbf511a0a4ff624e11
5
5
  SHA512:
6
- metadata.gz: c457f457ce059ed8d0f42ff2099dddd9fb0f831a0029aced033821cf672606e615146932ed6768c1adb859da1dc745a9d399b93cb83f9f6db6aab347ef0166a8
7
- data.tar.gz: 87549ea6c9fb559165892769dc8bf668c86bd242e0ea93eb49cbc57ac20869bb397d319162211ef8fafeb3f2db5264494e1d830d171692e563f3ab3757e9b487
6
+ metadata.gz: afa7d31465c734e950668041ec7a5222aa5157ff20537f5cf6ecbfb26379738007702424fb7772b6f46ad9e8ae36f789f85762fb739bb6b3f1412d3c2010a4d6
7
+ data.tar.gz: fedcc37e374bcc683b8a660cd335e72c06dced37f668555fb984448f54a975e589001635e1d3bf3a1fe865897b59312eddd07938094d79df70046841645903f2
@@ -1,3 +1,2 @@
1
- <E���Bd�ٝ���@qc̄tT�o OH���o \:���<6A|C*ЅR�'e5D.�D�L-�
2
- /+�
3
- E���(�Lhh�)�IKԈD'�؊Ξ�瑸�~�Ui����?��n��7mS���Yiyf5!H�ޓ�5�W�lېЩ7��C��gi��J�VĄ�S
1
+ S��l>~�;�jk\U�`�>��;�pi�����zv�U?�!�Zb4%b*�?�
2
+ ���{E�9Ҋ=׃�қ�w����A�UWYU �з�E� ��IVgsZ�h� s�Md�p���5��?@
data.tar.gz.sig CHANGED
Binary file
@@ -1,18 +1,14 @@
1
1
  # coding: UTF-8
2
2
 
3
- === 2.0.0.rc.2
4
-
5
- As a preview release, please file bugs for any problems you have with RubyGems
6
- at https://github.com/rubygems/rubygems/issues. To update to this preview
7
- release use gem update --system=2.0.0.rc.2
3
+ === 2.0.0 / 2013-02-24
8
4
 
9
5
  RubyGems 2.0 includes several new features and many breaking changes. Some of
10
6
  these changes will cause existing software to break. These changes are a
11
7
  result of improvements to the internals of RubyGems that make it more
12
8
  maintainable and improve APIs for RubyGems users.
13
9
 
14
- If you are using bundler be sure to install version 1.3.0.pre. Older versions
15
- of bundler will not work with RubyGems 2.0.
10
+ If you are using bundler be sure to install a 1.3.0.prerelease version or
11
+ newer. Older versions of bundler will not work with RubyGems 2.0.
16
12
 
17
13
  Changes since RubyGems 1.8.25 (including past pre-releases):
18
14
 
@@ -155,7 +151,22 @@ Changes since RubyGems 1.8.25 (including past pre-releases):
155
151
  * URI scheme matching is no longer case-sensitive. Fixes #322
156
152
  * ext/builder now checks $MAKE as well as $make (okkez)
157
153
 
158
- Changes since RubyGems 2.0.0.rc.1:
154
+ Changes since RubyGems 2.0.0.rc.2:
155
+
156
+ * Bug fixes:
157
+ * Gem.gzip and Gem.gunzip now return strings with BINARY encoding. Issue
158
+ #450 by Jeremy Kemper
159
+ * Fixed placement of executables with --user-install. Ruby bug #7779 by Jon
160
+ Forums.
161
+ * Fixed `gem update` with --user-install. Ruby bug #7779 by Jon Forums.
162
+ * Fixed test_initialize_user_install for windows. Ruby bug #7885 by Luis
163
+ Lavena.
164
+ * Create extension destination directory before building extensions. Ruby
165
+ Bug #7897 and patch by Kenta Murata.
166
+ * Fixed verification of gems at LowSecurity due to missing signature.
167
+ Thanks to André Arko.
168
+
169
+ === 2.0.0.rc.2 / 2013-02-08
159
170
 
160
171
  * Bug fixes:
161
172
  * Fixed signature verification of gems which was broken only on master.
@@ -8,7 +8,7 @@
8
8
  require 'rbconfig'
9
9
 
10
10
  module Gem
11
- VERSION = '2.0.0.rc.2'
11
+ VERSION = '2.0.0'
12
12
  end
13
13
 
14
14
  # Must be first since it unloads the prelude from 1.9.2
@@ -475,7 +475,9 @@ module Gem
475
475
  require 'zlib'
476
476
  data = StringIO.new data
477
477
 
478
- Zlib::GzipReader.new(data).read
478
+ unzipped = Zlib::GzipReader.new(data).read
479
+ unzipped.force_encoding Encoding::BINARY if Object.const_defined? :Encoding
480
+ unzipped
479
481
  end
480
482
 
481
483
  ##
@@ -486,6 +488,7 @@ module Gem
486
488
  require 'stringio'
487
489
  require 'zlib'
488
490
  zipped = StringIO.new
491
+ zipped.set_encoding Encoding::BINARY if Object.const_defined? :Encoding
489
492
 
490
493
  Zlib::GzipWriter.wrap zipped do |io| io.write data end
491
494
 
@@ -14,6 +14,8 @@ class Gem::Commands::UpdateCommand < Gem::Command
14
14
  include Gem::LocalRemoteOptions
15
15
  include Gem::VersionOption
16
16
 
17
+ attr_reader :installer # :nodoc:
18
+
17
19
  def initialize
18
20
  super 'update', 'Update installed gems to the latest version',
19
21
  :document => %w[rdoc ri],
@@ -39,7 +41,7 @@ class Gem::Commands::UpdateCommand < Gem::Command
39
41
  add_prerelease_option "as update targets"
40
42
 
41
43
  @updated = []
42
- @installer = Gem::DependencyInstaller.new options
44
+ @installer = nil
43
45
  end
44
46
 
45
47
  def arguments # :nodoc:
@@ -85,6 +87,9 @@ class Gem::Commands::UpdateCommand < Gem::Command
85
87
 
86
88
  def update_gem name, version = Gem::Requirement.default
87
89
  return if @updated.any? { |spec| spec.name == name }
90
+
91
+ @installer ||= Gem::DependencyInstaller.new options
92
+
88
93
  success = false
89
94
 
90
95
  say "Updating #{name}"
@@ -8,6 +8,7 @@ require 'rubygems/exceptions'
8
8
  require 'rubygems/package'
9
9
  require 'rubygems/ext'
10
10
  require 'rubygems/user_interaction'
11
+ require 'fileutils'
11
12
 
12
13
  ##
13
14
  # The installer installs the files contained in the .gem into the Gem.home.
@@ -110,6 +111,7 @@ class Gem::Installer
110
111
 
111
112
  if options[:user_install] and not options[:unpack] then
112
113
  @gem_home = Gem.user_dir
114
+ @bin_dir = Gem.bindir gem_home unless options[:bin_dir]
113
115
  check_that_user_bin_dir_is_in_path
114
116
  end
115
117
  end
@@ -560,7 +562,9 @@ class Gem::Installer
560
562
  # DOC: Missing docs or :nodoc:.
561
563
  def check_that_user_bin_dir_is_in_path
562
564
  user_bin_dir = @bin_dir || Gem.bindir(gem_home)
563
- user_bin_dir.gsub!(File::SEPARATOR, File::ALT_SEPARATOR) if File::ALT_SEPARATOR
565
+ user_bin_dir = user_bin_dir.gsub(File::SEPARATOR, File::ALT_SEPARATOR) if
566
+ File::ALT_SEPARATOR
567
+
564
568
  path = ENV['PATH']
565
569
  if Gem.win_platform? then
566
570
  path = path.downcase
@@ -668,6 +672,8 @@ TEXT
668
672
  end
669
673
 
670
674
  begin
675
+ FileUtils.mkdir_p dest_path
676
+
671
677
  Dir.chdir extension_dir do
672
678
  results = builder.build(extension, gem_dir, dest_path,
673
679
  results, @build_args)
@@ -518,8 +518,6 @@ EOM
518
518
  when /\.sig$/ then
519
519
  @signatures[$`] = entry.read if @security_policy
520
520
  next
521
- when 'checksums.yaml.gz' then
522
- next # already handled
523
521
  else
524
522
  digest entry
525
523
  end
@@ -1,3 +1,4 @@
1
+ # coding: US-ASCII
1
2
  require 'rubygems/test_case'
2
3
  require 'rubygems'
3
4
  require 'rubygems/installer'
@@ -1237,6 +1238,33 @@ class TestGem < Gem::TestCase
1237
1238
  end
1238
1239
  end
1239
1240
 
1241
+ def test_self_gunzip
1242
+ input = "\x1F\x8B\b\0\xED\xA3\x1AQ\0\x03\xCBH" +
1243
+ "\xCD\xC9\xC9\a\0\x86\xA6\x106\x05\0\0\0"
1244
+
1245
+ output = Gem.gunzip input
1246
+
1247
+ assert_equal 'hello', output
1248
+
1249
+ return unless Object.const_defined? :Encoding
1250
+
1251
+ assert_equal Encoding::BINARY, output.encoding
1252
+ end
1253
+
1254
+ def test_self_gzip
1255
+ input = 'hello'
1256
+
1257
+ output = Gem.gzip input
1258
+
1259
+ zipped = StringIO.new output
1260
+
1261
+ assert_equal 'hello', Zlib::GzipReader.new(zipped).read
1262
+
1263
+ return unless Object.const_defined? :Encoding
1264
+
1265
+ assert_equal Encoding::BINARY, output.encoding
1266
+ end
1267
+
1240
1268
  if Gem.win_platform? && '1.9' > RUBY_VERSION
1241
1269
  # Ruby 1.9 properly handles ~ path expansion, so no need to run such tests.
1242
1270
  def test_self_user_home_userprofile
@@ -18,7 +18,7 @@ class TestGemCommandsPushCommand < Gem::TestCase
18
18
  "ed244fbf2b1a52e012da8616c512fa47f9aa5250"
19
19
 
20
20
  @spec, @path = util_gem "freewill", "1.0.0"
21
- @host = Gem.host
21
+ @host = 'https://rubygems.example'
22
22
  @api_key = Gem.configuration.rubygems_api_key
23
23
 
24
24
  @fetcher = Gem::FakeFetcher.new
@@ -61,6 +61,27 @@ class TestGemCommandsPushCommand < Gem::TestCase
61
61
  assert_match @response, @ui.output
62
62
  end
63
63
 
64
+ def test_execute_host
65
+ host = 'https://other.example'
66
+
67
+ open 'example', 'w' do |io| io.write 'hello' end
68
+
69
+ @response = "Successfully registered gem: freewill (1.0.0)"
70
+ @fetcher.data["#{host}/api/v1/gems"] = [@response, 200, 'OK']
71
+ @fetcher.data["#{Gem.host}/api/v1/gems"] =
72
+ ['fail', 500, 'Internal Server Error']
73
+
74
+ @cmd.options[:host] = host
75
+ @cmd.options[:args] = %w[example]
76
+
77
+ @cmd.execute
78
+
79
+ assert_equal Net::HTTP::Post, @fetcher.last_request.class
80
+ assert_equal 'hello', @fetcher.last_request.body
81
+ assert_equal "application/octet-stream",
82
+ @fetcher.last_request["Content-Type"]
83
+ end
84
+
64
85
  def test_sending_when_default_host_disabled
65
86
  Gem.configuration.disable_default_gem_server = true
66
87
  response = "You must specify a gem server"
@@ -110,29 +131,13 @@ class TestGemCommandsPushCommand < Gem::TestCase
110
131
  send_battery
111
132
  end
112
133
 
113
- def test_sending_gem_default
134
+ def test_sending_gem
114
135
  @response = "Successfully registered gem: freewill (1.0.0)"
115
136
  @fetcher.data["#{@host}/api/v1/gems"] = [@response, 200, 'OK']
116
137
 
117
138
  send_battery
118
139
  end
119
140
 
120
- def test_sending_gem_host
121
- @response = "Successfully registered gem: freewill (1.0.0)"
122
- @fetcher.data["#{@host}/api/v1/gems"] = [@response, 200, 'OK']
123
- @cmd.options['host'] = "#{Gem.host}"
124
-
125
- send_battery
126
- end
127
-
128
- def test_sending_gem_ENV
129
- @response = "Successfully registered gem: freewill (1.0.0)"
130
- @fetcher.data["#{@host}/api/v1/gems"] = [@response, 200, 'OK']
131
- ENV["RUBYGEMS_HOST"] = "#{Gem.host}"
132
-
133
- send_battery
134
- end
135
-
136
141
  def test_raises_error_with_no_arguments
137
142
  def @cmd.sign_in(*); end
138
143
  assert_raises Gem::CommandLineError do
@@ -143,6 +148,7 @@ class TestGemCommandsPushCommand < Gem::TestCase
143
148
  def test_sending_gem_denied
144
149
  response = "You don't have permission to push to this gem"
145
150
  @fetcher.data["#{@host}/api/v1/gems"] = [response, 403, 'Forbidden']
151
+ @cmd.instance_variable_set :@host, @host
146
152
 
147
153
  assert_raises Gem::MockGemUi::TermError do
148
154
  use_ui @ui do
@@ -162,6 +168,7 @@ class TestGemCommandsPushCommand < Gem::TestCase
162
168
  Gem.configuration.load_api_keys
163
169
 
164
170
  @cmd.handle_options %w(-k other)
171
+ @cmd.instance_variable_set :@host, @host
165
172
  @cmd.send_gem(@path)
166
173
 
167
174
  assert_equal Gem.configuration.api_keys[:other],
@@ -355,6 +355,23 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
355
355
  assert_empty out
356
356
  end
357
357
 
358
+ def test_execute_user_install
359
+ util_clear_gems
360
+
361
+ Gem::Installer.new(@a1_path).install
362
+
363
+ @cmd.handle_options %w[--user-install]
364
+
365
+ use_ui @ui do
366
+ @cmd.execute
367
+ end
368
+
369
+ installer = @cmd.installer
370
+ user_install = installer.instance_variable_get :@user_install
371
+
372
+ assert user_install, 'user_install must be set on the installer'
373
+ end
374
+
358
375
  def test_handle_options_system
359
376
  @cmd.handle_options %w[--system]
360
377
 
@@ -137,6 +137,7 @@ load Gem.bin_path('a', 'executable', version)
137
137
  path = File.join @spec.gem_dir, "extconf_args"
138
138
 
139
139
  assert_equal args.inspect, File.read(path).strip
140
+ assert File.directory? File.join(@spec.gem_dir, 'lib')
140
141
  end
141
142
 
142
143
  def test_check_executable_overwrite
@@ -661,6 +662,24 @@ load Gem.bin_path('a', 'executable', version)
661
662
  installer = Gem::Installer.new gem
662
663
 
663
664
  assert_equal File.join(@gemhome, 'gems', spec.full_name), installer.gem_dir
665
+ assert_equal File.join(@gemhome, 'bin'), installer.bin_dir
666
+ end
667
+
668
+ def test_initialize_user_install
669
+ installer = Gem::Installer.new @gem, :user_install => true
670
+
671
+ assert_equal File.join(Gem.user_dir, 'gems', @spec.full_name),
672
+ installer.gem_dir
673
+ assert_equal Gem.bindir(Gem.user_dir), installer.bin_dir
674
+ end
675
+
676
+ def test_initialize_user_install_bin_dir
677
+ installer =
678
+ Gem::Installer.new @gem, :user_install => true, :bin_dir => @tempdir
679
+
680
+ assert_equal File.join(Gem.user_dir, 'gems', @spec.full_name),
681
+ installer.gem_dir
682
+ assert_equal @tempdir, installer.bin_dir
664
683
  end
665
684
 
666
685
  def test_install
@@ -511,6 +511,24 @@ class TestGemPackage < Gem::Package::TarTestCase
511
511
  assert_empty package.instance_variable_get(:@files), '@files must empty'
512
512
  end
513
513
 
514
+ def test_verify_security_policy_low_security
515
+ @spec.cert_chain = [PUBLIC_CERT.to_pem]
516
+ @spec.signing_key = PRIVATE_KEY
517
+
518
+ FileUtils.mkdir_p 'lib'
519
+ FileUtils.touch 'lib/code.rb'
520
+
521
+ build = Gem::Package.new @gem
522
+ build.spec = @spec
523
+
524
+ build.build
525
+
526
+ package = Gem::Package.new @gem
527
+ package.security_policy = Gem::Security::LowSecurity
528
+
529
+ assert package.verify
530
+ end
531
+
514
532
  def test_verify_security_policy_checksum_missing
515
533
  @spec.cert_chain = [PUBLIC_CERT.to_pem]
516
534
  @spec.signing_key = PRIVATE_KEY
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubygems-update
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.rc.2
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Weirich
@@ -32,120 +32,120 @@ cert_chain:
32
32
  Q8Tno9S3e4XGGP1ZWfLrTWEJbavFfhGHut2iMRwfC7s/YILAHNATopaJdH9DNpd1
33
33
  U81zGHMUBOvz/VGT6wJwYJ3emS2nfA2NOHFfgA==
34
34
  -----END CERTIFICATE-----
35
- date: 2013-02-08 00:00:00.000000000 Z
35
+ date: 2013-02-24 00:00:00.000000000 Z
36
36
  dependencies:
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: minitest
39
39
  requirement: !ruby/object:Gem::Requirement
40
40
  requirements:
41
- - - "~>"
41
+ - - ~>
42
42
  - !ruby/object:Gem::Version
43
43
  version: '4.3'
44
44
  type: :development
45
45
  prerelease: false
46
46
  version_requirements: !ruby/object:Gem::Requirement
47
47
  requirements:
48
- - - "~>"
48
+ - - ~>
49
49
  - !ruby/object:Gem::Version
50
50
  version: '4.3'
51
51
  - !ruby/object:Gem::Dependency
52
52
  name: rdoc
53
53
  requirement: !ruby/object:Gem::Requirement
54
54
  requirements:
55
- - - "~>"
55
+ - - ~>
56
56
  - !ruby/object:Gem::Version
57
57
  version: '3.10'
58
58
  type: :development
59
59
  prerelease: false
60
60
  version_requirements: !ruby/object:Gem::Requirement
61
61
  requirements:
62
- - - "~>"
62
+ - - ~>
63
63
  - !ruby/object:Gem::Version
64
64
  version: '3.10'
65
65
  - !ruby/object:Gem::Dependency
66
66
  name: builder
67
67
  requirement: !ruby/object:Gem::Requirement
68
68
  requirements:
69
- - - "~>"
69
+ - - ~>
70
70
  - !ruby/object:Gem::Version
71
71
  version: '2.1'
72
72
  type: :development
73
73
  prerelease: false
74
74
  version_requirements: !ruby/object:Gem::Requirement
75
75
  requirements:
76
- - - "~>"
76
+ - - ~>
77
77
  - !ruby/object:Gem::Version
78
78
  version: '2.1'
79
79
  - !ruby/object:Gem::Dependency
80
80
  name: hoe-seattlerb
81
81
  requirement: !ruby/object:Gem::Requirement
82
82
  requirements:
83
- - - "~>"
83
+ - - ~>
84
84
  - !ruby/object:Gem::Version
85
85
  version: '1.2'
86
86
  type: :development
87
87
  prerelease: false
88
88
  version_requirements: !ruby/object:Gem::Requirement
89
89
  requirements:
90
- - - "~>"
90
+ - - ~>
91
91
  - !ruby/object:Gem::Version
92
92
  version: '1.2'
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: session
95
95
  requirement: !ruby/object:Gem::Requirement
96
96
  requirements:
97
- - - "~>"
97
+ - - ~>
98
98
  - !ruby/object:Gem::Version
99
99
  version: '2.4'
100
100
  type: :development
101
101
  prerelease: false
102
102
  version_requirements: !ruby/object:Gem::Requirement
103
103
  requirements:
104
- - - "~>"
104
+ - - ~>
105
105
  - !ruby/object:Gem::Version
106
106
  version: '2.4'
107
107
  - !ruby/object:Gem::Dependency
108
108
  name: ZenTest
109
109
  requirement: !ruby/object:Gem::Requirement
110
110
  requirements:
111
- - - "~>"
111
+ - - ~>
112
112
  - !ruby/object:Gem::Version
113
113
  version: '4.5'
114
114
  type: :development
115
115
  prerelease: false
116
116
  version_requirements: !ruby/object:Gem::Requirement
117
117
  requirements:
118
- - - "~>"
118
+ - - ~>
119
119
  - !ruby/object:Gem::Version
120
120
  version: '4.5'
121
121
  - !ruby/object:Gem::Dependency
122
122
  name: rake
123
123
  requirement: !ruby/object:Gem::Requirement
124
124
  requirements:
125
- - - "~>"
125
+ - - ~>
126
126
  - !ruby/object:Gem::Version
127
127
  version: 0.9.3
128
128
  type: :development
129
129
  prerelease: false
130
130
  version_requirements: !ruby/object:Gem::Requirement
131
131
  requirements:
132
- - - "~>"
132
+ - - ~>
133
133
  - !ruby/object:Gem::Version
134
134
  version: 0.9.3
135
135
  - !ruby/object:Gem::Dependency
136
136
  name: hoe
137
137
  requirement: !ruby/object:Gem::Requirement
138
138
  requirements:
139
- - - "~>"
139
+ - - ~>
140
140
  - !ruby/object:Gem::Version
141
- version: '3.3'
141
+ version: '3.5'
142
142
  type: :development
143
143
  prerelease: false
144
144
  version_requirements: !ruby/object:Gem::Requirement
145
145
  requirements:
146
- - - "~>"
146
+ - - ~>
147
147
  - !ruby/object:Gem::Version
148
- version: '3.3'
148
+ version: '3.5'
149
149
  description: |-
150
150
  RubyGems is a package management framework for Ruby.
151
151
 
@@ -185,8 +185,8 @@ extra_rdoc_files:
185
185
  - UPGRADING.rdoc
186
186
  - hide_lib_for_update/note.txt
187
187
  files:
188
- - ".autotest"
189
- - ".document"
188
+ - .autotest
189
+ - .document
190
190
  - History.txt
191
191
  - LICENSE.txt
192
192
  - MIT.txt
@@ -440,30 +440,30 @@ files:
440
440
  - test/rubygems/wrong_key_cert_32.pem
441
441
  - util/CL2notes
442
442
  - util/create_certs.rb
443
- - ".gemtest"
443
+ - .gemtest
444
444
  homepage: http://rubygems.org
445
445
  licenses: []
446
446
  metadata: {}
447
447
  post_install_message:
448
448
  rdoc_options:
449
- - "--main"
449
+ - --main
450
450
  - README.rdoc
451
- - "--title=RubyGems 2.0.0.rc.2 Documentation"
451
+ - --title=RubyGems 2.0.0 Documentation
452
452
  require_paths:
453
453
  - hide_lib_for_update
454
454
  required_ruby_version: !ruby/object:Gem::Requirement
455
455
  requirements:
456
- - - ">="
456
+ - - '>='
457
457
  - !ruby/object:Gem::Version
458
458
  version: 1.8.7
459
459
  required_rubygems_version: !ruby/object:Gem::Requirement
460
460
  requirements:
461
- - - ">="
461
+ - - '>='
462
462
  - !ruby/object:Gem::Version
463
463
  version: '0'
464
464
  requirements: []
465
465
  rubyforge_project: rubygems
466
- rubygems_version: 2.0.0.rc.2
466
+ rubygems_version: 2.0.0
467
467
  signing_key:
468
468
  specification_version: 4
469
469
  summary: RubyGems is a package management framework for Ruby
metadata.gz.sig CHANGED
Binary file