rubygems-update 3.1.1 → 3.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cfff2250893c2233e664042cf61c859db6ddc09bf9085e9360c1e32ec92b0621
4
- data.tar.gz: 37a8b000b154d1dea0595ba0f3ee85255acfd8767a50872433f6737b82572ed2
3
+ metadata.gz: 8792a66eb8c568042479f6efb2c644d9a05a090d61740eb3ce2a879b58012998
4
+ data.tar.gz: 476db48a5bf0cd6c20e30269bc55cadc25442b82b34e8f95ffaea1ef5f0e01f2
5
5
  SHA512:
6
- metadata.gz: 43b3357db0d0790fdf81140513ca87cd60d899f20c23975957bfdb75902731de0245f5f0881e04c8e1d0e8d225b827cf4f1777254702996e8b2a85de2f7c42e7
7
- data.tar.gz: f050beceeb7f08355c6d390d8a5d88fe253f749a6cfd87b5bfb05417c3ca188cae947dad74c43d9137bf248d77501119b91778bf2c97d0939372c16eb1a5cfe8
6
+ metadata.gz: b1190d2ad52d0df45a0374e98a6c6f9b3d98263e6c44bd6999066c43a5b8f8676971070b32f1cef0c8525d154ec3979715c9c0da90ad6a967794e4c023a139bd
7
+ data.tar.gz: 4a9c8ae5717602d575285a4b3bc3265bf9a2c301d7949993ecd1953b2b78f983e6043b0b2d2593a28dfa1541d272670a2d1f1e12fe68c936702e0cc551f7b4b0
@@ -1,5 +1,25 @@
1
1
  # coding: UTF-8
2
2
 
3
+
4
+ === 3.1.2 / 2019-12-20
5
+
6
+ Minor enhancements:
7
+
8
+ * Restore non prompting `gem update --system` behavior. Pull request #3040
9
+ by David Rodríguez.
10
+ * Show only release notes for new code installed. Pull request #3041 by
11
+ David Rodríguez.
12
+ * Inform about installed `bundle` executable after `gem update --system`.
13
+ Pull request #3042 by David Rodríguez.
14
+ * Use Bundler 2.1.2. Pull request #3043 by SHIBATA Hiroshi.
15
+
16
+ Bug fixes:
17
+
18
+ * Require `uri` in source.rb. Pull request #3034 by mihaibuzgau.
19
+ * Fix `gem update --system --force`. Pull request #3035 by David
20
+ Rodríguez.
21
+ * Move `require uri` to source_list. Pull request #3038 by mihaibuzgau.
22
+
3
23
  === 3.1.1 / 2019-12-16
4
24
 
5
25
  Bug fixes:
data/Rakefile CHANGED
@@ -96,8 +96,13 @@ task :check_deprecations do
96
96
  end
97
97
 
98
98
  desc "Install rubygems to local system"
99
- task :install => :package do
100
- sh "gem install pkg/rubygems-update-#{v}.gem && update_rubygems"
99
+ task :install => [:clear_package, :package] do
100
+ sh "ruby -Ilib bin/gem install pkg/rubygems-update-#{v}.gem && update_rubygems"
101
+ end
102
+
103
+ desc "Clears previously built package"
104
+ task :clear_package do
105
+ rm_rf "pkg"
101
106
  end
102
107
 
103
108
  desc "Release rubygems-#{v}"
@@ -32,5 +32,5 @@ else
32
32
  update_dir = File.dirname(update_dir)
33
33
  Dir.chdir update_dir
34
34
  ENV["GEM_PREV_VER"] = Gem::VERSION
35
- system(Gem.ruby, 'setup.rb', *ARGV)
35
+ abort unless system(Gem.ruby, 'setup.rb', *ARGV)
36
36
  end
@@ -1,3 +1,16 @@
1
+ ## 2.1.2 (December 20, 2019)
2
+
3
+ Bugfixes:
4
+
5
+ - Restore an explicit `require "rubygems"` on top `rubygems_integration.rb` to avoid some missing constant errors under some convoluted setups [#7505](https://github.com/bundler/bundler/pull/7505)
6
+
7
+ ## 2.1.1 (December 17, 2019)
8
+
9
+ Bugfixes:
10
+
11
+ - Fix some cases of shelling out to `rubygems` still being silent [#7493](https://github.com/bundler/bundler/pull/7493)
12
+ - Restore compatibility with `rubygems-bundler` so that binstubs work under `RVM` [#7498](https://github.com/bundler/bundler/pull/7498)
13
+
1
14
  ## 2.1.0 (December 15, 2019)
2
15
 
3
16
  Features:
@@ -4,8 +4,8 @@ module Bundler
4
4
  # Represents metadata from when the Bundler gem was built.
5
5
  module BuildMetadata
6
6
  # begin ivars
7
- @built_at = "2019-12-16".freeze
8
- @git_commit_sha = "683fe9799".freeze
7
+ @built_at = "2019-12-20".freeze
8
+ @git_commit_sha = "4da3289eb".freeze
9
9
  @release = false
10
10
  # end ivars
11
11
 
@@ -25,12 +25,12 @@ module Bundler
25
25
  SharedHelpers.set_bundle_environment
26
26
  if bin_path = Bundler.which(cmd)
27
27
  if !Bundler.settings[:disable_exec_load] && ruby_shebang?(bin_path)
28
- return with_verbose_rubygems { kernel_load(bin_path, *args) }
28
+ return kernel_load(bin_path, *args)
29
29
  end
30
- with_verbose_rubygems { kernel_exec(bin_path, *args) }
30
+ kernel_exec(bin_path, *args)
31
31
  else
32
32
  # exec using the given command
33
- with_verbose_rubygems { kernel_exec(cmd, *args) }
33
+ kernel_exec(cmd, *args)
34
34
  end
35
35
  end
36
36
 
@@ -89,14 +89,5 @@ module Bundler
89
89
  first_line = File.open(file, "rb") {|f| f.read(possibilities.map(&:size).max) }
90
90
  possibilities.any? {|shebang| first_line.start_with?(shebang) }
91
91
  end
92
-
93
- def with_verbose_rubygems
94
- old_ui = Gem::DefaultUserInteraction.ui
95
- Gem::DefaultUserInteraction.ui = nil
96
-
97
- yield
98
- ensure
99
- Gem::DefaultUserInteraction.ui = old_ui
100
- end
101
92
  end
102
93
  end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "rubygems"
4
+
3
5
  module Bundler
4
6
  class RubygemsIntegration
5
7
  if defined?(Gem::Ext::Builder::CHDIR_MONITOR)
@@ -525,6 +527,14 @@ module Bundler
525
527
  end
526
528
  end
527
529
 
530
+ def plain_specs
531
+ Gem::Specification._all
532
+ end
533
+
534
+ def plain_specs=(specs)
535
+ Gem::Specification.all = specs
536
+ end
537
+
528
538
  def fetch_specs(remote, name)
529
539
  path = remote.uri.to_s + "#{name}.#{Gem.marshal_version}.gz"
530
540
  fetcher = gem_remote_fetcher
@@ -19,4 +19,9 @@ if Bundler::SharedHelpers.in_bundle?
19
19
  else
20
20
  Bundler.ui.silence { Bundler.setup }
21
21
  end
22
+
23
+ # We might be in the middle of shelling out to rubygems
24
+ # (RUBYOPT=-rbundler/setup), so we need to give rubygems the opportunity of
25
+ # not being silent.
26
+ Gem::DefaultUserInteraction.ui = nil
22
27
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.1.0".freeze
4
+ VERSION = "2.1.2".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
@@ -9,7 +9,7 @@
9
9
  require 'rbconfig'
10
10
 
11
11
  module Gem
12
- VERSION = "3.1.1".freeze
12
+ VERSION = "3.1.2".freeze
13
13
  end
14
14
 
15
15
  # Must be first since it unloads the prelude from 1.9.2
@@ -17,6 +17,7 @@ class Gem::Commands::SetupCommand < Gem::Command
17
17
 
18
18
  super 'setup', 'Install RubyGems',
19
19
  :format_executable => true, :document => %w[ri],
20
+ :force => true,
20
21
  :site_or_vendor => 'sitelibdir',
21
22
  :destdir => '', :prefix => '', :previous_version => '',
22
23
  :regenerate_binstubs => true
@@ -88,6 +89,11 @@ class Gem::Commands::SetupCommand < Gem::Command
88
89
  options[:regenerate_binstubs] = value
89
90
  end
90
91
 
92
+ add_option '-f', '--[no-]force',
93
+ 'Forcefully overwrite binstubs' do |value, options|
94
+ options[:force] = value
95
+ end
96
+
91
97
  add_option('-E', '--[no-]env-shebang',
92
98
  'Rewrite executables with a shebang',
93
99
  'of /usr/bin/env') do |value, options|
@@ -199,10 +205,10 @@ By default, this RubyGems will install gem as:
199
205
  say
200
206
 
201
207
  say "RubyGems installed the following executables:"
202
- say @bin_file_names.map { |name| "\t#{name}\n" }
208
+ say bin_file_names.map { |name| "\t#{name}\n" }
203
209
  say
204
210
 
205
- unless @bin_file_names.grep(/#{File::SEPARATOR}gem$/)
211
+ unless bin_file_names.grep(/#{File::SEPARATOR}gem$/)
206
212
  say "If `gem` was installed by a previous RubyGems installation, you may need"
207
213
  say "to remove it by hand."
208
214
  say
@@ -235,8 +241,6 @@ By default, this RubyGems will install gem as:
235
241
  end
236
242
 
237
243
  def install_executables(bin_dir)
238
- @bin_file_names = []
239
-
240
244
  prog_mode = options[:prog_mode] || 0755
241
245
 
242
246
  executables = { 'gem' => 'bin' }
@@ -249,13 +253,7 @@ By default, this RubyGems will install gem as:
249
253
  bin_files -= %w[update_rubygems]
250
254
 
251
255
  bin_files.each do |bin_file|
252
- bin_file_formatted = if options[:format_executable]
253
- Gem.default_exec_format % bin_file
254
- else
255
- bin_file
256
- end
257
-
258
- dest_file = File.join bin_dir, bin_file_formatted
256
+ dest_file = target_bin_path(bin_dir, bin_file)
259
257
  bin_tmp_file = File.join Dir.tmpdir, "#{bin_file}.#{$$}"
260
258
 
261
259
  begin
@@ -267,7 +265,7 @@ By default, this RubyGems will install gem as:
267
265
  end
268
266
 
269
267
  install bin_tmp_file, dest_file, :mode => prog_mode
270
- @bin_file_names << dest_file
268
+ bin_file_names << dest_file
271
269
  ensure
272
270
  rm bin_tmp_file
273
271
  end
@@ -429,13 +427,15 @@ By default, this RubyGems will install gem as:
429
427
  Dir.chdir("bundler") do
430
428
  built_gem = Gem::Package.build(bundler_spec)
431
429
  begin
432
- installer = Gem::Installer.at(built_gem, env_shebang: options[:env_shebang], format_executable: options[:format_executable], install_as_default: true, bin_dir: bin_dir, wrappers: true)
430
+ installer = Gem::Installer.at(built_gem, env_shebang: options[:env_shebang], format_executable: options[:format_executable], force: options[:force], install_as_default: true, bin_dir: bin_dir, wrappers: true)
433
431
  installer.install
434
432
  ensure
435
433
  FileUtils.rm_f built_gem
436
434
  end
437
435
  end
438
436
 
437
+ bundler_spec.executables.each {|executable| bin_file_names << target_bin_path(bin_dir, executable) }
438
+
439
439
  say "Bundler #{bundler_spec.version} installed"
440
440
  end
441
441
 
@@ -592,7 +592,7 @@ abort "#{deprecation_message}"
592
592
  history_string = ""
593
593
 
594
594
  until versions.length == 0 or
595
- versions.shift < options[:previous_version] do
595
+ versions.shift <= options[:previous_version] do
596
596
  history_string += version_lines.shift + text.shift
597
597
  end
598
598
 
@@ -626,4 +626,19 @@ abort "#{deprecation_message}"
626
626
  command.invoke(*args)
627
627
  end
628
628
 
629
+ private
630
+
631
+ def target_bin_path(bin_dir, bin_file)
632
+ bin_file_formatted = if options[:format_executable]
633
+ Gem.default_exec_format % bin_file
634
+ else
635
+ bin_file
636
+ end
637
+ File.join bin_dir, bin_file_formatted
638
+ end
639
+
640
+ def bin_file_names
641
+ @bin_file_names ||= []
642
+ end
643
+
629
644
  end
@@ -50,6 +50,8 @@ class Gem::SourceList
50
50
  # String.
51
51
 
52
52
  def <<(obj)
53
+ require "uri"
54
+
53
55
  src = case obj
54
56
  when URI
55
57
  Gem::Source.new(obj)
@@ -164,6 +164,50 @@ class Gem::TestCase < (defined?(Minitest::Test) ? Minitest::Test : MiniTest::Uni
164
164
  end
165
165
  end
166
166
 
167
+ ##
168
+ # Sets the bindir entry in RbConfig::CONFIG to +value+ and restores the
169
+ # original value when the block ends
170
+ #
171
+ def bindir(value)
172
+ bindir = RbConfig::CONFIG['bindir']
173
+
174
+ if value
175
+ RbConfig::CONFIG['bindir'] = value
176
+ else
177
+ RbConfig::CONFIG.delete 'bindir'
178
+ end
179
+
180
+ yield
181
+ ensure
182
+ if bindir
183
+ RbConfig::CONFIG['bindir'] = bindir
184
+ else
185
+ RbConfig::CONFIG.delete 'bindir'
186
+ end
187
+ end
188
+
189
+ ##
190
+ # Sets the EXEEXT entry in RbConfig::CONFIG to +value+ and restores the
191
+ # original value when the block ends
192
+ #
193
+ def exeext(value)
194
+ exeext = RbConfig::CONFIG['EXEEXT']
195
+
196
+ if value
197
+ RbConfig::CONFIG['EXEEXT'] = value
198
+ else
199
+ RbConfig::CONFIG.delete 'EXEEXT'
200
+ end
201
+
202
+ yield
203
+ ensure
204
+ if exeext
205
+ RbConfig::CONFIG['EXEEXT'] = exeext
206
+ else
207
+ RbConfig::CONFIG.delete 'EXEEXT'
208
+ end
209
+ end
210
+
167
211
  # TODO: move to minitest
168
212
  def refute_path_exists(path, msg = nil)
169
213
  msg = message(msg) { "Expected path '#{path}' to not exist" }
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "rubygems-update"
5
- s.version = "3.1.1"
5
+ s.version = "3.1.2"
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
 
@@ -1917,16 +1917,11 @@ You may need to `gem install -g` to install missing gems
1917
1917
  end
1918
1918
 
1919
1919
  def with_bindir_and_exeext(bindir, exeext)
1920
- orig_bindir = RbConfig::CONFIG['bindir']
1921
- orig_exe_ext = RbConfig::CONFIG['EXEEXT']
1922
-
1923
- RbConfig::CONFIG['bindir'] = bindir
1924
- RbConfig::CONFIG['EXEEXT'] = exeext
1925
-
1926
- yield
1927
- ensure
1928
- RbConfig::CONFIG['bindir'] = orig_bindir
1929
- RbConfig::CONFIG['EXEEXT'] = orig_exe_ext
1920
+ bindir(bindir) do
1921
+ exeext(exeext) do
1922
+ yield
1923
+ end
1924
+ end
1930
1925
  end
1931
1926
 
1932
1927
  def with_clean_path_to_ruby
@@ -123,6 +123,18 @@ class TestGemCommandsSetupCommand < Gem::TestCase
123
123
  assert_equal "I changed it!\n", File.read(gem_bin_path)
124
124
  end
125
125
 
126
+ def test_execute_informs_about_installed_executables
127
+ use_ui @ui do
128
+ @cmd.execute
129
+ end
130
+
131
+ out = @ui.output.split "\n"
132
+
133
+ exec_line = out.shift until exec_line == "RubyGems installed the following executables:"
134
+ assert_equal "\t#{default_gem_bin_path}", out.shift
135
+ assert_equal "\t#{default_bundle_bin_path}", out.shift
136
+ end
137
+
126
138
  def test_env_shebang_flag
127
139
  gem_bin_path = gem_install 'a'
128
140
  write_file gem_bin_path do |io|
@@ -133,10 +145,6 @@ class TestGemCommandsSetupCommand < Gem::TestCase
133
145
  @cmd.options[:env_shebang] = true
134
146
  @cmd.execute
135
147
 
136
- gem_exec = sprintf Gem.default_exec_format, 'gem'
137
- default_gem_bin_path = File.join @install_dir, 'bin', gem_exec
138
- bundle_exec = sprintf Gem.default_exec_format, 'bundle'
139
- default_bundle_bin_path = File.join @install_dir, 'bin', bundle_exec
140
148
  ruby_exec = sprintf Gem.default_exec_format, 'ruby'
141
149
 
142
150
  if Gem.win_platform?
@@ -212,10 +220,41 @@ class TestGemCommandsSetupCommand < Gem::TestCase
212
220
 
213
221
  # TODO: We need to assert to remove same version of bundler on gem_dir directory(It's not site_ruby dir)
214
222
 
215
- # expect to not remove bundler-* direcotyr.
223
+ # expect to not remove bundler-* directory.
216
224
  assert_path_exists 'default/gems/bundler-audit-1.0.0'
217
225
  end
218
226
 
227
+ def test_install_default_bundler_gem_with_force_flag
228
+ @cmd.extend FileUtils
229
+
230
+ bin_dir = File.join(@gemhome, 'bin')
231
+ bundle_bin = File.join(bin_dir, 'bundle')
232
+
233
+ write_file bundle_bin do |f|
234
+ f.puts '#!/usr/bin/ruby'
235
+ f.puts ''
236
+ f.puts 'echo "hello"'
237
+ end
238
+
239
+ bindir(bin_dir) do
240
+ @cmd.options[:force] = true
241
+
242
+ @cmd.install_default_bundler_gem bin_dir
243
+
244
+ bundler_spec = Gem::Specification.load("bundler/bundler.gemspec")
245
+ default_spec_path = File.join(Gem.default_specifications_dir, "#{bundler_spec.full_name}.gemspec")
246
+ spec = Gem::Specification.load(default_spec_path)
247
+
248
+ spec.executables.each do |e|
249
+ if Gem.win_platform?
250
+ assert_path_exists File.join(bin_dir, "#{e}.bat")
251
+ end
252
+
253
+ assert_path_exists File.join bin_dir, Gem.default_exec_format % e
254
+ end
255
+ end
256
+ end
257
+
219
258
  def test_remove_old_lib_files
220
259
  lib = File.join @install_dir, 'lib'
221
260
  lib_rubygems = File.join lib, 'rubygems'
@@ -308,11 +347,6 @@ class TestGemCommandsSetupCommand < Gem::TestCase
308
347
  * Fixed release note display for LANG=C when installing rubygems
309
348
  * π is tasty
310
349
 
311
- === 2.0.2 / 2013-03-06
312
-
313
- * Bug fixes:
314
- * Other bugs fixed
315
-
316
350
  EXPECTED
317
351
 
318
352
  output = @ui.output
@@ -323,4 +357,16 @@ class TestGemCommandsSetupCommand < Gem::TestCase
323
357
  @ui.outs.set_encoding @default_external if @default_external
324
358
  end
325
359
 
360
+ private
361
+
362
+ def default_gem_bin_path
363
+ gem_exec = sprintf Gem.default_exec_format, 'gem'
364
+ File.join @install_dir, 'bin', gem_exec
365
+ end
366
+
367
+ def default_bundle_bin_path
368
+ bundle_exec = sprintf Gem.default_exec_format, 'bundle'
369
+ File.join @install_dir, 'bin', bundle_exec
370
+ end
371
+
326
372
  end unless Gem.java_platform?
@@ -104,32 +104,19 @@ end
104
104
  def test_check_executable_overwrite_default_bin_dir
105
105
  installer = setup_base_installer
106
106
 
107
- if defined?(RUBY_FRAMEWORK_VERSION)
108
- orig_RUBY_FRAMEWORK_VERSION = RUBY_FRAMEWORK_VERSION
109
- Object.send :remove_const, :RUBY_FRAMEWORK_VERSION
110
- end
111
- orig_bindir = RbConfig::CONFIG['bindir']
112
- RbConfig::CONFIG['bindir'] = Gem.bindir
107
+ bindir(Gem.bindir) do
108
+ util_conflict_executable false
113
109
 
114
- util_conflict_executable false
110
+ ui = Gem::MockGemUi.new "n\n"
111
+ use_ui ui do
112
+ e = assert_raises Gem::InstallError do
113
+ installer.generate_bin
114
+ end
115
115
 
116
- ui = Gem::MockGemUi.new "n\n"
117
- use_ui ui do
118
- e = assert_raises Gem::InstallError do
119
- installer.generate_bin
116
+ conflicted = File.join @gemhome, 'bin', 'executable'
117
+ assert_match %r%\A"executable" from a conflicts with (?:#{Regexp.quote(conflicted)}|installed executable from conflict)\z%,
118
+ e.message
120
119
  end
121
-
122
- conflicted = File.join @gemhome, 'bin', 'executable'
123
- assert_match %r%\A"executable" from a conflicts with (?:#{Regexp.quote(conflicted)}|installed executable from conflict)\z%,
124
- e.message
125
- end
126
- ensure
127
- Object.const_set :RUBY_FRAMEWORK_VERSION, orig_RUBY_FRAMEWORK_VERSION if
128
- orig_RUBY_FRAMEWORK_VERSION
129
- if orig_bindir
130
- RbConfig::CONFIG['bindir'] = orig_bindir
131
- else
132
- RbConfig::CONFIG.delete 'bindir'
133
120
  end
134
121
  end
135
122
 
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.1.1
4
+ version: 3.1.2
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: 2019-12-16 00:00:00.000000000 Z
19
+ date: 2019-12-20 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
@@ -819,7 +819,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
819
819
  - !ruby/object:Gem::Version
820
820
  version: '0'
821
821
  requirements: []
822
- rubygems_version: 3.0.3
822
+ rubygems_version: 3.1.1
823
823
  signing_key:
824
824
  specification_version: 4
825
825
  summary: RubyGems is a package management framework for Ruby.