rubygems-update 1.5.3 → 1.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.
- data.tar.gz.sig +2 -1
- data/History.txt +60 -9
- data/Manifest.txt +1 -1
- data/Rakefile +0 -2
- data/lib/rubygems.rb +142 -65
- data/lib/rubygems/commands/owner_command.rb +3 -2
- data/lib/rubygems/commands/pristine_command.rb +5 -3
- data/lib/rubygems/commands/push_command.rb +8 -4
- data/lib/rubygems/commands/setup_command.rb +1 -2
- data/lib/rubygems/commands/uninstall_command.rb +5 -0
- data/lib/rubygems/commands/unpack_command.rb +10 -16
- data/lib/rubygems/config_file.rb +12 -5
- data/lib/rubygems/custom_require.rb +27 -7
- data/lib/rubygems/dependency.rb +33 -8
- data/lib/rubygems/dependency_installer.rb +21 -6
- data/lib/rubygems/dependency_list.rb +35 -3
- data/lib/rubygems/doc_manager.rb +6 -4
- data/lib/rubygems/gem_path_searcher.rb +45 -1
- data/lib/rubygems/gemcutter_utilities.rb +33 -0
- data/lib/rubygems/indexer.rb +1 -0
- data/lib/rubygems/installer.rb +11 -7
- data/lib/rubygems/installer_test_case.rb +23 -15
- data/lib/rubygems/mock_gem_ui.rb +1 -1
- data/lib/rubygems/remote_fetcher.rb +29 -10
- data/lib/rubygems/requirement.rb +1 -1
- data/lib/rubygems/security.rb +1 -0
- data/lib/rubygems/source_index.rb +3 -2
- data/lib/rubygems/spec_fetcher.rb +3 -1
- data/lib/rubygems/specification.rb +54 -12
- data/lib/rubygems/test_case.rb +99 -28
- data/lib/rubygems/test_utilities.rb +11 -1
- data/lib/rubygems/uninstaller.rb +22 -11
- data/lib/rubygems/user_interaction.rb +50 -29
- data/lib/rubygems/validator.rb +1 -1
- data/test/rubygems/fix_openssl_warnings.rb +12 -0
- data/test/rubygems/plugin/load/rubygems_plugin.rb +3 -1
- data/test/rubygems/test_gem.rb +384 -38
- data/test/rubygems/test_gem_builder.rb +1 -1
- data/test/rubygems/test_gem_command_manager.rb +2 -2
- data/test/rubygems/test_gem_commands_build_command.rb +1 -1
- data/test/rubygems/test_gem_commands_cert_command.rb +2 -1
- data/test/rubygems/test_gem_commands_dependency_command.rb +6 -5
- data/test/rubygems/test_gem_commands_fetch_command.rb +4 -4
- data/test/rubygems/test_gem_commands_install_command.rb +21 -18
- data/test/rubygems/test_gem_commands_lock_command.rb +1 -1
- data/test/rubygems/test_gem_commands_outdated_command.rb +2 -5
- data/test/rubygems/test_gem_commands_owner_command.rb +42 -0
- data/test/rubygems/test_gem_commands_pristine_command.rb +28 -8
- data/test/rubygems/test_gem_commands_push_command.rb +31 -5
- data/test/rubygems/test_gem_commands_specification_command.rb +8 -8
- data/test/rubygems/test_gem_commands_stale_command.rb +4 -2
- data/test/rubygems/test_gem_commands_uninstall_command.rb +23 -4
- data/test/rubygems/test_gem_commands_unpack_command.rb +10 -8
- data/test/rubygems/test_gem_commands_update_command.rb +16 -13
- data/test/rubygems/test_gem_commands_which_command.rb +1 -1
- data/test/rubygems/test_gem_config_file.rb +14 -0
- data/test/rubygems/test_gem_dependency.rb +39 -0
- data/test/rubygems/test_gem_dependency_installer.rb +213 -92
- data/test/rubygems/test_gem_dependency_list.rb +37 -17
- data/test/rubygems/test_gem_doc_manager.rb +5 -4
- data/test/rubygems/test_gem_format.rb +2 -2
- data/test/rubygems/test_gem_gemcutter_utilities.rb +48 -0
- data/test/rubygems/test_gem_indexer.rb +11 -10
- data/test/rubygems/test_gem_install_update_options.rb +0 -2
- data/test/rubygems/test_gem_installer.rb +151 -78
- data/test/rubygems/test_gem_package_tar_output.rb +3 -0
- data/test/rubygems/test_gem_remote_fetcher.rb +23 -14
- data/test/rubygems/test_gem_requirement.rb +4 -0
- data/test/rubygems/test_gem_security.rb +1 -0
- data/test/rubygems/test_gem_source_index.rb +17 -16
- data/test/rubygems/test_gem_spec_fetcher.rb +6 -1
- data/test/rubygems/test_gem_specification.rb +81 -31
- data/test/rubygems/test_gem_stream_ui.rb +11 -1
- data/test/rubygems/test_gem_uninstaller.rb +70 -10
- data/test/rubygems/test_gem_validator.rb +1 -1
- data/test/rubygems/test_kernel.rb +1 -1
- metadata +7 -7
- metadata.gz.sig +0 -0
- data/ChangeLog +0 -5811
@@ -49,6 +49,9 @@ class TestGemPackageTarOutput < Gem::Package::TarTestCase
|
|
49
49
|
|
50
50
|
if defined? OpenSSL then
|
51
51
|
def test_self_open_signed
|
52
|
+
@private_key = File.expand_path('test/rubygems/private_key.pem', @@project_dir)
|
53
|
+
@public_cert = File.expand_path('test/rubygems/public_cert.pem', @@project_dir)
|
54
|
+
|
52
55
|
signer = Gem::Security::Signer.new @private_key, [@public_cert]
|
53
56
|
|
54
57
|
open @file, 'wb' do |tar_io|
|
@@ -93,9 +93,10 @@ gems:
|
|
93
93
|
|
94
94
|
# REFACTOR: copied from test_gem_dependency_installer.rb
|
95
95
|
@gems_dir = File.join @tempdir, 'gems'
|
96
|
-
@cache_dir =
|
96
|
+
@cache_dir = Gem.cache_dir(@gemhome)
|
97
97
|
FileUtils.mkdir @gems_dir
|
98
98
|
|
99
|
+
# TODO: why does the remote fetcher need it written to disk?
|
99
100
|
@a1, @a1_gem = util_gem 'a', '1' do |s| s.executables << 'a_bin' end
|
100
101
|
|
101
102
|
Gem::RemoteFetcher.fetcher = nil
|
@@ -202,7 +203,7 @@ gems:
|
|
202
203
|
|
203
204
|
fetcher = util_fuck_with_fetcher a1_data
|
204
205
|
|
205
|
-
a1_cache_gem =
|
206
|
+
a1_cache_gem = Gem.cache_gem(@a1.file_name, @gemhome)
|
206
207
|
assert_equal a1_cache_gem, fetcher.download(@a1, 'http://gems.example.com')
|
207
208
|
assert_equal("http://gems.example.com/gems/a-1.gem",
|
208
209
|
fetcher.instance_variable_get(:@test_arg).to_s)
|
@@ -214,7 +215,7 @@ gems:
|
|
214
215
|
|
215
216
|
inst = Gem::RemoteFetcher.fetcher
|
216
217
|
|
217
|
-
assert_equal
|
218
|
+
assert_equal Gem.cache_gem(@a1.file_name, @gemhome),
|
218
219
|
inst.download(@a1, 'http://gems.example.com')
|
219
220
|
end
|
220
221
|
|
@@ -227,7 +228,7 @@ gems:
|
|
227
228
|
inst = Gem::RemoteFetcher.fetcher
|
228
229
|
end
|
229
230
|
|
230
|
-
assert_equal
|
231
|
+
assert_equal Gem.cache_gem(@a1.file_name, @gemhome),
|
231
232
|
inst.download(@a1, local_path)
|
232
233
|
end
|
233
234
|
|
@@ -242,7 +243,7 @@ gems:
|
|
242
243
|
inst = Gem::RemoteFetcher.fetcher
|
243
244
|
end
|
244
245
|
|
245
|
-
assert_equal
|
246
|
+
assert_equal Gem.cache_gem(@a1.file_name, @gemhome),
|
246
247
|
inst.download(@a1, local_path)
|
247
248
|
end
|
248
249
|
|
@@ -256,7 +257,7 @@ gems:
|
|
256
257
|
|
257
258
|
install_dir = File.join @tempdir, 'more_gems'
|
258
259
|
|
259
|
-
a1_cache_gem =
|
260
|
+
a1_cache_gem = Gem.cache_gem(@a1.file_name, install_dir)
|
260
261
|
FileUtils.mkdir_p(File.dirname(a1_cache_gem))
|
261
262
|
actual = fetcher.download(@a1, 'http://gems.example.com', install_dir)
|
262
263
|
|
@@ -272,7 +273,7 @@ gems:
|
|
272
273
|
FileUtils.mv @a1_gem, @tempdir
|
273
274
|
local_path = File.join @tempdir, @a1.file_name
|
274
275
|
inst = nil
|
275
|
-
File.chmod 0555,
|
276
|
+
File.chmod 0555, Gem.cache_dir(@gemhome)
|
276
277
|
|
277
278
|
Dir.chdir @tempdir do
|
278
279
|
inst = Gem::RemoteFetcher.fetcher
|
@@ -281,19 +282,19 @@ gems:
|
|
281
282
|
assert_equal File.join(@tempdir, @a1.file_name),
|
282
283
|
inst.download(@a1, local_path)
|
283
284
|
ensure
|
284
|
-
File.chmod 0755,
|
285
|
+
File.chmod 0755, Gem.cache_dir(@gemhome)
|
285
286
|
end
|
286
287
|
|
287
288
|
def test_download_read_only
|
288
|
-
File.chmod 0555,
|
289
|
+
File.chmod 0555, Gem.cache_dir(@gemhome)
|
289
290
|
File.chmod 0555, File.join(@gemhome)
|
290
291
|
|
291
292
|
fetcher = util_fuck_with_fetcher File.read(@a1_gem)
|
292
293
|
fetcher.download(@a1, 'http://gems.example.com')
|
293
|
-
assert File.exist?(
|
294
|
+
assert File.exist?(Gem.cache_gem(@a1.file_name, Gem.user_dir))
|
294
295
|
ensure
|
295
|
-
File.chmod 0755,
|
296
|
-
File.chmod 0755,
|
296
|
+
File.chmod 0755, @gemhome
|
297
|
+
File.chmod 0755, Gem.cache_dir(@gemhome)
|
297
298
|
end
|
298
299
|
end
|
299
300
|
|
@@ -312,7 +313,7 @@ gems:
|
|
312
313
|
|
313
314
|
fetcher = util_fuck_with_fetcher e1_data, :blow_chunks
|
314
315
|
|
315
|
-
e1_cache_gem =
|
316
|
+
e1_cache_gem = Gem.cache_gem(e1.file_name, @gemhome)
|
316
317
|
|
317
318
|
assert_equal e1_cache_gem, fetcher.download(e1, 'http://gems.example.com')
|
318
319
|
|
@@ -330,7 +331,7 @@ gems:
|
|
330
331
|
inst = Gem::RemoteFetcher.fetcher
|
331
332
|
end
|
332
333
|
|
333
|
-
cache_path =
|
334
|
+
cache_path = Gem.cache_gem(@a1.file_name, @gemhome)
|
334
335
|
FileUtils.mv local_path, cache_path
|
335
336
|
|
336
337
|
gem = Gem::Format.from_file_by_path cache_path
|
@@ -738,5 +739,13 @@ gems:
|
|
738
739
|
end
|
739
740
|
end
|
740
741
|
|
742
|
+
def test_correct_for_windows_path
|
743
|
+
path = "/C:/WINDOWS/Temp/gems"
|
744
|
+
assert_equal "C:/WINDOWS/Temp/gems", @fetcher.correct_for_windows_path(path)
|
745
|
+
|
746
|
+
path = "/home/skillet"
|
747
|
+
assert_equal "/home/skillet", @fetcher.correct_for_windows_path(path)
|
748
|
+
end
|
749
|
+
|
741
750
|
end
|
742
751
|
|
@@ -187,11 +187,15 @@ class TestGemRequirement < Gem::TestCase
|
|
187
187
|
assert_satisfied_by " ", "> 0.a "
|
188
188
|
assert_satisfied_by "", " > 0.a"
|
189
189
|
assert_satisfied_by "3.1", "< 3.2.rc1"
|
190
|
+
|
190
191
|
assert_satisfied_by "3.2.0", "> 3.2.0.rc1"
|
191
192
|
assert_satisfied_by "3.2.0.rc2", "> 3.2.0.rc1"
|
193
|
+
|
192
194
|
assert_satisfied_by "3.0.rc2", "< 3.0"
|
193
195
|
assert_satisfied_by "3.0.rc2", "< 3.0.0"
|
194
196
|
assert_satisfied_by "3.0.rc2", "< 3.0.1"
|
197
|
+
|
198
|
+
assert_satisfied_by "3.0.rc2", "> 0"
|
195
199
|
end
|
196
200
|
|
197
201
|
def test_illformed_requirements
|
@@ -17,7 +17,7 @@ class TestGemSourceIndex < Gem::TestCase
|
|
17
17
|
|
18
18
|
FileUtils.mkdir_p spec_dir
|
19
19
|
|
20
|
-
a1 =
|
20
|
+
a1 = quick_spec 'a', '1' do |spec| spec.author = 'author 1' end
|
21
21
|
|
22
22
|
spec_file = File.join spec_dir, a1.spec_name
|
23
23
|
|
@@ -38,7 +38,7 @@ class TestGemSourceIndex < Gem::TestCase
|
|
38
38
|
|
39
39
|
FileUtils.mkdir_p spec_dir
|
40
40
|
|
41
|
-
a1 =
|
41
|
+
a1 = quick_spec 'a', '1' do |spec| spec.author = 'author 1' end
|
42
42
|
|
43
43
|
spec_file = File.join spec_dir, a1.spec_name
|
44
44
|
|
@@ -208,24 +208,24 @@ end
|
|
208
208
|
end
|
209
209
|
|
210
210
|
def test_latest_specs
|
211
|
-
p1_ruby =
|
212
|
-
p1_platform =
|
211
|
+
p1_ruby = quick_spec 'p', '1'
|
212
|
+
p1_platform = quick_spec 'p', '1' do |spec|
|
213
213
|
spec.platform = Gem::Platform::CURRENT
|
214
214
|
end
|
215
215
|
|
216
|
-
a1_platform =
|
216
|
+
a1_platform = quick_spec @a1.name, (@a1.version) do |s|
|
217
217
|
s.platform = Gem::Platform.new 'x86-my_platform1'
|
218
218
|
end
|
219
219
|
|
220
|
-
a2_platform =
|
220
|
+
a2_platform = quick_spec @a2.name, (@a2.version) do |s|
|
221
221
|
s.platform = Gem::Platform.new 'x86-my_platform1'
|
222
222
|
end
|
223
223
|
|
224
|
-
a2_platform_other =
|
224
|
+
a2_platform_other = quick_spec @a2.name, (@a2.version) do |s|
|
225
225
|
s.platform = Gem::Platform.new 'x86-other_platform1'
|
226
226
|
end
|
227
227
|
|
228
|
-
a3_platform_other =
|
228
|
+
a3_platform_other = quick_spec @a2.name, (@a2.version.bump) do |s|
|
229
229
|
s.platform = Gem::Platform.new 'x86-other_platform1'
|
230
230
|
end
|
231
231
|
|
@@ -260,8 +260,8 @@ end
|
|
260
260
|
FileUtils.mkdir_p spec_dir1
|
261
261
|
FileUtils.mkdir_p spec_dir2
|
262
262
|
|
263
|
-
a1 =
|
264
|
-
a2 =
|
263
|
+
a1 = quick_spec 'a', '1' do |spec| spec.author = 'author 1' end
|
264
|
+
a2 = quick_spec 'a', '1' do |spec| spec.author = 'author 2' end
|
265
265
|
|
266
266
|
File.open File.join(spec_dir1, a1.spec_name), 'w' do |fp|
|
267
267
|
fp.write a1.to_ruby
|
@@ -281,12 +281,12 @@ end
|
|
281
281
|
|
282
282
|
assert_equal [], @source_index.outdated
|
283
283
|
|
284
|
-
updated =
|
284
|
+
updated = quick_spec @a2.name, (@a2.version.bump)
|
285
285
|
util_setup_spec_fetcher updated
|
286
286
|
|
287
287
|
assert_equal [updated.name], @source_index.outdated
|
288
288
|
|
289
|
-
updated_platform =
|
289
|
+
updated_platform = quick_spec @a2.name, (updated.version.bump) do |s|
|
290
290
|
s.platform = Gem::Platform.new 'x86-other_platform1'
|
291
291
|
end
|
292
292
|
|
@@ -296,10 +296,11 @@ end
|
|
296
296
|
end
|
297
297
|
|
298
298
|
def test_prerelease_specs_kept_in_right_place
|
299
|
-
gem_a1_alpha =
|
299
|
+
gem_a1_alpha = quick_spec 'abba', '1.a'
|
300
300
|
@source_index.add_spec gem_a1_alpha
|
301
301
|
|
302
302
|
refute @source_index.latest_specs.include?(gem_a1_alpha)
|
303
|
+
assert @source_index.latest_specs(true).include?(gem_a1_alpha)
|
303
304
|
assert @source_index.find_name(gem_a1_alpha.full_name).empty?
|
304
305
|
assert @source_index.prerelease_specs.include?(gem_a1_alpha)
|
305
306
|
end
|
@@ -357,11 +358,11 @@ end
|
|
357
358
|
def test_search_platform
|
358
359
|
util_set_arch 'x86-my_platform1'
|
359
360
|
|
360
|
-
a1 =
|
361
|
-
a1_mine =
|
361
|
+
a1 = quick_spec 'a', '1'
|
362
|
+
a1_mine = quick_spec 'a', '1' do |s|
|
362
363
|
s.platform = Gem::Platform.new 'x86-my_platform1'
|
363
364
|
end
|
364
|
-
a1_other =
|
365
|
+
a1_other = quick_spec 'a', '1' do |s|
|
365
366
|
s.platform = Gem::Platform.new 'x86-other_platform1'
|
366
367
|
end
|
367
368
|
|
@@ -10,7 +10,7 @@ class TestGemSpecFetcher < Gem::TestCase
|
|
10
10
|
|
11
11
|
util_setup_fake_fetcher
|
12
12
|
|
13
|
-
@a_pre =
|
13
|
+
@a_pre = quick_spec 'a', '1.a'
|
14
14
|
@source_index.add_spec @pl1
|
15
15
|
@source_index.add_spec @a_pre
|
16
16
|
|
@@ -406,5 +406,10 @@ class TestGemSpecFetcher < Gem::TestCase
|
|
406
406
|
assert_equal @latest_specs, latest_specs
|
407
407
|
end
|
408
408
|
|
409
|
+
def test_cache_dir_escapes_windows_paths
|
410
|
+
uri = URI.parse("file:///C:/WINDOWS/Temp/gem_repo")
|
411
|
+
cache_dir = @sf.cache_dir(uri).gsub(@sf.dir, '')
|
412
|
+
assert cache_dir !~ /:/, "#{cache_dir} should not contain a :"
|
413
|
+
end
|
409
414
|
end
|
410
415
|
|
@@ -40,6 +40,7 @@ end
|
|
40
40
|
def setup
|
41
41
|
super
|
42
42
|
|
43
|
+
# TODO: there is no reason why the spec tests need to write to disk
|
43
44
|
@a1 = quick_gem 'a', '1' do |s|
|
44
45
|
s.executable = 'exec'
|
45
46
|
s.extensions << 'ext/a/extconf.rb'
|
@@ -295,7 +296,7 @@ end
|
|
295
296
|
end
|
296
297
|
|
297
298
|
def test_add_dependency_with_explicit_type
|
298
|
-
gem =
|
299
|
+
gem = quick_spec "awesome", "1.0" do |awesome|
|
299
300
|
awesome.add_development_dependency "monkey"
|
300
301
|
end
|
301
302
|
|
@@ -365,25 +366,18 @@ end
|
|
365
366
|
end
|
366
367
|
|
367
368
|
def test_dependencies
|
368
|
-
|
369
|
-
|
370
|
-
pqa = Gem::Dependency.new 'pqa', ['> 0.4', '<= 0.6']
|
371
|
-
|
372
|
-
assert_equal [rake, jabber, pqa], @a1.dependencies
|
369
|
+
util_setup_deps
|
370
|
+
assert_equal [@bonobo, @monkey], @gem.dependencies
|
373
371
|
end
|
374
372
|
|
375
|
-
def
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
end
|
380
|
-
|
381
|
-
bonobo = Gem::Dependency.new("bonobo", [])
|
382
|
-
monkey = Gem::Dependency.new("monkey", [], :development)
|
373
|
+
def test_runtime_dependencies
|
374
|
+
util_setup_deps
|
375
|
+
assert_equal [@bonobo], @gem.runtime_dependencies
|
376
|
+
end
|
383
377
|
|
384
|
-
|
385
|
-
|
386
|
-
assert_equal
|
378
|
+
def test_development_dependencies
|
379
|
+
util_setup_deps
|
380
|
+
assert_equal [@monkey], @gem.development_dependencies
|
387
381
|
end
|
388
382
|
|
389
383
|
def test_description
|
@@ -391,8 +385,8 @@ end
|
|
391
385
|
end
|
392
386
|
|
393
387
|
def test_eql_eh
|
394
|
-
g1 =
|
395
|
-
g2 =
|
388
|
+
g1 = quick_spec 'gem'
|
389
|
+
g2 = quick_spec 'gem'
|
396
390
|
|
397
391
|
assert_equal g1, g2
|
398
392
|
assert_equal g1.hash, g2.hash
|
@@ -691,7 +685,7 @@ end
|
|
691
685
|
end
|
692
686
|
|
693
687
|
def test_prerelease_spec_adds_required_rubygems_version
|
694
|
-
@prerelease =
|
688
|
+
@prerelease = quick_spec('tardis', '2.2.0.a')
|
695
689
|
refute @prerelease.required_rubygems_version.satisfied_by?(Gem::Version.new('1.3.1'))
|
696
690
|
assert @prerelease.required_rubygems_version.satisfied_by?(Gem::Version.new('1.4.0'))
|
697
691
|
end
|
@@ -717,8 +711,8 @@ end
|
|
717
711
|
end
|
718
712
|
|
719
713
|
def test_spaceship_name
|
720
|
-
s1 =
|
721
|
-
s2 =
|
714
|
+
s1 = quick_spec 'a', '1'
|
715
|
+
s2 = quick_spec 'b', '1'
|
722
716
|
|
723
717
|
assert_equal(-1, (s1 <=> s2))
|
724
718
|
assert_equal( 0, (s1 <=> s1))
|
@@ -726,8 +720,8 @@ end
|
|
726
720
|
end
|
727
721
|
|
728
722
|
def test_spaceship_platform
|
729
|
-
s1 =
|
730
|
-
s2 =
|
723
|
+
s1 = quick_spec 'a', '1'
|
724
|
+
s2 = quick_spec 'a', '1' do |s|
|
731
725
|
s.platform = Gem::Platform.new 'x86-my_platform1'
|
732
726
|
end
|
733
727
|
|
@@ -737,8 +731,8 @@ end
|
|
737
731
|
end
|
738
732
|
|
739
733
|
def test_spaceship_version
|
740
|
-
s1 =
|
741
|
-
s2 =
|
734
|
+
s1 = quick_spec 'a', '1'
|
735
|
+
s2 = quick_spec 'a', '2'
|
742
736
|
|
743
737
|
assert_equal( -1, (s1 <=> s2))
|
744
738
|
assert_equal( 0, (s1 <=> s1))
|
@@ -804,6 +798,54 @@ end
|
|
804
798
|
assert_equal @a2, same_spec
|
805
799
|
end
|
806
800
|
|
801
|
+
def test_to_ruby_for_cache
|
802
|
+
@a2.add_runtime_dependency 'b', '1'
|
803
|
+
@a2.dependencies.first.instance_variable_set :@type, nil
|
804
|
+
@a2.required_rubygems_version = Gem::Requirement.new '> 0'
|
805
|
+
|
806
|
+
# cached specs do not have spec.files populated:
|
807
|
+
ruby_code = @a2.to_ruby_for_cache
|
808
|
+
|
809
|
+
expected = <<-SPEC
|
810
|
+
# -*- encoding: utf-8 -*-
|
811
|
+
|
812
|
+
Gem::Specification.new do |s|
|
813
|
+
s.name = %q{a}
|
814
|
+
s.version = \"2\"
|
815
|
+
|
816
|
+
s.required_rubygems_version = Gem::Requirement.new(\"> 0\") if s.respond_to? :required_rubygems_version=
|
817
|
+
s.authors = [\"A User\"]
|
818
|
+
s.date = %q{#{Gem::Specification::TODAY.strftime "%Y-%m-%d"}}
|
819
|
+
s.description = %q{This is a test description}
|
820
|
+
s.email = %q{example@example.com}
|
821
|
+
s.homepage = %q{http://example.com}
|
822
|
+
s.require_paths = [\"lib\"]
|
823
|
+
s.rubygems_version = %q{#{Gem::VERSION}}
|
824
|
+
s.summary = %q{this is a summary}
|
825
|
+
|
826
|
+
if s.respond_to? :specification_version then
|
827
|
+
s.specification_version = #{Gem::Specification::CURRENT_SPECIFICATION_VERSION}
|
828
|
+
|
829
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
830
|
+
s.add_runtime_dependency(%q<b>, [\"= 1\"])
|
831
|
+
else
|
832
|
+
s.add_dependency(%q<b>, [\"= 1\"])
|
833
|
+
end
|
834
|
+
else
|
835
|
+
s.add_dependency(%q<b>, [\"= 1\"])
|
836
|
+
end
|
837
|
+
end
|
838
|
+
SPEC
|
839
|
+
|
840
|
+
assert_equal expected, ruby_code
|
841
|
+
|
842
|
+
same_spec = eval ruby_code
|
843
|
+
|
844
|
+
# cached specs do not have spec.files populated:
|
845
|
+
@a2.files = []
|
846
|
+
assert_equal @a2, same_spec
|
847
|
+
end
|
848
|
+
|
807
849
|
def test_to_ruby_fancy
|
808
850
|
@a1.platform = Gem::Platform.local
|
809
851
|
ruby_code = @a1.to_ruby
|
@@ -843,16 +885,16 @@ Gem::Specification.new do |s|
|
|
843
885
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
844
886
|
s.add_runtime_dependency(%q<rake>, [\"> 0.4\"])
|
845
887
|
s.add_runtime_dependency(%q<jabber4r>, [\"> 0.0.0\"])
|
846
|
-
s.add_runtime_dependency(%q<pqa>, [\"
|
888
|
+
s.add_runtime_dependency(%q<pqa>, [\"<= 0.6\", \"> 0.4\"])
|
847
889
|
else
|
848
890
|
s.add_dependency(%q<rake>, [\"> 0.4\"])
|
849
891
|
s.add_dependency(%q<jabber4r>, [\"> 0.0.0\"])
|
850
|
-
s.add_dependency(%q<pqa>, [\"
|
892
|
+
s.add_dependency(%q<pqa>, [\"<= 0.6\", \"> 0.4\"])
|
851
893
|
end
|
852
894
|
else
|
853
895
|
s.add_dependency(%q<rake>, [\"> 0.4\"])
|
854
896
|
s.add_dependency(%q<jabber4r>, [\"> 0.0.0\"])
|
855
|
-
s.add_dependency(%q<pqa>, [\"
|
897
|
+
s.add_dependency(%q<pqa>, [\"<= 0.6\", \"> 0.4\"])
|
856
898
|
end
|
857
899
|
end
|
858
900
|
SPEC
|
@@ -1262,6 +1304,16 @@ end
|
|
1262
1304
|
specfile.delete
|
1263
1305
|
end
|
1264
1306
|
|
1307
|
+
def util_setup_deps
|
1308
|
+
@gem = quick_spec "awesome", "1.0" do |awesome|
|
1309
|
+
awesome.add_runtime_dependency "bonobo", []
|
1310
|
+
awesome.add_development_dependency "monkey", []
|
1311
|
+
end
|
1312
|
+
|
1313
|
+
@bonobo = Gem::Dependency.new("bonobo", [])
|
1314
|
+
@monkey = Gem::Dependency.new("monkey", [], :development)
|
1315
|
+
end
|
1316
|
+
|
1265
1317
|
def util_setup_validate
|
1266
1318
|
Dir.chdir @tempdir do
|
1267
1319
|
FileUtils.mkdir_p File.join('ext', 'a')
|
@@ -1273,6 +1325,4 @@ end
|
|
1273
1325
|
FileUtils.touch File.join('test', 'suite.rb')
|
1274
1326
|
end
|
1275
1327
|
end
|
1276
|
-
|
1277
1328
|
end
|
1278
|
-
|