Constructs the default Hash
of Regexp’s.
Synonym for CGI.unescapeHTML(str)
Synonym for CGI.unescapeElement(str)
Returns a new Fiddle::Function
instance at the memory address of the given name
function.
Raises a DLError
if the name
doesn’t exist.
argtype
is an Array
of arguments, passed to the name
function.
ctype
is the return type of the function
call_type
is the ABI of the function
See also Fiddle:Function.new
See Fiddle::CompositeHandler.sym
and Fiddle::Handler.sym
Returns a new closure wrapper for the name
function.
ctype
is the return type of the function
argtype
is an Array
of arguments, passed to the callback function
call_type
is the abi of the closure
block
is passed to the callback
See Fiddle::Closure
A wrapper class to use a StringIO
object as the body and switch to a TempFile when the passed threshold is passed. Initialize the data from the query.
Handles multipart forms (in particular, forms that involve file uploads). Reads query parameters in the @params field, and cookies into @cookies.
Return a Hash
for RJIT statistics. --rjit-stats makes more information available.
Displays a warning statement
to the warning output location. Asks a question
if given.
Return a hash for statistics generated for the --yjit-stats
command line option. Return nil
when option is not passed or unavailable.
Returns a list of the undefined instance methods defined in mod. The undefined methods of any ancestors are not included.
Unpacks sockaddr into port and ip_address.
sockaddr should be a string or an addrinfo for AF_INET/AF_INET6.
sockaddr = Socket.sockaddr_in(80, "127.0.0.1") p sockaddr #=> "\x02\x00\x00P\x7F\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00" p Socket.unpack_sockaddr_in(sockaddr) #=> [80, "127.0.0.1"]
Packs path as an AF_UNIX sockaddr string.
Socket.sockaddr_un("/tmp/sock") #=> "\x01\x00/tmp/sock\x00\x00..."
Returns whether the [position] is at the beginning of a line; that is, at the beginning of the [stored string] or immediately after a newline:
scanner = StringScanner.new(MULTILINE_TEXT) scanner.string # => "Go placidly amid the noise and haste,\nand remember what peace there may be in silence.\n" scanner.pos # => 0 scanner.beginning_of_line? # => true scanner.scan_until(/,/) # => "Go placidly amid the noise and haste," scanner.beginning_of_line? # => false scanner.scan(/\n/) # => "\n" scanner.beginning_of_line? # => true scanner.terminate scanner.beginning_of_line? # => true scanner.concat('x') scanner.terminate scanner.beginning_of_line? # => false
StringScanner#bol? is an alias for StringScanner#beginning_of_line?
.
Returns reference counter of Dispatch interface of WIN32OLE
object. You should not use this method because this method exists only for debugging WIN32OLE
.
Returns the array of WIN32OLE::Method
object . The element of the array is property (settable) of WIN32OLE
object.
excel = WIN32OLE.new('Excel.Application') properties = excel.ole_func_methods
Initialize WIN32OLE
object(ActiveX Control) by calling IPersistMemory::InitNew.
Before calling OLE method, some kind of the ActiveX controls created with MFC should be initialized by calling IPersistXXX::InitNew.
If and only if you received the exception “HRESULT error code: 0x8000ffff catastrophic failure”, try this method before invoking any ole_method.
obj = WIN32OLE.new("ProgID_or_GUID_of_ActiveX_Control") obj.ole_activex_initialize obj.method(...)
Invoked as a callback whenever a singleton method is undefined in the receiver.
module Chatty def Chatty.singleton_method_undefined(id) puts "Undefining #{id.id2name}" end def Chatty.one() end class << self undef_method(:one) end end
produces:
Undefining one
Establishes proc on thr as the handler for tracing, or disables tracing if the parameter is nil
.
Adds proc as a handler for tracing.
Establishes proc as the handler for tracing, or disables tracing if the parameter is nil
.
Note: this method is obsolete, please use TracePoint
instead.
proc takes up to six parameters:
an event name string
a filename string
a line number
a method name symbol, or nil
a binding, or nil
the class, module, or nil
proc is invoked whenever an event occurs.
Events are:
"c-call"
call a C-language routine
"c-return"
return from a C-language routine
"call"
call a Ruby method
"class"
start a class or module definition
"end"
finish a class or module definition
"line"
execute code on a new line
"raise"
raise an exception
"return"
return from a Ruby method
Tracing is disabled within the context of proc.
class Test def test a = 1 b = 2 end end set_trace_func proc { |event, file, line, id, binding, class_or_module| printf "%8s %s:%-2d %16p %14p\n", event, file, line, id, class_or_module } t = Test.new t.test
Produces:
c-return prog.rb:8 :set_trace_func Kernel line prog.rb:11 nil nil c-call prog.rb:11 :new Class c-call prog.rb:11 :initialize BasicObject c-return prog.rb:11 :initialize BasicObject c-return prog.rb:11 :new Class line prog.rb:12 nil nil call prog.rb:2 :test Test line prog.rb:3 :test Test line prog.rb:4 :test Test return prog.rb:5 :test Test