rubygems-update 3.2.2 → 3.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{History.txt → CHANGELOG.md} +482 -424
- data/Manifest.txt +30 -27
- data/Rakefile +11 -15
- data/bundler/CHANGELOG.md +67 -2
- data/bundler/bundler.gemspec +1 -1
- data/bundler/lib/bundler.rb +3 -7
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli.rb +2 -5
- data/bundler/lib/bundler/cli/cache.rb +1 -0
- data/bundler/lib/bundler/cli/gem.rb +2 -0
- data/bundler/lib/bundler/cli/update.rb +1 -1
- data/bundler/lib/bundler/compact_index_client/cache.rb +5 -13
- data/bundler/lib/bundler/compact_index_client/gem_parser.rb +28 -0
- data/bundler/lib/bundler/compact_index_client/updater.rb +0 -8
- data/bundler/lib/bundler/definition.rb +29 -21
- data/bundler/lib/bundler/dep_proxy.rb +15 -8
- data/bundler/lib/bundler/feature_flag.rb +0 -1
- data/bundler/lib/bundler/fetcher.rb +0 -1
- data/bundler/lib/bundler/gem_helper.rb +9 -7
- data/bundler/lib/bundler/gem_helpers.rb +30 -24
- data/bundler/lib/bundler/gem_version_promoter.rb +2 -2
- data/bundler/lib/bundler/installer.rb +0 -17
- data/bundler/lib/bundler/installer/standalone.rb +14 -0
- data/bundler/lib/bundler/lazy_specification.rb +10 -11
- data/bundler/{man → lib/bundler/man}/bundle-add.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-binstubs.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-cache.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-check.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-clean.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-config.1 +4 -4
- data/bundler/lib/bundler/man/bundle-config.1.ronn +3 -3
- data/bundler/{man → lib/bundler/man}/bundle-doctor.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-exec.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-gem.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-info.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-init.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-inject.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-install.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-list.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-lock.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-open.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-outdated.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-platform.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-pristine.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-remove.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-show.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-update.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-viz.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle.1 +1 -1
- data/bundler/{man → lib/bundler/man}/gemfile.5 +1 -1
- data/bundler/{man → lib/bundler/man}/index.txt +0 -0
- data/bundler/lib/bundler/resolver.rb +36 -16
- data/bundler/lib/bundler/resolver/spec_group.rb +18 -23
- data/bundler/lib/bundler/rubygems_ext.rb +16 -0
- data/bundler/lib/bundler/rubygems_integration.rb +0 -5
- data/bundler/lib/bundler/settings.rb +1 -1
- data/bundler/lib/bundler/source/git.rb +19 -17
- data/bundler/lib/bundler/source/git/git_proxy.rb +54 -49
- data/bundler/lib/bundler/source/path/installer.rb +2 -0
- data/bundler/lib/bundler/source/rubygems.rb +10 -2
- data/bundler/lib/bundler/spec_set.rb +6 -9
- data/bundler/lib/bundler/templates/newgem/Gemfile.tt +1 -1
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +1 -1
- data/bundler/lib/bundler/templates/newgem/rubocop.yml.tt +3 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +7 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +1 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +11 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +11 -7
- data/bundler/lib/bundler/version.rb +1 -1
- data/lib/rubygems.rb +2 -2
- data/lib/rubygems/commands/setup_command.rb +16 -62
- data/lib/rubygems/dependency_installer.rb +1 -0
- data/lib/rubygems/ext/builder.rb +5 -4
- data/lib/rubygems/ext/cmake_builder.rb +1 -2
- data/lib/rubygems/ext/configure_builder.rb +1 -2
- data/lib/rubygems/gemcutter_utilities.rb +2 -2
- data/lib/rubygems/installer.rb +0 -23
- data/lib/rubygems/installer_uninstaller_utils.rb +6 -1
- data/lib/rubygems/platform.rb +0 -4
- data/lib/rubygems/remote_fetcher.rb +4 -2
- data/lib/rubygems/request_set.rb +2 -13
- data/lib/rubygems/requirement.rb +1 -1
- data/lib/rubygems/resolver.rb +6 -1
- data/lib/rubygems/resolver/api_set.rb +28 -19
- data/lib/rubygems/resolver/api_set/gem_parser.rb +20 -0
- data/lib/rubygems/resolver/api_specification.rb +4 -3
- data/lib/rubygems/resolver/best_set.rb +2 -2
- data/lib/rubygems/resolver/index_specification.rb +18 -0
- data/lib/rubygems/resolver/installer_set.rb +57 -7
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/vertex.rb +1 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb +1 -1
- data/lib/rubygems/resolver/spec_specification.rb +14 -0
- data/lib/rubygems/resolver/specification.rb +12 -0
- data/lib/rubygems/source.rb +10 -6
- data/lib/rubygems/specification.rb +18 -14
- data/lib/rubygems/test_case.rb +17 -4
- data/rubygems-update.gemspec +2 -2
- data/test/rubygems/data/null-required-rubygems-version.gemspec.rz +0 -0
- data/test/rubygems/test_gem.rb +5 -0
- data/test/rubygems/test_gem_commands_install_command.rb +131 -0
- data/test/rubygems/test_gem_commands_setup_command.rb +21 -37
- data/test/rubygems/test_gem_dependency_installer.rb +27 -47
- data/test/rubygems/test_gem_ext_builder.rb +30 -6
- data/test/rubygems/test_gem_ext_cmake_builder.rb +2 -4
- data/test/rubygems/test_gem_ext_configure_builder.rb +2 -2
- data/test/rubygems/test_gem_installer.rb +8 -60
- data/test/rubygems/test_gem_platform.rb +8 -0
- data/test/rubygems/test_gem_remote_fetcher.rb +1 -1
- data/test/rubygems/test_gem_requirement.rb +34 -0
- data/test/rubygems/test_gem_resolver_api_set.rb +26 -52
- data/test/rubygems/test_gem_resolver_api_specification.rb +3 -3
- data/test/rubygems/test_gem_resolver_best_set.rb +26 -3
- data/test/rubygems/test_gem_source.rb +2 -2
- data/test/rubygems/test_gem_source_subpath_problem.rb +2 -2
- data/test/rubygems/test_gem_specification.rb +9 -3
- data/test/rubygems/test_gem_stream_ui.rb +1 -1
- metadata +34 -55
@@ -24,14 +24,15 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
|
24
24
|
lib/rubygems/test_case.rb
|
25
25
|
lib/rubygems/ssl_certs/rubygems.org/foo.pem
|
26
26
|
bundler/exe/bundle
|
27
|
+
bundler/exe/bundler
|
27
28
|
bundler/lib/bundler.rb
|
28
29
|
bundler/lib/bundler/b.rb
|
30
|
+
bundler/bin/bundler/man/bundle-b.1
|
29
31
|
bundler/lib/bundler/man/bundle-b.1.ronn
|
32
|
+
bundler/lib/bundler/man/gemfile.5
|
30
33
|
bundler/lib/bundler/man/gemfile.5.ronn
|
31
34
|
bundler/lib/bundler/templates/.circleci/config.yml
|
32
35
|
bundler/lib/bundler/templates/.travis.yml
|
33
|
-
bundler/man/bundle-b.1
|
34
|
-
bundler/man/gemfile.5
|
35
36
|
]
|
36
37
|
|
37
38
|
create_dummy_files(filelist)
|
@@ -41,7 +42,7 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
|
41
42
|
gemspec.name = "bundler"
|
42
43
|
gemspec.version = BUNDLER_VERS
|
43
44
|
gemspec.bindir = "exe"
|
44
|
-
gemspec.executables = ["bundle"]
|
45
|
+
gemspec.executables = ["bundle", "bundler"]
|
45
46
|
|
46
47
|
File.open 'bundler/bundler.gemspec', 'w' do |io|
|
47
48
|
io.puts gemspec.to_ruby
|
@@ -135,6 +136,7 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
|
135
136
|
exec_line = out.shift until exec_line == "RubyGems installed the following executables:"
|
136
137
|
assert_equal "\t#{default_gem_bin_path}", out.shift
|
137
138
|
assert_equal "\t#{default_bundle_bin_path}", out.shift
|
139
|
+
assert_equal "\t#{default_bundler_bin_path}", out.shift
|
138
140
|
end
|
139
141
|
|
140
142
|
def test_env_shebang_flag
|
@@ -152,6 +154,7 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
|
152
154
|
bin_env = win_platform? ? "" : %w[/usr/bin/env /bin/env].find {|f| File.executable?(f) } + " "
|
153
155
|
assert_match %r{\A#!\s*#{bin_env}#{ruby_exec}}, File.read(default_gem_bin_path)
|
154
156
|
assert_match %r{\A#!\s*#{bin_env}#{ruby_exec}}, File.read(default_bundle_bin_path)
|
157
|
+
assert_match %r{\A#!\s*#{bin_env}#{ruby_exec}}, File.read(default_bundler_bin_path)
|
155
158
|
assert_match %r{\A#!\s*#{bin_env}#{ruby_exec}}, File.read(gem_bin_path)
|
156
159
|
end
|
157
160
|
|
@@ -160,16 +163,6 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
|
160
163
|
@cmd.files_in('lib').sort
|
161
164
|
end
|
162
165
|
|
163
|
-
def test_bundler_man1_files_in
|
164
|
-
assert_equal %w[bundle-b.1],
|
165
|
-
@cmd.bundler_man1_files_in('bundler/man').sort
|
166
|
-
end
|
167
|
-
|
168
|
-
def test_bundler_man5_files_in
|
169
|
-
assert_equal %w[gemfile.5],
|
170
|
-
@cmd.bundler_man5_files_in('bundler/man').sort
|
171
|
-
end
|
172
|
-
|
173
166
|
def test_install_lib
|
174
167
|
@cmd.extend FileUtils
|
175
168
|
|
@@ -187,19 +180,6 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
|
187
180
|
end
|
188
181
|
end
|
189
182
|
|
190
|
-
def test_install_man
|
191
|
-
@cmd.extend FileUtils
|
192
|
-
|
193
|
-
Dir.mktmpdir 'man' do |dir|
|
194
|
-
@cmd.install_man dir
|
195
|
-
|
196
|
-
assert_path_exists File.join("#{dir}/man1", 'bundle-b.1')
|
197
|
-
refute_path_exists File.join("#{dir}/man1", 'bundle-b.1.ronn')
|
198
|
-
assert_path_exists File.join("#{dir}/man5", 'gemfile.5')
|
199
|
-
refute_path_exists File.join("#{dir}/man5", 'gemfile.5.ronn')
|
200
|
-
end
|
201
|
-
end
|
202
|
-
|
203
183
|
def test_install_default_bundler_gem
|
204
184
|
@cmd.extend FileUtils
|
205
185
|
|
@@ -308,8 +288,8 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
|
308
288
|
gemfile_5_ronn = File.join man, 'man5', 'gemfile.5.ronn'
|
309
289
|
gemfile_5_txt = File.join man, 'man5', 'gemfile.5.txt'
|
310
290
|
|
311
|
-
files_that_go = [bundle_b_1_txt, bundle_b_1_ronn, gemfile_5_txt, gemfile_5_ronn]
|
312
|
-
files_that_stay = [ruby_1
|
291
|
+
files_that_go = [bundle_b_1, bundle_b_1_txt, bundle_b_1_ronn, gemfile_5, gemfile_5_txt, gemfile_5_ronn]
|
292
|
+
files_that_stay = [ruby_1]
|
313
293
|
|
314
294
|
create_dummy_files(files_that_go + files_that_stay)
|
315
295
|
|
@@ -326,22 +306,22 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
|
326
306
|
|
327
307
|
@cmd.options[:previous_version] = Gem::Version.new '2.0.2'
|
328
308
|
|
329
|
-
File.open '
|
309
|
+
File.open 'CHANGELOG.md', 'w' do |io|
|
330
310
|
io.puts <<-HISTORY_TXT
|
331
|
-
|
311
|
+
# #{Gem::VERSION} / 2013-03-26
|
332
312
|
|
333
|
-
|
313
|
+
## Bug fixes:
|
334
314
|
* Fixed release note display for LANG=C when installing rubygems
|
335
315
|
* π is tasty
|
336
316
|
|
337
|
-
|
317
|
+
# 2.0.2 / 2013-03-06
|
338
318
|
|
339
|
-
|
319
|
+
## Bug fixes:
|
340
320
|
* Other bugs fixed
|
341
321
|
|
342
|
-
|
322
|
+
# 2.0.1 / 2013-03-05
|
343
323
|
|
344
|
-
|
324
|
+
## Bug fixes:
|
345
325
|
* Yet more bugs fixed
|
346
326
|
HISTORY_TXT
|
347
327
|
end
|
@@ -351,9 +331,9 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
|
351
331
|
end
|
352
332
|
|
353
333
|
expected = <<-EXPECTED
|
354
|
-
|
334
|
+
# #{Gem::VERSION} / 2013-03-26
|
355
335
|
|
356
|
-
|
336
|
+
## Bug fixes:
|
357
337
|
* Fixed release note display for LANG=C when installing rubygems
|
358
338
|
* π is tasty
|
359
339
|
|
@@ -410,4 +390,8 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
|
410
390
|
def default_bundle_bin_path
|
411
391
|
File.join @install_dir, 'bin', 'bundle'
|
412
392
|
end
|
393
|
+
|
394
|
+
def default_bundler_bin_path
|
395
|
+
File.join @install_dir, 'bin', 'bundler'
|
396
|
+
end
|
413
397
|
end unless Gem.java_platform?
|
@@ -946,6 +946,31 @@ class TestGemDependencyInstaller < Gem::TestCase
|
|
946
946
|
assert_equal %w[d-2], inst.installed_gems.map {|s| s.full_name }
|
947
947
|
end
|
948
948
|
|
949
|
+
def test_install_legacy_spec_with_nil_required_rubygems_version
|
950
|
+
path = File.expand_path "../data/null-required-rubygems-version.gemspec.rz", __FILE__
|
951
|
+
spec = Marshal.load Gem.read_binary(path)
|
952
|
+
def spec.validate(*args); end
|
953
|
+
|
954
|
+
util_build_gem spec
|
955
|
+
|
956
|
+
cache_file = File.join @tempdir, 'gems', "#{spec.original_name}.gem"
|
957
|
+
FileUtils.mkdir_p File.dirname cache_file
|
958
|
+
FileUtils.mv spec.cache_file, cache_file
|
959
|
+
|
960
|
+
util_setup_spec_fetcher spec
|
961
|
+
|
962
|
+
data = Gem.read_binary(cache_file)
|
963
|
+
|
964
|
+
@fetcher.data['http://gems.example.com/gems/activesupport-1.0.0.gem'] = data
|
965
|
+
|
966
|
+
dep = Gem::Dependency.new 'activesupport'
|
967
|
+
|
968
|
+
inst = Gem::DependencyInstaller.new
|
969
|
+
inst.install dep
|
970
|
+
|
971
|
+
assert_equal %w[activesupport-1.0.0], Gem::Specification.map(&:full_name)
|
972
|
+
end
|
973
|
+
|
949
974
|
def test_find_gems_gems_with_sources
|
950
975
|
util_setup_gems
|
951
976
|
|
@@ -1102,21 +1127,6 @@ class TestGemDependencyInstaller < Gem::TestCase
|
|
1102
1127
|
assert_equal %w[a-1], requests
|
1103
1128
|
end
|
1104
1129
|
|
1105
|
-
def util_write_a1_bin
|
1106
|
-
write_file File.join('gems', 'a-1', 'bin', 'a_bin') do |fp|
|
1107
|
-
fp.puts "#!/usr/bin/ruby"
|
1108
|
-
end
|
1109
|
-
end
|
1110
|
-
|
1111
|
-
def util_setup_c1_pre
|
1112
|
-
@c1_pre, @c1_pre_gem = util_spec 'c', '1.a' do |s|
|
1113
|
-
s.add_dependency 'a', '1.a'
|
1114
|
-
s.add_dependency 'b', '1'
|
1115
|
-
end
|
1116
|
-
|
1117
|
-
util_reset_gems
|
1118
|
-
end
|
1119
|
-
|
1120
1130
|
def util_setup_d
|
1121
1131
|
@d1, @d1_gem = util_gem 'd', '1'
|
1122
1132
|
@d2, @d2_gem = util_gem 'd', '2'
|
@@ -1124,43 +1134,13 @@ class TestGemDependencyInstaller < Gem::TestCase
|
|
1124
1134
|
util_reset_gems
|
1125
1135
|
end
|
1126
1136
|
|
1127
|
-
def util_setup_wxyz
|
1128
|
-
@x1_m, @x1_m_gem = util_spec 'x', '1' do |s|
|
1129
|
-
s.platform = Gem::Platform.new %w[cpu my_platform 1]
|
1130
|
-
end
|
1131
|
-
|
1132
|
-
@x1_o, @x1_o_gem = util_spec 'x', '1' do |s|
|
1133
|
-
s.platform = Gem::Platform.new %w[cpu other_platform 1]
|
1134
|
-
end
|
1135
|
-
|
1136
|
-
@w1, @w1_gem = util_spec 'w', '1', 'x' => nil
|
1137
|
-
|
1138
|
-
@y1, @y1_gem = util_spec 'y', '1'
|
1139
|
-
@y1_1_p, @y1_1_p_gem = util_spec 'y', '1.1' do |s|
|
1140
|
-
s.platform = Gem::Platform.new %w[cpu my_platform 1]
|
1141
|
-
end
|
1142
|
-
|
1143
|
-
@z1, @z1_gem = util_spec 'z', '1', 'y' => nil
|
1144
|
-
|
1145
|
-
util_reset_gems
|
1146
|
-
end
|
1147
|
-
|
1148
1137
|
def util_reset_gems
|
1149
1138
|
@a1 ||= nil
|
1150
1139
|
@b1 ||= nil
|
1151
1140
|
@a1_pre ||= nil
|
1152
|
-
@c1_pre ||= nil
|
1153
1141
|
@d1 ||= nil
|
1154
1142
|
@d2 ||= nil
|
1155
|
-
|
1156
|
-
@
|
1157
|
-
@x1_o ||= nil
|
1158
|
-
@y1 ||= nil
|
1159
|
-
@y1_1_p ||= nil
|
1160
|
-
@z1 ||= nil
|
1161
|
-
|
1162
|
-
util_setup_spec_fetcher(*[@a1, @a1_pre, @b1, @c1_pre,
|
1163
|
-
@d1, @d2, @x1_m, @x1_o, @w1, @y1,
|
1164
|
-
@y1_1_p, @z1].compact)
|
1143
|
+
|
1144
|
+
util_setup_spec_fetcher(*[@a1, @a1_pre, @b1, @d1, @d2].compact)
|
1165
1145
|
end
|
1166
1146
|
end
|
@@ -14,6 +14,7 @@ class TestGemExtBuilder < Gem::TestCase
|
|
14
14
|
FileUtils.mkdir_p @dest_path
|
15
15
|
|
16
16
|
@orig_DESTDIR = ENV['DESTDIR']
|
17
|
+
@orig_make = ENV['make']
|
17
18
|
|
18
19
|
@spec = util_spec 'a'
|
19
20
|
|
@@ -22,6 +23,7 @@ class TestGemExtBuilder < Gem::TestCase
|
|
22
23
|
|
23
24
|
def teardown
|
24
25
|
ENV['DESTDIR'] = @orig_DESTDIR
|
26
|
+
ENV['make'] = @orig_make
|
25
27
|
|
26
28
|
super
|
27
29
|
end
|
@@ -47,9 +49,9 @@ install:
|
|
47
49
|
|
48
50
|
results = results.join("\n").b
|
49
51
|
|
50
|
-
assert_match %r{
|
51
|
-
assert_match %r{
|
52
|
-
assert_match %r{
|
52
|
+
assert_match %r{DESTDIR\\=#{ENV['DESTDIR']} clean$}, results
|
53
|
+
assert_match %r{DESTDIR\\=#{ENV['DESTDIR']}$}, results
|
54
|
+
assert_match %r{DESTDIR\\=#{ENV['DESTDIR']} install$}, results
|
53
55
|
|
54
56
|
if /nmake/ !~ results
|
55
57
|
assert_match %r{^clean: destination$}, results
|
@@ -76,9 +78,31 @@ install:
|
|
76
78
|
|
77
79
|
results = results.join("\n").b
|
78
80
|
|
79
|
-
assert_match %r{
|
80
|
-
assert_match %r{
|
81
|
-
assert_match %r{
|
81
|
+
assert_match %r{DESTDIR\\=#{ENV['DESTDIR']} clean$}, results
|
82
|
+
assert_match %r{DESTDIR\\=#{ENV['DESTDIR']}$}, results
|
83
|
+
assert_match %r{DESTDIR\\=#{ENV['DESTDIR']} install$}, results
|
84
|
+
end
|
85
|
+
|
86
|
+
def test_custom_make_with_options
|
87
|
+
ENV['make'] = 'make V=1'
|
88
|
+
results = []
|
89
|
+
File.open File.join(@ext, 'Makefile'), 'w' do |io|
|
90
|
+
io.puts <<-MAKEFILE
|
91
|
+
all:
|
92
|
+
\t@#{Gem.ruby} -e "puts 'all: OK'"
|
93
|
+
|
94
|
+
clean:
|
95
|
+
\t@#{Gem.ruby} -e "puts 'clean: OK'"
|
96
|
+
|
97
|
+
install:
|
98
|
+
\t@#{Gem.ruby} -e "puts 'install: OK'"
|
99
|
+
MAKEFILE
|
100
|
+
end
|
101
|
+
Gem::Ext::Builder.make @dest_path, results, @ext
|
102
|
+
results = results.join("\n").b
|
103
|
+
assert_match %r{clean: OK}, results
|
104
|
+
assert_match %r{all: OK}, results
|
105
|
+
assert_match %r{install: OK}, results
|
82
106
|
end
|
83
107
|
|
84
108
|
def test_build_extensions
|
@@ -40,8 +40,7 @@ install (FILES test.txt DESTINATION bin)
|
|
40
40
|
|
41
41
|
output = output.join "\n"
|
42
42
|
|
43
|
-
assert_match
|
44
|
-
%r{^cmake \. -DCMAKE_INSTALL_PREFIX=#{Regexp.escape @dest_path}}, output
|
43
|
+
assert_match %r{^cmake \. -DCMAKE_INSTALL_PREFIX\\=#{Regexp.escape @dest_path}}, output
|
45
44
|
assert_match %r{#{Regexp.escape @ext}}, output
|
46
45
|
assert_contains_make_command '', output
|
47
46
|
assert_contains_make_command 'install', output
|
@@ -58,11 +57,10 @@ install (FILES test.txt DESTINATION bin)
|
|
58
57
|
output = output.join "\n"
|
59
58
|
|
60
59
|
shell_error_msg = %r{(CMake Error: .*)}
|
61
|
-
sh_prefix_cmake = "cmake . -DCMAKE_INSTALL_PREFIX="
|
62
60
|
|
63
61
|
assert_match 'cmake failed', error.message
|
64
62
|
|
65
|
-
assert_match %r{
|
63
|
+
assert_match %r{^cmake . -DCMAKE_INSTALL_PREFIX\\=#{Regexp.escape @dest_path}}, output
|
66
64
|
assert_match %r{#{shell_error_msg}}, output
|
67
65
|
end
|
68
66
|
|
@@ -28,7 +28,7 @@ class TestGemExtConfigureBuilder < Gem::TestCase
|
|
28
28
|
Gem::Ext::ConfigureBuilder.build nil, @dest_path, output, [], nil, @ext
|
29
29
|
|
30
30
|
assert_match(/^current directory:/, output.shift)
|
31
|
-
assert_equal "sh ./configure --prefix
|
31
|
+
assert_equal "sh ./configure --prefix\\=#{@dest_path}", output.shift
|
32
32
|
assert_equal "", output.shift
|
33
33
|
assert_match(/^current directory:/, output.shift)
|
34
34
|
assert_contains_make_command 'clean', output.shift
|
@@ -50,7 +50,7 @@ class TestGemExtConfigureBuilder < Gem::TestCase
|
|
50
50
|
end
|
51
51
|
|
52
52
|
shell_error_msg = %r{(\./configure: .*)|((?:[Cc]an't|cannot) open '?\./configure'?(?:: No such file or directory)?)}
|
53
|
-
sh_prefix_configure = "sh ./configure --prefix
|
53
|
+
sh_prefix_configure = "sh ./configure --prefix\\="
|
54
54
|
|
55
55
|
assert_match 'configure failed', error.message
|
56
56
|
|
@@ -821,6 +821,8 @@ gem 'other', version
|
|
821
821
|
|
822
822
|
assert !File.exist?(system_path), 'plugin written incorrect written to system plugins_dir'
|
823
823
|
assert File.exist?(build_root_path), 'plugin not written to build_root'
|
824
|
+
|
825
|
+
refute_includes File.read(build_root_path), build_root
|
824
826
|
end
|
825
827
|
|
826
828
|
def test_keeps_plugins_up_to_date
|
@@ -1172,12 +1174,16 @@ gem 'other', version
|
|
1172
1174
|
end
|
1173
1175
|
|
1174
1176
|
def test_install_force
|
1177
|
+
_, missing_dep_gem = util_gem 'missing_dep', '1' do |s|
|
1178
|
+
s.add_dependency 'doesnt_exist', '1'
|
1179
|
+
end
|
1180
|
+
|
1175
1181
|
use_ui @ui do
|
1176
|
-
installer = Gem::Installer.at
|
1182
|
+
installer = Gem::Installer.at missing_dep_gem, :force => true
|
1177
1183
|
installer.install
|
1178
1184
|
end
|
1179
1185
|
|
1180
|
-
gem_dir = File.join(@gemhome, 'gems', '
|
1186
|
+
gem_dir = File.join(@gemhome, 'gems', 'missing_dep-1')
|
1181
1187
|
assert_path_exists gem_dir
|
1182
1188
|
end
|
1183
1189
|
|
@@ -1620,54 +1626,6 @@ gem 'other', version
|
|
1620
1626
|
end
|
1621
1627
|
end
|
1622
1628
|
|
1623
|
-
def test_pre_install_checks_ruby_version
|
1624
|
-
use_ui @ui do
|
1625
|
-
installer = Gem::Installer.at old_ruby_required('= 1.4.6')
|
1626
|
-
e = assert_raises Gem::RuntimeRequirementNotMetError do
|
1627
|
-
installer.pre_install_checks
|
1628
|
-
end
|
1629
|
-
rv = Gem.ruby_version
|
1630
|
-
assert_equal "old_ruby_required requires Ruby version = 1.4.6. The current ruby version is #{rv}.",
|
1631
|
-
e.message
|
1632
|
-
end
|
1633
|
-
end
|
1634
|
-
|
1635
|
-
def test_pre_install_checks_ruby_version_with_prereleases
|
1636
|
-
util_set_RUBY_VERSION '2.6.0', -1, '63539', 'ruby 2.6.0preview2 (2018-05-31 trunk 63539) [x86_64-linux]'
|
1637
|
-
|
1638
|
-
installer = Gem::Installer.at old_ruby_required('>= 2.6.0.preview2')
|
1639
|
-
assert installer.pre_install_checks
|
1640
|
-
|
1641
|
-
installer = Gem::Installer.at old_ruby_required('> 2.6.0.preview2')
|
1642
|
-
e = assert_raises Gem::RuntimeRequirementNotMetError do
|
1643
|
-
assert installer.pre_install_checks
|
1644
|
-
end
|
1645
|
-
assert_equal "old_ruby_required requires Ruby version > 2.6.0.preview2. The current ruby version is 2.6.0.preview2.",
|
1646
|
-
e.message
|
1647
|
-
ensure
|
1648
|
-
util_restore_RUBY_VERSION
|
1649
|
-
end
|
1650
|
-
|
1651
|
-
def test_pre_install_checks_wrong_rubygems_version
|
1652
|
-
spec = util_spec 'old_rubygems_required', '1' do |s|
|
1653
|
-
s.required_rubygems_version = '< 0'
|
1654
|
-
end
|
1655
|
-
|
1656
|
-
util_build_gem spec
|
1657
|
-
|
1658
|
-
gem = File.join(@gemhome, 'cache', spec.file_name)
|
1659
|
-
|
1660
|
-
use_ui @ui do
|
1661
|
-
installer = Gem::Installer.at gem
|
1662
|
-
e = assert_raises Gem::RuntimeRequirementNotMetError do
|
1663
|
-
installer.pre_install_checks
|
1664
|
-
end
|
1665
|
-
rgv = Gem::VERSION
|
1666
|
-
assert_equal "old_rubygems_required requires RubyGems version < 0. The current RubyGems version is #{rgv}. " +
|
1667
|
-
"Try 'gem update --system' to update RubyGems itself.", e.message
|
1668
|
-
end
|
1669
|
-
end
|
1670
|
-
|
1671
1629
|
def test_pre_install_checks_malicious_name
|
1672
1630
|
spec = util_spec '../malicious', '1'
|
1673
1631
|
def spec.full_name # so the spec is buildable
|
@@ -2252,16 +2210,6 @@ gem 'other', version
|
|
2252
2210
|
assert_kind_of(String, installer.gem)
|
2253
2211
|
end
|
2254
2212
|
|
2255
|
-
def old_ruby_required(requirement)
|
2256
|
-
spec = util_spec 'old_ruby_required', '1' do |s|
|
2257
|
-
s.required_ruby_version = requirement
|
2258
|
-
end
|
2259
|
-
|
2260
|
-
util_build_gem spec
|
2261
|
-
|
2262
|
-
spec.cache_file
|
2263
|
-
end
|
2264
|
-
|
2265
2213
|
def util_execless
|
2266
2214
|
@spec = util_spec 'z'
|
2267
2215
|
util_build_gem @spec
|
@@ -356,6 +356,14 @@ class TestGemPlatform < Gem::TestCase
|
|
356
356
|
assert_local_match 'sparc-solaris2.8-mq5.3'
|
357
357
|
end
|
358
358
|
|
359
|
+
def test_inspect
|
360
|
+
result = Gem::Platform.new("universal-java11").inspect
|
361
|
+
|
362
|
+
assert_equal 1, result.scan(/@cpu=/).size
|
363
|
+
assert_equal 1, result.scan(/@os=/).size
|
364
|
+
assert_equal 1, result.scan(/@version=/).size
|
365
|
+
end
|
366
|
+
|
359
367
|
def assert_local_match(name)
|
360
368
|
assert_match Gem::Platform.local, name
|
361
369
|
end
|