rubygems-update 3.2.3 → 3.2.8
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} +480 -427
- data/Manifest.txt +30 -27
- data/Rakefile +20 -28
- data/bundler/CHANGELOG.md +73 -2
- data/bundler/bundler.gemspec +1 -1
- data/bundler/lib/bundler.rb +0 -1
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli.rb +3 -5
- data/bundler/lib/bundler/cli/cache.rb +1 -0
- data/bundler/lib/bundler/cli/gem.rb +14 -0
- data/bundler/lib/bundler/compact_index_client/updater.rb +0 -8
- data/bundler/lib/bundler/definition.rb +17 -27
- 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_version_promoter.rb +2 -2
- data/bundler/lib/bundler/index.rb +6 -5
- data/bundler/lib/bundler/installer.rb +0 -17
- data/bundler/lib/bundler/installer/standalone.rb +15 -0
- data/bundler/lib/bundler/lazy_specification.rb +9 -18
- 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 +82 -43
- data/bundler/lib/bundler/resolver/spec_group.rb +56 -44
- data/bundler/lib/bundler/rubygems_ext.rb +16 -0
- data/bundler/lib/bundler/settings.rb +1 -1
- data/bundler/lib/bundler/shared_helpers.rb +2 -2
- 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/source_list.rb +2 -4
- data/bundler/lib/bundler/spec_set.rb +5 -4
- data/bundler/lib/bundler/templates/newgem/CHANGELOG.md.tt +5 -0
- 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/dependency_graph.rb +0 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +11 -5
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +2 -2
- 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/vendor/thor/lib/thor.rb +5 -6
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +4 -2
- data/bundler/lib/bundler/vendor/thor/lib/thor/error.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +5 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/options.rb +9 -8
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +5 -2
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/color.rb +5 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- 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/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/installer_uninstaller_utils.rb +6 -1
- data/lib/rubygems/platform.rb +0 -4
- data/lib/rubygems/remote_fetcher.rb +3 -1
- data/lib/rubygems/requirement.rb +1 -1
- data/lib/rubygems/resolver/best_set.rb +1 -1
- data/lib/rubygems/resolver/index_specification.rb +8 -2
- data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb +7 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb +0 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/vertex.rb +11 -5
- data/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb +2 -2
- data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/specification_provider.rb +11 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb +11 -7
- 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-ruby-version.gemspec.rz +0 -0
- 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_setup_command.rb +21 -37
- data/test/rubygems/test_gem_dependency_installer.rb +52 -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 +2 -0
- 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 +35 -1
- data/test/rubygems/test_gem_resolver_best_set.rb +23 -0
- 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,56 @@ 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_ruby_version
|
950
|
+
path = File.expand_path "../data/null-required-ruby-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
|
+
|
974
|
+
def test_install_legacy_spec_with_nil_required_rubygems_version
|
975
|
+
path = File.expand_path "../data/null-required-rubygems-version.gemspec.rz", __FILE__
|
976
|
+
spec = Marshal.load Gem.read_binary(path)
|
977
|
+
def spec.validate(*args); end
|
978
|
+
|
979
|
+
util_build_gem spec
|
980
|
+
|
981
|
+
cache_file = File.join @tempdir, 'gems', "#{spec.original_name}.gem"
|
982
|
+
FileUtils.mkdir_p File.dirname cache_file
|
983
|
+
FileUtils.mv spec.cache_file, cache_file
|
984
|
+
|
985
|
+
util_setup_spec_fetcher spec
|
986
|
+
|
987
|
+
data = Gem.read_binary(cache_file)
|
988
|
+
|
989
|
+
@fetcher.data['http://gems.example.com/gems/activesupport-1.0.0.gem'] = data
|
990
|
+
|
991
|
+
dep = Gem::Dependency.new 'activesupport'
|
992
|
+
|
993
|
+
inst = Gem::DependencyInstaller.new
|
994
|
+
inst.install dep
|
995
|
+
|
996
|
+
assert_equal %w[activesupport-1.0.0], Gem::Specification.map(&:full_name)
|
997
|
+
end
|
998
|
+
|
949
999
|
def test_find_gems_gems_with_sources
|
950
1000
|
util_setup_gems
|
951
1001
|
|
@@ -1102,21 +1152,6 @@ class TestGemDependencyInstaller < Gem::TestCase
|
|
1102
1152
|
assert_equal %w[a-1], requests
|
1103
1153
|
end
|
1104
1154
|
|
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
1155
|
def util_setup_d
|
1121
1156
|
@d1, @d1_gem = util_gem 'd', '1'
|
1122
1157
|
@d2, @d2_gem = util_gem 'd', '2'
|
@@ -1124,43 +1159,13 @@ class TestGemDependencyInstaller < Gem::TestCase
|
|
1124
1159
|
util_reset_gems
|
1125
1160
|
end
|
1126
1161
|
|
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
1162
|
def util_reset_gems
|
1149
1163
|
@a1 ||= nil
|
1150
1164
|
@b1 ||= nil
|
1151
1165
|
@a1_pre ||= nil
|
1152
|
-
@c1_pre ||= nil
|
1153
1166
|
@d1 ||= nil
|
1154
1167
|
@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)
|
1168
|
+
|
1169
|
+
util_setup_spec_fetcher(*[@a1, @a1_pre, @b1, @d1, @d2].compact)
|
1165
1170
|
end
|
1166
1171
|
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
|
@@ -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
|
@@ -83,7 +83,7 @@ class TestGemRequirement < Gem::TestCase
|
|
83
83
|
Gem::Requirement.parse(Gem::Version.new('2'))
|
84
84
|
end
|
85
85
|
|
86
|
-
if RUBY_VERSION >= '2.5'
|
86
|
+
if RUBY_VERSION >= '2.5' && !(Gem.java_platform? && ENV["JRUBY_OPTS"] =~ /--debug/)
|
87
87
|
def test_parse_deduplication
|
88
88
|
assert_same '~>', Gem::Requirement.parse('~> 1').first
|
89
89
|
end
|
@@ -402,6 +402,27 @@ class TestGemRequirement < Gem::TestCase
|
|
402
402
|
assert_equal r1.hash, r2.hash
|
403
403
|
end
|
404
404
|
|
405
|
+
def test_hash_returns_equal_hashes_for_equivalent_requirements
|
406
|
+
refute_requirement_hash_equal "= 1.2", "= 1.3"
|
407
|
+
refute_requirement_hash_equal "= 1.3", "= 1.2"
|
408
|
+
|
409
|
+
refute_requirement_hash_equal "~> 1.3", "~> 1.3.0"
|
410
|
+
refute_requirement_hash_equal "~> 1.3.0", "~> 1.3"
|
411
|
+
|
412
|
+
assert_requirement_hash_equal ["> 2", "~> 1.3", "~> 1.3.1"], ["~> 1.3.1", "~> 1.3", "> 2"]
|
413
|
+
|
414
|
+
assert_requirement_hash_equal ["> 2", "~> 1.3"], ["> 2.0", "~> 1.3"]
|
415
|
+
assert_requirement_hash_equal ["> 2.0", "~> 1.3"], ["> 2", "~> 1.3"]
|
416
|
+
|
417
|
+
assert_requirement_hash_equal "= 1.0", "= 1.0.0"
|
418
|
+
assert_requirement_hash_equal "= 1.1", "= 1.1.0"
|
419
|
+
assert_requirement_hash_equal "= 1", "= 1.0.0"
|
420
|
+
|
421
|
+
assert_requirement_hash_equal "1.0", "1.0.0"
|
422
|
+
assert_requirement_hash_equal "1.1", "1.1.0"
|
423
|
+
assert_requirement_hash_equal "1", "1.0.0"
|
424
|
+
end
|
425
|
+
|
405
426
|
# Assert that two requirements are equal. Handles Gem::Requirements,
|
406
427
|
# strings, arrays, numbers, and versions.
|
407
428
|
|
@@ -416,6 +437,13 @@ class TestGemRequirement < Gem::TestCase
|
|
416
437
|
"#{requirement} is satisfied by #{version}"
|
417
438
|
end
|
418
439
|
|
440
|
+
# Assert that two requirement hashes are equal. Handles Gem::Requirements,
|
441
|
+
# strings, arrays, numbers, and versions.
|
442
|
+
|
443
|
+
def assert_requirement_hash_equal(expected, actual)
|
444
|
+
assert_equal req(expected).hash, req(actual).hash
|
445
|
+
end
|
446
|
+
|
419
447
|
# Refute the assumption that two requirements are equal.
|
420
448
|
|
421
449
|
def refute_requirement_equal(unexpected, actual)
|
@@ -428,4 +456,10 @@ class TestGemRequirement < Gem::TestCase
|
|
428
456
|
refute req(requirement).satisfied_by?(v(version)),
|
429
457
|
"#{requirement} is not satisfied by #{version}"
|
430
458
|
end
|
459
|
+
|
460
|
+
# Refute the assumption that two requirements hashes are equal.
|
461
|
+
|
462
|
+
def refute_requirement_hash_equal(unexpected, actual)
|
463
|
+
refute_equal req(unexpected).hash, req(actual).hash
|
464
|
+
end
|
431
465
|
end
|