mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rubygems: Update to RubyGems 2.1.3
Fixed installing platform gems Restored concurrent requires Fixed installing gems with extensions with --install-dir Fixed `gem fetch -v` to install the latest version Fixed installing gems with "./" in their files entries * test/rubygems/test_gem_package.rb: Tests for the above. * NEWS: Updated for RubyGems 2.1.3 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
85995e88d4
commit
1daa0b113d
110 changed files with 3493 additions and 4942 deletions
|
@ -46,10 +46,6 @@ Some examples of 'gem' usage.
|
|||
* Update all gems on your system:
|
||||
|
||||
gem update
|
||||
|
||||
* Update your local version of RubyGems
|
||||
|
||||
gem update --system
|
||||
EOF
|
||||
|
||||
PLATFORMS = <<-'EOF'
|
||||
|
@ -59,9 +55,8 @@ your current platform by running `gem environment`.
|
|||
|
||||
RubyGems matches platforms as follows:
|
||||
|
||||
* The CPU must match exactly unless one of the platforms has
|
||||
"universal" as the CPU or the local CPU starts with "arm" and the gem's
|
||||
CPU is exactly "arm" (for gems that support generic ARM architecture).
|
||||
* The CPU must match exactly, unless one of the platforms has
|
||||
"universal" as the CPU.
|
||||
* The OS must match exactly.
|
||||
* The versions must match exactly unless one of the versions is nil.
|
||||
|
||||
|
@ -71,20 +66,11 @@ you pass must match "#{cpu}-#{os}" or "#{cpu}-#{os}-#{version}". On mswin
|
|||
platforms, the version is the compiler version, not the OS version. (Ruby
|
||||
compiled with VC6 uses "60" as the compiler version, VC8 uses "80".)
|
||||
|
||||
For the ARM architecture, gems with a platform of "arm-linux" should run on a
|
||||
reasonable set of ARM CPUs and not depend on instructions present on a limited
|
||||
subset of the architecture. For example, the binary should run on platforms
|
||||
armv5, armv6hf, armv6l, armv7, etc. If you use the "arm-linux" platform
|
||||
please test your gem on a variety of ARM hardware before release to ensure it
|
||||
functions correctly.
|
||||
|
||||
Example platforms:
|
||||
|
||||
x86-freebsd # Any FreeBSD version on an x86 CPU
|
||||
universal-darwin-8 # Darwin 8 only gems that run on any CPU
|
||||
x86-mswin32-80 # Windows gems compiled with VC8
|
||||
armv7-linux # Gem complied for an ARMv7 CPU running linux
|
||||
arm-linux # Gem compiled for any ARM CPU running linux
|
||||
|
||||
When building platform gems, set the platform in the gem specification to
|
||||
Gem::Platform::CURRENT. This will correctly mark the gem with your ruby's
|
||||
|
@ -94,8 +80,6 @@ platform.
|
|||
|
||||
def initialize
|
||||
super 'help', "Provide help on the 'gem' command"
|
||||
|
||||
@command_manager = Gem::CommandManager.instance
|
||||
end
|
||||
|
||||
def arguments # :nodoc:
|
||||
|
@ -112,10 +96,46 @@ platform.
|
|||
end
|
||||
|
||||
def execute
|
||||
command_manager = Gem::CommandManager.instance
|
||||
arg = options[:args][0]
|
||||
|
||||
if begins? "commands", arg then
|
||||
show_commands
|
||||
out = []
|
||||
out << "GEM commands are:"
|
||||
out << nil
|
||||
|
||||
margin_width = 4
|
||||
|
||||
desc_width = command_manager.command_names.map { |n| n.size }.max + 4
|
||||
|
||||
summary_width = 80 - margin_width - desc_width
|
||||
wrap_indent = ' ' * (margin_width + desc_width)
|
||||
format = "#{' ' * margin_width}%-#{desc_width}s%s"
|
||||
|
||||
command_manager.command_names.each do |cmd_name|
|
||||
command = command_manager[cmd_name]
|
||||
|
||||
summary =
|
||||
if command then
|
||||
command.summary
|
||||
else
|
||||
"[No command found for #{cmd_name}, bug?]"
|
||||
end
|
||||
|
||||
summary = wrap(summary, summary_width).split "\n"
|
||||
out << sprintf(format, cmd_name, summary.shift)
|
||||
until summary.empty? do
|
||||
out << "#{wrap_indent}#{summary.shift}"
|
||||
end
|
||||
end
|
||||
|
||||
out << nil
|
||||
out << "For help on a particular command, use 'gem help COMMAND'."
|
||||
out << nil
|
||||
out << "Commands may be abbreviated, so long as they are unambiguous."
|
||||
out << "e.g. 'gem i rake' is short for 'gem install rake'."
|
||||
|
||||
say out.join("\n")
|
||||
|
||||
elsif begins? "options", arg then
|
||||
say Gem::Command::HELP
|
||||
|
@ -127,79 +147,29 @@ platform.
|
|||
say PLATFORMS
|
||||
|
||||
elsif options[:help] then
|
||||
show_help
|
||||
command = command_manager[options[:help]]
|
||||
if command
|
||||
# help with provided command
|
||||
command.invoke("--help")
|
||||
else
|
||||
alert_error "Unknown command #{options[:help]}. Try 'gem help commands'"
|
||||
end
|
||||
|
||||
elsif arg then
|
||||
show_command_help arg
|
||||
possibilities = command_manager.find_command_possibilities(arg.downcase)
|
||||
if possibilities.size == 1
|
||||
command = command_manager[possibilities.first]
|
||||
command.invoke("--help")
|
||||
elsif possibilities.size > 1
|
||||
alert_warning "Ambiguous command #{arg} (#{possibilities.join(', ')})"
|
||||
else
|
||||
alert_warning "Unknown command #{arg}. Try gem help commands"
|
||||
end
|
||||
|
||||
else
|
||||
say Gem::Command::HELP
|
||||
end
|
||||
end
|
||||
|
||||
def show_commands # :nodoc:
|
||||
out = []
|
||||
out << "GEM commands are:"
|
||||
out << nil
|
||||
|
||||
margin_width = 4
|
||||
|
||||
desc_width = @command_manager.command_names.map { |n| n.size }.max + 4
|
||||
|
||||
summary_width = 80 - margin_width - desc_width
|
||||
wrap_indent = ' ' * (margin_width + desc_width)
|
||||
format = "#{' ' * margin_width}%-#{desc_width}s%s"
|
||||
|
||||
@command_manager.command_names.each do |cmd_name|
|
||||
command = @command_manager[cmd_name]
|
||||
|
||||
summary =
|
||||
if command then
|
||||
command.summary
|
||||
else
|
||||
"[No command found for #{cmd_name}]"
|
||||
end
|
||||
|
||||
summary = wrap(summary, summary_width).split "\n"
|
||||
out << sprintf(format, cmd_name, summary.shift)
|
||||
until summary.empty? do
|
||||
out << "#{wrap_indent}#{summary.shift}"
|
||||
end
|
||||
end
|
||||
|
||||
out << nil
|
||||
out << "For help on a particular command, use 'gem help COMMAND'."
|
||||
out << nil
|
||||
out << "Commands may be abbreviated, so long as they are unambiguous."
|
||||
out << "e.g. 'gem i rake' is short for 'gem install rake'."
|
||||
|
||||
say out.join("\n")
|
||||
end
|
||||
|
||||
def show_command_help command_name # :nodoc:
|
||||
command_name = command_name.downcase
|
||||
|
||||
possibilities = @command_manager.find_command_possibilities command_name
|
||||
|
||||
if possibilities.size == 1 then
|
||||
command = @command_manager[possibilities.first]
|
||||
command.invoke("--help")
|
||||
elsif possibilities.size > 1 then
|
||||
alert_warning "Ambiguous command #{command_name} (#{possibilities.join(', ')})"
|
||||
else
|
||||
alert_warning "Unknown command #{command_name}. Try: gem help commands"
|
||||
end
|
||||
end
|
||||
|
||||
def show_help # :nodoc:
|
||||
command = @command_manager[options[:help]]
|
||||
if command then
|
||||
# help with provided command
|
||||
command.invoke("--help")
|
||||
else
|
||||
alert_error "Unknown command #{options[:help]}. Try 'gem help commands'"
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue