$70 GRAYBYTE WORDPRESS FILE MANAGER $30

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.217.254 | ADMIN IP 216.73.216.23
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/ruby30/share/rubygems/rubygems/

HOME
Current File : /opt/alt/ruby30/share/rubygems/rubygems//command_manager.rb
# frozen_string_literal: true
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++

require_relative 'command'
require_relative 'user_interaction'
require_relative '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',
    'login'  => 'signin',
    'logout' => 'signout',
  }.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.deprecation_warning if cmd.deprecated?
      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


Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
3 Mar 2024 10.47 PM
root / root
0755
commands
--
17 Jul 2024 8.45 AM
root / linksafe
0755
core_ext
--
17 Jul 2024 8.45 AM
root / linksafe
0755
defaults
--
17 Jul 2024 8.45 AM
root / linksafe
0755
ext
--
17 Jul 2024 8.45 AM
root / linksafe
0755
optparse
--
17 Jul 2024 8.45 AM
root / linksafe
0755
package
--
17 Jul 2024 8.45 AM
root / linksafe
0755
request
--
17 Jul 2024 8.45 AM
root / linksafe
0755
request_set
--
17 Jul 2024 8.45 AM
root / linksafe
0755
resolver
--
17 Jul 2024 8.45 AM
root / linksafe
0755
security
--
17 Jul 2024 8.45 AM
root / linksafe
0755
source
--
17 Jul 2024 8.45 AM
root / linksafe
0755
ssl_certs
--
26 Jun 2024 1.55 PM
root / linksafe
0755
tsort
--
26 Jun 2024 1.55 PM
root / linksafe
0755
util
--
17 Jul 2024 8.45 AM
root / linksafe
0755
available_set.rb
3.013 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
basic_specification.rb
7.703 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
bundler_version_finder.rb
3.041 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
command.rb
15.911 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
command_manager.rb
5.094 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
compatibility.rb
0.998 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
config_file.rb
13.282 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
defaults.rb
7.059 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
dependency.rb
8.597 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
dependency_installer.rb
10.221 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
dependency_list.rb
5.545 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
deprecate.rb
3.444 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
doctor.rb
3.178 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
errors.rb
4.65 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
exceptions.rb
6.347 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
ext.rb
0.449 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
gem_runner.rb
1.901 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
gemcutter_utilities.rb
7.627 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
indexer.rb
10.85 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
install_default_message.rb
0.34 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
install_message.rb
0.314 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
install_update_options.rb
6.305 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
installer.rb
26.401 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
installer_uninstaller_utils.rb
0.755 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
local_remote_options.rb
3.562 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
mock_gem_ui.rb
1.379 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
name_tuple.rb
2.401 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
openssl.rb
0.122 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
optparse.rb
0.07 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
package.rb
17.173 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
package_task.rb
3.793 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
path_support.rb
1.88 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
platform.rb
6.654 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
psych_additions.rb
0.293 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
psych_tree.rb
0.775 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
query_utils.rb
8.608 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
rdoc.rb
0.226 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
remote_fetcher.rb
9.258 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
request.rb
8.618 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
request_set.rb
11.252 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
requirement.rb
6.908 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
resolver.rb
9.646 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
s3_uri_signer.rb
5.907 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
safe_yaml.rb
1.503 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
security.rb
22.401 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
security_option.rb
1.058 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
server.rb
22.867 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
source.rb
5.701 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
source_list.rb
2.518 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
spec_fetcher.rb
6.54 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
specification.rb
70.074 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
specification_policy.rb
13.122 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
stub_specification.rb
4.74 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
text.rb
1.85 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
tsort.rb
0.064 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
uninstaller.rb
10.223 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
uri.rb
2.121 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
uri_formatter.rb
0.763 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
user_interaction.rb
13.114 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
util.rb
2.5 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
validator.rb
3.648 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
version.rb
12.439 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
version_option.rb
2.208 KB
26 Jun 2024 1.55 PM
root / linksafe
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF