rubygems-update 1.3.5 → 1.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rubygems-update might be problematic. Click here for more details.
- data.tar.gz.sig +0 -0
- data/.autotest +8 -1
- data/ChangeLog +164 -0
- data/History.txt +52 -1
- data/Manifest.txt +8 -8
- data/README +3 -2
- data/Rakefile +49 -5
- data/bin/gem +2 -2
- data/bin/update_rubygems +9 -11
- data/cruise_config.rb +4 -3
- data/hide_lib_for_update/note.txt +5 -0
- data/lib/rbconfig/datadir.rb +10 -14
- data/lib/rubygems.rb +117 -140
- data/lib/rubygems/builder.rb +4 -2
- data/lib/rubygems/command.rb +51 -48
- data/lib/rubygems/command_manager.rb +2 -0
- data/lib/rubygems/commands/dependency_command.rb +10 -5
- data/lib/rubygems/commands/environment_command.rb +1 -1
- data/lib/rubygems/commands/fetch_command.rb +6 -5
- data/lib/rubygems/commands/install_command.rb +1 -0
- data/lib/rubygems/commands/mirror_command.rb +8 -8
- data/lib/rubygems/commands/owner_command.rb +75 -0
- data/lib/rubygems/commands/pristine_command.rb +1 -1
- data/lib/rubygems/commands/push_command.rb +45 -0
- data/lib/rubygems/commands/query_command.rb +4 -1
- data/lib/rubygems/commands/rdoc_command.rb +24 -9
- data/lib/rubygems/commands/server_command.rb +6 -0
- data/lib/rubygems/commands/setup_command.rb +14 -4
- data/lib/rubygems/commands/unpack_command.rb +2 -2
- data/lib/rubygems/commands/update_command.rb +2 -2
- data/lib/rubygems/commands/which_command.rb +7 -9
- data/lib/rubygems/config_file.rb +100 -26
- data/lib/rubygems/defaults.rb +1 -1
- data/lib/rubygems/dependency.rb +133 -75
- data/lib/rubygems/dependency_installer.rb +28 -10
- data/lib/rubygems/dependency_list.rb +41 -12
- data/lib/rubygems/doc_manager.rb +7 -0
- data/lib/rubygems/format.rb +16 -20
- data/lib/rubygems/gem_openssl.rb +1 -1
- data/lib/rubygems/gem_path_searcher.rb +10 -12
- data/lib/rubygems/gemcutter_utilities.rb +49 -0
- data/lib/rubygems/indexer.rb +2 -2
- data/lib/rubygems/install_update_options.rb +1 -9
- data/lib/rubygems/installer.rb +35 -76
- data/lib/rubygems/local_remote_options.rb +1 -2
- data/lib/rubygems/package.rb +0 -1
- data/lib/rubygems/package/tar_input.rb +3 -1
- data/lib/rubygems/package_task.rb +16 -11
- data/lib/rubygems/remote_fetcher.rb +22 -8
- data/lib/rubygems/requirement.rb +78 -100
- data/lib/rubygems/server.rb +41 -10
- data/lib/rubygems/source_index.rb +5 -5
- data/lib/rubygems/spec_fetcher.rb +2 -2
- data/lib/rubygems/specification.rb +66 -16
- data/lib/rubygems/test_utilities.rb +33 -4
- data/lib/rubygems/uninstaller.rb +3 -3
- data/lib/rubygems/user_interaction.rb +45 -0
- data/lib/rubygems/validator.rb +6 -7
- data/lib/rubygems/version.rb +206 -149
- data/lib/rubygems/version_option.rb +16 -0
- data/test/fake_certlib/openssl.rb +1 -1
- data/test/functional.rb +0 -7
- data/test/gem_installer_test_case.rb +4 -4
- data/test/gem_package_tar_test_case.rb +1 -1
- data/test/gemutilities.rb +35 -31
- data/test/insure_session.rb +0 -8
- data/test/mockgemui.rb +0 -8
- data/test/simple_gem.rb +2 -8
- data/test/test_config.rb +3 -10
- data/test/test_gem.rb +9 -14
- data/test/test_gem_builder.rb +1 -7
- data/test/test_gem_command.rb +1 -8
- data/test/test_gem_command_manager.rb +1 -7
- data/test/test_gem_commands_build_command.rb +4 -4
- data/test/test_gem_commands_cert_command.rb +1 -2
- data/test/test_gem_commands_check_command.rb +1 -7
- data/test/test_gem_commands_contents_command.rb +1 -1
- data/test/test_gem_commands_dependency_command.rb +17 -31
- data/test/test_gem_commands_environment_command.rb +1 -1
- data/test/test_gem_commands_fetch_command.rb +14 -12
- data/test/test_gem_commands_generate_index_command.rb +1 -1
- data/test/test_gem_commands_install_command.rb +22 -20
- data/test/test_gem_commands_list_command.rb +1 -1
- data/test/test_gem_commands_lock_command.rb +1 -1
- data/test/test_gem_commands_mirror_command.rb +5 -5
- data/test/test_gem_commands_outdated_command.rb +3 -5
- data/test/test_gem_commands_owner_command.rb +105 -0
- data/test/test_gem_commands_pristine_command.rb +2 -2
- data/test/test_gem_commands_push_command.rb +61 -0
- data/test/test_gem_commands_query_command.rb +23 -56
- data/test/test_gem_commands_server_command.rb +1 -1
- data/test/test_gem_commands_sources_command.rb +1 -70
- data/test/test_gem_commands_specification_command.rb +3 -4
- data/test/test_gem_commands_stale_command.rb +1 -1
- data/test/test_gem_commands_uninstall_command.rb +3 -4
- data/test/test_gem_commands_unpack_command.rb +1 -1
- data/test/test_gem_commands_update_command.rb +13 -13
- data/test/test_gem_commands_which_command.rb +66 -0
- data/test/test_gem_config_file.rb +13 -7
- data/test/test_gem_dependency.rb +82 -134
- data/test/test_gem_dependency_installer.rb +55 -30
- data/test/test_gem_dependency_list.rb +28 -7
- data/test/test_gem_doc_manager.rb +1 -7
- data/test/test_gem_ext_configure_builder.rb +2 -2
- data/test/test_gem_ext_ext_conf_builder.rb +1 -1
- data/test/test_gem_ext_rake_builder.rb +1 -1
- data/test/test_gem_format.rb +14 -11
- data/test/test_gem_gem_path_searcher.rb +12 -1
- data/test/test_gem_gem_runner.rb +1 -1
- data/test/test_gem_gemcutter_utilities.rb +103 -0
- data/test/test_gem_indexer.rb +44 -51
- data/test/test_gem_install_update_options.rb +1 -7
- data/test/test_gem_installer.rb +22 -82
- data/test/test_gem_local_remote_options.rb +1 -1
- data/test/test_gem_package_tar_header.rb +1 -8
- data/test/test_gem_package_tar_input.rb +1 -8
- data/test/test_gem_package_tar_output.rb +1 -8
- data/test/test_gem_package_tar_reader.rb +1 -8
- data/test/test_gem_package_tar_reader_entry.rb +1 -8
- data/test/test_gem_package_tar_writer.rb +1 -8
- data/test/test_gem_package_task.rb +1 -25
- data/test/test_gem_platform.rb +4 -4
- data/test/test_gem_remote_fetcher.rb +31 -21
- data/test/test_gem_requirement.rb +210 -140
- data/test/test_gem_server.rb +36 -1
- data/test/test_gem_source_index.rb +7 -13
- data/test/test_gem_spec_fetcher.rb +17 -47
- data/test/test_gem_specification.rb +7 -20
- data/test/test_gem_stream_ui.rb +21 -1
- data/test/test_gem_uninstaller.rb +1 -2
- data/test/test_gem_validator.rb +2 -8
- data/test/test_gem_version.rb +110 -254
- data/test/test_gem_version_option.rb +1 -1
- data/test/test_kernel.rb +1 -7
- data/util/CL2notes +1 -1
- data/util/gem_prelude.rb.template +64 -41
- metadata +33 -71
- metadata.gz.sig +0 -0
- data/lib/rubygems/digest/digest_adapter.rb +0 -49
- data/lib/rubygems/digest/md5.rb +0 -23
- data/lib/rubygems/digest/sha1.rb +0 -22
- data/lib/rubygems/digest/sha2.rb +0 -22
- data/lib/rubygems/timer.rb +0 -28
- data/test/test_gem_digest.rb +0 -46
- data/test/test_gem_source_info_cache.rb +0 -447
- data/test/test_gem_source_info_cache_entry.rb +0 -78
data/test/functional.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require File.
|
1
|
+
require File.expand_path('../gemutilities', __FILE__)
|
2
2
|
require 'rubygems/installer'
|
3
3
|
|
4
4
|
class Gem::Installer
|
@@ -20,12 +20,12 @@ class GemInstallerTestCase < RubyGemTestCase
|
|
20
20
|
super
|
21
21
|
|
22
22
|
@spec = quick_gem 'a'
|
23
|
-
@gem = File.join @tempdir,
|
23
|
+
@gem = File.join @tempdir, @spec.file_name
|
24
24
|
|
25
25
|
@installer = util_installer @spec, @gem, @gemhome
|
26
26
|
|
27
27
|
@user_spec = quick_gem 'b'
|
28
|
-
@user_gem = File.join @tempdir,
|
28
|
+
@user_gem = File.join @tempdir, @user_spec.file_name
|
29
29
|
|
30
30
|
@user_installer = util_installer @user_spec, @user_gem, Gem.user_dir
|
31
31
|
@user_installer.gem_dir = File.join(Gem.user_dir, 'gems',
|
@@ -82,7 +82,7 @@ class GemInstallerTestCase < RubyGemTestCase
|
|
82
82
|
|
83
83
|
def util_installer(spec, gem_path, gem_home)
|
84
84
|
util_build_gem spec
|
85
|
-
FileUtils.mv File.join(@gemhome, 'cache',
|
85
|
+
FileUtils.mv File.join(@gemhome, 'cache', spec.file_name),
|
86
86
|
@tempdir
|
87
87
|
|
88
88
|
installer = Gem::Installer.new gem_path
|
data/test/gemutilities.rb
CHANGED
@@ -1,9 +1,3 @@
|
|
1
|
-
#--
|
2
|
-
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
|
3
|
-
# All rights reserved.
|
4
|
-
# See LICENSE.txt for permissions.
|
5
|
-
#++
|
6
|
-
|
7
1
|
at_exit { $SAFE = 1 }
|
8
2
|
|
9
3
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
@@ -75,6 +69,8 @@ class RubyGemTestCase < MiniTest::Unit::TestCase
|
|
75
69
|
@latest_usrcache = File.join(@gemhome, ".gem", "latest_user_cache")
|
76
70
|
@userhome = File.join @tempdir, 'userhome'
|
77
71
|
|
72
|
+
Gem.ensure_gem_subdirectories @gemhome
|
73
|
+
|
78
74
|
@orig_ENV_HOME = ENV['HOME']
|
79
75
|
ENV['HOME'] = @userhome
|
80
76
|
Gem.instance_variable_set :@user_home, nil
|
@@ -167,7 +163,7 @@ class RubyGemTestCase < MiniTest::Unit::TestCase
|
|
167
163
|
end
|
168
164
|
end
|
169
165
|
|
170
|
-
gem = File.join(@tempdir,
|
166
|
+
gem = File.join(@tempdir, gem.file_name).untaint
|
171
167
|
Gem::Installer.new(gem, :wrappers => true).install
|
172
168
|
end
|
173
169
|
|
@@ -245,7 +241,7 @@ class RubyGemTestCase < MiniTest::Unit::TestCase
|
|
245
241
|
yield(s) if block_given?
|
246
242
|
end
|
247
243
|
|
248
|
-
path = File.join "specifications",
|
244
|
+
path = File.join "specifications", spec.spec_name
|
249
245
|
written_path = write_file path do |io|
|
250
246
|
io.write(spec.to_ruby)
|
251
247
|
end
|
@@ -272,7 +268,7 @@ class RubyGemTestCase < MiniTest::Unit::TestCase
|
|
272
268
|
Gem::Builder.new(spec).build
|
273
269
|
end
|
274
270
|
|
275
|
-
FileUtils.mv
|
271
|
+
FileUtils.mv spec.file_name,
|
276
272
|
File.join(@gemhome, 'cache', "#{spec.original_name}.gem")
|
277
273
|
end
|
278
274
|
end
|
@@ -291,8 +287,7 @@ class RubyGemTestCase < MiniTest::Unit::TestCase
|
|
291
287
|
cache_file = File.join @tempdir, 'gems', "#{spec.original_name}.gem"
|
292
288
|
FileUtils.mv File.join(@gemhome, 'cache', "#{spec.original_name}.gem"),
|
293
289
|
cache_file
|
294
|
-
FileUtils.rm File.join(@gemhome, 'specifications',
|
295
|
-
"#{spec.full_name}.gemspec")
|
290
|
+
FileUtils.rm File.join(@gemhome, 'specifications', spec.spec_name)
|
296
291
|
|
297
292
|
spec.loaded_from = nil
|
298
293
|
spec.loaded = false
|
@@ -406,26 +401,6 @@ Also, a list:
|
|
406
401
|
Gem::RemoteFetcher.fetcher = @fetcher
|
407
402
|
end
|
408
403
|
|
409
|
-
def util_setup_source_info_cache(*specs)
|
410
|
-
require 'rubygems/source_info_cache'
|
411
|
-
require 'rubygems/source_info_cache_entry'
|
412
|
-
|
413
|
-
specs = Hash[*specs.map { |spec| [spec.full_name, spec] }.flatten]
|
414
|
-
si = Gem::SourceIndex.new specs
|
415
|
-
|
416
|
-
sice = Gem::SourceInfoCacheEntry.new si, 0
|
417
|
-
sic = Gem::SourceInfoCache.new
|
418
|
-
|
419
|
-
sic.set_cache_data( { @gem_repo => sice } )
|
420
|
-
sic.update
|
421
|
-
sic.write_cache
|
422
|
-
sic.reset_cache_data
|
423
|
-
|
424
|
-
Gem::SourceInfoCache.instance_variable_set :@cache, sic
|
425
|
-
|
426
|
-
si
|
427
|
-
end
|
428
|
-
|
429
404
|
def util_setup_spec_fetcher(*specs)
|
430
405
|
specs = Hash[*specs.map { |spec| [spec.full_name, spec] }.flatten]
|
431
406
|
si = Gem::SourceIndex.new specs
|
@@ -572,6 +547,35 @@ Also, a list:
|
|
572
547
|
'rake'
|
573
548
|
end
|
574
549
|
|
550
|
+
##
|
551
|
+
# Construct a new Gem::Dependency.
|
552
|
+
|
553
|
+
def dep name, *requirements
|
554
|
+
Gem::Dependency.new name, *requirements
|
555
|
+
end
|
556
|
+
|
557
|
+
##
|
558
|
+
# Construct a new Gem::Requirement.
|
559
|
+
|
560
|
+
def req *requirements
|
561
|
+
return requirements.first if Gem::Requirement === requirements.first
|
562
|
+
Gem::Requirement.create requirements
|
563
|
+
end
|
564
|
+
|
565
|
+
##
|
566
|
+
# Construct a new Gem::Specification.
|
567
|
+
|
568
|
+
def spec name, version, &block
|
569
|
+
Gem::Specification.new name, v(version), &block
|
570
|
+
end
|
571
|
+
|
572
|
+
##
|
573
|
+
# Construct a new Gem::Version.
|
574
|
+
|
575
|
+
def v string
|
576
|
+
Gem::Version.create string
|
577
|
+
end
|
578
|
+
|
575
579
|
end
|
576
580
|
|
577
581
|
MiniTest::Unit.autorun
|
data/test/insure_session.rb
CHANGED
data/test/mockgemui.rb
CHANGED
data/test/simple_gem.rb
CHANGED
@@ -1,10 +1,4 @@
|
|
1
|
-
|
2
|
-
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
|
3
|
-
# All rights reserved.
|
4
|
-
# See LICENSE.txt for permissions.
|
5
|
-
#++
|
6
|
-
|
7
|
-
SIMPLE_GEM = <<-GEMDATA
|
1
|
+
SIMPLE_GEM = <<-GEMDATA
|
8
2
|
MD5SUM = "e3701f9db765a2358aef94c40ded71c8"
|
9
3
|
if $0 == __FILE__
|
10
4
|
require 'optparse'
|
@@ -69,4 +63,4 @@ g1CKTjX9BGAj1w==
|
|
69
63
|
eJwDAAAAAAE=
|
70
64
|
---
|
71
65
|
eJwrKC0pVlAvzy9XyE3MU+cCACwiBP4=
|
72
|
-
|
66
|
+
GEMDATA
|
data/test/test_config.rb
CHANGED
@@ -1,18 +1,11 @@
|
|
1
|
-
|
2
|
-
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
|
3
|
-
# All rights reserved.
|
4
|
-
# See LICENSE.txt for permissions.
|
5
|
-
#++
|
6
|
-
|
7
|
-
require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
|
8
|
-
require 'rbconfig'
|
1
|
+
require File.expand_path('../gemutilities', __FILE__)
|
9
2
|
require 'rubygems'
|
10
3
|
|
11
4
|
class TestConfig < RubyGemTestCase
|
12
5
|
|
13
6
|
def test_datadir
|
14
|
-
datadir =
|
15
|
-
assert_equal "#{datadir}/xyz",
|
7
|
+
datadir = RbConfig::CONFIG['datadir']
|
8
|
+
assert_equal "#{datadir}/xyz", RbConfig.datadir('xyz')
|
16
9
|
end
|
17
10
|
|
18
11
|
end
|
data/test/test_gem.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require File.
|
1
|
+
require File.expand_path('../gemutilities', __FILE__)
|
2
2
|
require 'rubygems'
|
3
3
|
require 'rubygems/gem_openssl'
|
4
4
|
require 'rubygems/installer'
|
@@ -95,7 +95,7 @@ class TestGem < RubyGemTestCase
|
|
95
95
|
bindir = if defined?(RUBY_FRAMEWORK_VERSION) then
|
96
96
|
'/usr/bin'
|
97
97
|
else
|
98
|
-
|
98
|
+
RbConfig::CONFIG['bindir']
|
99
99
|
end
|
100
100
|
|
101
101
|
assert_equal bindir, Gem.bindir(default)
|
@@ -181,16 +181,11 @@ class TestGem < RubyGemTestCase
|
|
181
181
|
end
|
182
182
|
|
183
183
|
def test_self_default_sources
|
184
|
-
assert_equal %w[http://
|
184
|
+
assert_equal %w[http://rubygems.org/], Gem.default_sources
|
185
185
|
end
|
186
186
|
|
187
187
|
def test_self_dir
|
188
188
|
assert_equal @gemhome, Gem.dir
|
189
|
-
|
190
|
-
Gem::DIRECTORIES.each do |filename|
|
191
|
-
assert File.directory?(File.join(Gem.dir, filename)),
|
192
|
-
"expected #{filename} to exist"
|
193
|
-
end
|
194
189
|
end
|
195
190
|
|
196
191
|
def test_self_ensure_gem_directories
|
@@ -442,13 +437,13 @@ class TestGem < RubyGemTestCase
|
|
442
437
|
def test_self_refresh
|
443
438
|
util_make_gems
|
444
439
|
|
445
|
-
a1_spec = File.join @gemhome, "specifications",
|
440
|
+
a1_spec = File.join @gemhome, "specifications", @a1.spec_name
|
446
441
|
|
447
442
|
FileUtils.mv a1_spec, @tempdir
|
448
443
|
|
449
444
|
refute Gem.source_index.gems.include?(@a1.full_name)
|
450
445
|
|
451
|
-
FileUtils.mv File.join(@tempdir,
|
446
|
+
FileUtils.mv File.join(@tempdir, @a1.spec_name), a1_spec
|
452
447
|
|
453
448
|
Gem.refresh
|
454
449
|
|
@@ -538,11 +533,11 @@ class TestGem < RubyGemTestCase
|
|
538
533
|
path = [@userhome, other].join File::PATH_SEPARATOR
|
539
534
|
Gem.send :set_paths, path
|
540
535
|
|
541
|
-
|
542
|
-
assert File.exist?(File.join(other, 'gems'))
|
536
|
+
assert_equal [@userhome, other, @gemhome], Gem.path
|
543
537
|
end
|
544
538
|
|
545
539
|
def test_self_set_paths_nonexistent_home
|
540
|
+
ENV['GEM_HOME'] = @gemhome
|
546
541
|
Gem.clear_paths
|
547
542
|
|
548
543
|
other = File.join @tempdir, 'other'
|
@@ -551,7 +546,7 @@ class TestGem < RubyGemTestCase
|
|
551
546
|
|
552
547
|
Gem.send :set_paths, other
|
553
548
|
|
554
|
-
|
549
|
+
assert_equal [other, @gemhome], Gem.path
|
555
550
|
end
|
556
551
|
|
557
552
|
def test_self_source_index
|
@@ -616,7 +611,7 @@ class TestGem < RubyGemTestCase
|
|
616
611
|
ENV['USERPROFILE'] = orig_user_profile
|
617
612
|
ENV['USERDRIVE'] = orig_user_drive
|
618
613
|
ENV['USERPATH'] = orig_user_path
|
619
|
-
end
|
614
|
+
end if '1.9' > RUBY_VERSION
|
620
615
|
|
621
616
|
def util_ensure_gem_dirs
|
622
617
|
Gem.ensure_gem_subdirectories @gemhome
|
data/test/test_gem_builder.rb
CHANGED
@@ -1,10 +1,4 @@
|
|
1
|
-
|
2
|
-
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
|
3
|
-
# All rights reserved.
|
4
|
-
# See LICENSE.txt for permissions.
|
5
|
-
#++
|
6
|
-
|
7
|
-
require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
|
1
|
+
require File.expand_path('../gemutilities', __FILE__)
|
8
2
|
require 'rubygems/builder'
|
9
3
|
|
10
4
|
class TestGemBuilder < RubyGemTestCase
|
data/test/test_gem_command.rb
CHANGED
@@ -1,11 +1,4 @@
|
|
1
|
-
|
2
|
-
#--
|
3
|
-
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
|
4
|
-
# All rights reserved.
|
5
|
-
# See LICENSE.txt for permissions.
|
6
|
-
#++
|
7
|
-
|
8
|
-
require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
|
1
|
+
require File.expand_path('../gemutilities', __FILE__)
|
9
2
|
require 'rubygems/command'
|
10
3
|
|
11
4
|
class Gem::Command
|
@@ -1,10 +1,4 @@
|
|
1
|
-
|
2
|
-
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
|
3
|
-
# All rights reserved.
|
4
|
-
# See LICENSE.txt for permissions.
|
5
|
-
#++
|
6
|
-
|
7
|
-
require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
|
1
|
+
require File.expand_path('../gemutilities', __FILE__)
|
8
2
|
require 'rubygems/command_manager'
|
9
3
|
|
10
4
|
class TestGemCommandManager < RubyGemTestCase
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require File.
|
1
|
+
require File.expand_path('../gemutilities', __FILE__)
|
2
2
|
require 'rubygems/commands/build_command'
|
3
3
|
require 'rubygems/format'
|
4
4
|
|
@@ -15,7 +15,7 @@ class TestGemCommandsBuildCommand < RubyGemTestCase
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def test_execute
|
18
|
-
gemspec_file = File.join(@tempdir,
|
18
|
+
gemspec_file = File.join(@tempdir, @gem.spec_name)
|
19
19
|
|
20
20
|
File.open gemspec_file, 'w' do |gs|
|
21
21
|
gs.write @gem.to_ruby
|
@@ -25,7 +25,7 @@ class TestGemCommandsBuildCommand < RubyGemTestCase
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def test_execute_yaml
|
28
|
-
gemspec_file = File.join(@tempdir,
|
28
|
+
gemspec_file = File.join(@tempdir, @gem.spec_name)
|
29
29
|
|
30
30
|
File.open gemspec_file, 'w' do |gs|
|
31
31
|
gs.write @gem.to_yaml
|
@@ -61,7 +61,7 @@ class TestGemCommandsBuildCommand < RubyGemTestCase
|
|
61
61
|
assert_equal [], output
|
62
62
|
assert_equal '', @ui.error
|
63
63
|
|
64
|
-
gem_file = File.join @tempdir,
|
64
|
+
gem_file = File.join @tempdir, gem.file_name
|
65
65
|
assert File.exist?(gem_file)
|
66
66
|
|
67
67
|
spec = Gem::Format.from_file_by_path(gem_file).spec
|
@@ -1,10 +1,4 @@
|
|
1
|
-
|
2
|
-
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
|
3
|
-
# All rights reserved.
|
4
|
-
# See LICENSE.txt for permissions.
|
5
|
-
#++
|
6
|
-
|
7
|
-
require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
|
1
|
+
require File.expand_path('../gemutilities', __FILE__)
|
8
2
|
require 'rubygems/commands/check_command'
|
9
3
|
|
10
4
|
class TestGemCommandsCheckCommand < RubyGemTestCase
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require File.
|
1
|
+
require File.expand_path('../gemutilities', __FILE__)
|
2
2
|
require 'rubygems/commands/dependency_command'
|
3
3
|
|
4
4
|
class TestGemCommandsDependencyCommand < RubyGemTestCase
|
@@ -9,12 +9,13 @@ class TestGemCommandsDependencyCommand < RubyGemTestCase
|
|
9
9
|
@cmd = Gem::Commands::DependencyCommand.new
|
10
10
|
@cmd.options[:domain] = :local
|
11
11
|
|
12
|
-
util_setup_fake_fetcher
|
12
|
+
util_setup_fake_fetcher true
|
13
13
|
end
|
14
14
|
|
15
15
|
def test_execute
|
16
16
|
quick_gem 'foo' do |gem|
|
17
17
|
gem.add_dependency 'bar', '> 1'
|
18
|
+
gem.add_dependency 'baz', '> 1'
|
18
19
|
end
|
19
20
|
|
20
21
|
Gem.source_index = nil
|
@@ -25,7 +26,8 @@ class TestGemCommandsDependencyCommand < RubyGemTestCase
|
|
25
26
|
@cmd.execute
|
26
27
|
end
|
27
28
|
|
28
|
-
assert_equal "Gem foo-2\n bar (> 1, runtime)\n\n",
|
29
|
+
assert_equal "Gem foo-2\n bar (> 1, runtime)\n baz (> 1, runtime)\n\n",
|
30
|
+
@ui.output
|
29
31
|
assert_equal '', @ui.error
|
30
32
|
end
|
31
33
|
|
@@ -41,6 +43,8 @@ class TestGemCommandsDependencyCommand < RubyGemTestCase
|
|
41
43
|
expected = <<-EOF
|
42
44
|
Gem a-1
|
43
45
|
|
46
|
+
Gem a-2.a
|
47
|
+
|
44
48
|
Gem a-2
|
45
49
|
|
46
50
|
Gem a-3.a
|
@@ -100,6 +104,8 @@ Gem pl-1-x86-linux
|
|
100
104
|
expected = <<-EOF
|
101
105
|
Gem a-1
|
102
106
|
|
107
|
+
Gem a-2.a
|
108
|
+
|
103
109
|
Gem a-2
|
104
110
|
|
105
111
|
Gem a-3.a
|
@@ -173,8 +179,7 @@ ERROR: Only reverse dependencies for local gems are supported.
|
|
173
179
|
|
174
180
|
util_setup_spec_fetcher foo
|
175
181
|
|
176
|
-
FileUtils.rm File.join(@gemhome, 'specifications',
|
177
|
-
"#{foo.full_name}.gemspec")
|
182
|
+
FileUtils.rm File.join(@gemhome, 'specifications', foo.spec_name)
|
178
183
|
|
179
184
|
@cmd.options[:args] = %w[foo]
|
180
185
|
@cmd.options[:domain] = :remote
|
@@ -187,43 +192,24 @@ ERROR: Only reverse dependencies for local gems are supported.
|
|
187
192
|
assert_equal '', @ui.error
|
188
193
|
end
|
189
194
|
|
190
|
-
def
|
191
|
-
foo = quick_gem 'foo' do |gem|
|
192
|
-
gem.add_dependency 'bar', '> 1'
|
193
|
-
end
|
194
|
-
|
195
|
+
def test_execute_prerelease
|
195
196
|
@fetcher = Gem::FakeFetcher.new
|
196
197
|
Gem::RemoteFetcher.fetcher = @fetcher
|
197
198
|
|
198
|
-
|
199
|
-
si = util_setup_source_info_cache foo
|
200
|
-
|
201
|
-
@fetcher.data["#{@gem_repo}yaml"] = YAML.dump si
|
202
|
-
@fetcher.data["#{@gem_repo}Marshal.#{Gem.marshal_version}"] =
|
203
|
-
si.dump
|
204
|
-
|
205
|
-
@fetcher.data.delete "#{@gem_repo}latest_specs.#{Gem.marshal_version}.gz"
|
199
|
+
util_setup_spec_fetcher @a2_pre
|
206
200
|
|
207
|
-
FileUtils.rm File.join(@gemhome, 'specifications',
|
208
|
-
"#{foo.full_name}.gemspec")
|
201
|
+
FileUtils.rm File.join(@gemhome, 'specifications', @a2_pre.spec_name)
|
209
202
|
|
210
|
-
@cmd.options[:args] = %w[
|
203
|
+
@cmd.options[:args] = %w[a]
|
211
204
|
@cmd.options[:domain] = :remote
|
205
|
+
@cmd.options[:prerelease] = true
|
212
206
|
|
213
207
|
use_ui @ui do
|
214
208
|
@cmd.execute
|
215
209
|
end
|
216
210
|
|
217
|
-
assert_equal "Gem
|
218
|
-
|
219
|
-
expected = <<-EOF
|
220
|
-
WARNING: RubyGems 1.2+ index not found for:
|
221
|
-
\t#{@gem_repo}
|
222
|
-
|
223
|
-
RubyGems will revert to legacy indexes degrading performance.
|
224
|
-
EOF
|
225
|
-
|
226
|
-
assert_equal expected, @ui.error
|
211
|
+
assert_equal "Gem a-2.a\n\n", @ui.output
|
212
|
+
assert_equal '', @ui.error
|
227
213
|
end
|
228
214
|
|
229
215
|
end
|