GRAYBYTE WORDPRESS FILE MANAGER3965

Server IP : 198.54.121.189 / Your IP : 216.73.216.224
System : Linux premium69.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
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /opt/alt/ruby24/lib64/ruby/2.4.0/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /opt/alt/ruby24/lib64/ruby/2.4.0//e2mmap.rb
# frozen_string_literal: false
#
#--
#   e2mmap.rb - for Ruby 1.1
#       $Release Version: 2.0$
#       $Revision: 1.10 $
#       by Keiju ISHITSUKA
#
#++
#
# Helper module for easily defining exceptions with predefined messages.
#
# == Usage
#
# 1.
#   class Foo
#     extend Exception2MessageMapper
#     def_e2message ExistingExceptionClass, "message..."
#     def_exception :NewExceptionClass, "message..."[, superclass]
#     ...
#   end
#
# 2.
#   module Error
#     extend Exception2MessageMapper
#     def_e2message ExistingExceptionClass, "message..."
#     def_exception :NewExceptionClass, "message..."[, superclass]
#     ...
#   end
#   class Foo
#     include Error
#     ...
#   end
#
#   foo = Foo.new
#   foo.Fail ....
#
# 3.
#   module Error
#     extend Exception2MessageMapper
#     def_e2message ExistingExceptionClass, "message..."
#     def_exception :NewExceptionClass, "message..."[, superclass]
#     ...
#   end
#   class Foo
#     extend Exception2MessageMapper
#     include Error
#     ...
#   end
#
#   Foo.Fail NewExceptionClass, arg...
#   Foo.Fail ExistingExceptionClass, arg...
#
#
module Exception2MessageMapper

  E2MM = Exception2MessageMapper # :nodoc:

  def E2MM.extend_object(cl)
    super
    cl.bind(self) unless cl < E2MM
  end

  def bind(cl)
    self.module_eval "#{<<-"begin;"}\n#{<<-"end;"}", __FILE__, __LINE__+1
    begin;
      def Raise(err = nil, *rest)
        Exception2MessageMapper.Raise(self.class, err, *rest)
      end
      alias Fail Raise

      class << self
        undef included
      end
      def self.included(mod)
        mod.extend Exception2MessageMapper
      end
    end;
  end

  # Fail(err, *rest)
  #     err:    exception
  #     rest:   message arguments
  #
  def Raise(err = nil, *rest)
    E2MM.Raise(self, err, *rest)
  end
  alias Fail Raise
  alias fail Raise

  # def_e2message(c, m)
  #         c:  exception
  #         m:  message_form
  #     define exception c with message m.
  #
  def def_e2message(c, m)
    E2MM.def_e2message(self, c, m)
  end

  # def_exception(n, m, s)
  #         n:  exception_name
  #         m:  message_form
  #         s:  superclass(default: StandardError)
  #     define exception named ``c'' with message m.
  #
  def def_exception(n, m, s = StandardError)
    E2MM.def_exception(self, n, m, s)
  end

  #
  # Private definitions.
  #
  # {[class, exp] => message, ...}
  @MessageMap = {}

  # E2MM.def_e2message(k, e, m)
  #         k:  class to define exception under.
  #         e:  exception
  #         m:  message_form
  #     define exception c with message m.
  #
  def E2MM.def_e2message(k, c, m)
    E2MM.instance_eval{@MessageMap[[k, c]] = m}
    c
  end

  # E2MM.def_exception(k, n, m, s)
  #         k:  class to define exception under.
  #         n:  exception_name
  #         m:  message_form
  #         s:  superclass(default: StandardError)
  #     define exception named ``c'' with message m.
  #
  def E2MM.def_exception(k, n, m, s = StandardError)
    e = Class.new(s)
    E2MM.instance_eval{@MessageMap[[k, e]] = m}
    k.module_eval {remove_const(n)} if k.const_defined?(n, false)
    k.const_set(n, e)
  end

  # Fail(klass, err, *rest)
  #     klass:  class to define exception under.
  #     err:    exception
  #     rest:   message arguments
  #
  def E2MM.Raise(klass = E2MM, err = nil, *rest)
    if form = e2mm_message(klass, err)
      b = $@.nil? ? caller(1) : $@
      b.shift if b[0] =~ /^#{Regexp.quote(__FILE__)}:/
      raise err, sprintf(form, *rest), b
    else
      E2MM.Fail E2MM, ErrNotRegisteredException, err.inspect
    end
  end
  class << E2MM
    alias Fail Raise
  end

  def E2MM.e2mm_message(klass, exp)
    for c in klass.ancestors
      if mes = @MessageMap[[c,exp]]
        m = klass.instance_eval('"' + mes + '"')
        return m
      end
    end
    nil
  end
  class << self
    alias message e2mm_message
  end

  E2MM.def_exception(E2MM,
                     :ErrNotRegisteredException,
                     "not registered exception(%s)")
end



[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
March 03 2024 22:47:57
root / root
0755
cgi
--
March 03 2024 22:47:57
root / linksafe
0755
digest
--
March 03 2024 22:47:57
root / linksafe
0755
drb
--
March 03 2024 22:47:57
root / linksafe
0755
fiddle
--
March 03 2024 22:47:57
root / linksafe
0755
forwardable
--
March 03 2024 22:47:57
root / root
0755
io
--
March 03 2024 22:47:59
root / linksafe
0755
irb
--
March 03 2024 22:47:57
root / linksafe
0755
json
--
March 03 2024 22:47:59
root / linksafe
0755
matrix
--
March 03 2024 22:47:57
root / linksafe
0755
net
--
March 03 2024 22:47:57
root / linksafe
0755
openssl
--
March 03 2024 22:47:57
root / linksafe
0755
optparse
--
March 03 2024 22:47:57
root / linksafe
0755
psych
--
March 03 2024 22:48:00
root / linksafe
0755
racc
--
March 03 2024 22:47:57
root / linksafe
0755
rbconfig
--
March 03 2024 22:48:02
root / linksafe
0755
rdoc
--
March 03 2024 22:48:01
root / linksafe
0755
rexml
--
March 03 2024 22:47:57
root / linksafe
0755
rinda
--
March 03 2024 22:47:57
root / linksafe
0755
ripper
--
March 03 2024 22:47:57
root / linksafe
0755
rss
--
March 03 2024 22:47:57
root / linksafe
0755
rubygems
--
March 03 2024 22:48:02
root / linksafe
0755
shell
--
March 03 2024 22:47:57
root / linksafe
0755
syslog
--
March 03 2024 22:47:57
root / root
0755
unicode_normalize
--
March 03 2024 22:47:57
root / root
0755
uri
--
March 03 2024 22:47:57
root / linksafe
0755
webrick
--
March 03 2024 22:47:57
root / linksafe
0755
x86_64-linux
--
March 03 2024 22:48:00
root / root
0755
yaml
--
March 03 2024 22:47:57
root / linksafe
0755
English.rb
6.452 KB
March 31 2020 11:42:18
root / linksafe
0644
abbrev.rb
3.492 KB
March 31 2020 11:42:18
root / linksafe
0644
base64.rb
3.307 KB
March 31 2020 11:42:18
root / linksafe
0644
benchmark.rb
17.898 KB
March 31 2020 11:42:18
root / linksafe
0644
cgi.rb
9.804 KB
March 31 2020 11:42:18
root / linksafe
0644
cmath.rb
9.478 KB
March 31 2020 11:42:18
root / linksafe
0644
csv.rb
83.531 KB
March 31 2020 11:42:18
root / linksafe
0644
date.rb
0.98 KB
July 26 2023 14:47:32
root / linksafe
0644
debug.rb
29.976 KB
March 31 2020 11:42:18
root / linksafe
0644
delegate.rb
10.306 KB
March 31 2020 11:42:18
root / linksafe
0644
digest.rb
2.826 KB
July 26 2023 14:47:33
root / linksafe
0644
drb.rb
0.049 KB
March 31 2020 11:42:18
root / linksafe
0644
e2mmap.rb
3.944 KB
March 31 2020 11:42:18
root / linksafe
0644
erb.rb
27.246 KB
March 31 2020 11:42:18
root / linksafe
0644
expect.rb
2.174 KB
July 26 2023 14:47:48
root / linksafe
0644
fiddle.rb
1.683 KB
July 26 2023 14:47:35
root / linksafe
0644
fileutils.rb
44.056 KB
March 31 2020 11:42:18
root / linksafe
0644
find.rb
2.516 KB
March 31 2020 11:42:18
root / linksafe
0644
forwardable.rb
8.504 KB
March 31 2020 11:42:18
root / linksafe
0644
getoptlong.rb
15.409 KB
March 31 2020 11:42:18
root / linksafe
0644
ipaddr.rb
17.1 KB
March 31 2020 11:42:18
root / linksafe
0644
irb.rb
20.289 KB
March 31 2020 11:42:18
root / linksafe
0644
json.rb
1.767 KB
July 26 2023 14:47:36
root / linksafe
0644
kconv.rb
5.768 KB
July 26 2023 14:47:38
root / linksafe
0644
logger.rb
23.534 KB
March 31 2020 11:42:18
root / linksafe
0644
mathn.rb
3.424 KB
March 31 2020 11:42:18
root / linksafe
0644
matrix.rb
53.366 KB
March 31 2020 11:42:18
root / linksafe
0644
mkmf.rb
84.322 KB
July 26 2023 14:46:03
root / linksafe
0644
monitor.rb
7.02 KB
March 31 2020 11:42:18
root / linksafe
0644
mutex_m.rb
2.04 KB
March 31 2020 11:42:18
root / linksafe
0644
observer.rb
5.832 KB
March 31 2020 11:42:18
root / linksafe
0644
open-uri.rb
24.764 KB
March 31 2020 11:42:18
root / linksafe
0644
open3.rb
20.595 KB
March 31 2020 11:42:18
root / linksafe
0644
openssl.rb
0.435 KB
July 26 2023 14:47:47
root / linksafe
0644
optionparser.rb
0.058 KB
March 31 2020 11:42:18
root / linksafe
0644
optparse.rb
57.25 KB
March 31 2020 11:42:18
root / linksafe
0644
ostruct.rb
10.201 KB
March 31 2020 11:42:18
root / linksafe
0644
pathname.rb
16.078 KB
July 26 2023 14:47:47
root / linksafe
0644
pp.rb
14.431 KB
March 31 2020 11:42:18
root / linksafe
0644
prettyprint.rb
15.895 KB
March 31 2020 11:42:18
root / linksafe
0644
prime.rb
12.49 KB
March 31 2020 11:42:18
root / linksafe
0644
profile.rb
0.23 KB
March 31 2020 11:42:18
root / linksafe
0644
profiler.rb
4.539 KB
March 31 2020 11:42:18
root / linksafe
0644
pstore.rb
14.705 KB
March 31 2020 11:42:18
root / linksafe
0644
psych.rb
15.249 KB
July 26 2023 14:47:48
root / linksafe
0644
rdoc.rb
5.065 KB
March 31 2020 11:42:18
root / linksafe
0644
resolv-replace.rb
1.763 KB
March 31 2020 11:42:18
root / linksafe
0644
resolv.rb
73.479 KB
March 31 2020 11:42:18
root / linksafe
0644
ripper.rb
2.556 KB
July 26 2023 14:47:52
root / linksafe
0644
rss.rb
2.871 KB
March 31 2020 11:42:18
root / linksafe
0644
rubygems.rb
35.378 KB
March 31 2020 11:42:18
root / linksafe
0644
scanf.rb
23.558 KB
March 31 2020 11:42:18
root / linksafe
0644
securerandom.rb
7.483 KB
March 31 2020 11:42:18
root / linksafe
0644
set.rb
20.735 KB
March 31 2020 11:42:18
root / linksafe
0644
shell.rb
11.371 KB
March 31 2020 11:42:18
root / linksafe
0644
shellwords.rb
6.657 KB
March 31 2020 11:42:18
root / linksafe
0644
singleton.rb
4.056 KB
March 31 2020 11:42:18
root / linksafe
0644
socket.rb
42.99 KB
July 26 2023 14:47:56
root / linksafe
0644
sync.rb
7.295 KB
March 31 2020 11:42:18
root / linksafe
0644
tempfile.rb
10.802 KB
March 31 2020 11:42:18
root / linksafe
0644
thwait.rb
3.351 KB
March 31 2020 11:42:18
root / linksafe
0644
time.rb
22.355 KB
March 31 2020 11:42:18
root / linksafe
0644
timeout.rb
3.825 KB
March 31 2020 11:42:18
root / linksafe
0644
tmpdir.rb
4.295 KB
March 31 2020 11:42:18
root / linksafe
0644
tracer.rb
6.44 KB
March 31 2020 11:42:18
root / linksafe
0644
tsort.rb
14.299 KB
March 31 2020 11:42:18
root / linksafe
0644
ubygems.rb
0.291 KB
March 31 2020 11:42:18
root / linksafe
0644
un.rb
9.176 KB
March 31 2020 11:42:18
root / linksafe
0644
unicode_normalize.rb
3.196 KB
March 31 2020 11:42:18
root / linksafe
0644
uri.rb
3.1 KB
March 31 2020 11:42:18
root / linksafe
0644
weakref.rb
2.946 KB
March 31 2020 11:42:18
root / linksafe
0644
webrick.rb
6.72 KB
March 31 2020 11:42:18
root / linksafe
0644
yaml.rb
1.73 KB
March 31 2020 11:42:18
root / linksafe
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF