/
opt
/
cpanel
/
ea-ruby27
/
root
/
usr
/
share
/
ruby
/
ruby-2.7.8
/
rubygems
/
/opt/cpanel/ea-ruby27/root/usr/share/ruby/ruby-2.7.8/rubygems
mkdir
upload
Name
Size
Mode
Actions
commands/
-
0755
rm
core_ext/
-
0755
rm
defaults/
-
0755
rm
ext/
-
0755
rm
package/
-
0755
rm
request/
-
0755
rm
request_set/
-
0755
rm
resolver/
-
0755
rm
security/
-
0755
rm
source/
-
0755
rm
ssl_certs/
-
0755
rm
util/
-
0755
rm
available_set.rb
3094
0644
edit
dl
rm
basic_specification.rb
7801
0644
edit
dl
rm
bundler_version_finder.rb
3044
0644
edit
dl
rm
command.rb
16169
0644
edit
dl
rm
command_manager.rb
5111
0644
edit
dl
rm
compatibility.rb
1022
0644
edit
dl
rm
config_file.rb
12998
0644
edit
dl
rm
defaults.rb
4879
0644
edit
dl
rm
dependency.rb
8845
0644
edit
dl
rm
dependency_installer.rb
12292
0644
edit
dl
rm
dependency_list.rb
5673
0644
edit
dl
rm
deprecate.rb
1794
0644
edit
dl
rm
doctor.rb
3136
0644
edit
dl
rm
errors.rb
4750
0644
edit
dl
rm
exceptions.rb
6646
0644
edit
dl
rm
ext.rb
460
0644
edit
dl
rm
gemcutter_utilities.rb
5284
0644
edit
dl
rm
gem_runner.rb
2232
0644
edit
dl
rm
indexer.rb
11562
0644
edit
dl
rm
installer.rb
27262
0644
edit
dl
rm
installer_test_case.rb
4911
0644
edit
dl
rm
install_default_message.rb
336
0644
edit
dl
rm
install_message.rb
310
0644
edit
dl
rm
install_update_options.rb
6412
0644
edit
dl
rm
local_remote_options.rb
3619
0644
edit
dl
rm
mock_gem_ui.rb
1418
0644
edit
dl
rm
name_tuple.rb
2480
0644
edit
dl
rm
package.rb
18418
0644
edit
dl
rm
package_task.rb
3888
0644
edit
dl
rm
path_support.rb
1928
0644
edit
dl
rm
platform.rb
6401
0644
edit
dl
rm
psych_additions.rb
300
0644
edit
dl
rm
psych_tree.rb
796
0644
edit
dl
rm
rdoc.rb
524
0644
edit
dl
rm
remote_fetcher.rb
9709
0644
edit
dl
rm
request.rb
8909
0644
edit
dl
rm
request_set.rb
12230
0644
edit
dl
rm
requirement.rb
7323
0644
edit
dl
rm
resolver.rb
9682
0644
edit
dl
rm
s3_uri_signer.rb
6070
0644
edit
dl
rm
safe_yaml.rb
1591
0644
edit
dl
rm
security.rb
21751
0644
edit
dl
rm
security_option.rb
1056
0644
edit
dl
rm
server.rb
23270
0644
edit
dl
rm
source.rb
5511
0644
edit
dl
rm
source_list.rb
2610
0644
edit
dl
rm
source_local.rb
274
0644
edit
dl
rm
source_specific_file.rb
272
0644
edit
dl
rm
specification.rb
72481
0644
edit
dl
rm
specification_policy.rb
11950
0644
edit
dl
rm
spec_fetcher.rb
6450
0644
edit
dl
rm
stub_specification.rb
4857
0644
edit
dl
rm
syck_hack.rb
2170
0644
edit
dl
rm
test_case.rb
40880
0644
edit
dl
rm
test_utilities.rb
9054
0644
edit
dl
rm
text.rb
1894
0644
edit
dl
rm
uninstaller.rb
9043
0644
edit
dl
rm
uri_formatter.rb
778
0644
edit
dl
rm
uri_parser.rb
785
0644
edit
dl
rm
uri_parsing.rb
324
0644
edit
dl
rm
user_interaction.rb
13624
0644
edit
dl
rm
util.rb
2465
0644
edit
dl
rm
validator.rb
3739
0644
edit
dl
rm
version.rb
12744
0644
edit
dl
rm
version_option.rb
2066
0644
edit
dl
rm
Edit:
/opt/cpanel/ea-ruby27/root/usr/share/ruby/ruby-2.7.8/rubygems/command_manager.rb
(5111B)
# frozen_string_literal: true #-- # 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' require 'rubygems/text' ## # 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' # # Gem::CommandManager.instance.register_command :edit # # You should put the implementation of your command in rubygems/commands. # # # file rubygems/commands/edit_command.rb # class Gem::Commands::EditCommand < Gem::Command # # ... # end # # See Gem::Command for instructions on writing gem commands. class Gem::CommandManager include Gem::Text include Gem::UserInteraction BUILTIN_COMMANDS = [ # :nodoc: :build, :cert, :check, :cleanup, :contents, :dependency, :environment, :fetch, :generate_index, :help, :info, :install, :list, :lock, :mirror, :open, :outdated, :owner, :pristine, :push, :query, :rdoc, :search, :server, :signin, :signout, :sources, :specification, :stale, :uninstall, :unpack, :update, :which, :yank, ].freeze ALIAS_COMMANDS = { 'i' => 'install' }.freeze ## # Return the authoritative instance of the command manager. def self.instance @command_manager ||= new end ## # Returns self. Allows a CommandManager instance to stand # in for the class itself. def instance self 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 = {} BUILTIN_COMMANDS.each do |name| register_command name end end ## # Register the Symbol +command+ as a gem command. def register_command(command, obj=false) @commands[command] = obj end ## # Unregister the Symbol +command+ as a gem command. def unregister_command(command) @commands.delete command end ## # Returns a Command instance for +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 command specified by +args+. def run(args, build_args=nil) process_args(args, build_args) rescue StandardError, Timeout::Error => ex alert_error clean_text("While executing gem ... (#{ex.class})\n #{ex}") ui.backtrace ex terminate_interaction(1) rescue Interrupt alert_error clean_text("Interrupted") terminate_interaction(1) end def process_args(args, build_args=nil) if args.empty? say Gem::Command::HELP terminate_interaction 1 end case args.first when '-h', '--help' then say Gem::Command::HELP terminate_interaction 0 when '-v', '--version' then say Gem::VERSION terminate_interaction 0 when /^-/ then alert_error clean_text("Invalid option: #{args.first}. See 'gem --help'.") terminate_interaction 1 else cmd_name = args.shift.downcase cmd = find_command cmd_name cmd.invoke_with_build_args args, build_args end end def find_command(cmd_name) cmd_name = find_alias_command cmd_name possibilities = find_command_possibilities cmd_name if possibilities.size > 1 raise Gem::CommandLineError, "Ambiguous command #{cmd_name} matches [#{possibilities.join(', ')}]" elsif possibilities.empty? raise Gem::CommandLineError, "Unknown command #{cmd_name}" end self[possibilities.first] end def find_alias_command(cmd_name) alias_name = ALIAS_COMMANDS[cmd_name] alias_name ? alias_name : cmd_name end def find_command_possibilities(cmd_name) len = cmd_name.length found = command_names.select { |name| cmd_name == name[0, len] } exact = found.find { |name| name == cmd_name } exact ? [exact] : found end private def load_and_instantiate(command_name) command_name = command_name.to_s const_name = command_name.capitalize.gsub(/_(.)/) { $1.upcase } << "Command" load_error = nil begin begin require "rubygems/commands/#{command_name}_command" rescue LoadError => e load_error = e end Gem::Commands.const_get(const_name).new rescue Exception => e e = load_error if load_error alert_error clean_text("Loading command: #{command_name} (#{e.class})\n\t#{e}") ui.backtrace e end end end
Save
cmd:
run