rubygems-update 2.6.6 → 2.6.7

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: 295ab606b876dc2ce144068ee0b1d880bb7d8b39
4
- data.tar.gz: 51923585b6de3caa75f94d0bbb96504611a47f85
3
+ metadata.gz: 8f8ebff1d7a817d5be825280b5c587a09bc84ea5
4
+ data.tar.gz: 8dfc361737e408f6291f7d670b1e9a7b6b9900f3
5
5
  SHA512:
6
- metadata.gz: bf597aa5a09307d9599a7292f99722a6fbb3207722aec904adc6d673bc8e3fe3b3c3d539ba30dcc5667cc8623a373686cd59fbb49aed158a2a84781c4a73f872
7
- data.tar.gz: 126e74187106a0a56d50e728cfa65c058dadabcfeae1a5a1a110bfdffc313541eb008d77bf13a6ea6bb5fa670241cd31edc6524dfca197199961a88ccf81d2d5
6
+ metadata.gz: 76309ac79a71bc0d35a962741ebd39aec07c33d37eae5e5593cedc0d645970a0f26bc8a4f868897ed5d5f06d8ecc3a830b1694d8a3a9ee5df2ead8c934c14164
7
+ data.tar.gz: 3b4b9d5aaeedfc0c58b7e1418ddef65402044f0bf1cb948d5028ad8c70dccc10ac6c2e652670d24b577136ac8684cd2b744f4ffca0af0b6f6a19da590c6b343f
@@ -1,5 +1,19 @@
1
1
  # coding: UTF-8
2
2
 
3
+ === 2.6.7 / 2016-09-26
4
+
5
+ Bug fixes:
6
+
7
+ * Install native extensions in the correct location when using the
8
+ `--user-install` flag. Pull request #1683 by Noah Kantrowitz.
9
+ * When calling `Gem.sources`, load sources from `configuration`
10
+ if present, else use the default sources. Pull request #1699
11
+ by Luis Sagastume.
12
+ * Fail gracefully when attempting to redirect without a Location.
13
+ Pull request #1711 by Samuel Giddins.
14
+ * Update vendored Molinillo to 0.5.1. Pull request #1714 by
15
+ Samuel Giddins.
16
+
3
17
  === 2.6.6 / 2016-06-22
4
18
 
5
19
  Bug fixes:
@@ -10,7 +10,7 @@ require 'rbconfig'
10
10
  require 'thread'
11
11
 
12
12
  module Gem
13
- VERSION = '2.6.6'
13
+ VERSION = '2.6.7'
14
14
  end
15
15
 
16
16
  # Must be first since it unloads the prelude from 1.9.2
@@ -971,7 +971,8 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
971
971
  # default_sources if the sources list is empty.
972
972
 
973
973
  def self.sources
974
- @sources ||= Gem::SourceList.from(default_sources)
974
+ source_list = configuration.sources || default_sources
975
+ @sources ||= Gem::SourceList.from(source_list)
975
976
  end
976
977
 
977
978
  ##
@@ -143,6 +143,10 @@ class Gem::ConfigFile
143
143
 
144
144
  attr_accessor :ssl_ca_cert
145
145
 
146
+ ##
147
+ # sources to look for gems
148
+ attr_accessor :sources
149
+
146
150
  ##
147
151
  # Path name of directory or file of openssl client certificate, used for remote https connection with client authentication
148
152
 
@@ -216,6 +220,7 @@ class Gem::ConfigFile
216
220
  @update_sources = @hash[:update_sources] if @hash.key? :update_sources
217
221
  @verbose = @hash[:verbose] if @hash.key? :verbose
218
222
  @disable_default_gem_server = @hash[:disable_default_gem_server] if @hash.key? :disable_default_gem_server
223
+ @sources = @hash[:sources] if @hash.key? :sources
219
224
 
220
225
  @ssl_verify_mode = @hash[:ssl_verify_mode] if @hash.key? :ssl_verify_mode
221
226
  @ssl_ca_cert = @hash[:ssl_ca_cert] if @hash.key? :ssl_ca_cert
@@ -224,7 +229,6 @@ class Gem::ConfigFile
224
229
  @api_keys = nil
225
230
  @rubygems_api_key = nil
226
231
 
227
- Gem.sources = @hash[:sources] if @hash.key? :sources
228
232
  handle_arguments arg_list
229
233
  end
230
234
 
@@ -282,18 +282,23 @@ class Gem::Installer
282
282
 
283
283
  run_pre_install_hooks
284
284
 
285
+ # Set loaded_from to ensure extension_dir is correct
286
+ if @options[:install_as_default] then
287
+ spec.loaded_from = default_spec_file
288
+ else
289
+ spec.loaded_from = spec_file
290
+ end
291
+
285
292
  # Completely remove any previous gem files
286
293
  FileUtils.rm_rf gem_dir
287
294
  FileUtils.rm_rf spec.extension_dir
288
295
 
289
296
  FileUtils.mkdir_p gem_dir
290
297
 
291
- if @options[:install_as_default]
292
- spec.loaded_from = default_spec_file
298
+ if @options[:install_as_default] then
293
299
  extract_bin
294
300
  write_default_spec
295
301
  else
296
- spec.loaded_from = spec_file
297
302
  extract_files
298
303
 
299
304
  build_extensions
@@ -260,6 +260,9 @@ class Gem::RemoteFetcher
260
260
  Net::HTTPTemporaryRedirect then
261
261
  raise FetchError.new('too many redirects', uri) if depth > 10
262
262
 
263
+ unless location = response['Location']
264
+ raise FetchError.new("redirecting but no redirect location was given", uri)
265
+ end
263
266
  location = URI.parse response['Location']
264
267
 
265
268
  if https?(uri) && !https?(location)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module Gem::Resolver::Molinillo
3
3
  # The version of Gem::Resolver::Molinillo.
4
- VERSION = '0.5.0'.freeze
4
+ VERSION = '0.5.1'.freeze
5
5
  end
@@ -184,6 +184,8 @@ module Gem::Resolver::Molinillo
184
184
  raise VersionConflict.new(c) unless state
185
185
  activated.rewind_to(sliced_states.first || :initial_state) if sliced_states
186
186
  state.conflicts = c
187
+ index = states.size - 1
188
+ @parent_of.reject! { |_, i| i >= index }
187
189
  end
188
190
  end
189
191
 
@@ -209,7 +211,10 @@ module Gem::Resolver::Molinillo
209
211
  # @return [Object] the requirement that led to `requirement` being added
210
212
  # to the list of requirements.
211
213
  def parent_of(requirement)
212
- @parent_of[requirement]
214
+ return unless requirement
215
+ return unless index = @parent_of[requirement]
216
+ return unless parent_state = @states[index]
217
+ parent_state.requirement
213
218
  end
214
219
 
215
220
  # @return [Object] the requirement that led to a version of a possibility
@@ -418,7 +423,8 @@ module Gem::Resolver::Molinillo
418
423
  debug(depth) { "Requiring nested dependencies (#{nested_dependencies.join(', ')})" }
419
424
  nested_dependencies.each do |d|
420
425
  activated.add_child_vertex(name_for(d), nil, [name_for(activated_spec)], d)
421
- @parent_of[d] = requirement
426
+ parent_index = states.size - 1
427
+ @parent_of[d] ||= parent_index
422
428
  end
423
429
 
424
430
  push_state_for_requirements(requirements + nested_dependencies, !nested_dependencies.empty?)
@@ -961,6 +961,9 @@ class TestGem < Gem::TestCase
961
961
 
962
962
  def test_self_sources
963
963
  assert_equal %w[http://gems.example.com/], Gem.sources
964
+ Gem.sources = nil
965
+ Gem.configuration.sources = %w[http://test.example.com/]
966
+ assert_equal %w[http://test.example.com/], Gem.sources
964
967
  end
965
968
 
966
969
  def test_try_activate_returns_true_for_activated_specs
@@ -61,12 +61,11 @@ class TestGemConfigFile < Gem::TestCase
61
61
  end
62
62
 
63
63
  util_config_file
64
-
65
64
  assert_equal true, @cfg.backtrace
66
65
  assert_equal 10, @cfg.bulk_threshold
67
66
  assert_equal false, @cfg.verbose
68
67
  assert_equal false, @cfg.update_sources
69
- assert_equal %w[http://more-gems.example.com], Gem.sources
68
+ assert_equal %w[http://more-gems.example.com], @cfg.sources
70
69
  assert_equal '--wrappers', @cfg[:install]
71
70
  assert_equal(['/usr/ruby/1.8/lib/ruby/gems/1.8', '/var/ruby/1.8/gem_home'],
72
71
  @cfg.path)
@@ -1141,6 +1141,35 @@ gem 'other', version
1141
1141
  refute_path_exists should_be_removed
1142
1142
  end
1143
1143
 
1144
+ def test_install_user_extension_dir
1145
+ @spec.extensions << "extconf.rb"
1146
+ write_file File.join(@tempdir, "extconf.rb") do |io|
1147
+ io.write <<-RUBY
1148
+ require "mkmf"
1149
+ create_makefile("#{@spec.name}")
1150
+ RUBY
1151
+ end
1152
+
1153
+ @spec.files += %w[extconf.rb]
1154
+
1155
+ # Create the non-user ext dir
1156
+ expected_extension_dir = @spec.extension_dir.dup
1157
+ FileUtils.mkdir_p expected_extension_dir
1158
+
1159
+ use_ui @ui do
1160
+ path = Gem::Package.build @spec
1161
+
1162
+ installer = Gem::Installer.at path, :user_install => true
1163
+ installer.install
1164
+ end
1165
+
1166
+ expected_makefile = File.join Gem.user_dir, 'gems', @spec.full_name, 'Makefile'
1167
+
1168
+ assert_path_exists expected_makefile
1169
+ assert_path_exists expected_extension_dir
1170
+ refute_path_exists File.join expected_extension_dir, 'gem_make.out'
1171
+ end
1172
+
1144
1173
  # ruby core repository needs to `depend` file for extension build.
1145
1174
  # but 1.9.2 and earlier mkmf.rb does not create TOUCH file like depend.
1146
1175
  if RUBY_VERSION < '1.9.3'
@@ -687,6 +687,23 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
687
687
  assert_equal "too many redirects (#{url})", e.message
688
688
  end
689
689
 
690
+ def test_fetch_http_redirects_without_location
691
+ fetcher = Gem::RemoteFetcher.new nil
692
+ @fetcher = fetcher
693
+ url = 'http://gems.example.com/redirect'
694
+
695
+ def fetcher.request(uri, request_class, last_modified = nil)
696
+ res = Net::HTTPMovedPermanently.new nil, 301, nil
697
+ res
698
+ end
699
+
700
+ e = assert_raises Gem::RemoteFetcher::FetchError do
701
+ fetcher.fetch_http URI.parse(url)
702
+ end
703
+
704
+ assert_equal "redirecting but no redirect location was given (#{url})", e.message
705
+ end
706
+
690
707
  def test_fetch_http_with_additional_headers
691
708
  ENV["http_proxy"] = @proxy_uri
692
709
  ENV["no_proxy"] = URI::parse(@server_uri).host
@@ -1036,4 +1053,3 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
1036
1053
  end
1037
1054
 
1038
1055
  end
1039
-
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.6.6
4
+ version: 2.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Weirich
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-06-22 00:00:00.000000000 Z
13
+ date: 2016-09-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: builder
@@ -791,7 +791,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
791
791
  version: '0'
792
792
  requirements: []
793
793
  rubyforge_project:
794
- rubygems_version: 2.6.5
794
+ rubygems_version: 2.6.6
795
795
  signing_key:
796
796
  specification_version: 4
797
797
  summary: RubyGems is a package management framework for Ruby