Permalink
Browse files

Tag REL_0_9_0_8

git-svn-id: http://rubygems.rubyforge.org/svn/tags/REL_0_9_0_8@1168 3d4018f9-ac1a-0410-99e9-8a154d859a19
  • Loading branch information...
1 parent 0146649 commit ae4db31f957417e62830e9fd3ebc53ff6afd57fe drbrain committed Dec 24, 2006
View
@@ -1,3 +1,8 @@
+2006-12-23 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/command.rb lib/rubygems/gem_commands.rb: Make help
+ output fit in 80 columns.
+
2006-12-20 Eric Hodel <drbrain@segment7.net>
* lib/rubygems/remote_fetcher.rb (Gem::RemoteFetcher#fetch_size): Give
View
@@ -54,8 +54,8 @@ CLOBBER.include(
desc "Run all tests"
task :default => [:test]
-desc "Run all tests"
-task :test => [:test_all]
+desc "Run unit tests (functionals fail on win32)"
+task :test => [:test_units]
desc "Run just the unit tests"
Rake::TestTask.new(:test_units) do |t|
@@ -171,19 +171,19 @@ task :update_version => [:prerelease] do
if ENV['RELTEST']
announce "Release Task Testing, skipping commiting of new version"
else
- sh %{cvs commit -m "Updated to version #{PKG_VERSION}" lib/rubygems/rubygems_version.rb} # "
+ sh %{svn commit -m "Updated to version #{PKG_VERSION}" lib/rubygems/rubygems_version.rb} # "
end
end
end
task :tag => [:prerelease] do
reltag = "REL_#{PKG_VERSION.gsub(/\./, '_')}"
- reltag << ENV['REUSE'].gsub(/\./, '_') if ENV['REUSE']
- announce "Tagging CVS with [#{reltag}]"
+ reltag = "REL_#{ENV['REUSE'].gsub(/\./, '_')}" if ENV['REUSE']
+ announce "Tagging SVN with [#{reltag}]"
if ENV['RELTEST']
- announce "Release Task Testing, skipping CVS tagging"
+ announce "Release Task Testing, skipping SVN tagging"
else
- sh %{cvs tag #{reltag}}
+ sh %{cd ..; svn copy trunk tags/#{reltag}}
end
end
View
@@ -37,7 +37,7 @@ def execute
# Override to display the usage for an individual gem command.
def usage
- "#{program_name}"
+ program_name
end
# Override to provide details of the arguments a command takes.
@@ -166,7 +166,9 @@ def create_option_parser
@parser.separator("")
end
@parser.separator(" Summary:")
- @parser.separator(" #@summary")
+ wrap(@summary, 80 - 4).each do |line|
+ @parser.separator(" #{line.strip}")
+ end
unless defaults_str.empty?
@parser.separator("")
@parser.separator(" Defaults:")
@@ -187,6 +189,11 @@ def configure_options(option_list, option_names)
end
end
+ # Wraps +text+ to +width+
+ def wrap(text, width)
+ text.gsub(/(.{1,#{width}})( +|$\n?)|(.{1,#{width}})/, "\\1\\3\n")
+ end
+
##################################################################
# Class methods for Command.
class << self
@@ -63,8 +63,8 @@ module LocalRemoteOptions
# Add the local/remote options to the command line parser.
def add_local_remote_options
add_option('-l', '--local',
- 'Restrict operations to the LOCAL domain (default)') do
- |value, options|
+ 'Restrict operations to the LOCAL domain'
+ ) do |value, options|
options[:domain] = :local
end
@@ -101,32 +101,32 @@ module InstallUpdateOptions
# Add the install/update options to the option parser.
def add_install_update_options
add_option('-i', '--install-dir DIR',
- 'Gem repository directory to get installed gems.') do
- |value, options|
+ 'Gem repository directory to get installed',
+ 'gems.') do |value, options|
options[:install_dir] = File.expand_path(value)
end
add_option('-d', '--[no-]rdoc',
- 'Generate RDoc documentation for the gem on install') do
- |value, options|
+ 'Generate RDoc documentation for the gem on',
+ 'install') do |value, options|
options[:generate_rdoc] = value
end
add_option('--[no-]ri',
- 'Generate RI documentation for the gem on install') do
- |value, options|
+ 'Generate RI documentation for the gem on',
+ 'install') do |value, options|
options[:generate_ri] = value
end
add_option('-E', '--env-shebang',
- "Rewrite the shebang line on installed scripts to use /usr/bin/env") do
- |value, options|
+ "Rewrite the shebang line on installed",
+ "scripts to use /usr/bin/env") do |value, options|
options[:env_shebang] = value
end
add_option('-f', '--[no-]force',
- 'Force gem to install, bypassing dependency checks') do
- |value, options|
+ 'Force gem to install, bypassing dependency',
+ 'checks') do |value, options|
options[:force] = value
end
@@ -156,8 +156,8 @@ def add_install_update_options
end
add_option('-y', '--include-dependencies',
- 'Unconditionally install the required dependent gems') do
- |value, options|
+ 'Unconditionally install the required',
+ 'dependent gems') do |value, options|
options[:include_dependencies] = value
end
end
@@ -174,13 +174,14 @@ def install_update_defaults_str
module VersionOption
# Add the options to the option parser.
- def add_version_option(taskname)
+ def add_version_option(taskname, *wrap)
add_option('-v', '--version VERSION',
- "Specify version of gem to #{taskname}") do
- |value, options|
+ "Specify version of gem to #{taskname}", *wrap) do
+ |value, options|
options[:version] = value
end
end
+
end
####################################################################
@@ -343,7 +344,7 @@ def execute
class SourcesCommand < Command
def initialize
- super 'sources', 'Manage the sources Rubygems will search forgems'
+ super 'sources', 'Manage the sources RubyGems will search forgems'
add_option '-a', '--add SOURCE_URI', 'Add source' do |value, options|
options[:add] = value
@@ -423,14 +424,14 @@ def initialize
end
add_option('-i', '--[no-]ignore-dependencies',
- 'Ignore dependency requirements while uninstalling'
- ) do |value, options|
+ 'Ignore dependency requirements while',
+ 'uninstalling') do |value, options|
options[:ignore] = value
end
add_option('-x', '--[no-]executables',
- 'Uninstall applicable executables without confirmation'
- ) do |value, options|
+ 'Uninstall applicable executables without',
+ 'confirmation') do |value, options|
options[:executables] = value
end
@@ -481,7 +482,9 @@ def initialize
end
end
- add_option('-r', '--remove STRING', 'Remove trusted certificates containing STRING.') do |value, options|
+ add_option('-r', '--remove STRING',
+ 'Remove trusted certificates containing',
+ 'STRING.') do |value, options|
trust_dir = Gem::Security::OPT[:trust_dir]
glob_str = File::join(trust_dir, '*.pem')
@@ -495,8 +498,8 @@ def initialize
end
add_option('-b', '--build EMAIL_ADDR',
- 'Build private key and self-signed certificate for EMAIL_ADDR.'
- ) do |value, options|
+ 'Build private key and self-signed',
+ 'certificate for EMAIL_ADDR.') do |value, options|
vals = Gem::Security::build_self_signed_cert(value)
File::chmod(0600, vals[:key_path])
puts "Public Cert: #{vals[:cert_path]}",
@@ -505,23 +508,21 @@ def initialize
end
add_option('-C', '--certificate CERT',
- 'Certificate for --sign command.'
- ) do |value, options|
+ 'Certificate for --sign command.') do |value, options|
cert = OpenSSL::X509::Certificate.new(File.read(value))
Gem::Security::OPT[:issuer_cert] = cert
end
add_option('-K', '--private-key KEY',
- 'Private key for --sign command.'
- ) do |value, options|
+ 'Private key for --sign command.') do |value, options|
key = OpenSSL::PKey::RSA.new(File.read(value))
Gem::Security::OPT[:issuer_key] = key
end
add_option('-s', '--sign NEWCERT',
- 'Sign a certificate with my key and certificate.'
- ) do |value, options|
+ 'Sign a certificate with my key and',
+ 'certificate.') do |value, options|
cert = OpenSSL::X509::Certificate.new(File.read(value))
my_cert = Gem::Security::OPT[:issuer_cert]
my_key = Gem::Security::OPT[:issuer_key]
@@ -644,17 +645,26 @@ class CheckCommand < Command
include CommandAids
def initialize
- super('check', 'Check installed gems', {:verify => false, :alien => false})
- add_option('-v', '--verify FILE', 'Verify gem file against its internal checksum') do |value, options|
+ super('check', 'Check installed gems',
+ {:verify => false, :alien => false})
+
+ add_option('-v', '--verify FILE',
+ 'Verify gem file against its internal',
+ 'checksum') do |value, options|
options[:verify] = value
end
- add_option('-a', '--alien', "Report 'unmanaged' or rogue files in the gem repository") do |value, options|
+
+ add_option('-a', '--alien', "Report 'unmanaged' or rogue files in the",
+ "gem repository") do |value, options|
options[:alien] = true
end
+
add_option('-t', '--test', "Run unit tests for gem") do |value, options|
options[:test] = true
end
- add_option('-V', '--version', "Specify version for which to run unit tests") do |value, options|
+
+ add_option('-V', '--version',
+ "Specify version for which to run unit tests") do |value, options|
options[:version] = value
end
end
@@ -1009,7 +1019,7 @@ class CleanupCommand < Command
def initialize
super(
'cleanup',
- 'Cleanup old versions of installed gems in the local repository',
+ 'Clean up old versions of installed gems in the local repository',
{
:force => false,
:test => false,
@@ -1086,11 +1096,11 @@ def initialize
:version => "> 0.0.0"
})
add_option('--all',
- 'Restore all installed gems to pristine condition'
+ 'Restore all installed gems to pristine', 'condition'
) do |value, options|
options[:all] = value
end
- add_version_option('restore to pristine condition')
+ add_version_option('restore to', 'pristine condition')
end
def defaults_str
@@ -1181,8 +1191,8 @@ def initialize
:include_ri => true,
})
add_option('--all',
- 'Generate RDoc/RI documentation for all installed gems'
- ) do |value, options|
+ 'Generate RDoc/RI documentation for all',
+ 'installed gems') do |value, options|
options[:all] = value
end
add_option('--[no-]rdoc',
@@ -1244,7 +1254,7 @@ class EnvironmentCommand < Command
include CommandAids
def initialize
- super('environment', 'Display RubyGems environmental information')
+ super('environment', 'Display information about the RubyGems environment')
end
def usage
@@ -1280,7 +1290,7 @@ def execute
elsif arg
fail Gem::CommandLineError, "Unknown enviroment option [#{arg}]"
else
- out = "Rubygems Environment:\n"
+ out = "RubyGems Environment:\n"
out << " - VERSION: #{Gem::RubyGemsVersion} (#{Gem::RubyGemsPackageVersion})\n"
out << " - INSTALLATION DIRECTORY: #{Gem.dir}\n"
out << " - GEM PATH:\n"
@@ -1303,10 +1313,12 @@ class SpecificationCommand < Command
include CommandAids
def initialize
- super('specification', 'Display gem specification (in yaml)', {:domain=>:local, :version=>"> 0.0.0"})
+ super('specification', 'Display gem specification (in yaml)',
+ {:domain=>:local, :version=>"> 0.0.0"})
add_version_option('examine')
add_local_remote_options
- add_option('--all', 'Output specifications for all versions of the gem') do
+ add_option('--all', 'Output specifications for all versions of',
+ 'the gem') do |value, options|
options[:all] = true
end
end
@@ -1448,18 +1460,33 @@ def arguments
def execute
arg = options[:args][0]
if begins?("commands", arg)
- require 'stringio'
- out = StringIO.new
- out.puts "\nGEM commands are:\n\n"
- desc_indent = command_manager.command_names.collect {|n| n.size}.max + 4
- format = " %-#{desc_indent}s %s\n"
+ out = []
+ out << "GEM commands are:"
+ out << nil
+
+ margin_width = 4
+ desc_width = command_manager.command_names.collect {|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|
- out.printf format, "#{cmd_name}", command_manager[cmd_name].summary
+ summary = command_manager[cmd_name].summary
+ 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.puts "\nFor help on a particular command, use 'gem help COMMAND'."
- out.puts "\nCommands may be abbreviated, so long as they are unambiguous."
- out.puts "e.g. 'gem i rake' is short for 'gem install rake'."
- say out.string
+
+ 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)
say Gem::HELP
elsif begins?("examples", arg)
@@ -2,5 +2,5 @@
# This file is auto-generated by build scripts.
# See: rake update_version
module Gem
- RubyGemsVersion = '0.9.0.7'
+ RubyGemsVersion = '0.9.0.8'
end
Oops, something went wrong.

0 comments on commit ae4db31

Please sign in to comment.