diff options
Diffstat (limited to 'lib/rubygems/commands')
35 files changed, 70 insertions, 0 deletions
diff --git a/lib/rubygems/commands/build_command.rb b/lib/rubygems/commands/build_command.rb index decdca06bb..e2b5def1e8 100644 --- a/lib/rubygems/commands/build_command.rb +++ b/lib/rubygems/commands/build_command.rb @@ -3,6 +3,7 @@ require 'rubygems/command' require 'rubygems/package' class Gem::Commands::BuildCommand < Gem::Command + def initialize super 'build', 'Build a gem from a gemspec' @@ -107,4 +108,5 @@ Gems can be saved to a specified filename with the output option: terminate_interaction 1 end end + end diff --git a/lib/rubygems/commands/cert_command.rb b/lib/rubygems/commands/cert_command.rb index e5355d3652..5a093dd92f 100644 --- a/lib/rubygems/commands/cert_command.rb +++ b/lib/rubygems/commands/cert_command.rb @@ -3,6 +3,7 @@ require 'rubygems/command' require 'rubygems/security' class Gem::Commands::CertCommand < Gem::Command + def initialize super 'cert', 'Manage RubyGems certificates and signing settings', :add => [], :remove => [], :list => [], :build => [], :sign => [] @@ -311,4 +312,5 @@ For further reading on signing gems see `ri Gem::Security`. # It's simple, but is all we need email =~ /\A.+@.+\z/ end + end if defined?(OpenSSL::SSL) diff --git a/lib/rubygems/commands/check_command.rb b/lib/rubygems/commands/check_command.rb index 8b8eda53cf..7905b8ab69 100644 --- a/lib/rubygems/commands/check_command.rb +++ b/lib/rubygems/commands/check_command.rb @@ -5,6 +5,7 @@ require 'rubygems/validator' require 'rubygems/doctor' class Gem::Commands::CheckCommand < Gem::Command + include Gem::VersionOption def initialize @@ -89,4 +90,5 @@ specifications and will clean up gems that have been partially uninstalled. def usage # :nodoc: "#{program_name} [OPTIONS] [GEMNAME ...]" end + end diff --git a/lib/rubygems/commands/cleanup_command.rb b/lib/rubygems/commands/cleanup_command.rb index b9819a4f96..98cd203208 100644 --- a/lib/rubygems/commands/cleanup_command.rb +++ b/lib/rubygems/commands/cleanup_command.rb @@ -4,6 +4,7 @@ require 'rubygems/dependency_list' require 'rubygems/uninstaller' class Gem::Commands::CleanupCommand < Gem::Command + def initialize super 'cleanup', 'Clean up old versions of installed gems', @@ -180,4 +181,5 @@ If no gems are named all gems in GEM_HOME are cleaned. # Restore path Gem::Uninstaller may have changed Gem.use_paths @original_home, *@original_path end + end diff --git a/lib/rubygems/commands/contents_command.rb b/lib/rubygems/commands/contents_command.rb index f17aed64db..d30b62d43c 100644 --- a/lib/rubygems/commands/contents_command.rb +++ b/lib/rubygems/commands/contents_command.rb @@ -3,6 +3,7 @@ require 'rubygems/command' require 'rubygems/version_option' class Gem::Commands::ContentsCommand < Gem::Command + include Gem::VersionOption def initialize @@ -185,4 +186,5 @@ prefix or only the files that are requireable. [i, File.join(i, "specifications")] end.flatten end + end diff --git a/lib/rubygems/commands/dependency_command.rb b/lib/rubygems/commands/dependency_command.rb index e472d8fa8d..bdb71adc3c 100644 --- a/lib/rubygems/commands/dependency_command.rb +++ b/lib/rubygems/commands/dependency_command.rb @@ -4,6 +4,7 @@ require 'rubygems/local_remote_options' require 'rubygems/version_option' class Gem::Commands::DependencyCommand < Gem::Command + include Gem::LocalRemoteOptions include Gem::VersionOption @@ -214,4 +215,5 @@ use with other commands. /\A#{Regexp.union(*args)}/ end end + end diff --git a/lib/rubygems/commands/environment_command.rb b/lib/rubygems/commands/environment_command.rb index 37429fb836..3d6a7afdae 100644 --- a/lib/rubygems/commands/environment_command.rb +++ b/lib/rubygems/commands/environment_command.rb @@ -2,6 +2,7 @@ require 'rubygems/command' class Gem::Commands::EnvironmentCommand < Gem::Command + def initialize super 'environment', 'Display information about the RubyGems environment' end @@ -171,4 +172,5 @@ lib/rubygems/defaults/operating_system.rb return nil end + end diff --git a/lib/rubygems/commands/fetch_command.rb b/lib/rubygems/commands/fetch_command.rb index 6a1b346dd3..ab77a3b26a 100644 --- a/lib/rubygems/commands/fetch_command.rb +++ b/lib/rubygems/commands/fetch_command.rb @@ -4,6 +4,7 @@ require 'rubygems/local_remote_options' require 'rubygems/version_option' class Gem::Commands::FetchCommand < Gem::Command + include Gem::LocalRemoteOptions include Gem::VersionOption @@ -72,4 +73,5 @@ then repackaging it. say "Downloaded #{spec.full_name}" end end + end diff --git a/lib/rubygems/commands/generate_index_command.rb b/lib/rubygems/commands/generate_index_command.rb index 93e25ef5e4..6dccdcb946 100644 --- a/lib/rubygems/commands/generate_index_command.rb +++ b/lib/rubygems/commands/generate_index_command.rb @@ -8,6 +8,7 @@ require 'rubygems/indexer' # See `gem help generate_index` class Gem::Commands::GenerateIndexCommand < Gem::Command + def initialize super 'generate_index', 'Generates the index files for a gem server directory', @@ -82,4 +83,5 @@ Marshal::MINOR_VERSION constants. It is used to ensure compatibility. end end end + end diff --git a/lib/rubygems/commands/help_command.rb b/lib/rubygems/commands/help_command.rb index 9ba8bf1293..23df79f6ce 100644 --- a/lib/rubygems/commands/help_command.rb +++ b/lib/rubygems/commands/help_command.rb @@ -2,6 +2,7 @@ require 'rubygems/command' class Gem::Commands::HelpCommand < Gem::Command + # :stopdoc: EXAMPLES = <<-EOF.freeze Some examples of 'gem' usage. @@ -369,4 +370,5 @@ platform. alert_warning "Unknown command #{command_name}. Try: gem help commands" end end + end diff --git a/lib/rubygems/commands/info_command.rb b/lib/rubygems/commands/info_command.rb index 9ca6ae364f..a64843405e 100644 --- a/lib/rubygems/commands/info_command.rb +++ b/lib/rubygems/commands/info_command.rb @@ -4,6 +4,7 @@ require 'rubygems/command' require 'rubygems/query_utils' class Gem::Commands::InfoCommand < Gem::Command + include Gem::QueryUtils def initialize @@ -35,4 +36,5 @@ class Gem::Commands::InfoCommand < Gem::Command def defaults_str "--local" end + end diff --git a/lib/rubygems/commands/install_command.rb b/lib/rubygems/commands/install_command.rb index 70825b88fd..6f9a8d2a08 100644 --- a/lib/rubygems/commands/install_command.rb +++ b/lib/rubygems/commands/install_command.rb @@ -12,6 +12,7 @@ require 'rubygems/version_option' # See `gem help install` class Gem::Commands::InstallCommand < Gem::Command + attr_reader :installed_specs # :nodoc: include Gem::VersionOption @@ -269,4 +270,5 @@ You can use `i` command instead of `install`. gems = @installed_specs.length == 1 ? 'gem' : 'gems' say "#{@installed_specs.length} #{gems} installed" end + end diff --git a/lib/rubygems/commands/list_command.rb b/lib/rubygems/commands/list_command.rb index 5c99d3d73d..f94038920f 100644 --- a/lib/rubygems/commands/list_command.rb +++ b/lib/rubygems/commands/list_command.rb @@ -6,6 +6,7 @@ require 'rubygems/query_utils' # Searches for gems starting with the supplied argument. class Gem::Commands::ListCommand < Gem::Command + include Gem::QueryUtils def initialize @@ -38,4 +39,5 @@ To search for remote gems use the search command. def usage # :nodoc: "#{program_name} [REGEXP ...]" end + end diff --git a/lib/rubygems/commands/lock_command.rb b/lib/rubygems/commands/lock_command.rb index f1dc1ac586..ed1d5489b7 100644 --- a/lib/rubygems/commands/lock_command.rb +++ b/lib/rubygems/commands/lock_command.rb @@ -2,6 +2,7 @@ require 'rubygems/command' class Gem::Commands::LockCommand < Gem::Command + def initialize super 'lock', 'Generate a lockdown list of gems', :strict => false @@ -105,4 +106,5 @@ lock it down to the exact version. gemspecs.find {|path| File.exist? path } end + end diff --git a/lib/rubygems/commands/mirror_command.rb b/lib/rubygems/commands/mirror_command.rb index 86671a93b2..4e2a41fa33 100644 --- a/lib/rubygems/commands/mirror_command.rb +++ b/lib/rubygems/commands/mirror_command.rb @@ -3,6 +3,7 @@ require 'rubygems/command' unless defined? Gem::Commands::MirrorCommand class Gem::Commands::MirrorCommand < Gem::Command + def initialize super('mirror', 'Mirror all gem files (requires rubygems-mirror)') begin @@ -21,5 +22,6 @@ The mirror command has been moved to the rubygems-mirror gem. def execute alert_error "Install the rubygems-mirror gem for the mirror command" end + end end diff --git a/lib/rubygems/commands/open_command.rb b/lib/rubygems/commands/open_command.rb index 1e40758ec5..c4ed0c2f1a 100644 --- a/lib/rubygems/commands/open_command.rb +++ b/lib/rubygems/commands/open_command.rb @@ -3,6 +3,7 @@ require 'rubygems/command' require 'rubygems/version_option' class Gem::Commands::OpenCommand < Gem::Command + include Gem::VersionOption def initialize @@ -81,4 +82,5 @@ class Gem::Commands::OpenCommand < Gem::Command say "Unable to find gem '#{name}'" end + end diff --git a/lib/rubygems/commands/outdated_command.rb b/lib/rubygems/commands/outdated_command.rb index 3579bfc3ba..035eaffcbc 100644 --- a/lib/rubygems/commands/outdated_command.rb +++ b/lib/rubygems/commands/outdated_command.rb @@ -5,6 +5,7 @@ require 'rubygems/spec_fetcher' require 'rubygems/version_option' class Gem::Commands::OutdatedCommand < Gem::Command + include Gem::LocalRemoteOptions include Gem::VersionOption @@ -29,4 +30,5 @@ update the gems with the update or install commands. say "#{spec.name} (#{spec.version} < #{remote_version})" end end + end diff --git a/lib/rubygems/commands/owner_command.rb b/lib/rubygems/commands/owner_command.rb index 0f01823967..f8e68c48e7 100644 --- a/lib/rubygems/commands/owner_command.rb +++ b/lib/rubygems/commands/owner_command.rb @@ -5,6 +5,7 @@ require 'rubygems/gemcutter_utilities' require 'rubygems/text' class Gem::Commands::OwnerCommand < Gem::Command + include Gem::Text include Gem::LocalRemoteOptions include Gem::GemcutterUtilities @@ -108,4 +109,5 @@ permission to. request.add_field "OTP", options[:otp] if options[:otp] end end + end diff --git a/lib/rubygems/commands/pristine_command.rb b/lib/rubygems/commands/pristine_command.rb index db8136c9a6..d10060923f 100644 --- a/lib/rubygems/commands/pristine_command.rb +++ b/lib/rubygems/commands/pristine_command.rb @@ -5,6 +5,7 @@ require 'rubygems/installer' require 'rubygems/version_option' class Gem::Commands::PristineCommand < Gem::Command + include Gem::VersionOption def initialize @@ -187,4 +188,5 @@ extensions will be restored. say "Restored #{spec.full_name}" end end + end diff --git a/lib/rubygems/commands/push_command.rb b/lib/rubygems/commands/push_command.rb index 003b2dacc7..dadd397a2a 100644 --- a/lib/rubygems/commands/push_command.rb +++ b/lib/rubygems/commands/push_command.rb @@ -5,6 +5,7 @@ require 'rubygems/gemcutter_utilities' require 'rubygems/package' class Gem::Commands::PushCommand < Gem::Command + include Gem::LocalRemoteOptions include Gem::GemcutterUtilities @@ -103,4 +104,5 @@ The push command will use ~/.gem/credentials to authenticate to a server, but yo gem_metadata["allowed_push_host"] ] end + end diff --git a/lib/rubygems/commands/query_command.rb b/lib/rubygems/commands/query_command.rb index 406a34e549..7a26b55ac6 100644 --- a/lib/rubygems/commands/query_command.rb +++ b/lib/rubygems/commands/query_command.rb @@ -4,6 +4,7 @@ require 'rubygems/query_utils' require 'rubygems/deprecate' class Gem::Commands::QueryCommand < Gem::Command + extend Gem::Deprecate rubygems_deprecate_command @@ -23,4 +24,5 @@ class Gem::Commands::QueryCommand < Gem::Command add_query_options end + end diff --git a/lib/rubygems/commands/rdoc_command.rb b/lib/rubygems/commands/rdoc_command.rb index e8c9e84b29..ff9e1ffcfa 100644 --- a/lib/rubygems/commands/rdoc_command.rb +++ b/lib/rubygems/commands/rdoc_command.rb @@ -5,6 +5,7 @@ require 'rubygems/rdoc' require 'fileutils' class Gem::Commands::RdocCommand < Gem::Command + include Gem::VersionOption def initialize @@ -92,4 +93,5 @@ Use --overwrite to force rebuilding of documentation. end end end + end diff --git a/lib/rubygems/commands/search_command.rb b/lib/rubygems/commands/search_command.rb index aeb2119235..65ee25167c 100644 --- a/lib/rubygems/commands/search_command.rb +++ b/lib/rubygems/commands/search_command.rb @@ -3,6 +3,7 @@ require 'rubygems/command' require 'rubygems/query_utils' class Gem::Commands::SearchCommand < Gem::Command + include Gem::QueryUtils def initialize @@ -37,4 +38,5 @@ To list local gems use the list command. def usage # :nodoc: "#{program_name} [REGEXP]" end + end diff --git a/lib/rubygems/commands/server_command.rb b/lib/rubygems/commands/server_command.rb index 91d5e267f8..e91a8e5176 100644 --- a/lib/rubygems/commands/server_command.rb +++ b/lib/rubygems/commands/server_command.rb @@ -3,6 +3,7 @@ require 'rubygems/command' require 'rubygems/server' class Gem::Commands::ServerCommand < Gem::Command + def initialize super 'server', 'Documentation and gem repository HTTP server', :port => 8808, :gemdir => [], :daemon => false @@ -81,4 +82,5 @@ You can set up a shortcut to gem server documentation using the URL: options[:gemdir] = Gem.path if options[:gemdir].empty? Gem::Server.run options end + end diff --git a/lib/rubygems/commands/setup_command.rb b/lib/rubygems/commands/setup_command.rb index 73c1b65223..4151671982 100644 --- a/lib/rubygems/commands/setup_command.rb +++ b/lib/rubygems/commands/setup_command.rb @@ -6,6 +6,7 @@ require 'rubygems/command' # RubyGems checkout or tarball. class Gem::Commands::SetupCommand < Gem::Command + HISTORY_HEADER = /^===\s*[\d.a-zA-Z]+\s*\/\s*\d{4}-\d{2}-\d{2}\s*$/.freeze VERSION_MATCHER = /^===\s*([\d.a-zA-Z]+)\s*\/\s*\d{4}-\d{2}-\d{2}\s*$/.freeze @@ -735,4 +736,5 @@ abort "#{deprecation_message}" def bin_file_names @bin_file_names ||= [] end + end diff --git a/lib/rubygems/commands/signin_command.rb b/lib/rubygems/commands/signin_command.rb index 2e19c8333c..7c4b5ceb69 100644 --- a/lib/rubygems/commands/signin_command.rb +++ b/lib/rubygems/commands/signin_command.rb @@ -3,6 +3,7 @@ require 'rubygems/command' require 'rubygems/gemcutter_utilities' class Gem::Commands::SigninCommand < Gem::Command + include Gem::GemcutterUtilities def initialize @@ -30,4 +31,5 @@ class Gem::Commands::SigninCommand < Gem::Command def execute sign_in options[:host] end + end diff --git a/lib/rubygems/commands/signout_command.rb b/lib/rubygems/commands/signout_command.rb index ebbe746cb4..2d7329c590 100644 --- a/lib/rubygems/commands/signout_command.rb +++ b/lib/rubygems/commands/signout_command.rb @@ -2,6 +2,7 @@ require 'rubygems/command' class Gem::Commands::SignoutCommand < Gem::Command + def initialize super 'signout', 'Sign out from all the current sessions.' end @@ -28,4 +29,5 @@ class Gem::Commands::SignoutCommand < Gem::Command say 'You have successfully signed out from all sessions.' end end + end diff --git a/lib/rubygems/commands/sources_command.rb b/lib/rubygems/commands/sources_command.rb index 3be3a5dc79..ca9d425232 100644 --- a/lib/rubygems/commands/sources_command.rb +++ b/lib/rubygems/commands/sources_command.rb @@ -5,6 +5,7 @@ require 'rubygems/spec_fetcher' require 'rubygems/local_remote_options' class Gem::Commands::SourcesCommand < Gem::Command + include Gem::LocalRemoteOptions def initialize @@ -219,4 +220,5 @@ To remove a source use the --remove argument: say "*** Unable to remove #{desc} source cache ***" end end + end diff --git a/lib/rubygems/commands/specification_command.rb b/lib/rubygems/commands/specification_command.rb index e4a8afab21..e19bfeed73 100644 --- a/lib/rubygems/commands/specification_command.rb +++ b/lib/rubygems/commands/specification_command.rb @@ -5,6 +5,7 @@ require 'rubygems/version_option' require 'rubygems/package' class Gem::Commands::SpecificationCommand < Gem::Command + include Gem::LocalRemoteOptions include Gem::VersionOption @@ -142,4 +143,5 @@ Specific fields in the specification can be extracted in YAML format: say "\n" end end + end diff --git a/lib/rubygems/commands/stale_command.rb b/lib/rubygems/commands/stale_command.rb index badc9905c1..2fd4388891 100644 --- a/lib/rubygems/commands/stale_command.rb +++ b/lib/rubygems/commands/stale_command.rb @@ -2,6 +2,7 @@ require 'rubygems/command' class Gem::Commands::StaleCommand < Gem::Command + def initialize super('stale', 'List gems along with access times') end @@ -36,4 +37,5 @@ longer using. say "#{name} at #{atime.strftime '%c'}" end end + end diff --git a/lib/rubygems/commands/uninstall_command.rb b/lib/rubygems/commands/uninstall_command.rb index 1540b2f0fb..2aac9e975e 100644 --- a/lib/rubygems/commands/uninstall_command.rb +++ b/lib/rubygems/commands/uninstall_command.rb @@ -10,6 +10,7 @@ require 'fileutils' # See `gem help uninstall` class Gem::Commands::UninstallCommand < Gem::Command + include Gem::VersionOption def initialize @@ -194,4 +195,5 @@ that is a dependency of an existing gem. You can use the def uninstall(gem_name) Gem::Uninstaller.new(gem_name, options).uninstall end + end diff --git a/lib/rubygems/commands/unpack_command.rb b/lib/rubygems/commands/unpack_command.rb index 8d90d08eb4..1091a55f37 100644 --- a/lib/rubygems/commands/unpack_command.rb +++ b/lib/rubygems/commands/unpack_command.rb @@ -13,6 +13,7 @@ module Gem::Security # :nodoc: end class Gem::Commands::UnpackCommand < Gem::Command + include Gem::VersionOption include Gem::SecurityOption @@ -172,4 +173,5 @@ command help for an example. path end + end diff --git a/lib/rubygems/commands/update_command.rb b/lib/rubygems/commands/update_command.rb index bac9c82fc8..612667dfd0 100644 --- a/lib/rubygems/commands/update_command.rb +++ b/lib/rubygems/commands/update_command.rb @@ -10,6 +10,7 @@ require 'rubygems/install_message' # must come before rdoc for messaging require 'rubygems/rdoc' class Gem::Commands::UpdateCommand < Gem::Command + include Gem::InstallUpdateOptions include Gem::LocalRemoteOptions include Gem::VersionOption @@ -309,4 +310,5 @@ command to remove old versions. result end + end diff --git a/lib/rubygems/commands/which_command.rb b/lib/rubygems/commands/which_command.rb index d42ab18395..fca463a1ef 100644 --- a/lib/rubygems/commands/which_command.rb +++ b/lib/rubygems/commands/which_command.rb @@ -2,6 +2,7 @@ require 'rubygems/command' class Gem::Commands::WhichCommand < Gem::Command + def initialize super 'which', 'Find the location of a library file you can require', :search_gems_first => false, :show_all => false @@ -84,4 +85,5 @@ requiring to see why it does not behave as you expect. def usage # :nodoc: "#{program_name} FILE [FILE ...]" end + end diff --git a/lib/rubygems/commands/yank_command.rb b/lib/rubygems/commands/yank_command.rb index 6ad74de96b..3ca05756f6 100644 --- a/lib/rubygems/commands/yank_command.rb +++ b/lib/rubygems/commands/yank_command.rb @@ -5,6 +5,7 @@ require 'rubygems/version_option' require 'rubygems/gemcutter_utilities' class Gem::Commands::YankCommand < Gem::Command + include Gem::LocalRemoteOptions include Gem::VersionOption include Gem::GemcutterUtilities @@ -96,4 +97,5 @@ data you will need to change them immediately and yank your gem. def get_platform_from_requirements(requirements) Gem.platforms[1].to_s if requirements.key? :added_platform end + end |