SILENT KILLERPanel

Current Path: > > opt > alt > ruby32 > > share > rubygems > rubygems


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: //opt/alt/ruby32//share/rubygems/rubygems

NameTypeSizeLast ModifiedActions
commands Directory - -
core_ext Directory - -
defaults Directory - -
ext Directory - -
gemcutter_utilities Directory - -
optparse Directory - -
package Directory - -
request Directory - -
request_set Directory - -
resolver Directory - -
security Directory - -
source Directory - -
ssl_certs Directory - -
tsort Directory - -
util Directory - -
available_set.rb File 3086 bytes April 24 2025 07:53:50.
basic_specification.rb File 7836 bytes April 24 2025 07:53:50.
bundler_version_finder.rb File 2010 bytes April 24 2025 07:53:50.
command.rb File 16463 bytes April 24 2025 07:53:50.
command_manager.rb File 5726 bytes April 24 2025 07:53:50.
compatibility.rb File 1027 bytes April 24 2025 07:53:50.
config_file.rb File 14367 bytes April 24 2025 07:53:50.
defaults.rb File 7122 bytes April 24 2025 07:53:50.
dependency.rb File 8854 bytes April 24 2025 07:53:50.
dependency_installer.rb File 10256 bytes April 24 2025 07:53:50.
dependency_list.rb File 5676 bytes April 24 2025 07:53:50.
deprecate.rb File 5007 bytes April 24 2025 07:53:50.
doctor.rb File 3205 bytes April 24 2025 07:53:50.
errors.rb File 4634 bytes April 24 2025 07:53:50.
exceptions.rb File 7516 bytes April 24 2025 07:53:50.
ext.rb File 498 bytes April 24 2025 07:53:50.
gem_runner.rb File 1839 bytes April 24 2025 07:53:50.
gemcutter_utilities.rb File 10788 bytes April 24 2025 07:53:50.
indexer.rb File 11169 bytes April 24 2025 07:53:50.
install_default_message.rb File 349 bytes April 24 2025 07:53:50.
install_message.rb File 323 bytes April 24 2025 07:53:50.
install_update_options.rb File 6507 bytes April 24 2025 07:53:50.
installer.rb File 27885 bytes April 24 2025 07:53:50.
installer_uninstaller_utils.rb File 773 bytes April 24 2025 07:53:50.
local_remote_options.rb File 3647 bytes April 24 2025 07:53:50.
mock_gem_ui.rb File 1413 bytes April 24 2025 07:53:50.
name_tuple.rb File 2445 bytes April 24 2025 07:53:50.
openssl.rb File 125 bytes April 24 2025 07:53:50.
optparse.rb File 72 bytes April 24 2025 07:53:50.
package.rb File 18120 bytes April 24 2025 07:53:50.
package_task.rb File 3885 bytes April 24 2025 07:53:50.
path_support.rb File 1828 bytes April 24 2025 07:53:50.
platform.rb File 7663 bytes April 24 2025 07:53:50.
psych_tree.rb File 795 bytes April 24 2025 07:53:50.
query_utils.rb File 8699 bytes April 24 2025 07:53:50.
rdoc.rb File 232 bytes April 24 2025 07:53:50.
remote_fetcher.rb File 9417 bytes April 24 2025 07:53:50.
request.rb File 8803 bytes April 24 2025 07:53:50.
request_set.rb File 11582 bytes April 24 2025 07:53:50.
requirement.rb File 7055 bytes April 24 2025 07:53:50.
resolver.rb File 9870 bytes April 24 2025 07:53:50.
s3_uri_signer.rb File 6066 bytes April 24 2025 07:53:50.
safe_yaml.rb File 1578 bytes April 24 2025 07:53:50.
security.rb File 22476 bytes April 24 2025 07:53:50.
security_option.rb File 1084 bytes April 24 2025 07:53:50.
shellwords.rb File 66 bytes April 24 2025 07:53:50.
source.rb File 5710 bytes April 24 2025 07:53:50.
source_list.rb File 2466 bytes April 24 2025 07:53:50.
spec_fetcher.rb File 6515 bytes April 24 2025 07:53:50.
specification.rb File 72144 bytes April 24 2025 07:53:50.
specification_policy.rb File 14124 bytes April 24 2025 07:53:50.
stub_specification.rb File 4569 bytes April 24 2025 07:53:50.
text.rb File 2117 bytes April 24 2025 07:53:50.
tsort.rb File 66 bytes April 24 2025 07:53:50.
uninstaller.rb File 10445 bytes April 24 2025 07:53:50.
unknown_command_spell_checker.rb File 411 bytes April 24 2025 07:53:50.
update_suggestion.rb File 2313 bytes April 24 2025 07:53:50.
uri.rb File 2382 bytes April 24 2025 07:53:50.
uri_formatter.rb File 781 bytes April 24 2025 07:53:50.
user_interaction.rb File 13354 bytes April 24 2025 07:53:50.
util.rb File 2465 bytes April 24 2025 07:53:50.
validator.rb File 3744 bytes April 24 2025 07:53:50.
version.rb File 12870 bytes April 24 2025 07:53:50.
version_option.rb File 2262 bytes April 24 2025 07:53:50.

Reading File: //opt/alt/ruby32//share/rubygems/rubygems/text.rb

# frozen_string_literal: true

##
# A collection of text-wrangling methods

module Gem::Text

  ##
  # Remove any non-printable characters and make the text suitable for
  # printing.
  def clean_text(text)
    text.gsub(/[\000-\b\v-\f\016-\037\177]/, ".")
  end

  def truncate_text(text, description, max_length = 100_000)
    raise ArgumentError, "max_length must be positive" unless max_length > 0
    return text if text.size <= max_length
    "Truncating #{description} to #{max_length.to_s.reverse.gsub(/...(?=.)/,'\&,').reverse} characters:\n" + text[0, max_length]
  end

  ##
  # Wraps +text+ to +wrap+ characters and optionally indents by +indent+
  # characters

  def format_text(text, wrap, indent=0)
    result = []
    work = clean_text(text)

    while work.length > wrap do
      if work =~ /^(.{0,#{wrap}})[ \n]/
        result << $1.rstrip
        work.slice!(0, $&.length)
      else
        result << work.slice!(0, wrap)
      end
    end

    result << work if work.length.nonzero?
    result.join("\n").gsub(/^/, " " * indent)
  end

  def min3(a, b, c) # :nodoc:
    if a < b && a < c
      a
    elsif b < c
      b
    else
      c
    end
  end

  # Returns a value representing the "cost" of transforming str1 into str2
  # Vendored version of DidYouMean::Levenshtein.distance from the ruby/did_you_mean gem @ 1.4.0
  # https://github.com/ruby/did_you_mean/blob/2ddf39b874808685965dbc47d344cf6c7651807c/lib/did_you_mean/levenshtein.rb#L7-L37
  def levenshtein_distance(str1, str2)
    n = str1.length
    m = str2.length
    return m if n.zero?
    return n if m.zero?

    d = (0..m).to_a
    x = nil

    # to avoid duplicating an enumerable object, create it outside of the loop
    str2_codepoints = str2.codepoints

    str1.each_codepoint.with_index(1) do |char1, i|
      j = 0
      while j < m
        cost = (char1 == str2_codepoints[j]) ? 0 : 1
        x = min3(
          d[j + 1] + 1, # insertion
          i + 1,      # deletion
          d[j] + cost # substitution
        )
        d[j] = i
        i = x

        j += 1
      end
      d[m] = x
    end

    x
  end
end

SILENT KILLER Tool