X7ROOT File Manager
Current Path:
/opt/alt/ruby18/lib64/ruby/site_ruby/1.8/rubygems
opt
/
alt
/
ruby18
/
lib64
/
ruby
/
site_ruby
/
1.8
/
rubygems
/
ðŸ“
..
📄
builder.rb
(2.21 KB)
📄
command.rb
(12.46 KB)
📄
command_manager.rb
(4.67 KB)
ðŸ“
commands
📄
config_file.rb
(9.69 KB)
📄
custom_require.rb
(1.83 KB)
📄
defaults.rb
(2.65 KB)
📄
dependency.rb
(6.43 KB)
📄
dependency_installer.rb
(9.94 KB)
📄
dependency_list.rb
(5.58 KB)
📄
deprecate.rb
(1.81 KB)
📄
doc_manager.rb
(5.55 KB)
📄
errors.rb
(793 B)
📄
exceptions.rb
(2.34 KB)
ðŸ“
ext
📄
ext.rb
(379 B)
📄
format.rb
(1.96 KB)
📄
gem_openssl.rb
(2.24 KB)
📄
gem_path_searcher.rb
(4.57 KB)
📄
gem_runner.rb
(2.38 KB)
📄
gemcutter_utilities.rb
(1.86 KB)
📄
indexer.rb
(16.93 KB)
📄
install_update_options.rb
(3.87 KB)
📄
installer.rb
(17.02 KB)
📄
installer_test_case.rb
(3.1 KB)
📄
local_remote_options.rb
(3.36 KB)
📄
mock_gem_ui.rb
(1.05 KB)
📄
old_format.rb
(3.69 KB)
ðŸ“
package
📄
package.rb
(2.15 KB)
📄
package_task.rb
(3.79 KB)
📄
path_support.rb
(1.5 KB)
📄
platform.rb
(5.55 KB)
📄
psych_additions.rb
(249 B)
📄
psych_tree.rb
(687 B)
📄
remote_fetcher.rb
(13.78 KB)
📄
require_paths_builder.rb
(577 B)
📄
requirement.rb
(5.01 KB)
📄
security.rb
(28.83 KB)
📄
server.rb
(21.93 KB)
📄
source_index.rb
(11 KB)
📄
spec_fetcher.rb
(7.17 KB)
📄
specification.rb
(54.83 KB)
ðŸ“
ssl_certs
📄
syck_hack.rb
(2.02 KB)
📄
test_case.rb
(23.22 KB)
📄
test_utilities.rb
(3.47 KB)
📄
text.rb
(1.23 KB)
📄
uninstaller.rb
(6.77 KB)
📄
user_interaction.rb
(11.22 KB)
📄
validator.rb
(4.65 KB)
📄
version.rb
(10.19 KB)
📄
version_option.rb
(1.59 KB)
Editing: command_manager.rb
#-- # Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others. # All rights reserved. # See LICENSE.txt for permissions. #++ require 'rubygems/command' require 'rubygems/user_interaction' ## # The command manager registers and installs all the individual sub-commands # supported by the gem command. # # Extra commands can be provided by writing a rubygems_plugin.rb # file in an installed gem. You should register your command against the # Gem::CommandManager instance, like this: # # # file rubygems_plugin.rb # require 'rubygems/command_manager' # # class Gem::Commands::EditCommand < Gem::Command # # ... # end # # Gem::CommandManager.instance.register_command :edit # # See Gem::Command for instructions on writing gem commands. class Gem::CommandManager include Gem::UserInteraction ## # Return the authoritative instance of the command manager. def self.instance @command_manager ||= new end ## # Reset the authoritative instance of the command manager. def self.reset @command_manager = nil end ## # Register all the subcommands supported by the gem command. def initialize require 'timeout' @commands = {} register_command :build register_command :cert register_command :check register_command :cleanup register_command :contents register_command :dependency register_command :environment register_command :fetch register_command :generate_index register_command :help register_command :install register_command :list register_command :lock register_command :outdated register_command :owner register_command :pristine register_command :push register_command :query register_command :rdoc register_command :search register_command :server register_command :sources register_command :specification register_command :stale register_command :uninstall register_command :unpack register_command :update register_command :which end ## # Register the Symbol +command+ as a gem command. def register_command(command) @commands[command] = false end ## # Unregister the Symbol +command+ as a gem command. def unregister_command(command) @commands.delete command end ## # Return the registered command from the command name. def [](command_name) command_name = command_name.intern return nil if @commands[command_name].nil? @commands[command_name] ||= load_and_instantiate(command_name) end ## # Return a sorted list of all command names (as strings). def command_names @commands.keys.collect {|key| key.to_s}.sort end ## # Run the config specified by +args+. def run(args) process_args(args) rescue StandardError, Timeout::Error => ex alert_error "While executing gem ... (#{ex.class})\n #{ex.to_s}" ui.errs.puts "\t#{ex.backtrace.join "\n\t"}" if Gem.configuration.backtrace terminate_interaction(1) rescue Interrupt alert_error "Interrupted" terminate_interaction(1) end def process_args(args) args = args.to_str.split(/\s+/) if args.respond_to?(:to_str) if args.size == 0 say Gem::Command::HELP terminate_interaction(1) end case args[0] when '-h', '--help' say Gem::Command::HELP terminate_interaction(0) when '-v', '--version' say Gem::VERSION terminate_interaction(0) when /^-/ alert_error "Invalid option: #{args[0]}. See 'gem --help'." terminate_interaction(1) else cmd_name = args.shift.downcase cmd = find_command(cmd_name) cmd.invoke(*args) end end def find_command(cmd_name) possibilities = find_command_possibilities cmd_name if possibilities.size > 1 then raise "Ambiguous command #{cmd_name} matches [#{possibilities.join(', ')}]" elsif possibilities.size < 1 then raise "Unknown command #{cmd_name}" end self[possibilities.first] end def find_command_possibilities(cmd_name) len = cmd_name.length command_names.select { |n| cmd_name == n[0, len] } end private def load_and_instantiate(command_name) command_name = command_name.to_s const_name = command_name.capitalize.gsub(/_(.)/) { $1.upcase } << "Command" commands = Gem::Commands retried = false begin commands.const_get(const_name).new rescue NameError raise if retried retried = true begin require "rubygems/commands/#{command_name}_command" rescue Exception => e alert_error "Loading command: #{command_name} (#{e.class})\n #{e}" ui.errs.puts "\t#{e.backtrace.join "\n\t"}" if Gem.configuration.backtrace end retry end end end
Upload File
Create Folder