rubygems-update 3.2.20 → 3.2.24

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.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +42 -0
  3. data/Manifest.txt +0 -1
  4. data/bundler/CHANGELOG.md +56 -0
  5. data/bundler/lib/bundler.rb +5 -6
  6. data/bundler/lib/bundler/build_metadata.rb +2 -2
  7. data/bundler/lib/bundler/cli.rb +1 -0
  8. data/bundler/lib/bundler/cli/doctor.rb +11 -1
  9. data/bundler/lib/bundler/cli/install.rb +7 -8
  10. data/bundler/lib/bundler/cli/lock.rb +5 -1
  11. data/bundler/lib/bundler/cli/update.rb +8 -3
  12. data/bundler/lib/bundler/current_ruby.rb +4 -4
  13. data/bundler/lib/bundler/definition.rb +46 -85
  14. data/bundler/lib/bundler/dsl.rb +11 -22
  15. data/bundler/lib/bundler/feature_flag.rb +0 -2
  16. data/bundler/lib/bundler/fetcher/compact_index.rb +1 -1
  17. data/bundler/lib/bundler/fetcher/downloader.rb +1 -2
  18. data/bundler/lib/bundler/index.rb +1 -5
  19. data/bundler/lib/bundler/installer.rb +5 -12
  20. data/bundler/lib/bundler/installer/standalone.rb +1 -1
  21. data/bundler/lib/bundler/lockfile_parser.rb +2 -20
  22. data/bundler/lib/bundler/man/bundle-add.1 +1 -1
  23. data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
  24. data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
  25. data/bundler/lib/bundler/man/bundle-check.1 +1 -1
  26. data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
  27. data/bundler/lib/bundler/man/bundle-config.1 +1 -4
  28. data/bundler/lib/bundler/man/bundle-config.1.ronn +0 -3
  29. data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
  30. data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
  31. data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
  32. data/bundler/lib/bundler/man/bundle-info.1 +1 -1
  33. data/bundler/lib/bundler/man/bundle-init.1 +1 -1
  34. data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
  35. data/bundler/lib/bundler/man/bundle-install.1 +1 -1
  36. data/bundler/lib/bundler/man/bundle-list.1 +1 -1
  37. data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
  38. data/bundler/lib/bundler/man/bundle-open.1 +1 -1
  39. data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
  40. data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
  41. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  42. data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
  43. data/bundler/lib/bundler/man/bundle-show.1 +1 -1
  44. data/bundler/lib/bundler/man/bundle-update.1 +4 -4
  45. data/bundler/lib/bundler/man/bundle-update.1.ronn +3 -3
  46. data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
  47. data/bundler/lib/bundler/man/bundle.1 +1 -1
  48. data/bundler/lib/bundler/man/gemfile.5 +1 -1
  49. data/bundler/lib/bundler/plugin.rb +2 -0
  50. data/bundler/lib/bundler/plugin/index.rb +4 -1
  51. data/bundler/lib/bundler/plugin/installer.rb +1 -1
  52. data/bundler/lib/bundler/resolver.rb +3 -1
  53. data/bundler/lib/bundler/rubygems_ext.rb +22 -6
  54. data/bundler/lib/bundler/runtime.rb +1 -3
  55. data/bundler/lib/bundler/settings.rb +9 -8
  56. data/bundler/lib/bundler/source/rubygems.rb +4 -17
  57. data/bundler/lib/bundler/source_list.rb +40 -21
  58. data/bundler/lib/bundler/spec_set.rb +5 -10
  59. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +1 -1
  60. data/bundler/lib/bundler/version.rb +1 -1
  61. data/lib/rubygems.rb +1 -1
  62. data/lib/rubygems/commands/cert_command.rb +42 -38
  63. data/lib/rubygems/config_file.rb +1 -1
  64. data/lib/rubygems/gemcutter_utilities.rb +12 -4
  65. data/lib/rubygems/package/io_source.rb +4 -0
  66. data/lib/rubygems/request.rb +1 -1
  67. data/lib/rubygems/specification.rb +6 -2
  68. data/lib/rubygems/uninstaller.rb +36 -5
  69. data/lib/rubygems/util/licenses.rb +107 -2
  70. data/rubygems-update.gemspec +1 -1
  71. data/setup.rb +1 -2
  72. data/test/rubygems/test_gem_commands_push_command.rb +0 -5
  73. data/test/rubygems/test_gem_commands_setup_command.rb +3 -3
  74. data/test/rubygems/test_gem_commands_signin_command.rb +7 -0
  75. data/test/rubygems/test_gem_ext_rake_builder.rb +2 -0
  76. data/test/rubygems/test_gem_gemcutter_utilities.rb +12 -6
  77. data/test/rubygems/test_gem_installer.rb +1 -1
  78. data/test/rubygems/test_gem_package.rb +8 -1
  79. data/test/rubygems/test_gem_server.rb +4 -4
  80. data/test/rubygems/test_gem_uninstaller.rb +9 -2
  81. data/test/rubygems/test_require.rb +0 -2
  82. metadata +3 -4
  83. data/Rakefile +0 -396
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "rubygems-update"
5
- s.version = "3.2.20"
5
+ s.version = "3.2.24"
6
6
  s.authors = ["Jim Weirich", "Chad Fowler", "Eric Hodel", "Luis Lavena", "Aaron Patterson", "Samuel Giddins", "André Arko", "Evan Phoenix", "Hiroshi SHIBATA"]
7
7
  s.email = ["", "", "drbrain@segment7.net", "luislavena@gmail.com", "aaron@tenderlovemaking.com", "segiddins@segiddins.me", "andre@arko.net", "evan@phx.io", "hsbt@ruby-lang.org"]
8
8
 
data/setup.rb CHANGED
@@ -11,8 +11,7 @@ if ENV['RUBYOPT'] or defined? Gem
11
11
  ENV.delete 'RUBYOPT'
12
12
 
13
13
  require 'rbconfig'
14
- cmd = [RbConfig.ruby, 'setup.rb', *ARGV].compact
15
- cmd[1,0] = "--disable-gems"
14
+ cmd = [RbConfig.ruby, '--disable-gems', 'setup.rb', *ARGV]
16
15
 
17
16
  exec(*cmd)
18
17
  end
@@ -155,7 +155,6 @@ class TestGemCommandsPushCommand < Gem::TestCase
155
155
  @host => @api_key,
156
156
  }
157
157
 
158
- FileUtils.mkdir_p File.dirname Gem.configuration.credentials_path
159
158
  File.open Gem.configuration.credentials_path, 'w' do |f|
160
159
  f.write keys.to_yaml
161
160
  end
@@ -190,7 +189,6 @@ class TestGemCommandsPushCommand < Gem::TestCase
190
189
  @host => @api_key,
191
190
  }
192
191
 
193
- FileUtils.mkdir_p File.dirname Gem.configuration.credentials_path
194
192
  File.open Gem.configuration.credentials_path, 'w' do |f|
195
193
  f.write keys.to_yaml
196
194
  end
@@ -232,7 +230,6 @@ class TestGemCommandsPushCommand < Gem::TestCase
232
230
  :rubygems_api_key => @api_key,
233
231
  }
234
232
 
235
- FileUtils.mkdir_p File.dirname Gem.configuration.credentials_path
236
233
  File.open Gem.configuration.credentials_path, 'w' do |f|
237
234
  f.write keys.to_yaml
238
235
  end
@@ -274,7 +271,6 @@ class TestGemCommandsPushCommand < Gem::TestCase
274
271
  @host => @api_key,
275
272
  }
276
273
 
277
- FileUtils.mkdir_p File.dirname Gem.configuration.credentials_path
278
274
  File.open Gem.configuration.credentials_path, 'w' do |f|
279
275
  f.write keys.to_yaml
280
276
  end
@@ -305,7 +301,6 @@ class TestGemCommandsPushCommand < Gem::TestCase
305
301
  host => api_key,
306
302
  }
307
303
 
308
- FileUtils.mkdir_p File.dirname Gem.configuration.credentials_path
309
304
  File.open Gem.configuration.credentials_path, 'w' do |f|
310
305
  f.write keys.to_yaml
311
306
  end
@@ -48,7 +48,7 @@ class TestGemCommandsSetupCommand < Gem::TestCase
48
48
  io.puts gemspec.to_ruby
49
49
  end
50
50
 
51
- open(File.join(Gem.default_specifications_dir, "bundler-1.15.4.gemspec"), 'w') do |io|
51
+ File.open(File.join(Gem.default_specifications_dir, "bundler-1.15.4.gemspec"), 'w') do |io|
52
52
  gemspec.version = "1.15.4"
53
53
  io.puts gemspec.to_ruby
54
54
  end
@@ -175,7 +175,7 @@ class TestGemCommandsSetupCommand < Gem::TestCase
175
175
  assert_path_exist File.join(dir, 'bundler.rb')
176
176
  assert_path_exist File.join(dir, 'bundler/b.rb')
177
177
 
178
- assert_path_exist File.join(dir, 'bundler/templates/.circleci/config.yml') unless RUBY_ENGINE == "truffleruby" # https://github.com/oracle/truffleruby/issues/2116
178
+ assert_path_exist File.join(dir, 'bundler/templates/.circleci/config.yml')
179
179
  assert_path_exist File.join(dir, 'bundler/templates/.travis.yml')
180
180
  end
181
181
  end
@@ -272,7 +272,7 @@ class TestGemCommandsSetupCommand < Gem::TestCase
272
272
 
273
273
  @cmd.remove_old_lib_files lib
274
274
 
275
- files_that_go.each {|file| assert_path_not_exist(file) unless file == old_bundler_ci && RUBY_ENGINE == "truffleruby" } # https://github.com/oracle/truffleruby/issues/2116
275
+ files_that_go.each {|file| assert_path_not_exist(file) unless file == old_bundler_ci }
276
276
 
277
277
  files_that_stay.each {|file| assert_path_exist file }
278
278
  end
@@ -26,6 +26,13 @@ class TestGemCommandsSigninCommand < Gem::TestCase
26
26
  assert_match %r{Signed in.}, sign_in_ui.output
27
27
  end
28
28
 
29
+ def test_execute_when_not_already_signed_in_and_not_preexisting_credentials_folder
30
+ FileUtils.rm Gem.configuration.credentials_path
31
+
32
+ sign_in_ui = util_capture { @cmd.execute }
33
+ assert_match %r{Signed in.}, sign_in_ui.output
34
+ end
35
+
29
36
  def test_execute_when_already_signed_in_with_same_host
30
37
  host = 'http://some-gemcutter-compatible-host.org'
31
38
 
@@ -48,6 +48,8 @@ class TestGemExtRakeBuilder < Gem::TestCase
48
48
  end
49
49
 
50
50
  def test_class_no_openssl_override
51
+ pend 'openssl is missing' unless Gem::HAVE_OPENSSL
52
+
51
53
  create_temp_mkrf_file('task :default')
52
54
 
53
55
  rake = util_spec 'rake' do |s|
@@ -14,6 +14,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
14
14
  Gem.configuration.disable_default_gem_server = nil
15
15
 
16
16
  ENV['RUBYGEMS_HOST'] = nil
17
+ ENV['GEM_HOST_OTP_CODE'] = nil
17
18
  Gem.configuration.rubygems_api_key = nil
18
19
 
19
20
  @cmd = Gem::Command.new '', 'summary'
@@ -22,6 +23,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
22
23
 
23
24
  def teardown
24
25
  ENV['RUBYGEMS_HOST'] = nil
26
+ ENV['GEM_HOST_OTP_CODE'] = nil
25
27
  Gem.configuration.rubygems_api_key = nil
26
28
 
27
29
  credential_teardown
@@ -35,8 +37,6 @@ class TestGemGemcutterUtilities < Gem::TestCase
35
37
  "http://rubygems.engineyard.com" => "EYKEY",
36
38
  }
37
39
 
38
- FileUtils.mkdir_p File.dirname Gem.configuration.credentials_path
39
-
40
40
  File.open Gem.configuration.credentials_path, 'w' do |f|
41
41
  f.write keys.to_yaml
42
42
  end
@@ -50,7 +50,6 @@ class TestGemGemcutterUtilities < Gem::TestCase
50
50
 
51
51
  def test_api_key
52
52
  keys = { :rubygems_api_key => 'KEY' }
53
- FileUtils.mkdir_p File.dirname Gem.configuration.credentials_path
54
53
 
55
54
  File.open Gem.configuration.credentials_path, 'w' do |f|
56
55
  f.write keys.to_yaml
@@ -63,7 +62,6 @@ class TestGemGemcutterUtilities < Gem::TestCase
63
62
 
64
63
  def test_api_key_override
65
64
  keys = { :rubygems_api_key => 'KEY', :other => 'OTHER' }
66
- FileUtils.mkdir_p File.dirname Gem.configuration.credentials_path
67
65
 
68
66
  File.open Gem.configuration.credentials_path, 'w' do |f|
69
67
  f.write keys.to_yaml
@@ -168,7 +166,6 @@ class TestGemGemcutterUtilities < Gem::TestCase
168
166
  api_key = 'a5fdbb6ba150cbb83aad2bb2fede64cf040453903'
169
167
  other_api_key = 'f46dbb18bb6a9c97cdc61b5b85c186a17403cdcbf'
170
168
 
171
- FileUtils.mkdir_p File.dirname(Gem.configuration.credentials_path)
172
169
  File.open Gem.configuration.credentials_path, 'w' do |f|
173
170
  f.write Hash[:other_api_key, other_api_key].to_yaml
174
171
  end
@@ -191,6 +188,16 @@ class TestGemGemcutterUtilities < Gem::TestCase
191
188
  assert_match %r{Access Denied.}, @sign_in_ui.output
192
189
  end
193
190
 
191
+ def test_signin_with_env_otp_code
192
+ ENV['GEM_HOST_OTP_CODE'] = '111111'
193
+ api_key = 'a5fdbb6ba150cbb83aad2bb2fede64cf040453903'
194
+
195
+ util_sign_in [api_key, 200, 'OK']
196
+
197
+ assert_match 'Signed in with API key:', @sign_in_ui.output
198
+ assert_equal '111111', @fetcher.last_request['OTP']
199
+ end
200
+
194
201
  def test_sign_in_with_correct_otp_code
195
202
  api_key = 'a5fdbb6ba150cbb83aad2bb2fede64cf040453903'
196
203
  response_fail = "You have enabled multifactor authentication but your request doesn't have the correct OTP code. Please check it and retry."
@@ -246,7 +253,6 @@ class TestGemGemcutterUtilities < Gem::TestCase
246
253
 
247
254
  def test_verify_api_key
248
255
  keys = {:other => 'a5fdbb6ba150cbb83aad2bb2fede64cf040453903'}
249
- FileUtils.mkdir_p File.dirname(Gem.configuration.credentials_path)
250
256
  File.open Gem.configuration.credentials_path, 'w' do |f|
251
257
  f.write keys.to_yaml
252
258
  end
@@ -730,7 +730,7 @@ gem 'other', version
730
730
  installer.generate_bin
731
731
 
732
732
  default_shebang = Gem.ruby
733
- shebang_line = open("#{@gemhome}/bin/executable") {|f| f.readlines.first }
733
+ shebang_line = File.open("#{@gemhome}/bin/executable") {|f| f.readlines.first }
734
734
  assert_match(/\A#!/, shebang_line)
735
735
  assert_match(/#{default_shebang}/, shebang_line)
736
736
  end
@@ -937,7 +937,7 @@ class TestGemPackage < Gem::Package::TarTestCase
937
937
  build = Gem::Package.new @gem
938
938
  build.spec = @spec
939
939
  build.setup_signer
940
- open @gem, 'wb' do |gem_io|
940
+ File.open @gem, 'wb' do |gem_io|
941
941
  Gem::Package::TarWriter.new gem_io do |gem|
942
942
  build.add_metadata gem
943
943
  build.add_contents gem
@@ -1145,6 +1145,13 @@ class TestGemPackage < Gem::Package::TarTestCase
1145
1145
  end
1146
1146
  end
1147
1147
 
1148
+ def test_contents_from_io
1149
+ io = StringIO.new Gem.read_binary @gem
1150
+ package = Gem::Package.new io
1151
+
1152
+ assert_equal %w[lib/code.rb], package.contents
1153
+ end
1154
+
1148
1155
  def util_tar
1149
1156
  tar_io = StringIO.new
1150
1157
 
@@ -365,7 +365,7 @@ class TestGemServer < Gem::TestCase
365
365
  specs_dir = File.join dir, 'specifications'
366
366
  FileUtils.mkdir_p specs_dir
367
367
 
368
- open File.join(specs_dir, spec.spec_name), 'w' do |io|
368
+ File.open File.join(specs_dir, spec.spec_name), 'w' do |io|
369
369
  io.write spec.to_ruby
370
370
  end
371
371
 
@@ -420,7 +420,7 @@ class TestGemServer < Gem::TestCase
420
420
  specs_dir = File.join dir, 'specifications'
421
421
  FileUtils.mkdir_p specs_dir
422
422
 
423
- open File.join(specs_dir, spec.spec_name), 'w' do |io|
423
+ File.open File.join(specs_dir, spec.spec_name), 'w' do |io|
424
424
  io.write spec.to_ruby
425
425
  end
426
426
 
@@ -475,7 +475,7 @@ class TestGemServer < Gem::TestCase
475
475
  specs_dir = File.join dir, 'specifications'
476
476
  FileUtils.mkdir_p specs_dir
477
477
 
478
- open File.join(specs_dir, spec.spec_name), 'w' do |io|
478
+ File.open File.join(specs_dir, spec.spec_name), 'w' do |io|
479
479
  io.write spec.to_ruby
480
480
  end
481
481
 
@@ -502,7 +502,7 @@ class TestGemServer < Gem::TestCase
502
502
  specs_dir = File.join dir, 'specifications'
503
503
  FileUtils.mkdir_p specs_dir
504
504
 
505
- open File.join(specs_dir, spec.spec_name), 'w' do |io|
505
+ File.open File.join(specs_dir, spec.spec_name), 'w' do |io|
506
506
  io.write spec.to_ruby
507
507
  end
508
508
 
@@ -295,8 +295,15 @@ class TestGemUninstaller < Gem::InstallerTestCase
295
295
 
296
296
  uninstaller = Gem::Uninstaller.new spec.name, :executables => true
297
297
 
298
- uninstaller.uninstall
299
-
298
+ ui = Gem::MockGemUi.new "1\ny\n"
299
+ use_ui ui do
300
+ uninstaller.uninstall
301
+ end
302
+ expected = "Successfully uninstalled default-2\n" \
303
+ "There was both a regular copy and a default copy of default-2. The " \
304
+ "regular copy was successfully uninstalled, but the default copy " \
305
+ "was left around because default gems can't be removed.\n"
306
+ assert_equal expected, ui.output
300
307
  assert_path_not_exist spec.gem_dir
301
308
  end
302
309
 
@@ -679,8 +679,6 @@ class TestGemRequire < Gem::TestCase
679
679
  end
680
680
 
681
681
  def test_no_crash_when_overriding_warn_with_warning_module
682
- pend "https://github.com/oracle/truffleruby/issues/2109" if RUBY_ENGINE == "truffleruby"
683
-
684
682
  Dir.mktmpdir("warn_test") do |dir|
685
683
  File.write(dir + "/main.rb", "module Warning; def warn(str); super; end; end; warn 'Foo Bar'")
686
684
  _, err = capture_subprocess_io do
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: 3.2.20
4
+ version: 3.2.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Weirich
@@ -16,7 +16,7 @@ authors:
16
16
  autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
- date: 2021-06-11 00:00:00.000000000 Z
19
+ date: 2021-07-15 00:00:00.000000000 Z
20
20
  dependencies: []
21
21
  description: |-
22
22
  A package (also known as a library) contains a set of functionality
@@ -63,7 +63,6 @@ files:
63
63
  - Manifest.txt
64
64
  - POLICIES.md
65
65
  - README.md
66
- - Rakefile
67
66
  - UPGRADING.md
68
67
  - bin/gem
69
68
  - bin/update_rubygems
@@ -772,7 +771,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
772
771
  - !ruby/object:Gem::Version
773
772
  version: '0'
774
773
  requirements: []
775
- rubygems_version: 3.2.20
774
+ rubygems_version: 3.2.24
776
775
  signing_key:
777
776
  specification_version: 4
778
777
  summary: RubyGems is a package management framework for Ruby.
data/Rakefile DELETED
@@ -1,396 +0,0 @@
1
- RakeFileUtils.verbose_flag = false
2
-
3
- require 'rubygems'
4
- require 'rubygems/package_task'
5
- require "rake/testtask"
6
- require 'psych'
7
-
8
- desc "Setup Rubygems dev environment"
9
- task :setup do
10
- sh "ruby", "-I", "lib", "bundler/spec/support/bundle.rb", "install", "--gemfile=dev_gems.rb"
11
- end
12
-
13
- desc "Update Rubygems dev environment"
14
- task :update do |_, args|
15
- sh "ruby", "-I", "lib", "bundler/spec/support/bundle.rb", "update", *args, "--gemfile=dev_gems.rb"
16
- end
17
-
18
- desc "Update the locked bundler version in dev environment"
19
- task :update_locked_bundler do |_, args|
20
- sh "ruby", "bundler/spec/support/bundle.rb", "update", "--bundler", "--gemfile=dev_gems.rb"
21
- sh "ruby", "bundler/spec/support/bundle.rb", "update", "--bundler", "--gemfile=bundler/tool/bundler/test_gems.rb"
22
- sh "ruby", "bundler/spec/support/bundle.rb", "update", "--bundler", "--gemfile=bundler/tool/bundler/rubocop_gems.rb"
23
- sh "ruby", "bundler/spec/support/bundle.rb", "update", "--bundler", "--gemfile=bundler/tool/bundler/rubocop23_gems.rb"
24
- end
25
-
26
- desc "Setup git hooks"
27
- task :git_hooks do
28
- sh "git config core.hooksPath .githooks"
29
- end
30
-
31
- Rake::TestTask.new do |t|
32
- t.ruby_opts = %w[-w]
33
- t.ruby_opts << '-rdevkit' if RbConfig::CONFIG['host_os'].include?('mingw')
34
-
35
- t.libs << "test"
36
- t.libs << "bundler/lib"
37
-
38
- t.test_files = FileList['test/**/test_*.rb']
39
- end
40
-
41
- task :default => :test
42
-
43
- spec = Gem::Specification.load('rubygems-update.gemspec')
44
- v = spec.version
45
-
46
- require 'rdoc/task'
47
-
48
- RDoc::Task.new :rdoc => 'docs', :clobber_rdoc => 'clobber_docs' do |doc|
49
- doc.main = 'README.md'
50
- doc.title = "RubyGems #{v} API Documentation"
51
-
52
- rdoc_files = Rake::FileList.new %w[lib bundler/lib]
53
- rdoc_files.add %w[CHANGELOG.md LICENSE.txt MIT.txt CODE_OF_CONDUCT.md CONTRIBUTING.md
54
- MAINTAINERS.txt Manifest.txt POLICIES.md README.md UPGRADING.md bundler/CHANGELOG.md
55
- bundler/doc/contributing/README.md bundler/LICENSE.md bundler/README.md
56
- hide_lib_for_update/note.txt].map(&:freeze)
57
-
58
- doc.rdoc_files = rdoc_files
59
-
60
- doc.rdoc_dir = 'doc'
61
- end
62
-
63
- load "util/automatiek.rake"
64
-
65
- # We currently ship Molinillo master branch as of
66
- # https://github.com/CocoaPods/Molinillo/commit/7cc27a355e861bdf593e2cde7bf1bca3daae4303
67
- Automatiek::RakeTask.new("molinillo") do |lib|
68
- lib.version = "master"
69
- lib.download = { :github => "https://github.com/CocoaPods/Molinillo" }
70
- lib.namespace = "Molinillo"
71
- lib.prefix = "Gem::Resolver"
72
- lib.vendor_lib = "lib/rubygems/resolver/molinillo"
73
- end
74
-
75
- namespace :rubocop do
76
- desc "Run rubocop for RubyGems. Pass positional arguments, e.g. -a, as Rake arguments."
77
- task(:rubygems) do |_, args|
78
- sh "util/rubocop", *args
79
- end
80
-
81
- desc "Run rubocop for Bundler. Pass positional arguments, e.g. -a, as Rake arguments."
82
- task(:bundler) do |_, args|
83
- sh "bundler/bin/rubocop", *args
84
- end
85
- end
86
-
87
- task rubocop: %w[rubocop:rubygems rubocop:bundler]
88
-
89
- # --------------------------------------------------------------------
90
- # Creating a release
91
-
92
- task :prerelease => %w[clobber test bundler:build_metadata check_deprecations]
93
- task :postrelease => %w[bundler:build_metadata:clean upload guides:publish blog:publish]
94
-
95
- desc "Check for deprecated methods with expired deprecation horizon"
96
- task :check_deprecations do
97
- if v.segments[1] == 0 && v.segments[2] == 0
98
- sh("util/rubocop -r ./util/cops/deprecations --only Rubygems/Deprecations")
99
- else
100
- puts "Skipping deprecation checks since not releasing a major version."
101
- end
102
- end
103
-
104
- desc "Prepare stable branch"
105
- task :prepare_stable_branch, [:version] do |_t, opts|
106
- require_relative "util/release"
107
-
108
- Release.new(opts[:version] || v.to_s).prepare!
109
- end
110
-
111
- desc "Install rubygems to local system"
112
- task :install => [:clear_package, :package] do
113
- sh "ruby -Ilib bin/gem install --no-document pkg/rubygems-update-#{v}.gem --backtrace && update_rubygems --no-document --backtrace"
114
- end
115
-
116
- desc "Clears previously built package"
117
- task :clear_package do
118
- rm_rf "pkg"
119
- end
120
-
121
- desc "Generates the changelog for a specific target version"
122
- task :generate_changelog, [:version] do |_t, opts|
123
- require_relative "util/release"
124
-
125
- Release.for_rubygems(opts[:version]).cut_changelog!
126
- end
127
-
128
- desc "Release rubygems-#{v}"
129
- task :release => :prerelease do
130
- Rake::Task["package"].invoke
131
- sh "gem push pkg/rubygems-update-#{v}.gem"
132
- Rake::Task["postrelease"].invoke
133
- end
134
-
135
- Gem::PackageTask.new(spec) {}
136
-
137
- Rake::Task["package"].enhance ["pkg/rubygems-#{v}.tgz", "pkg/rubygems-#{v}.zip"]
138
-
139
- file "pkg/rubygems-#{v}" => "pkg/rubygems-update-#{v}" do |t|
140
- require 'find'
141
-
142
- dest_root = File.expand_path t.name
143
-
144
- cd t.source do
145
- Find.find '.' do |file|
146
- dest = File.expand_path file, dest_root
147
-
148
- if File.directory? file
149
- mkdir_p dest
150
- else
151
- rm_f dest
152
- safe_ln file, dest
153
- end
154
- end
155
- end
156
- end
157
-
158
- file "pkg/rubygems-#{v}.zip" => "pkg/rubygems-#{v}" do
159
- cd 'pkg' do
160
- if Gem.win_platform?
161
- sh "7z a rubygems-#{v}.zip rubygems-#{v}"
162
- else
163
- sh "zip -q -r rubygems-#{v}.zip rubygems-#{v}"
164
- end
165
- end
166
- end
167
-
168
- file "pkg/rubygems-#{v}.tgz" => "pkg/rubygems-#{v}" do
169
- cd 'pkg' do
170
- if Gem.win_platform? && RUBY_VERSION < '2.4'
171
- sh "7z a -ttar rubygems-#{v}.tar rubygems-#{v}"
172
- sh "7z a -tgzip rubygems-#{v}.tgz rubygems-#{v}.tar"
173
- else
174
- sh "tar -czf rubygems-#{v}.tgz --owner=rubygems:0 --group=rubygems:0 rubygems-#{v}"
175
- end
176
- end
177
- end
178
-
179
- desc "Upload the release to Github releases"
180
- task :upload_to_github do
181
- require_relative "util/release"
182
-
183
- Release.for_rubygems(v).create_for_github!
184
- end
185
-
186
- desc "Upload release to S3"
187
- task :upload_to_s3 do
188
- require "aws-sdk-s3"
189
-
190
- s3 = Aws::S3::Resource.new(region:'us-west-2')
191
- %w[zip tgz].each do |ext|
192
- obj = s3.bucket('oregon.production.s3.rubygems.org').object("rubygems/rubygems-#{v}.#{ext}")
193
- obj.upload_file("pkg/rubygems-#{v}.#{ext}", acl: 'public-read')
194
- end
195
- end
196
-
197
- desc "Upload release to rubygems.org"
198
- task :upload => %w[upload_to_github upload_to_s3]
199
-
200
- directory '../guides.rubygems.org' do
201
- sh 'git', 'clone',
202
- 'git@github.com:rubygems/guides.git',
203
- '../guides.rubygems.org'
204
- end
205
-
206
- namespace 'guides' do
207
- task 'pull' => %w[../guides.rubygems.org] do
208
- chdir '../guides.rubygems.org' do
209
- sh 'git', 'pull'
210
- end
211
- end
212
-
213
- task 'update' => %w[../guides.rubygems.org] do
214
- lib_dir = File.join Dir.pwd, 'lib'
215
-
216
- chdir '../guides.rubygems.org' do
217
- ruby '-I', lib_dir, '-S', 'rake', 'command_guide'
218
- ruby '-I', lib_dir, '-S', 'rake', 'spec_guide'
219
- end
220
- end
221
-
222
- task 'commit' => %w[../guides.rubygems.org] do
223
- chdir '../guides.rubygems.org' do
224
- begin
225
- sh 'git', 'diff', '--quiet'
226
- rescue
227
- sh 'git', 'commit', 'command-reference.md', 'specification-reference.md',
228
- '-m', "Rebuild for RubyGems #{v}"
229
- end
230
- end
231
- end
232
-
233
- task 'push' => %w[../guides.rubygems.org] do
234
- chdir '../guides.rubygems.org' do
235
- sh 'git', 'push'
236
- end
237
- end
238
-
239
- desc 'Updates and publishes the guides for the just-released RubyGems'
240
- task 'publish'
241
-
242
- task 'publish' => %w[
243
- guides:pull
244
- guides:update
245
- guides:commit
246
- guides:push
247
- ]
248
- end
249
-
250
- directory '../blog.rubygems.org' do
251
- sh 'git', 'clone',
252
- 'git@github.com:rubygems/rubygems.github.io.git',
253
- '../blog.rubygems.org'
254
- end
255
-
256
- namespace 'blog' do
257
- date = Time.now.strftime '%Y-%m-%d'
258
- post_page = "_posts/#{date}-#{v}-released.md"
259
- checksums = ''
260
-
261
- task 'checksums' => 'package' do
262
- require 'digest'
263
- Dir['pkg/*{tgz,zip,gem}'].map do |file|
264
- digest = Digest::SHA256.new
265
-
266
- open file, 'rb' do |io|
267
- while chunk = io.read(65536) do
268
- digest.update chunk
269
- end
270
- end
271
-
272
- checksums << "* #{File.basename(file)} \n"
273
- checksums << " #{digest.hexdigest}\n"
274
- end
275
- end
276
-
277
- task 'pull' => %w[../blog.rubygems.org] do
278
- chdir '../blog.rubygems.org' do
279
- sh 'git', 'pull'
280
- end
281
- end
282
-
283
- path = File.join '../blog.rubygems.org', post_page
284
-
285
- task 'update' => [path]
286
-
287
- file path => 'checksums' do
288
- name = `git config --get user.name`.strip
289
- email = `git config --get user.email`.strip
290
-
291
- require_relative "util/changelog"
292
- history = Changelog.for_rubygems(v.to_s)
293
-
294
- require 'tempfile'
295
-
296
- Tempfile.open 'blog_post' do |io|
297
- io.write <<-ANNOUNCEMENT
298
- ---
299
- title: #{v} Released
300
- layout: post
301
- author: #{name}
302
- author_email: #{email}
303
- ---
304
-
305
- RubyGems #{v} includes #{history.change_types_for_blog}.
306
-
307
- To update to the latest RubyGems you can run:
308
-
309
- gem update --system
310
-
311
- To install RubyGems by hand see the [Download RubyGems][download] page.
312
-
313
- #{history.release_notes_for_blog.join("\n")}
314
-
315
- SHA256 Checksums:
316
-
317
- #{checksums}
318
-
319
- [download]: https://rubygems.org/pages/download
320
-
321
- ANNOUNCEMENT
322
-
323
- io.flush
324
-
325
- sh(ENV['EDITOR'] || 'vim', io.path)
326
-
327
- FileUtils.cp io.path, path
328
- end
329
- end
330
-
331
- task 'commit' => %w[../blog.rubygems.org] do
332
- chdir '../blog.rubygems.org' do
333
- sh 'git', 'add', post_page
334
- sh 'git', 'commit', post_page,
335
- '-m', "Added #{v} release announcement"
336
- end
337
- end
338
-
339
- task 'push' => %w[../blog.rubygems.org] do
340
- chdir '../blog.rubygems.org' do
341
- sh 'git', 'push'
342
- end
343
- end
344
-
345
- desc 'Updates and publishes the blog for the just-released RubyGems'
346
- task 'publish' => %w[
347
- blog:pull
348
- blog:update
349
- blog:commit
350
- blog:push
351
- ]
352
- end
353
-
354
- # Misc Tasks ---------------------------------------------------------
355
-
356
- module Rubygems
357
- class ProjectFiles
358
- def self.all
359
- files = []
360
- exclude = %r{\A(?:\.|dev_gems|bundler/(?!lib|exe|[^/]+\.md|bundler.gemspec)|util/)}
361
- tracked_files = `git ls-files`.split("\n")
362
-
363
- tracked_files.each do |path|
364
- next unless File.file?(path)
365
- next if path =~ exclude
366
- files << path
367
- end
368
-
369
- files.sort
370
- end
371
- end
372
- end
373
-
374
- desc "Update the manifest to reflect what's on disk"
375
- task :update_manifest do
376
- File.open('Manifest.txt', 'w') {|f| f.puts(Rubygems::ProjectFiles.all) }
377
- end
378
-
379
- desc "Check the manifest is up to date"
380
- task :check_manifest do
381
- if File.read("Manifest.txt").split != Rubygems::ProjectFiles.all
382
- abort "Manifest is out of date. Run `rake update_manifest` to sync it"
383
- end
384
- end
385
-
386
- namespace :bundler do
387
- task :build_metadata do
388
- chdir('bundler') { sh "rake build_metadata" }
389
- end
390
-
391
- namespace :build_metadata do
392
- task :clean do
393
- chdir('bundler') { sh "rake build_metadata:clean" }
394
- end
395
- end
396
- end