rubygems-update 1.3.2 → 1.3.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.tar.gz.sig +0 -0
- data/ChangeLog +61 -0
- data/Manifest.txt +1 -0
- data/doc/release_notes/rel_1_3_3.rdoc +95 -0
- data/lib/rubygems.rb +25 -4
- data/lib/rubygems/command_manager.rb +8 -8
- data/lib/rubygems/commands/cleanup_command.rb +11 -5
- data/lib/rubygems/commands/install_command.rb +1 -1
- data/lib/rubygems/commands/server_command.rb +23 -1
- data/lib/rubygems/commands/specification_command.rb +30 -3
- data/lib/rubygems/doc_manager.rb +4 -8
- data/lib/rubygems/ext/configure_builder.rb +1 -0
- data/lib/rubygems/ext/rake_builder.rb +1 -1
- data/lib/rubygems/package_task.rb +9 -8
- data/lib/rubygems/requirement.rb +1 -1
- data/lib/rubygems/rubygems_version.rb +1 -1
- data/lib/rubygems/server.rb +188 -4
- data/lib/rubygems/specification.rb +28 -20
- data/lib/rubygems/uninstaller.rb +13 -13
- data/lib/rubygems/version.rb +30 -8
- data/test/test_gem.rb +8 -0
- data/test/test_gem_commands_server_command.rb +26 -0
- data/test/test_gem_commands_specification_command.rb +13 -0
- data/test/test_gem_server.rb +10 -0
- data/test/test_gem_specification.rb +50 -26
- data/test/test_gem_uninstaller.rb +30 -0
- data/test/test_gem_version.rb +12 -0
- data/test/test_kernel.rb +3 -1
- metadata +4 -3
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/ChangeLog
CHANGED
@@ -1,5 +1,66 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
|
3
|
+
2009-05-04 Eric Hodel <drbrain@segment7.net>
|
4
|
+
|
5
|
+
* lib/rubygems/rubygems_version.rb: 1.3.3.
|
6
|
+
* doc/release_notes/rel_1_3_3.rdoc: RubyGems 1.3.3 release notes.
|
7
|
+
* lib/rubygems/specification.rb: Default has_rdoc to true, ignore
|
8
|
+
its value.
|
9
|
+
* lib/rubygems/doc_manager.rb: Always generate RDoc regardless of
|
10
|
+
#has_rdoc?
|
11
|
+
* lib/rubygems.rb: Raise Gem::LoadError if Kernel#gem fails due to
|
12
|
+
previously-loaded gem. Bug reported by Alf Mikula.
|
13
|
+
|
14
|
+
2009-05-02 Eric Hodel <drbrain@segment7.net>
|
15
|
+
|
16
|
+
* lib/rubygems/commands/server_command.rb: Allow port names with
|
17
|
+
--port.
|
18
|
+
* lib/rubygems/requirement.rb: Match prerelease versions and ~>
|
19
|
+
correctly. Patch #25759 by Yossef Mendelssohn.
|
20
|
+
|
21
|
+
2009-05-01 Eric Hodel <drbrain@segment7.net>
|
22
|
+
|
23
|
+
* lib/rubygems/specification.rb: Check bindir for executables, not
|
24
|
+
root. Bug reported by David Chelimsky. Remove Time.today, no way
|
25
|
+
to override it before RubyGems loads. Bug #25564 by Emanuele
|
26
|
+
Vicentini. Raise Gem::Exception for #installation_path when not
|
27
|
+
installed. Bug #25741 by Daniel Berger. Don't error in #validate
|
28
|
+
when homepage is nil. Bug #25677 by Mike Burrows.
|
29
|
+
* lib/rubygems/commands/cleanup_command.rb: Clean up --user-install
|
30
|
+
gems. Bug #25516 by Brett Eisenberg.
|
31
|
+
* lib/rubygems/uninstaller.rb: Uninstall executables from the correct
|
32
|
+
directory. Bug #25555 by Brett Eisenberg.
|
33
|
+
* lib/rubygems/server.rb: Add search that jumps to RDoc. Patch
|
34
|
+
#22959 by Vladimir Dobriakov.
|
35
|
+
|
36
|
+
2009-05-01 James Tucker <jftucker@gmail.com>
|
37
|
+
|
38
|
+
* lib/rubygems.rb: Gem.bin_path now escapes paths with spaces.
|
39
|
+
|
40
|
+
2009-04-30 Daniel Berger <djberg96@gmail.com>
|
41
|
+
|
42
|
+
* lib/rubygems/commands/install_command.rb: Replaced deprecated
|
43
|
+
Gem::SourceIndex method 'search' with 'find_name' when using
|
44
|
+
the -t option. Fixes bug # 25632 by Daniel Berger.
|
45
|
+
|
46
|
+
2009-04-30 James Tucker <jftucker@gmail.com>
|
47
|
+
|
48
|
+
* lib/rubygems/ext/rake_builder.rb: Use explicit ruby command loading
|
49
|
+
rubygems to invoke rake.
|
50
|
+
|
51
|
+
2009-04-24 Eric Hodel <drbrain@segment7.net>
|
52
|
+
|
53
|
+
* lib/rubygems/commands/specification_command.rb: Added requesting
|
54
|
+
single fields from a spec.
|
55
|
+
|
56
|
+
2009-04-23 James Tucker <jftucker@gmail.com>
|
57
|
+
|
58
|
+
* lib/rubygems/ext/configure_builder.rb: Support Gem::Command.build_args.
|
59
|
+
|
60
|
+
2009-04-15 Eric Hodel <drbrain@segment7.net>
|
61
|
+
|
62
|
+
* lib/rubygems/rubygems_version.rb: 1.3.2.
|
63
|
+
|
3
64
|
2009-04-14 Eric Hodel <drbrain@segment7.net>
|
4
65
|
|
5
66
|
* lib/rubygems/specification.rb: Complain when summary and
|
data/Manifest.txt
CHANGED
@@ -0,0 +1,95 @@
|
|
1
|
+
= Announce: RubyGems Release 1.3.3
|
2
|
+
|
3
|
+
NOTE: RubyGems 1.1 and 1.2 have problems upgrading when there is no
|
4
|
+
rubygems-update installed. You will need to follow the second set of update
|
5
|
+
instructions if you see "Nothing to update".
|
6
|
+
|
7
|
+
Release 1.3.3 fixes some bugs and adds some features.
|
8
|
+
|
9
|
+
New Features:
|
10
|
+
|
11
|
+
* `gem server` allows port names (from /etc/services) with --port.
|
12
|
+
* `gem server` now has search that jumps to RDoc. Patch #22959 by Vladimir
|
13
|
+
Dobriakov.
|
14
|
+
* `gem spec` can retrieve single fields from a spec (like `gem spec rake
|
15
|
+
authors`).
|
16
|
+
* Gem::Specification#has_rdoc= is deprecated and ignored (defaults to true)
|
17
|
+
* RDoc is now generated regardless of Gem::Specification#has_rdoc?
|
18
|
+
|
19
|
+
Bug Fixes:
|
20
|
+
|
21
|
+
* `gem clean` now cleans up --user-install gems. Bug #25516 by Brett
|
22
|
+
Eisenberg.
|
23
|
+
* Gem.bin_path now escapes paths with spaces.
|
24
|
+
* Rake extension builder uses explicit correctly loads rubygems when invoking
|
25
|
+
rake.
|
26
|
+
* Prerelease versions now match "~>" correctly. Patch #25759 by Yossef
|
27
|
+
Mendelssohn.
|
28
|
+
* Check bindir for executables, not root when validating. Bug reported by
|
29
|
+
David Chelimsky.
|
30
|
+
* Remove Time.today, no way to override it before RubyGems loads. Bug #25564
|
31
|
+
by Emanuele Vicentini
|
32
|
+
* Raise Gem::Exception for #installation_path when not installed. Bug #25741
|
33
|
+
by Daniel Berger.
|
34
|
+
* Don't raise in Gem::Specification#validate when homepage is nil. Bug #25677
|
35
|
+
by Mike Burrows.
|
36
|
+
* Uninstall executables from the correct directory. Bug #25555 by Brett
|
37
|
+
Eisenberg.
|
38
|
+
* Raise Gem::LoadError if Kernel#gem fails due to previously-loaded gem. Bug
|
39
|
+
reported by Alf Mikula.
|
40
|
+
|
41
|
+
Deprecation Notices:
|
42
|
+
|
43
|
+
* Gem::manage_gems has been removed.
|
44
|
+
* Time::today has been removed early. There was no way to make it warn and be
|
45
|
+
easy to override with user code.
|
46
|
+
|
47
|
+
For a full list of changes to RubyGems and the contributor for each change, see
|
48
|
+
the ChangeLog file.
|
49
|
+
|
50
|
+
== How can I get RubyGems?
|
51
|
+
|
52
|
+
NOTE: If you have installed RubyGems using a package system you may want to
|
53
|
+
install a new RubyGems through the same packaging system.
|
54
|
+
|
55
|
+
If you have a recent version of RubyGems (0.8.5 or later), then all
|
56
|
+
you need to do is:
|
57
|
+
|
58
|
+
$ gem update --system (you might need to be admin/root)
|
59
|
+
|
60
|
+
NOTE: RubyGems 1.1 and 1.2 have problems upgrading when there is no
|
61
|
+
rubygems-update installed. You will need to follow the second set of update
|
62
|
+
instructions if you see "Nothing to update".
|
63
|
+
|
64
|
+
NOTE: You may have to run the command twice if you have any previosly
|
65
|
+
installed rubygems-update gems.
|
66
|
+
|
67
|
+
If you have an older version of RubyGems installed, then you can still
|
68
|
+
do it in two steps:
|
69
|
+
|
70
|
+
$ gem install rubygems-update (again, might need to be admin/root)
|
71
|
+
$ update_rubygems (... here too)
|
72
|
+
|
73
|
+
If you don't have any gems install, there is still the pre-gem
|
74
|
+
approach to getting software ... doing it manually:
|
75
|
+
|
76
|
+
1. DOWNLOAD FROM: http://rubyforge.org/frs/?group_id=126
|
77
|
+
2. UNPACK INTO A DIRECTORY AND CD THERE
|
78
|
+
3. INSTALL WITH: ruby setup.rb (you may need admin/root privilege)
|
79
|
+
|
80
|
+
== To File Bugs
|
81
|
+
|
82
|
+
The RubyGems bug tracker can be found on RubyForge at:
|
83
|
+
http://rubyforge.org/tracker/?func=add&group_id=126&atid=575
|
84
|
+
|
85
|
+
When filing a bug, `gem env` output will be helpful in diagnosing the issue.
|
86
|
+
|
87
|
+
If you find a bug where RubyGems crashes, please provide debug output. You can
|
88
|
+
do that with `gem --debug the_command`.
|
89
|
+
|
90
|
+
== Thanks
|
91
|
+
|
92
|
+
Keep those gems coming!
|
93
|
+
|
94
|
+
-- The RubyGems team
|
95
|
+
|
data/lib/rubygems.rb
CHANGED
@@ -11,9 +11,26 @@ require 'thread'
|
|
11
11
|
require 'etc'
|
12
12
|
|
13
13
|
module Gem
|
14
|
+
|
15
|
+
##
|
16
|
+
# Raised when RubyGems is unable to load or activate a gem. Contains the
|
17
|
+
# name and version requirements of the gem that either conflicts with
|
18
|
+
# already activated gems or that RubyGems is otherwise unable to activate.
|
19
|
+
|
14
20
|
class LoadError < ::LoadError
|
15
|
-
|
21
|
+
|
22
|
+
##
|
23
|
+
# Name of gem
|
24
|
+
|
25
|
+
attr_accessor :name
|
26
|
+
|
27
|
+
##
|
28
|
+
# Version requirement of gem
|
29
|
+
|
30
|
+
attr_accessor :version_requirement
|
31
|
+
|
16
32
|
end
|
33
|
+
|
17
34
|
end
|
18
35
|
|
19
36
|
module Kernel
|
@@ -249,13 +266,17 @@ module Gem
|
|
249
266
|
|
250
267
|
unless matches.any? { |spec| spec.version == existing_spec.version } then
|
251
268
|
sources_message = sources.map { |spec| spec.full_name }
|
252
|
-
stack_message = @loaded_stacks[gem.name].map { |spec| spec.full_name }
|
269
|
+
stack_message = @loaded_stacks[gem.name].map { |spec| spec.full_name }
|
253
270
|
|
254
271
|
msg = "can't activate #{gem} for #{sources_message.inspect}, "
|
255
272
|
msg << "already activated #{existing_spec.full_name} for "
|
256
273
|
msg << "#{stack_message.inspect}"
|
257
274
|
|
258
|
-
|
275
|
+
e = Gem::LoadError.new msg
|
276
|
+
e.name = gem.name
|
277
|
+
e.version_requirement = gem.version_requirements
|
278
|
+
|
279
|
+
raise e
|
259
280
|
end
|
260
281
|
|
261
282
|
return false
|
@@ -362,7 +383,7 @@ module Gem
|
|
362
383
|
raise Gem::Exception, msg
|
363
384
|
end
|
364
385
|
|
365
|
-
File.join
|
386
|
+
File.join(spec.full_gem_path, spec.bindir, exec_name).sub(/.*\s.*/m, '"\&"')
|
366
387
|
end
|
367
388
|
|
368
389
|
##
|
@@ -30,14 +30,14 @@ require 'rubygems/user_interaction'
|
|
30
30
|
class Gem::CommandManager
|
31
31
|
|
32
32
|
include Gem::UserInteraction
|
33
|
-
|
33
|
+
|
34
34
|
##
|
35
35
|
# Return the authoritative instance of the command manager.
|
36
36
|
|
37
37
|
def self.instance
|
38
38
|
@command_manager ||= new
|
39
39
|
end
|
40
|
-
|
40
|
+
|
41
41
|
##
|
42
42
|
# Register all the subcommands supported by the gem command.
|
43
43
|
|
@@ -71,14 +71,14 @@ class Gem::CommandManager
|
|
71
71
|
register_command :update
|
72
72
|
register_command :which
|
73
73
|
end
|
74
|
-
|
74
|
+
|
75
75
|
##
|
76
76
|
# Register the command object.
|
77
77
|
|
78
78
|
def register_command(command_obj)
|
79
79
|
@commands[command_obj] = false
|
80
80
|
end
|
81
|
-
|
81
|
+
|
82
82
|
##
|
83
83
|
# Return the registered command from the command name.
|
84
84
|
|
@@ -87,14 +87,14 @@ class Gem::CommandManager
|
|
87
87
|
return nil if @commands[command_name].nil?
|
88
88
|
@commands[command_name] ||= load_and_instantiate(command_name)
|
89
89
|
end
|
90
|
-
|
90
|
+
|
91
91
|
##
|
92
92
|
# Return a sorted list of all command names (as strings).
|
93
93
|
|
94
94
|
def command_names
|
95
95
|
@commands.keys.collect {|key| key.to_s}.sort
|
96
96
|
end
|
97
|
-
|
97
|
+
|
98
98
|
##
|
99
99
|
# Run the config specified by +args+.
|
100
100
|
|
@@ -115,7 +115,7 @@ class Gem::CommandManager
|
|
115
115
|
if args.size == 0
|
116
116
|
say Gem::Command::HELP
|
117
117
|
terminate_interaction(1)
|
118
|
-
end
|
118
|
+
end
|
119
119
|
case args[0]
|
120
120
|
when '-h', '--help'
|
121
121
|
say Gem::Command::HELP
|
@@ -149,7 +149,7 @@ class Gem::CommandManager
|
|
149
149
|
|
150
150
|
command_names.select { |n| cmd_name == n[0, len] }
|
151
151
|
end
|
152
|
-
|
152
|
+
|
153
153
|
private
|
154
154
|
|
155
155
|
def load_and_instantiate(command_name)
|
@@ -77,15 +77,21 @@ installed elsewhere in GEM_PATH the cleanup command won't touch it.
|
|
77
77
|
say "Attempting to uninstall #{spec.full_name}"
|
78
78
|
|
79
79
|
options[:args] = [spec.name]
|
80
|
-
options[:version] = "= #{spec.version}"
|
81
|
-
options[:executables] = false
|
82
80
|
|
83
|
-
|
81
|
+
uninstall_options = {
|
82
|
+
:executables => false,
|
83
|
+
:version => "= #{spec.version}",
|
84
|
+
}
|
85
|
+
|
86
|
+
if Gem.user_dir == spec.installation_path then
|
87
|
+
uninstall_options[:install_dir] = spec.installation_path
|
88
|
+
end
|
89
|
+
|
90
|
+
uninstaller = Gem::Uninstaller.new spec.name, uninstall_options
|
84
91
|
|
85
92
|
begin
|
86
93
|
uninstaller.uninstall
|
87
|
-
rescue Gem::DependencyRemovalException,
|
88
|
-
Gem::InstallError,
|
94
|
+
rescue Gem::DependencyRemovalException, Gem::InstallError,
|
89
95
|
Gem::GemNotInHomeException => e
|
90
96
|
say "Unable to uninstall #{spec.full_name}:"
|
91
97
|
say "\t#{e.class}: #{e.message}"
|
@@ -115,7 +115,7 @@ version is also installed.
|
|
115
115
|
|
116
116
|
if options[:test] then
|
117
117
|
installed_gems.each do |spec|
|
118
|
-
gem_spec = Gem::SourceIndex.from_installed_gems.
|
118
|
+
gem_spec = Gem::SourceIndex.from_installed_gems.find_name(spec.name, spec.version.version).first
|
119
119
|
result = Gem::Validator.new.unit_test(gem_spec)
|
120
120
|
if result and not result.passed?
|
121
121
|
unless ask_yes_no("...keep Gem?", true)
|
@@ -7,7 +7,23 @@ class Gem::Commands::ServerCommand < Gem::Command
|
|
7
7
|
super 'server', 'Documentation and gem repository HTTP server',
|
8
8
|
:port => 8808, :gemdir => Gem.dir, :daemon => false
|
9
9
|
|
10
|
-
|
10
|
+
OptionParser.accept :Port do |port|
|
11
|
+
if port =~ /\A\d+\z/ then
|
12
|
+
port = Integer port
|
13
|
+
raise OptionParser::InvalidArgument, "#{port}: not a port number" if
|
14
|
+
port > 65535
|
15
|
+
|
16
|
+
port
|
17
|
+
else
|
18
|
+
begin
|
19
|
+
Socket.getservbyname port
|
20
|
+
rescue SocketError => e
|
21
|
+
raise OptionParser::InvalidArgument, "#{port}: no such named service"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
add_option '-p', '--port=PORT', :Port,
|
11
27
|
'port to listen on' do |port, options|
|
12
28
|
options[:port] = port
|
13
29
|
end
|
@@ -37,6 +53,12 @@ for gem installation.
|
|
37
53
|
|
38
54
|
To install gems from a running server, use `gem install GEMNAME --source
|
39
55
|
http://gem_server_host:8808`
|
56
|
+
|
57
|
+
You can set up a shortcut to gem server documentation using the URL:
|
58
|
+
|
59
|
+
http://localhost:8808/rdoc?q=%s - Firefox
|
60
|
+
http://localhost:8808/rdoc?q=* - LaunchBar
|
61
|
+
|
40
62
|
EOF
|
41
63
|
end
|
42
64
|
|
@@ -39,7 +39,10 @@ class Gem::Commands::SpecificationCommand < Gem::Command
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def arguments # :nodoc:
|
42
|
-
|
42
|
+
<<-ARGS
|
43
|
+
GEMFILE name of gem to show the gemspec for
|
44
|
+
FIELD name of gemspec field to show
|
45
|
+
ARGS
|
43
46
|
end
|
44
47
|
|
45
48
|
def defaults_str # :nodoc:
|
@@ -47,14 +50,35 @@ class Gem::Commands::SpecificationCommand < Gem::Command
|
|
47
50
|
end
|
48
51
|
|
49
52
|
def usage # :nodoc:
|
50
|
-
"#{program_name} [GEMFILE]"
|
53
|
+
"#{program_name} [GEMFILE] [FIELD]"
|
51
54
|
end
|
52
55
|
|
53
56
|
def execute
|
54
57
|
specs = []
|
55
|
-
gem =
|
58
|
+
gem = options[:args].shift
|
59
|
+
|
60
|
+
unless gem then
|
61
|
+
raise Gem::CommandLineError,
|
62
|
+
"Please specify a gem name or file on the command line"
|
63
|
+
end
|
64
|
+
|
56
65
|
dep = Gem::Dependency.new gem, options[:version]
|
57
66
|
|
67
|
+
field = get_one_optional_argument
|
68
|
+
|
69
|
+
if field then
|
70
|
+
field = field.intern
|
71
|
+
|
72
|
+
if options[:format] == :ruby then
|
73
|
+
raise Gem::CommandLineError, "--ruby and FIELD are mutually exclusive"
|
74
|
+
end
|
75
|
+
|
76
|
+
unless Gem::Specification.attribute_names.include? field then
|
77
|
+
raise Gem::CommandLineError,
|
78
|
+
"no field %p on Gem::Specification" % field.to_s
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
58
82
|
if local? then
|
59
83
|
if File.exist? gem then
|
60
84
|
specs << Gem::Format.from_file_by_path(gem).spec rescue nil
|
@@ -77,11 +101,14 @@ class Gem::Commands::SpecificationCommand < Gem::Command
|
|
77
101
|
end
|
78
102
|
|
79
103
|
output = lambda do |s|
|
104
|
+
s = s.send field if field
|
105
|
+
|
80
106
|
say case options[:format]
|
81
107
|
when :ruby then s.to_ruby
|
82
108
|
when :marshal then Marshal.dump s
|
83
109
|
else s.to_yaml
|
84
110
|
end
|
111
|
+
|
85
112
|
say "\n"
|
86
113
|
end
|
87
114
|
|
data/lib/rubygems/doc_manager.rb
CHANGED
@@ -105,10 +105,8 @@ class Gem::DocManager
|
|
105
105
|
# RI docs generation to fail if run after RDoc).
|
106
106
|
|
107
107
|
def generate_ri
|
108
|
-
|
109
|
-
|
110
|
-
install_ri # RDoc bug, ri goes first
|
111
|
-
end
|
108
|
+
setup_rdoc
|
109
|
+
install_ri # RDoc bug, ri goes first
|
112
110
|
|
113
111
|
FileUtils.mkdir_p @doc_dir unless File.exist?(@doc_dir)
|
114
112
|
end
|
@@ -121,10 +119,8 @@ class Gem::DocManager
|
|
121
119
|
# RI docs generation to fail if run after RDoc).
|
122
120
|
|
123
121
|
def generate_rdoc
|
124
|
-
|
125
|
-
|
126
|
-
install_rdoc
|
127
|
-
end
|
122
|
+
setup_rdoc
|
123
|
+
install_rdoc
|
128
124
|
|
129
125
|
FileUtils.mkdir_p @doc_dir unless File.exist?(@doc_dir)
|
130
126
|
end
|