rubygems-update 2.5.2 → 2.6.0
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.
- checksums.yaml +4 -4
- data/History.txt +39 -0
- data/MAINTAINERS.md +1 -0
- data/README.rdoc +2 -2
- data/lib/rubygems.rb +26 -9
- data/lib/rubygems/basic_specification.rb +1 -2
- data/lib/rubygems/command.rb +8 -1
- data/lib/rubygems/commands/cleanup_command.rb +8 -3
- data/lib/rubygems/commands/install_command.rb +1 -0
- data/lib/rubygems/commands/open_command.rb +4 -0
- data/lib/rubygems/commands/push_command.rb +7 -3
- data/lib/rubygems/commands/update_command.rb +1 -0
- data/lib/rubygems/config_file.rb +11 -2
- data/lib/rubygems/dependency.rb +2 -1
- data/lib/rubygems/gemcutter_utilities.rb +9 -1
- data/lib/rubygems/install_update_options.rb +1 -0
- data/lib/rubygems/package.rb +1 -1
- data/lib/rubygems/package/tar_header.rb +1 -2
- data/lib/rubygems/package/tar_reader.rb +1 -2
- data/lib/rubygems/package/tar_reader/entry.rb +1 -1
- data/lib/rubygems/package/tar_writer.rb +1 -1
- data/lib/rubygems/path_support.rb +13 -23
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb +4 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +1 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/ui.rb +2 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb +37 -14
- data/lib/rubygems/source_list.rb +1 -1
- data/lib/rubygems/specification.rb +4 -1
- data/lib/rubygems/test_case.rb +1 -1
- data/lib/rubygems/version.rb +16 -12
- data/test/rubygems/test_gem.rb +59 -0
- data/test/rubygems/test_gem_command.rb +4 -0
- data/test/rubygems/test_gem_commands_cleanup_command.rb +29 -1
- data/test/rubygems/test_gem_commands_open_command.rb +18 -1
- data/test/rubygems/test_gem_commands_push_command.rb +49 -9
- data/test/rubygems/test_gem_ext_cmake_builder.rb +3 -1
- data/test/rubygems/test_gem_gemcutter_utilities.rb +2 -2
- data/test/rubygems/test_gem_path_support.rb +42 -6
- data/test/rubygems/test_gem_remote_fetcher.rb +2 -0
- data/test/rubygems/test_gem_source_list.rb +6 -0
- data/test/rubygems/test_gem_version.rb +8 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbc3146d444b0206ed2811c6e2827fcc64547fee
|
4
|
+
data.tar.gz: 8fdcaecea808e972b177eb780f351bf09a2ec884
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c98ed35c5cf9f940941cf8bde958d4e6b479d4f69fb89e2cc1118a7119e9c41771488939ee86828c218f0e0207320604b8afa52a28529dffb65ae22f11873515
|
7
|
+
data.tar.gz: 0e560eaee32adc1be7cd038294434d6f3df03acdc3641b553c976c315651e4f9572f7ed50254ac3f01237df4121b305f1910ab1e5b9f7df3f87e5335adbb632e
|
data/History.txt
CHANGED
@@ -1,5 +1,44 @@
|
|
1
1
|
# coding: UTF-8
|
2
2
|
|
3
|
+
=== 2.6.0 / 2016-02-26
|
4
|
+
|
5
|
+
Minor enhancements:
|
6
|
+
|
7
|
+
* RubyGems now defaults the `gem push` to the gem's "allowed_push_host"
|
8
|
+
metadata setting. Pull request #1486 by Josh Lane.
|
9
|
+
* Update bundled Molinillo to 0.4.3. Pull request #1493 by Samuel E. Giddins.
|
10
|
+
* Add version option to gem open command. Pull request #1483 by Hrvoje
|
11
|
+
Šimić.
|
12
|
+
* Feature/add silent flag. Pull request #1455 by Luis Sagastume.
|
13
|
+
* Allow specifying gem requirements via env variables. Pull request #1472
|
14
|
+
by Samuel E. Giddins.
|
15
|
+
|
16
|
+
Bug fixes:
|
17
|
+
|
18
|
+
* RubyGems now stores `gem push` credentials under the host you signed-in for.
|
19
|
+
Pull request #1485 by Josh Lane.
|
20
|
+
* Move `coding` location to first line. Pull request #1471 by SHIBATA
|
21
|
+
Hiroshi.
|
22
|
+
* [PathSupport] Handle a regexp path separator. Pull request #1469 by
|
23
|
+
Samuel E. Giddins.
|
24
|
+
* Clean up the PathSupport object. Pull request #1094 by Aaron Patterson.
|
25
|
+
* Join with File::PATH_SEPARATOR in Gem.use_paths. Pull request #1476 by
|
26
|
+
Samuel E. Giddins.
|
27
|
+
* Handle when the gem home and gem path arent set in the config file. Pull
|
28
|
+
request #1478 by Samuel E. Giddins.
|
29
|
+
* Terminate TimeoutHandler. Pull request #1479 by Nobuyoshi Nakada.
|
30
|
+
* Remove redundant cache. Pull request #1482 by Eileen M. Uchitelle.
|
31
|
+
* Freeze `Gem::Version@segments` instance variable. Pull request #1487 by
|
32
|
+
Ben Dean.
|
33
|
+
* Gem cleanup is trying to uninstall gems outside GEM_HOME and reporting
|
34
|
+
an error after it tries. Pull request #1353 by Luis Sagastume.
|
35
|
+
* Avoid duplicated sources. Pull request #1489 by Luis Sagastume.
|
36
|
+
* Better description for quiet flag. Pull request #1491 by Luis Sagastume.
|
37
|
+
* Raise error if find_by_name returns with nil. Pull request #1494 by
|
38
|
+
Zoltán Hegedüs.
|
39
|
+
* Find_files only from loaded_gems when using gemdeps. Pull request #1277
|
40
|
+
by Michal Papis.
|
41
|
+
|
3
42
|
=== 2.5.2 / 2016-01-31
|
4
43
|
|
5
44
|
Bug fixes:
|
data/MAINTAINERS.md
CHANGED
@@ -2,3 +2,4 @@ André Arko <andre@arko.net> (@indirect)
|
|
2
2
|
Jeremy Hinegardner <jeremy@copiousfreetime.org> (@copiousfreetime)
|
3
3
|
Kurtis Rainbolt-Greene <me@kurtisrainboltgreene.name> (@krainboltgreene)
|
4
4
|
Samuel Giddins <segiddins@segiddins.me> (@segiddins)
|
5
|
+
Marie Markwell <me@marie.so> (@duckinator)
|
data/README.rdoc
CHANGED
@@ -26,8 +26,8 @@ See UPGRADING.rdoc for more details and alternative instructions.
|
|
26
26
|
|
27
27
|
If you don't have RubyGems installed, you can still do it manually:
|
28
28
|
|
29
|
-
* Download from: https://rubygems.org/pages/download
|
30
|
-
*
|
29
|
+
* Download from: https://rubygems.org/pages/download, unpack, and cd there
|
30
|
+
* OR clone this repository and cd there
|
31
31
|
* Install with: ruby setup.rb # you may need admin/root privilege
|
32
32
|
|
33
33
|
For more details and other options, see:
|
data/lib/rubygems.rb
CHANGED
@@ -10,7 +10,7 @@ require 'rbconfig'
|
|
10
10
|
require 'thread'
|
11
11
|
|
12
12
|
module Gem
|
13
|
-
VERSION = '2.
|
13
|
+
VERSION = '2.6.0'
|
14
14
|
end
|
15
15
|
|
16
16
|
# Must be first since it unloads the prelude from 1.9.2
|
@@ -174,6 +174,14 @@ module Gem
|
|
174
174
|
@pre_reset_hooks ||= []
|
175
175
|
@post_reset_hooks ||= []
|
176
176
|
|
177
|
+
def self.env_requirement(gem_name)
|
178
|
+
@env_requirements_by_name ||= {}
|
179
|
+
@env_requirements_by_name[gem_name] ||= begin
|
180
|
+
req = ENV["GEM_REQUIREMENT_#{gem_name.upcase}"] || '>= 0'.freeze
|
181
|
+
Gem::Requirement.create(req)
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
177
185
|
##
|
178
186
|
# Try to activate a gem containing +path+. Returns true if
|
179
187
|
# activation succeeded or wasn't needed because it was already
|
@@ -192,8 +200,13 @@ module Gem
|
|
192
200
|
|
193
201
|
begin
|
194
202
|
spec.activate
|
195
|
-
rescue Gem::LoadError # this could fail due to gem dep collisions, go lax
|
196
|
-
Gem::Specification.find_by_name(spec.name)
|
203
|
+
rescue Gem::LoadError => e # this could fail due to gem dep collisions, go lax
|
204
|
+
spec_by_name = Gem::Specification.find_by_name(spec.name)
|
205
|
+
if spec_by_name.nil?
|
206
|
+
raise e
|
207
|
+
else
|
208
|
+
spec_by_name.activate
|
209
|
+
end
|
197
210
|
end
|
198
211
|
|
199
212
|
return true
|
@@ -326,7 +339,7 @@ module Gem
|
|
326
339
|
# lookup files.
|
327
340
|
|
328
341
|
def self.paths
|
329
|
-
@paths ||= Gem::PathSupport.new
|
342
|
+
@paths ||= Gem::PathSupport.new(ENV)
|
330
343
|
end
|
331
344
|
|
332
345
|
# Initialize the filesystem paths to use from +env+.
|
@@ -335,7 +348,7 @@ module Gem
|
|
335
348
|
|
336
349
|
def self.paths=(env)
|
337
350
|
clear_paths
|
338
|
-
@paths = Gem::PathSupport.new env
|
351
|
+
@paths = Gem::PathSupport.new ENV.to_hash.merge(env)
|
339
352
|
Gem::Specification.dirs = @paths.path
|
340
353
|
end
|
341
354
|
|
@@ -430,7 +443,9 @@ module Gem
|
|
430
443
|
|
431
444
|
files = find_files_from_load_path glob if check_load_path
|
432
445
|
|
433
|
-
|
446
|
+
gem_specifications = @gemdeps ? Gem.loaded_specs.values : Gem::Specification.stubs
|
447
|
+
|
448
|
+
files.concat gem_specifications.map { |spec|
|
434
449
|
spec.matches_for_glob("#{glob}#{Gem.suffix_pattern}")
|
435
450
|
}.flatten
|
436
451
|
|
@@ -939,9 +954,11 @@ module Gem
|
|
939
954
|
# by the unit tests to provide environment isolation.
|
940
955
|
|
941
956
|
def self.use_paths(home, *paths)
|
942
|
-
paths
|
943
|
-
paths
|
944
|
-
|
957
|
+
paths.flatten!
|
958
|
+
paths.compact!
|
959
|
+
hash = { "GEM_HOME" => home, "GEM_PATH" => paths.join(File::PATH_SEPARATOR) }
|
960
|
+
hash.delete_if { |_, v| v.nil? }
|
961
|
+
self.paths = hash
|
945
962
|
end
|
946
963
|
|
947
964
|
##
|
@@ -95,7 +95,7 @@ class Gem::BasicSpecification
|
|
95
95
|
# Returns path to the extensions directory.
|
96
96
|
|
97
97
|
def extensions_dir
|
98
|
-
|
98
|
+
Gem.default_ext_dir_for(base_dir) ||
|
99
99
|
File.join(base_dir, 'extensions', Gem::Platform.local.to_s,
|
100
100
|
Gem.extension_api_version)
|
101
101
|
end
|
@@ -196,7 +196,6 @@ class Gem::BasicSpecification
|
|
196
196
|
|
197
197
|
def internal_init # :nodoc:
|
198
198
|
@extension_dir = nil
|
199
|
-
@extensions_dir = nil
|
200
199
|
@full_gem_path = nil
|
201
200
|
@gem_dir = nil
|
202
201
|
@ignored = nil
|
data/lib/rubygems/command.rb
CHANGED
@@ -300,6 +300,8 @@ class Gem::Command
|
|
300
300
|
|
301
301
|
options[:build_args] = build_args
|
302
302
|
|
303
|
+
self.ui = Gem::SilentUI.new if options[:silent]
|
304
|
+
|
303
305
|
if options[:help] then
|
304
306
|
show_help
|
305
307
|
elsif @when_invoked then
|
@@ -520,10 +522,15 @@ class Gem::Command
|
|
520
522
|
end
|
521
523
|
end
|
522
524
|
|
523
|
-
add_common_option('-q', '--quiet', 'Silence
|
525
|
+
add_common_option('-q', '--quiet', 'Silence command progress meter') do |value, options|
|
524
526
|
Gem.configuration.verbose = false
|
525
527
|
end
|
526
528
|
|
529
|
+
add_common_option("--silent",
|
530
|
+
"Silence rubygems output") do |value, options|
|
531
|
+
options[:silent] = true
|
532
|
+
end
|
533
|
+
|
527
534
|
# Backtrace and config-file are added so they show up in the help
|
528
535
|
# commands. Both options are actually handled before the other
|
529
536
|
# options get parsed.
|
@@ -76,6 +76,9 @@ If no gems are named all gems in GEM_HOME are cleaned.
|
|
76
76
|
end
|
77
77
|
|
78
78
|
def clean_gems
|
79
|
+
@original_home = Gem.dir
|
80
|
+
@original_path = Gem.path
|
81
|
+
|
79
82
|
get_primary_gems
|
80
83
|
get_candidate_gems
|
81
84
|
get_gems_to_cleanup
|
@@ -87,9 +90,6 @@ If no gems are named all gems in GEM_HOME are cleaned.
|
|
87
90
|
|
88
91
|
deps = deplist.strongly_connected_components.flatten
|
89
92
|
|
90
|
-
@original_home = Gem.dir
|
91
|
-
@original_path = Gem.path
|
92
|
-
|
93
93
|
deps.reverse_each do |spec|
|
94
94
|
uninstall_dep spec
|
95
95
|
end
|
@@ -108,6 +108,7 @@ If no gems are named all gems in GEM_HOME are cleaned.
|
|
108
108
|
end
|
109
109
|
|
110
110
|
def get_gems_to_cleanup
|
111
|
+
|
111
112
|
gems_to_cleanup = @candidate_gems.select { |spec|
|
112
113
|
@primary_gems[spec.name].version != spec.version
|
113
114
|
}
|
@@ -116,6 +117,10 @@ If no gems are named all gems in GEM_HOME are cleaned.
|
|
116
117
|
spec.default_gem?
|
117
118
|
}
|
118
119
|
|
120
|
+
gems_to_cleanup = gems_to_cleanup.select { |spec|
|
121
|
+
spec.base_dir == @original_home
|
122
|
+
}
|
123
|
+
|
119
124
|
@default_gems += default_gems
|
120
125
|
@default_gems.uniq!
|
121
126
|
@gems_to_cleanup = gems_to_cleanup.uniq
|
@@ -15,6 +15,10 @@ class Gem::Commands::OpenCommand < Gem::Command
|
|
15
15
|
"Opens gem sources in EDITOR") do |editor, options|
|
16
16
|
options[:editor] = editor || get_env_editor
|
17
17
|
end
|
18
|
+
add_option('-v', '--version VERSION', String,
|
19
|
+
"Opens specific gem version") do |version|
|
20
|
+
options[:version] = version
|
21
|
+
end
|
18
22
|
end
|
19
23
|
|
20
24
|
def arguments # :nodoc:
|
@@ -76,13 +76,17 @@ You can upgrade or downgrade to the latest release version with:
|
|
76
76
|
@host = gem_data.spec.metadata['default_gem_server']
|
77
77
|
end
|
78
78
|
|
79
|
-
|
80
|
-
args << @host
|
79
|
+
push_host = nil
|
81
80
|
|
82
81
|
if gem_data.spec.metadata.has_key?('allowed_push_host')
|
83
|
-
|
82
|
+
push_host = gem_data.spec.metadata['allowed_push_host']
|
84
83
|
end
|
85
84
|
|
85
|
+
@host ||= push_host
|
86
|
+
|
87
|
+
# Always include @host, even if it's nil
|
88
|
+
args += [ @host, push_host ]
|
89
|
+
|
86
90
|
say "Pushing gem to #{@host || Gem.host}..."
|
87
91
|
|
88
92
|
response = rubygems_api_request(*args) do |request|
|
data/lib/rubygems/config_file.rb
CHANGED
@@ -306,9 +306,18 @@ if you believe they were disclosed to a third party.
|
|
306
306
|
# Sets the RubyGems.org API key to +api_key+
|
307
307
|
|
308
308
|
def rubygems_api_key= api_key
|
309
|
+
set_api_key :rubygems_api_key, api_key
|
310
|
+
|
311
|
+
@rubygems_api_key = api_key
|
312
|
+
end
|
313
|
+
|
314
|
+
##
|
315
|
+
# Set a specific host's API key to +api_key+
|
316
|
+
|
317
|
+
def set_api_key host, api_key
|
309
318
|
check_credentials_permissions
|
310
319
|
|
311
|
-
config = load_file(credentials_path).merge(
|
320
|
+
config = load_file(credentials_path).merge(host => api_key)
|
312
321
|
|
313
322
|
dirname = File.dirname credentials_path
|
314
323
|
Dir.mkdir(dirname) unless File.exist? dirname
|
@@ -320,7 +329,7 @@ if you believe they were disclosed to a third party.
|
|
320
329
|
f.write config.to_yaml
|
321
330
|
end
|
322
331
|
|
323
|
-
|
332
|
+
load_api_keys # reload
|
324
333
|
end
|
325
334
|
|
326
335
|
def load_file(filename)
|
data/lib/rubygems/dependency.rb
CHANGED
@@ -275,8 +275,9 @@ class Gem::Dependency
|
|
275
275
|
end
|
276
276
|
|
277
277
|
def matching_specs platform_only = false
|
278
|
+
env_req = Gem.env_requirement(name)
|
278
279
|
matches = Gem::Specification.stubs_for(name).find_all { |spec|
|
279
|
-
requirement.satisfied_by? spec.version
|
280
|
+
requirement.satisfied_by?(spec.version) && env_req.satisfied_by?(spec.version)
|
280
281
|
}.map(&:to_spec)
|
281
282
|
|
282
283
|
if platform_only
|
@@ -115,7 +115,7 @@ module Gem::GemcutterUtilities
|
|
115
115
|
|
116
116
|
with_response response do |resp|
|
117
117
|
say "Signed in."
|
118
|
-
|
118
|
+
set_api_key host, resp.body
|
119
119
|
end
|
120
120
|
end
|
121
121
|
|
@@ -156,5 +156,13 @@ module Gem::GemcutterUtilities
|
|
156
156
|
end
|
157
157
|
end
|
158
158
|
|
159
|
+
def set_api_key host, key
|
160
|
+
if host == Gem::DEFAULT_HOST
|
161
|
+
Gem.configuration.rubygems_api_key = key
|
162
|
+
else
|
163
|
+
Gem.configuration.set_api_key host, key
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
159
167
|
end
|
160
168
|
|
data/lib/rubygems/package.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
1
|
# -*- coding: utf-8 -*-
|
2
|
+
# frozen_string_literal: true
|
3
3
|
#--
|
4
4
|
# Copyright (C) 2004 Mauricio Julio Fernández Pradier
|
5
5
|
# See LICENSE.txt for additional licensing information.
|
@@ -227,4 +227,3 @@ class Gem::Package::TarHeader
|
|
227
227
|
end
|
228
228
|
|
229
229
|
end
|
230
|
-
|
@@ -1,5 +1,5 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
1
|
# -*- coding: utf-8 -*-
|
2
|
+
# frozen_string_literal: true
|
3
3
|
#--
|
4
4
|
# Copyright (C) 2004 Mauricio Julio Fernández Pradier
|
5
5
|
# See LICENSE.txt for additional licensing information.
|
@@ -121,4 +121,3 @@ class Gem::Package::TarReader
|
|
121
121
|
end
|
122
122
|
|
123
123
|
require 'rubygems/package/tar_reader/entry'
|
124
|
-
|
@@ -22,21 +22,16 @@ class Gem::PathSupport
|
|
22
22
|
# Constructor. Takes a single argument which is to be treated like a
|
23
23
|
# hashtable, or defaults to ENV, the system environment.
|
24
24
|
#
|
25
|
-
def initialize(env
|
26
|
-
@env
|
27
|
-
|
28
|
-
# note 'env' vs 'ENV'...
|
29
|
-
@home = env["GEM_HOME"] || ENV["GEM_HOME"] || Gem.default_dir
|
25
|
+
def initialize(env)
|
26
|
+
@home = env["GEM_HOME"] || Gem.default_dir
|
30
27
|
|
31
28
|
if File::ALT_SEPARATOR then
|
32
29
|
@home = @home.gsub(File::ALT_SEPARATOR, File::SEPARATOR)
|
33
30
|
end
|
34
31
|
|
35
|
-
|
32
|
+
@path = split_gem_path env["GEM_PATH"], @home
|
36
33
|
|
37
|
-
@spec_cache_dir =
|
38
|
-
env["GEM_SPEC_CACHE"] || ENV["GEM_SPEC_CACHE"] ||
|
39
|
-
Gem.default_spec_cache_dir
|
34
|
+
@spec_cache_dir = env["GEM_SPEC_CACHE"] || Gem.default_spec_cache_dir
|
40
35
|
|
41
36
|
@spec_cache_dir = @spec_cache_dir.dup.untaint
|
42
37
|
end
|
@@ -44,24 +39,19 @@ class Gem::PathSupport
|
|
44
39
|
private
|
45
40
|
|
46
41
|
##
|
47
|
-
#
|
42
|
+
# Split the Gem search path (as reported by Gem.path).
|
48
43
|
|
49
|
-
def
|
44
|
+
def split_gem_path gpaths, home
|
50
45
|
# FIX: it should be [home, *path], not [*path, home]
|
51
46
|
|
52
47
|
gem_path = []
|
53
48
|
|
54
|
-
# FIX: I can't tell wtf this is doing.
|
55
|
-
gpaths ||= (ENV['GEM_PATH'] || "").empty? ? nil : ENV["GEM_PATH"]
|
56
|
-
|
57
49
|
if gpaths
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
gem_path += default_path
|
64
|
-
end
|
50
|
+
gem_path = gpaths.split(Gem.path_separator)
|
51
|
+
# Handle the path_separator being set to a regexp, which will cause
|
52
|
+
# end_with? to error
|
53
|
+
if gpaths =~ /#{Gem.path_separator}\z/
|
54
|
+
gem_path += default_path
|
65
55
|
end
|
66
56
|
|
67
57
|
if File::ALT_SEPARATOR then
|
@@ -70,12 +60,12 @@ class Gem::PathSupport
|
|
70
60
|
end
|
71
61
|
end
|
72
62
|
|
73
|
-
gem_path <<
|
63
|
+
gem_path << home
|
74
64
|
else
|
75
65
|
gem_path = default_path
|
76
66
|
end
|
77
67
|
|
78
|
-
|
68
|
+
gem_path.uniq
|
79
69
|
end
|
80
70
|
|
81
71
|
# Return the default Gem path
|
@@ -127,6 +127,10 @@ module Gem::Resolver::Molinillo
|
|
127
127
|
v.incoming_edges.delete(e)
|
128
128
|
detach_vertex_named(v.name) unless v.root? || v.predecessors.any?
|
129
129
|
end
|
130
|
+
vertex.incoming_edges.each do |e|
|
131
|
+
v = e.origin
|
132
|
+
v.outgoing_edges.delete(e)
|
133
|
+
end
|
130
134
|
end
|
131
135
|
|
132
136
|
# @param [String] name
|
@@ -342,26 +342,37 @@ module Gem::Resolver::Molinillo
|
|
342
342
|
# @return [Boolean] Whether the possibility was swapped into {#activated}
|
343
343
|
def attempt_to_swap_possibility
|
344
344
|
swapped = activated.dup
|
345
|
-
swapped.vertex_named(name)
|
346
|
-
|
345
|
+
vertex = swapped.vertex_named(name)
|
346
|
+
vertex.payload = possibility
|
347
|
+
return unless vertex.requirements.
|
347
348
|
all? { |r| requirement_satisfied_by?(r, swapped, possibility) }
|
348
|
-
|
349
|
+
return unless new_spec_satisfied?
|
350
|
+
actual_vertex = activated.vertex_named(name)
|
351
|
+
actual_vertex.payload = possibility
|
352
|
+
fixup_swapped_children(actual_vertex)
|
353
|
+
activate_spec
|
354
|
+
end
|
355
|
+
|
356
|
+
# Ensures there are no orphaned successors to the given {vertex}.
|
357
|
+
# @param [DependencyGraph::Vertex] vertex the vertex to fix up.
|
358
|
+
# @return [void]
|
359
|
+
def fixup_swapped_children(vertex)
|
360
|
+
payload = vertex.payload
|
361
|
+
dep_names = dependencies_for(payload).map(&method(:name_for))
|
362
|
+
vertex.successors.each do |succ|
|
363
|
+
if !dep_names.include?(succ.name) && !succ.root? && succ.predecessors.to_a == [vertex]
|
364
|
+
debug(depth) { "Removing orphaned spec #{succ.name} after swapping #{name}" }
|
365
|
+
activated.detach_vertex_named(succ.name)
|
366
|
+
requirements.delete_if { |r| name_for(r) == succ.name }
|
367
|
+
end
|
368
|
+
end
|
349
369
|
end
|
350
370
|
|
351
371
|
# Attempts to activate the current {#possibility} (given that it hasn't
|
352
372
|
# already been activated)
|
353
373
|
# @return [void]
|
354
374
|
def attempt_to_activate_new_spec
|
355
|
-
|
356
|
-
locked_requirement = locked_requirement_named(name)
|
357
|
-
requested_spec_satisfied = requirement_satisfied_by?(requirement, activated, possibility)
|
358
|
-
locked_spec_satisfied = !locked_requirement ||
|
359
|
-
requirement_satisfied_by?(locked_requirement, activated, possibility)
|
360
|
-
debug(depth) { 'Unsatisfied by requested spec' } unless requested_spec_satisfied
|
361
|
-
debug(depth) { 'Unsatisfied by locked spec' } unless locked_spec_satisfied
|
362
|
-
requested_spec_satisfied && locked_spec_satisfied
|
363
|
-
end
|
364
|
-
if satisfied
|
375
|
+
if new_spec_satisfied?
|
365
376
|
activate_spec
|
366
377
|
else
|
367
378
|
create_conflict
|
@@ -369,6 +380,18 @@ module Gem::Resolver::Molinillo
|
|
369
380
|
end
|
370
381
|
end
|
371
382
|
|
383
|
+
# @return [Boolean] whether the current spec is satisfied as a new
|
384
|
+
# possibility.
|
385
|
+
def new_spec_satisfied?
|
386
|
+
locked_requirement = locked_requirement_named(name)
|
387
|
+
requested_spec_satisfied = requirement_satisfied_by?(requirement, activated, possibility)
|
388
|
+
locked_spec_satisfied = !locked_requirement ||
|
389
|
+
requirement_satisfied_by?(locked_requirement, activated, possibility)
|
390
|
+
debug(depth) { 'Unsatisfied by requested spec' } unless requested_spec_satisfied
|
391
|
+
debug(depth) { 'Unsatisfied by locked spec' } unless locked_spec_satisfied
|
392
|
+
requested_spec_satisfied && locked_spec_satisfied
|
393
|
+
end
|
394
|
+
|
372
395
|
# @param [String] requirement_name the spec name to search for
|
373
396
|
# @return [Object] the locked spec named `requirement_name`, if one
|
374
397
|
# is found on {#base}
|
@@ -394,7 +417,7 @@ module Gem::Resolver::Molinillo
|
|
394
417
|
# @return [void]
|
395
418
|
def require_nested_dependencies_for(activated_spec)
|
396
419
|
nested_dependencies = dependencies_for(activated_spec)
|
397
|
-
debug(depth) { "Requiring nested dependencies (#{nested_dependencies.
|
420
|
+
debug(depth) { "Requiring nested dependencies (#{nested_dependencies.join(', ')})" }
|
398
421
|
nested_dependencies.each { |d| activated.add_child_vertex(name_for(d), nil, [name_for(activated_spec)], d) }
|
399
422
|
|
400
423
|
push_state_for_requirements(requirements + nested_dependencies, nested_dependencies.size > 0)
|
data/lib/rubygems/source_list.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
1
|
# -*- coding: utf-8 -*-
|
2
|
+
# frozen_string_literal: true
|
3
3
|
#--
|
4
4
|
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
|
5
5
|
# All rights reserved.
|
@@ -1684,6 +1684,8 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1684
1684
|
(conflicts[spec] ||= []) << dep
|
1685
1685
|
end
|
1686
1686
|
}
|
1687
|
+
env_req = Gem.env_requirement(name)
|
1688
|
+
(conflicts[self] ||= []) << env_req unless env_req.satisfied_by? version
|
1687
1689
|
conflicts
|
1688
1690
|
end
|
1689
1691
|
|
@@ -1701,6 +1703,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1701
1703
|
# Return true if there are possible conflicts against the currently loaded specs.
|
1702
1704
|
|
1703
1705
|
def has_conflicts?
|
1706
|
+
return true unless Gem.env_requirement(name).satisfied_by?(version)
|
1704
1707
|
self.dependencies.any? { |dep|
|
1705
1708
|
if dep.runtime? then
|
1706
1709
|
spec = Gem.loaded_specs[dep.name]
|
data/lib/rubygems/test_case.rb
CHANGED
@@ -570,7 +570,7 @@ class Gem::TestCase < MiniTest::Unit::TestCase
|
|
570
570
|
def write_file(path)
|
571
571
|
path = File.join @gemhome, path unless Pathname.new(path).absolute?
|
572
572
|
dir = File.dirname path
|
573
|
-
FileUtils.mkdir_p dir
|
573
|
+
FileUtils.mkdir_p dir unless File.directory? dir
|
574
574
|
|
575
575
|
open path, 'wb' do |io|
|
576
576
|
yield io if block_given?
|
data/lib/rubygems/version.rb
CHANGED
@@ -219,7 +219,7 @@ class Gem::Version
|
|
219
219
|
|
220
220
|
def bump
|
221
221
|
@bump ||= begin
|
222
|
-
segments = self.segments
|
222
|
+
segments = self.segments
|
223
223
|
segments.pop while segments.any? { |s| String === s }
|
224
224
|
segments.pop if segments.size > 1
|
225
225
|
|
@@ -298,7 +298,7 @@ class Gem::Version
|
|
298
298
|
|
299
299
|
def release
|
300
300
|
@release ||= if prerelease?
|
301
|
-
segments = self.segments
|
301
|
+
segments = self.segments
|
302
302
|
segments.pop while segments.any? { |s| String === s }
|
303
303
|
self.class.new segments.join('.')
|
304
304
|
else
|
@@ -307,20 +307,14 @@ class Gem::Version
|
|
307
307
|
end
|
308
308
|
|
309
309
|
def segments # :nodoc:
|
310
|
-
|
311
|
-
# segments is lazy so it can pick up version values that come from
|
312
|
-
# old marshaled versions, which don't go through marshal_load.
|
313
|
-
|
314
|
-
@segments ||= @version.scan(/[0-9]+|[a-z]+/i).map do |s|
|
315
|
-
/^\d+$/ =~ s ? s.to_i : s
|
316
|
-
end
|
310
|
+
_segments.dup
|
317
311
|
end
|
318
312
|
|
319
313
|
##
|
320
314
|
# A recommended version for use with a ~> Requirement.
|
321
315
|
|
322
316
|
def approximate_recommendation
|
323
|
-
segments = self.segments
|
317
|
+
segments = self.segments
|
324
318
|
|
325
319
|
segments.pop while segments.any? { |s| String === s }
|
326
320
|
segments.pop while segments.size > 2
|
@@ -339,8 +333,8 @@ class Gem::Version
|
|
339
333
|
return unless Gem::Version === other
|
340
334
|
return 0 if @version == other._version
|
341
335
|
|
342
|
-
lhsegments =
|
343
|
-
rhsegments = other.
|
336
|
+
lhsegments = _segments
|
337
|
+
rhsegments = other._segments
|
344
338
|
|
345
339
|
lhsize = lhsegments.size
|
346
340
|
rhsize = rhsegments.size
|
@@ -367,4 +361,14 @@ class Gem::Version
|
|
367
361
|
def _version
|
368
362
|
@version
|
369
363
|
end
|
364
|
+
|
365
|
+
def _segments
|
366
|
+
# segments is lazy so it can pick up version values that come from
|
367
|
+
# old marshaled versions, which don't go through marshal_load.
|
368
|
+
# since this version object is cached in @@all, its @segments should be frozen
|
369
|
+
|
370
|
+
@segments ||= @version.scan(/[0-9]+|[a-z]+/i).map do |s|
|
371
|
+
/^\d+$/ =~ s ? s.to_i : s
|
372
|
+
end.freeze
|
373
|
+
end
|
370
374
|
end
|
data/test/rubygems/test_gem.rb
CHANGED
@@ -473,6 +473,45 @@ class TestGem < Gem::TestCase
|
|
473
473
|
assert_equal cwd, $LOAD_PATH.shift
|
474
474
|
end
|
475
475
|
|
476
|
+
def test_self_find_files_with_gemfile
|
477
|
+
# write_file(File.join Dir.pwd, 'Gemfile') fails on travis 1.8.7 with $SAFE=1
|
478
|
+
skip if RUBY_VERSION <= "1.8.7"
|
479
|
+
|
480
|
+
cwd = File.expand_path("test/rubygems", @@project_dir)
|
481
|
+
$LOAD_PATH.unshift cwd
|
482
|
+
|
483
|
+
discover_path = File.join 'lib', 'sff', 'discover.rb'
|
484
|
+
|
485
|
+
foo1, _ = %w(1 2).map { |version|
|
486
|
+
spec = quick_gem 'sff', version do |s|
|
487
|
+
s.files << discover_path
|
488
|
+
end
|
489
|
+
|
490
|
+
write_file(File.join 'gems', spec.full_name, discover_path) do |fp|
|
491
|
+
fp.puts "# #{spec.full_name}"
|
492
|
+
end
|
493
|
+
|
494
|
+
spec
|
495
|
+
}
|
496
|
+
Gem.refresh
|
497
|
+
|
498
|
+
write_file(File.join Dir.pwd, 'Gemfile') do |fp|
|
499
|
+
fp.puts "source 'https://rubygems.org'"
|
500
|
+
fp.puts "gem '#{foo1.name}', '#{foo1.version}'"
|
501
|
+
end
|
502
|
+
Gem.use_gemdeps(File.join Dir.pwd, 'Gemfile')
|
503
|
+
|
504
|
+
expected = [
|
505
|
+
File.expand_path('test/rubygems/sff/discover.rb', @@project_dir),
|
506
|
+
File.join(foo1.full_gem_path, discover_path)
|
507
|
+
]
|
508
|
+
|
509
|
+
assert_equal expected, Gem.find_files('sff/discover')
|
510
|
+
assert_equal expected, Gem.find_files('sff/**.rb'), '[ruby-core:31730]'
|
511
|
+
ensure
|
512
|
+
assert_equal cwd, $LOAD_PATH.shift unless RUBY_VERSION <= "1.8.7"
|
513
|
+
end
|
514
|
+
|
476
515
|
def test_self_find_latest_files
|
477
516
|
cwd = File.expand_path("test/rubygems", @@project_dir)
|
478
517
|
$LOAD_PATH.unshift cwd
|
@@ -929,6 +968,26 @@ class TestGem < Gem::TestCase
|
|
929
968
|
assert_match %r%Could not find 'b' %, e.message
|
930
969
|
end
|
931
970
|
|
971
|
+
def test_self_try_activate_missing_prerelease
|
972
|
+
b = util_spec 'b', '1.0rc1'
|
973
|
+
a = util_spec 'a', '1.0rc1', 'b' => '1.0rc1'
|
974
|
+
|
975
|
+
install_specs b, a
|
976
|
+
uninstall_gem b
|
977
|
+
|
978
|
+
a_file = File.join a.gem_dir, 'lib', 'a_file.rb'
|
979
|
+
|
980
|
+
write_file a_file do |io|
|
981
|
+
io.puts '# a_file.rb'
|
982
|
+
end
|
983
|
+
|
984
|
+
e = assert_raises Gem::LoadError do
|
985
|
+
Gem.try_activate 'a_file'
|
986
|
+
end
|
987
|
+
|
988
|
+
assert_match %r%Could not find 'b' \(= 1.0rc1\)%, e.message
|
989
|
+
end
|
990
|
+
|
932
991
|
def test_self_try_activate_missing_extensions
|
933
992
|
spec = util_spec 'ext', '1' do |s|
|
934
993
|
s.extensions = %w[ext/extconf.rb]
|
@@ -170,12 +170,16 @@ class TestGemCommand < Gem::TestCase
|
|
170
170
|
@cmd.add_option('-f', '--file FILE', 'File option') do |value, options|
|
171
171
|
options[:help] = true
|
172
172
|
end
|
173
|
+
@cmd.add_option('--silent', 'Silence rubygems output') do |value, options|
|
174
|
+
options[:silent] = true
|
175
|
+
end
|
173
176
|
assert @cmd.handles?(['-x'])
|
174
177
|
assert @cmd.handles?(['-h'])
|
175
178
|
assert @cmd.handles?(['-h', 'command'])
|
176
179
|
assert @cmd.handles?(['--help', 'command'])
|
177
180
|
assert @cmd.handles?(['-f', 'filename'])
|
178
181
|
assert @cmd.handles?(['--file=filename'])
|
182
|
+
assert @cmd.handles?(['--silent'])
|
179
183
|
refute @cmd.handles?(['-z'])
|
180
184
|
refute @cmd.handles?(['-f'])
|
181
185
|
refute @cmd.handles?(['--toothpaste'])
|
@@ -112,7 +112,7 @@ class TestGemCommandsCleanupCommand < Gem::TestCase
|
|
112
112
|
@cmd.execute
|
113
113
|
|
114
114
|
assert_path_exists @a_1.gem_dir
|
115
|
-
|
115
|
+
assert_path_exists @a_1_1.gem_dir
|
116
116
|
ensure
|
117
117
|
FileUtils.chmod 0755, @gemhome
|
118
118
|
end unless win_platform?
|
@@ -165,5 +165,33 @@ class TestGemCommandsCleanupCommand < Gem::TestCase
|
|
165
165
|
assert_match %r%^Skipped default gems: b-2%, @ui.output
|
166
166
|
assert_empty @ui.error
|
167
167
|
end
|
168
|
+
|
169
|
+
def test_execute_remove_gem_home_only
|
170
|
+
c_1, = util_gem 'c', '1'
|
171
|
+
c_2, = util_gem 'c', '2'
|
172
|
+
d_1, = util_gem 'd', '1'
|
173
|
+
d_2, = util_gem 'd', '2'
|
174
|
+
e_1, = util_gem 'e', '1'
|
175
|
+
e_2, = util_gem 'e', '2'
|
176
|
+
|
177
|
+
c_1 = install_gem c_1, :user_install => true # pick up user install path
|
178
|
+
c_2 = install_gem c_2
|
179
|
+
|
180
|
+
d_1 = install_gem d_1
|
181
|
+
d_2 = install_gem d_2, :user_install => true # pick up user install path
|
182
|
+
|
183
|
+
e_1 = install_gem e_1
|
184
|
+
e_2 = install_gem e_2
|
185
|
+
|
186
|
+
Gem::Specification.dirs = [Gem.dir, Gem.user_dir]
|
187
|
+
|
188
|
+
@cmd.options[:args] = []
|
189
|
+
|
190
|
+
@cmd.execute
|
191
|
+
|
192
|
+
assert_path_exists c_1.gem_dir
|
193
|
+
refute_path_exists d_1.gem_dir
|
194
|
+
refute_path_exists e_1.gem_dir
|
195
|
+
end
|
168
196
|
end
|
169
197
|
|
@@ -10,9 +10,10 @@ class TestGemCommandsOpenCommand < Gem::TestCase
|
|
10
10
|
@cmd = Gem::Commands::OpenCommand.new
|
11
11
|
end
|
12
12
|
|
13
|
-
def gem
|
13
|
+
def gem(name, version = "1.0")
|
14
14
|
spec = quick_gem name do |gem|
|
15
15
|
gem.files = %W[lib/#{name}.rb Rakefile]
|
16
|
+
gem.version = version
|
16
17
|
end
|
17
18
|
write_file File.join(*%W[gems #{spec.full_name} lib #{name}.rb])
|
18
19
|
write_file File.join(*%W[gems #{spec.full_name} Rakefile])
|
@@ -37,6 +38,22 @@ class TestGemCommandsOpenCommand < Gem::TestCase
|
|
37
38
|
assert_equal "", @ui.error
|
38
39
|
end
|
39
40
|
|
41
|
+
def test_wrong_version
|
42
|
+
@cmd.options[:version] = "4.0"
|
43
|
+
@cmd.options[:args] = %w[foo]
|
44
|
+
|
45
|
+
spec = gem "foo", "5.0"
|
46
|
+
|
47
|
+
assert_raises Gem::MockGemUi::TermError do
|
48
|
+
use_ui @ui do
|
49
|
+
@cmd.execute
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
assert_match %r|Unable to find gem 'foo'|, @ui.output
|
54
|
+
assert_equal "", @ui.error
|
55
|
+
end
|
56
|
+
|
40
57
|
def test_execute_bad_gem
|
41
58
|
@cmd.options[:args] = %w[foo]
|
42
59
|
|
@@ -118,7 +118,7 @@ class TestGemCommandsPushCommand < Gem::TestCase
|
|
118
118
|
end
|
119
119
|
|
120
120
|
def test_sending_gem_to_metadata_host
|
121
|
-
@host = "http://
|
121
|
+
@host = "http://privategemserver.example"
|
122
122
|
|
123
123
|
@spec, @path = util_gem "freebird", "1.0.1" do |spec|
|
124
124
|
spec.metadata['default_gem_server'] = @host
|
@@ -152,7 +152,7 @@ class TestGemCommandsPushCommand < Gem::TestCase
|
|
152
152
|
end
|
153
153
|
|
154
154
|
def test_sending_gem_to_allowed_push_host
|
155
|
-
@host = "http://privategemserver.
|
155
|
+
@host = "http://privategemserver.example"
|
156
156
|
|
157
157
|
@spec, @path = util_gem "freebird", "1.0.1" do |spec|
|
158
158
|
spec.metadata['allowed_push_host'] = @host
|
@@ -179,8 +179,8 @@ class TestGemCommandsPushCommand < Gem::TestCase
|
|
179
179
|
end
|
180
180
|
|
181
181
|
def test_sending_gem_to_allowed_push_host_with_basic_credentials
|
182
|
-
@sanitized_host = "http://privategemserver.
|
183
|
-
@host = "http://user:password@privategemserver.
|
182
|
+
@sanitized_host = "http://privategemserver.example"
|
183
|
+
@host = "http://user:password@privategemserver.example"
|
184
184
|
|
185
185
|
@spec, @path = util_gem "freebird", "1.0.1" do |spec|
|
186
186
|
spec.metadata['allowed_push_host'] = @sanitized_host
|
@@ -207,10 +207,10 @@ class TestGemCommandsPushCommand < Gem::TestCase
|
|
207
207
|
|
208
208
|
def test_sending_gem_to_disallowed_default_host
|
209
209
|
@spec, @path = util_gem "freebird", "1.0.1" do |spec|
|
210
|
-
spec.metadata['allowed_push_host'] = "https://privategemserver.
|
210
|
+
spec.metadata['allowed_push_host'] = "https://privategemserver.example"
|
211
211
|
end
|
212
212
|
|
213
|
-
response = %{ERROR: "#{@host}" is not allowed by the gemspec, which only allows "https://privategemserver.
|
213
|
+
response = %{ERROR: "#{@host}" is not allowed by the gemspec, which only allows "https://privategemserver.example"}
|
214
214
|
|
215
215
|
assert_raises Gem::MockGemUi::TermError do
|
216
216
|
send_battery
|
@@ -220,10 +220,11 @@ class TestGemCommandsPushCommand < Gem::TestCase
|
|
220
220
|
end
|
221
221
|
|
222
222
|
def test_sending_gem_to_disallowed_push_host
|
223
|
-
@host = "https://
|
223
|
+
@host = "https://anotherprivategemserver.example"
|
224
|
+
push_host = "https://privategemserver.example"
|
224
225
|
|
225
226
|
@spec, @path = util_gem "freebird", "1.0.1" do |spec|
|
226
|
-
spec.metadata['allowed_push_host'] =
|
227
|
+
spec.metadata['allowed_push_host'] = push_host
|
227
228
|
end
|
228
229
|
|
229
230
|
@api_key = "PRIVKEY"
|
@@ -241,7 +242,7 @@ class TestGemCommandsPushCommand < Gem::TestCase
|
|
241
242
|
|
242
243
|
FileUtils.rm Gem.configuration.credentials_path
|
243
244
|
|
244
|
-
response =
|
245
|
+
response = "ERROR: \"#{@host}\" is not allowed by the gemspec, which only allows \"#{push_host}\""
|
245
246
|
|
246
247
|
assert_raises Gem::MockGemUi::TermError do
|
247
248
|
send_battery
|
@@ -250,6 +251,45 @@ class TestGemCommandsPushCommand < Gem::TestCase
|
|
250
251
|
assert_match response, @ui.error
|
251
252
|
end
|
252
253
|
|
254
|
+
def test_sending_gem_defaulting_to_allowed_push_host
|
255
|
+
host = "http://privategemserver.example"
|
256
|
+
|
257
|
+
@spec, @path = util_gem "freebird", "1.0.1" do |spec|
|
258
|
+
spec.metadata.delete('default_gem_server')
|
259
|
+
spec.metadata['allowed_push_host'] = host
|
260
|
+
end
|
261
|
+
|
262
|
+
api_key = "PRIVKEY"
|
263
|
+
|
264
|
+
keys = {
|
265
|
+
host => api_key
|
266
|
+
}
|
267
|
+
|
268
|
+
FileUtils.mkdir_p File.dirname Gem.configuration.credentials_path
|
269
|
+
open Gem.configuration.credentials_path, 'w' do |f|
|
270
|
+
f.write keys.to_yaml
|
271
|
+
end
|
272
|
+
Gem.configuration.load_api_keys
|
273
|
+
|
274
|
+
FileUtils.rm Gem.configuration.credentials_path
|
275
|
+
|
276
|
+
@response = "Successfully registered gem: freebird (1.0.1)"
|
277
|
+
@fetcher.data["#{host}/api/v1/gems"] = [@response, 200, 'OK']
|
278
|
+
|
279
|
+
# do not set @host
|
280
|
+
use_ui(@ui) { @cmd.send_gem(@path) }
|
281
|
+
|
282
|
+
assert_match %r{Pushing gem to #{host}...}, @ui.output
|
283
|
+
|
284
|
+
assert_equal Net::HTTP::Post, @fetcher.last_request.class
|
285
|
+
assert_equal Gem.read_binary(@path), @fetcher.last_request.body
|
286
|
+
assert_equal File.size(@path), @fetcher.last_request["Content-Length"].to_i
|
287
|
+
assert_equal "application/octet-stream", @fetcher.last_request["Content-Type"]
|
288
|
+
assert_equal api_key, @fetcher.last_request["Authorization"]
|
289
|
+
|
290
|
+
assert_match @response, @ui.output
|
291
|
+
end
|
292
|
+
|
253
293
|
def test_raises_error_with_no_arguments
|
254
294
|
def @cmd.sign_in(*); end
|
255
295
|
assert_raises Gem::CommandLineError do
|
@@ -7,6 +7,9 @@ class TestGemExtCmakeBuilder < Gem::TestCase
|
|
7
7
|
def setup
|
8
8
|
super
|
9
9
|
|
10
|
+
# Details: https://github.com/rubygems/rubygems/issues/1270#issuecomment-177368340
|
11
|
+
skip "CmakeBuilder doesn't work on Windows." if Gem.win_platform?
|
12
|
+
|
10
13
|
`cmake #{Gem::Ext::Builder.redirector}`
|
11
14
|
|
12
15
|
skip 'cmake not present' unless $?.success?
|
@@ -82,4 +85,3 @@ install (FILES test.txt DESTINATION bin)
|
|
82
85
|
end
|
83
86
|
|
84
87
|
end
|
85
|
-
|
@@ -110,7 +110,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
|
|
110
110
|
assert_match %r{Signed in.}, @sign_in_ui.output
|
111
111
|
|
112
112
|
credentials = YAML.load_file Gem.configuration.credentials_path
|
113
|
-
assert_equal api_key, credentials[
|
113
|
+
assert_equal api_key, credentials['http://example.com']
|
114
114
|
end
|
115
115
|
|
116
116
|
def test_sign_in_with_host_nil
|
@@ -137,7 +137,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
|
|
137
137
|
assert_match %r{Signed in.}, @sign_in_ui.output
|
138
138
|
|
139
139
|
credentials = YAML.load_file Gem.configuration.credentials_path
|
140
|
-
assert_equal api_key, credentials[
|
140
|
+
assert_equal api_key, credentials['http://example.com']
|
141
141
|
end
|
142
142
|
|
143
143
|
def test_sign_in_skips_with_existing_credentials
|
@@ -12,7 +12,7 @@ class TestGemPathSupport < Gem::TestCase
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def test_initialize
|
15
|
-
ps = Gem::PathSupport.new
|
15
|
+
ps = Gem::PathSupport.new ENV
|
16
16
|
|
17
17
|
assert_equal ENV["GEM_HOME"], ps.home
|
18
18
|
|
@@ -21,7 +21,7 @@ class TestGemPathSupport < Gem::TestCase
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def test_initialize_home
|
24
|
-
ps = Gem::PathSupport.new "GEM_HOME" => "#{@tempdir}/foo"
|
24
|
+
ps = Gem::PathSupport.new ENV.to_hash.merge("GEM_HOME" => "#{@tempdir}/foo")
|
25
25
|
|
26
26
|
assert_equal File.join(@tempdir, "foo"), ps.home
|
27
27
|
|
@@ -39,7 +39,7 @@ class TestGemPathSupport < Gem::TestCase
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def test_initialize_path
|
42
|
-
ps = Gem::PathSupport.new "GEM_PATH" => %W[#{@tempdir}/foo #{@tempdir}/bar]
|
42
|
+
ps = Gem::PathSupport.new ENV.to_hash.merge("GEM_PATH" => %W[#{@tempdir}/foo #{@tempdir}/bar].join(Gem.path_separator))
|
43
43
|
|
44
44
|
assert_equal ENV["GEM_HOME"], ps.home
|
45
45
|
|
@@ -52,9 +52,45 @@ class TestGemPathSupport < Gem::TestCase
|
|
52
52
|
assert_equal expected, ps.path
|
53
53
|
end
|
54
54
|
|
55
|
+
def test_initialize_regexp_path_separator
|
56
|
+
Gem.stub(:path_separator, /#{File::PATH_SEPARATOR}/) do
|
57
|
+
path = %W[#{@tempdir}/foo
|
58
|
+
#{File::PATH_SEPARATOR}
|
59
|
+
#{@tempdir}/bar
|
60
|
+
#{File::PATH_SEPARATOR}].join
|
61
|
+
ps = Gem::PathSupport.new "GEM_PATH" => path, "GEM_HOME" => ENV["GEM_HOME"]
|
62
|
+
|
63
|
+
assert_equal ENV["GEM_HOME"], ps.home
|
64
|
+
|
65
|
+
expected = [
|
66
|
+
File.join(@tempdir, 'foo'),
|
67
|
+
File.join(@tempdir, 'bar'),
|
68
|
+
] + Gem.default_path << ENV["GEM_HOME"]
|
69
|
+
|
70
|
+
assert_equal expected, ps.path
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def test_initialize_path_with_defaults
|
75
|
+
path = %W[#{@tempdir}/foo
|
76
|
+
#{File::PATH_SEPARATOR}
|
77
|
+
#{@tempdir}/bar
|
78
|
+
#{File::PATH_SEPARATOR}].join
|
79
|
+
ps = Gem::PathSupport.new "GEM_PATH" => path, "GEM_HOME" => ENV["GEM_HOME"]
|
80
|
+
|
81
|
+
assert_equal ENV["GEM_HOME"], ps.home
|
82
|
+
|
83
|
+
expected = [
|
84
|
+
File.join(@tempdir, 'foo'),
|
85
|
+
File.join(@tempdir, 'bar'),
|
86
|
+
] + Gem.default_path << ENV["GEM_HOME"]
|
87
|
+
|
88
|
+
assert_equal expected, ps.path
|
89
|
+
end
|
90
|
+
|
55
91
|
def test_initialize_home_path
|
56
92
|
ps = Gem::PathSupport.new("GEM_HOME" => "#{@tempdir}/foo",
|
57
|
-
"GEM_PATH" => %W[#{@tempdir}/foo #{@tempdir}/bar])
|
93
|
+
"GEM_PATH" => %W[#{@tempdir}/foo #{@tempdir}/bar].join(Gem.path_separator))
|
58
94
|
|
59
95
|
assert_equal File.join(@tempdir, "foo"), ps.home
|
60
96
|
|
@@ -69,12 +105,12 @@ class TestGemPathSupport < Gem::TestCase
|
|
69
105
|
def test_initialize_spec
|
70
106
|
ENV["GEM_SPEC_CACHE"] = nil
|
71
107
|
|
72
|
-
ps = Gem::PathSupport.new
|
108
|
+
ps = Gem::PathSupport.new ENV
|
73
109
|
assert_equal Gem.default_spec_cache_dir, ps.spec_cache_dir
|
74
110
|
|
75
111
|
ENV["GEM_SPEC_CACHE"] = 'bar'
|
76
112
|
|
77
|
-
ps = Gem::PathSupport.new
|
113
|
+
ps = Gem::PathSupport.new ENV
|
78
114
|
assert_equal ENV["GEM_SPEC_CACHE"], ps.spec_cache_dir
|
79
115
|
|
80
116
|
ENV["GEM_SPEC_CACHE"] = File.join @tempdir, 'spec_cache'
|
@@ -924,6 +924,8 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
|
|
924
924
|
@ssl_server_thread.kill.join
|
925
925
|
@ssl_server_thread = nil
|
926
926
|
end
|
927
|
+
utils = WEBrick::Utils # TimeoutHandler is since 1.9
|
928
|
+
utils::TimeoutHandler.terminate if defined?(utils::TimeoutHandler.terminate)
|
927
929
|
end
|
928
930
|
|
929
931
|
def normal_server_port
|
@@ -146,6 +146,14 @@ class TestGemVersion < Gem::TestCase
|
|
146
146
|
assert_less_than "1.0.0-1", "1"
|
147
147
|
end
|
148
148
|
|
149
|
+
# modifying the segments of a version should not affect the segments of the cached version object
|
150
|
+
def test_segments
|
151
|
+
v('9.8.7').segments[2] += 1
|
152
|
+
|
153
|
+
refute_version_equal "9.8.8", "9.8.7"
|
154
|
+
assert_equal [9,8,7], v("9.8.7").segments
|
155
|
+
end
|
156
|
+
|
149
157
|
# Asserts that +version+ is a prerelease.
|
150
158
|
|
151
159
|
def assert_prerelease version
|
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.
|
4
|
+
version: 2.6.0
|
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-02-
|
13
|
+
date: 2016-02-26 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: minitest
|
@@ -128,8 +128,8 @@ description: |-
|
|
128
128
|
|
129
129
|
If you don't have RubyGems installed, you can still do it manually:
|
130
130
|
|
131
|
-
* Download from: https://rubygems.org/pages/download
|
132
|
-
*
|
131
|
+
* Download from: https://rubygems.org/pages/download, unpack, and cd there
|
132
|
+
* OR clone this repository and cd there
|
133
133
|
* Install with: ruby setup.rb # you may need admin/root privilege
|
134
134
|
|
135
135
|
For more details and other options, see:
|
@@ -555,7 +555,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
555
555
|
version: '0'
|
556
556
|
requirements: []
|
557
557
|
rubyforge_project:
|
558
|
-
rubygems_version: 2.5.
|
558
|
+
rubygems_version: 2.5.2
|
559
559
|
signing_key:
|
560
560
|
specification_version: 4
|
561
561
|
summary: RubyGems is a package management framework for Ruby
|