rubygems-update 0.8.3
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/ChangeLog +2335 -0
- data/README +54 -0
- data/Rakefile +293 -0
- data/Releases +98 -0
- data/TODO +7 -0
- data/bin/gem +11 -0
- data/bin/gem_server +111 -0
- data/bin/generate_yaml_index.rb +58 -0
- data/bin/update_rubygems +18 -0
- data/doc/doc.css +73 -0
- data/doc/makedoc.rb +4 -0
- data/examples/application/an-app.gemspec +26 -0
- data/examples/application/bin/myapp +3 -0
- data/examples/application/lib/somefunctionality.rb +3 -0
- data/gemspecs/README +4 -0
- data/gemspecs/cgikit-1.1.0.gemspec +18 -0
- data/gemspecs/jabber4r.gemspec +26 -0
- data/gemspecs/linguistics.gemspec +22 -0
- data/gemspecs/ook.gemspec +21 -0
- data/gemspecs/progressbar.gemspec +22 -0
- data/gemspecs/redcloth.gemspec +22 -0
- data/gemspecs/rublog.gemspec +23 -0
- data/gemspecs/ruby-doom.gemspec +21 -0
- data/gemspecs/rubyjdwp.gemspec +21 -0
- data/gemspecs/statistics.gemspec +21 -0
- data/lib/rubygems.rb +353 -0
- data/lib/rubygems/builder.rb +54 -0
- data/lib/rubygems/cmd_manager.rb +127 -0
- data/lib/rubygems/command.rb +191 -0
- data/lib/rubygems/config_file.rb +57 -0
- data/lib/rubygems/doc_manager.rb +94 -0
- data/lib/rubygems/format.rb +65 -0
- data/lib/rubygems/gem_commands.rb +925 -0
- data/lib/rubygems/gem_runner.rb +23 -0
- data/lib/rubygems/installer.rb +621 -0
- data/lib/rubygems/loadpath_manager.rb +108 -0
- data/lib/rubygems/old_format.rb +150 -0
- data/lib/rubygems/open-uri.rb +604 -0
- data/lib/rubygems/package.rb +740 -0
- data/lib/rubygems/remote_installer.rb +499 -0
- data/lib/rubygems/rubygems_version.rb +6 -0
- data/lib/rubygems/source_index.rb +130 -0
- data/lib/rubygems/specification.rb +613 -0
- data/lib/rubygems/user_interaction.rb +176 -0
- data/lib/rubygems/validator.rb +148 -0
- data/lib/rubygems/version.rb +279 -0
- data/lib/ubygems.rb +4 -0
- data/pkgs/sources/lib/sources.rb +6 -0
- data/pkgs/sources/sources.gemspec +14 -0
- data/post-install.rb +75 -0
- data/redist/session.gem +433 -0
- data/scripts/buildtests.rb +25 -0
- data/scripts/gemdoc.rb +62 -0
- data/scripts/runtest.rb +17 -0
- data/scripts/specdoc.rb +164 -0
- data/setup.rb +1360 -0
- data/test/bogussources.rb +5 -0
- data/test/data/legacy/keyedlist-0.4.0.ruby +11 -0
- data/test/data/legacy/keyedlist-0.4.0.yaml +16 -0
- data/test/data/lib/code.rb +1 -0
- data/test/data/one/README.one +1 -0
- data/test/data/one/lib/one.rb +3 -0
- data/test/data/one/one.gemspec +17 -0
- data/test/data/one/one.yaml +40 -0
- data/test/functional.rb +145 -0
- data/test/gemenvironment.rb +45 -0
- data/test/gemutilities.rb +18 -0
- data/test/insure_session.rb +46 -0
- data/test/mock/gems/gems/sources-0.0.1/lib/sources.rb +5 -0
- data/test/mock/gems/specifications/sources-0.0.1.gemspec +8 -0
- data/test/mockgemui.rb +45 -0
- data/test/onegem.rb +23 -0
- data/test/simple_gem.rb +66 -0
- data/test/test_builder.rb +13 -0
- data/test/test_cached_fetcher.rb +60 -0
- data/test/test_check_command.rb +28 -0
- data/test/test_command.rb +130 -0
- data/test/test_configfile.rb +36 -0
- data/test/test_format.rb +70 -0
- data/test/test_gemloadpaths.rb +45 -0
- data/test/test_gempaths.rb +115 -0
- data/test/test_loadmanager.rb +40 -0
- data/test/test_local_cache.rb +157 -0
- data/test/test_package.rb +600 -0
- data/test/test_parse_commands.rb +179 -0
- data/test/test_process_commands.rb +21 -0
- data/test/test_remote_fetcher.rb +162 -0
- data/test/test_remote_installer.rb +154 -0
- data/test/test_source_index.rb +58 -0
- data/test/test_specification.rb +286 -0
- data/test/test_validator.rb +53 -0
- data/test/test_version_comparison.rb +204 -0
- data/test/testgem.rc +6 -0
- data/test/user_capture.rb +1 -0
- data/test/yaml_data.rb +59 -0
- metadata +151 -0
@@ -0,0 +1,11 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = %q{keyedlist}
|
3
|
+
s.version = %q{0.4.0}
|
4
|
+
s.has_rdoc = true
|
5
|
+
s.summary = %q{A Hash which automatically computes keys.}
|
6
|
+
s.files = ["lib/keyedlist.rb"]
|
7
|
+
s.require_paths = ["lib"]
|
8
|
+
s.autorequire = %q{keyedlist}
|
9
|
+
s.author = %q{Florian Gross}
|
10
|
+
s.email = %q{flgr@ccan.de}
|
11
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
rubygems_version: "1.0"
|
3
|
+
name: keyedlist
|
4
|
+
version: !ruby/object:Gem::Version
|
5
|
+
version: 0.4.0
|
6
|
+
date: 2004-03-28 15:37:49.828000 +02:00
|
7
|
+
platform:
|
8
|
+
summary: A Hash which automatically computes keys.
|
9
|
+
require_paths:
|
10
|
+
- lib
|
11
|
+
files:
|
12
|
+
- lib/keyedlist.rb
|
13
|
+
autorequire: keyedlist
|
14
|
+
author: Florian Gross
|
15
|
+
email: flgr@ccan.de
|
16
|
+
has_rdoc: true
|
@@ -0,0 +1 @@
|
|
1
|
+
CODE = 1
|
@@ -0,0 +1 @@
|
|
1
|
+
README for the One GEM.
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
spec = Gem::Specification.new do |s|
|
4
|
+
s.platform = Gem::Platform::RUBY
|
5
|
+
s.summary = "Test GEM One"
|
6
|
+
s.name = 'one'
|
7
|
+
s.version = '0.0.1'
|
8
|
+
s.requirements << 'none'
|
9
|
+
s.require_path = 'lib'
|
10
|
+
s.autorequire = 'one'
|
11
|
+
s.files = ['lib/one.rb', 'README.one']
|
12
|
+
s.author = 'Jim Weirich'
|
13
|
+
s.email = 'jim@weirichhouse.org'
|
14
|
+
s.homepage = 'http://onestepback.org'
|
15
|
+
s.has_rdoc = true
|
16
|
+
s.description = "Test GEM for customer tests"
|
17
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
rubygems_version: "0.7"
|
3
|
+
specification_version: 1
|
4
|
+
name: one
|
5
|
+
version: !ruby/object:Gem::Version
|
6
|
+
version: 0.0.1
|
7
|
+
date: 2004-08-07
|
8
|
+
summary: Test GEM One
|
9
|
+
require_paths:
|
10
|
+
- lib
|
11
|
+
author: Jim Weirich
|
12
|
+
email: jim@weirichhouse.org
|
13
|
+
homepage: http://onestepback.org
|
14
|
+
rubyforge_project:
|
15
|
+
description: Test GEM for customer tests
|
16
|
+
autorequire: one
|
17
|
+
default_executable:
|
18
|
+
bindir: bin
|
19
|
+
has_rdoc: true
|
20
|
+
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
21
|
+
requirements:
|
22
|
+
-
|
23
|
+
- ">"
|
24
|
+
- !ruby/object:Gem::Version
|
25
|
+
version: 0.0.0
|
26
|
+
version:
|
27
|
+
platform: ruby
|
28
|
+
files:
|
29
|
+
- lib/one.rb
|
30
|
+
- README.one
|
31
|
+
test_files: []
|
32
|
+
library_stubs: []
|
33
|
+
rdoc_options: []
|
34
|
+
extra_rdoc_files: []
|
35
|
+
executables: []
|
36
|
+
extensions: []
|
37
|
+
requirements:
|
38
|
+
- none
|
39
|
+
dependencies: []
|
40
|
+
|
data/test/functional.rb
ADDED
@@ -0,0 +1,145 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'test/unit'
|
4
|
+
require 'rubygems'
|
5
|
+
Gem.manage_gems
|
6
|
+
require 'yaml'
|
7
|
+
require 'fileutils'
|
8
|
+
require 'test/insure_session'
|
9
|
+
require 'test/onegem'
|
10
|
+
|
11
|
+
class FunctionalTest < Test::Unit::TestCase
|
12
|
+
def setup
|
13
|
+
@gem_path = File.expand_path("bin/gem")
|
14
|
+
lib_path = File.expand_path("lib")
|
15
|
+
@ruby_options = "-I#{lib_path} -I."
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_gem_help_options
|
19
|
+
gem 'help options'
|
20
|
+
assert_match(/Usage:/, @out)
|
21
|
+
assert_status
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_gem_help_commands
|
25
|
+
gem 'help commands'
|
26
|
+
assert_match(/gem install/, @out)
|
27
|
+
assert_status
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_gem_no_args_shows_help
|
31
|
+
gem
|
32
|
+
assert_match(/Usage:/, @out)
|
33
|
+
assert_status 1
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_environment
|
37
|
+
gem 'environment'
|
38
|
+
|
39
|
+
assert_match /VERSION:\s+(\d+\.)*\d+/, @out
|
40
|
+
assert_match /INSTALLATION DIRECTORY:/, @out
|
41
|
+
assert_match /GEM PATH:/, @out
|
42
|
+
assert_match /REMOTE SOURCES:/, @out
|
43
|
+
assert_status
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_env_version
|
47
|
+
gem 'environment version'
|
48
|
+
assert_match /\d+\.\d+$/, @out
|
49
|
+
end
|
50
|
+
|
51
|
+
def test_env_gemdir
|
52
|
+
gem 'environment gemdir'
|
53
|
+
assert_equal Gem.dir, @out.chomp
|
54
|
+
end
|
55
|
+
|
56
|
+
def test_env_gempath
|
57
|
+
gem 'environment gempath'
|
58
|
+
assert_equal Gem.path, @out.chomp.split("\n")
|
59
|
+
end
|
60
|
+
|
61
|
+
def test_env_remotesources
|
62
|
+
gem 'environment remotesources'
|
63
|
+
assert_equal Gem::RemoteInstaller.new.sources, @out.chomp.split("\n")
|
64
|
+
end
|
65
|
+
|
66
|
+
def test_build
|
67
|
+
OneGem.rebuild(self)
|
68
|
+
assert File.exist?(OneGem::ONEGEM), "Gem file (#{OneGem::ONEGEM}) should exist"
|
69
|
+
assert_match /Successfully built RubyGem/, @out
|
70
|
+
assert_match /Name: one$/, @out
|
71
|
+
assert_match /Version: 0.0.1$/, @out
|
72
|
+
assert_match /File: #{OneGem::ONENAME}/, @out
|
73
|
+
spec = read_gem_file(OneGem::ONEGEM)
|
74
|
+
assert_equal "one", spec.name
|
75
|
+
assert_equal "Test GEM One", spec.summary
|
76
|
+
end
|
77
|
+
|
78
|
+
def test_build_from_yaml
|
79
|
+
OneGem.rebuild(self)
|
80
|
+
assert File.exist?(OneGem::ONEGEM), "Gem file (#{OneGem::ONEGEM}) should exist"
|
81
|
+
assert_match /Successfully built RubyGem/, @out
|
82
|
+
assert_match /Name: one$/, @out
|
83
|
+
assert_match /Version: 0.0.1$/, @out
|
84
|
+
assert_match /File: #{OneGem::ONENAME}/, @out
|
85
|
+
spec = read_gem_file(OneGem::ONEGEM)
|
86
|
+
assert_equal "one", spec.name
|
87
|
+
assert_equal "Test GEM One", spec.summary
|
88
|
+
end
|
89
|
+
|
90
|
+
def test_bogus_source_hoses_up_remote_install_but_gem_command_gives_decent_error_message
|
91
|
+
@ruby_options << " -rtest/bogussources"
|
92
|
+
gem "install asdf --remote"
|
93
|
+
assert_match(/error/im, @err)
|
94
|
+
assert_status 1
|
95
|
+
end
|
96
|
+
|
97
|
+
def test_all_command_helps
|
98
|
+
mgr = Gem::CommandManager.new
|
99
|
+
mgr.command_names.each do |cmdname|
|
100
|
+
gem "help #{cmdname}"
|
101
|
+
assert_match /Usage: gem #{cmdname}/, @out, "should see help for #{cmdname}"
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
def test_gemrc_paths
|
106
|
+
gem "env --config-file test/testgem.rc"
|
107
|
+
assert_match %{/usr/local/rubygems}, @out
|
108
|
+
assert_match %{/another/spot/for/rubygems}, @out
|
109
|
+
assert_match %{test/data/gemhome}, @out
|
110
|
+
end
|
111
|
+
|
112
|
+
def test_gemrc_args
|
113
|
+
gem "help --config-file test/testgem.rc"
|
114
|
+
assert_match %{gem build}, @out
|
115
|
+
assert_match %{gem install}, @out
|
116
|
+
end
|
117
|
+
|
118
|
+
# :section: Help Methods
|
119
|
+
|
120
|
+
# Run a gem command for the functional test.
|
121
|
+
def gem(options="")
|
122
|
+
shell = Session::Shell.new
|
123
|
+
options = options + " --config-file missing_file" if options !~ /--config-file/
|
124
|
+
command = "ruby #{@ruby_options} #{@gem_path} #{options}"
|
125
|
+
puts "COMMAND: [#{command}]" if @verbose
|
126
|
+
@out, @err = shell.execute command
|
127
|
+
@status = shell.exit_status
|
128
|
+
puts "STATUS: [#{@status}]" if @verbose
|
129
|
+
puts "OUTPUT: [#{@out}]" if @verbose
|
130
|
+
puts "ERROR: [#{@err}]" if @verbose
|
131
|
+
puts "PWD: [#{Dir.pwd}]" if @verbose
|
132
|
+
shell.close
|
133
|
+
end
|
134
|
+
|
135
|
+
private
|
136
|
+
|
137
|
+
def assert_status(expected_status=0)
|
138
|
+
assert_equal expected_status, @status
|
139
|
+
end
|
140
|
+
|
141
|
+
def read_gem_file(filename)
|
142
|
+
Gem::Format.from_file_by_path(filename).spec
|
143
|
+
end
|
144
|
+
|
145
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# Create a test environment for gems.
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'rubygems/installer'
|
5
|
+
require 'test/mockgemui'
|
6
|
+
require 'rake'
|
7
|
+
|
8
|
+
module TestEnvironment
|
9
|
+
include Gem::DefaultUserInteraction
|
10
|
+
|
11
|
+
# Create a testing environment for gems.
|
12
|
+
def create
|
13
|
+
return if File.exist? "test/data/gemhome/gems/a-0.0.1"
|
14
|
+
Dir.chdir("test/data") do
|
15
|
+
mkdir "lib" unless File.exists? "lib"
|
16
|
+
open("lib/code.rb", "w") do |f| f.puts "CODE = 1" end unless
|
17
|
+
File.exists? "lib/code.rb"
|
18
|
+
spec = Gem::Specification.new do |s|
|
19
|
+
s.files = ['lib/code.rb']
|
20
|
+
s.name = "a"
|
21
|
+
s.version = "0.0.1"
|
22
|
+
s.summary = "summary"
|
23
|
+
s.description = "desc"
|
24
|
+
s.require_path = 'lib'
|
25
|
+
end
|
26
|
+
use_ui(MockGemUi.new) do
|
27
|
+
Gem::Builder.new(spec).build
|
28
|
+
spec.version = "0.0.2"
|
29
|
+
Gem::Builder.new(spec).build
|
30
|
+
spec.name = 'b'
|
31
|
+
Gem::Builder.new(spec).build
|
32
|
+
spec.name = 'c'
|
33
|
+
spec.version = '1.2'
|
34
|
+
Gem::Builder.new(spec).build
|
35
|
+
FileUtils.mkdir("gemhome") unless File.exist? "gemhome"
|
36
|
+
Gem::Installer.new("a-0.0.1.gem").install(false, "gemhome", false)
|
37
|
+
Gem::Installer.new("a-0.0.2.gem").install(false, "gemhome", false)
|
38
|
+
Gem::Installer.new("b-0.0.2.gem").install(false, "gemhome", false)
|
39
|
+
Gem::Installer.new("c-1.2.gem").install(false, "gemhome", false)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
extend(self)
|
45
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'fileutils'
|
4
|
+
require 'test/yaml_data'
|
5
|
+
|
6
|
+
module Utilities
|
7
|
+
def make_gemhome(path)
|
8
|
+
FileUtils.mkdir_p path
|
9
|
+
end
|
10
|
+
|
11
|
+
def make_cache_area(path, *uris)
|
12
|
+
make_gemhome(path)
|
13
|
+
fn = File.join(path, 'source_cache')
|
14
|
+
open(fn, 'w') do |f| f.write cache_hash(*uris).to_yaml end
|
15
|
+
end
|
16
|
+
|
17
|
+
extend self
|
18
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
Gem::manage_gems
|
5
|
+
|
6
|
+
def install_session
|
7
|
+
path_to_gem = File.join("redist", "session.gem")
|
8
|
+
begin
|
9
|
+
Gem::Installer.new(path_to_gem).install
|
10
|
+
rescue Errno::EACCES => ex
|
11
|
+
puts
|
12
|
+
puts "*****************************************************************"
|
13
|
+
puts "Unable to install Gem 'Session'."
|
14
|
+
puts "Reason: #{ex.message}"
|
15
|
+
puts "Try running:"
|
16
|
+
puts
|
17
|
+
puts " gem -Li #{path_to_gem}"
|
18
|
+
puts
|
19
|
+
puts "with the appropriate admin privileges."
|
20
|
+
puts "*****************************************************************"
|
21
|
+
puts
|
22
|
+
exit
|
23
|
+
end
|
24
|
+
require_gem 'session'
|
25
|
+
end
|
26
|
+
|
27
|
+
begin
|
28
|
+
require_gem 'session'
|
29
|
+
rescue LoadError => e
|
30
|
+
puts
|
31
|
+
puts "Required Gem 'Session' missing."
|
32
|
+
puts "We can attempt to install from the RubyGems Distribution,"
|
33
|
+
puts "but installation may require admin privileges on your system."
|
34
|
+
puts
|
35
|
+
print "Install now from RubyGems distribution? [Yn]"
|
36
|
+
answer = gets
|
37
|
+
if(answer =~ /^y/i || answer =~ /^[^a-zA-Z0-9]$/) then
|
38
|
+
install_session
|
39
|
+
puts
|
40
|
+
puts "Retry running the functional tests."
|
41
|
+
exit(0)
|
42
|
+
else
|
43
|
+
puts "Test cancelled...quitting"
|
44
|
+
exit(1)
|
45
|
+
end
|
46
|
+
end
|
data/test/mockgemui.rb
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'stringio'
|
4
|
+
require 'rubygems/user_interaction'
|
5
|
+
|
6
|
+
class MockGemUi < Gem::StreamUI
|
7
|
+
class TermError < RuntimeError; end
|
8
|
+
|
9
|
+
def initialize(input="")
|
10
|
+
super(StringIO.new(input), StringIO.new, StringIO.new)
|
11
|
+
@terminated = false
|
12
|
+
@banged = false
|
13
|
+
end
|
14
|
+
|
15
|
+
def input
|
16
|
+
@ins.string
|
17
|
+
end
|
18
|
+
|
19
|
+
def output
|
20
|
+
@outs.string
|
21
|
+
end
|
22
|
+
|
23
|
+
def error
|
24
|
+
@errs.string
|
25
|
+
end
|
26
|
+
|
27
|
+
def banged?
|
28
|
+
@banged
|
29
|
+
end
|
30
|
+
|
31
|
+
def terminated?
|
32
|
+
@terminated
|
33
|
+
end
|
34
|
+
|
35
|
+
def terminate_interaction!(status=1)
|
36
|
+
@terminated = true
|
37
|
+
@banged = true
|
38
|
+
fail TermError
|
39
|
+
end
|
40
|
+
|
41
|
+
def terminate_interaction(status=0)
|
42
|
+
@terminated = true
|
43
|
+
fail TermError
|
44
|
+
end
|
45
|
+
end
|
data/test/onegem.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
module OneGem
|
2
|
+
|
3
|
+
ONEDIR = "test/data/one"
|
4
|
+
ONENAME = "one-0.0.1.gem"
|
5
|
+
ONEGEM = "#{ONEDIR}/#{ONENAME}"
|
6
|
+
|
7
|
+
def clear
|
8
|
+
FileUtils.rm_f ONEGEM
|
9
|
+
end
|
10
|
+
|
11
|
+
def build(controller)
|
12
|
+
Dir.chdir(ONEDIR) do
|
13
|
+
controller.gem "build one.gemspec"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def rebuild(controller)
|
18
|
+
clear
|
19
|
+
build(controller)
|
20
|
+
end
|
21
|
+
|
22
|
+
extend self
|
23
|
+
end
|