Results for: "module_function"

Returns true if stat is readable by the real user id of this process.

File.stat("testfile").readable_real?   #=> true

If stat is readable by others, returns an integer representing the file permission bits of stat. Returns nil otherwise. The meaning of the bits is platform dependent; on Unix systems, see stat(2).

m = File.stat("/etc/passwd").world_readable?  #=> 420
sprintf("%o", m)                              #=> "644"

Returns true if stat is writable by the real user id of this process.

File.stat("testfile").writable_real?   #=> true

If stat is writable by others, returns an integer representing the file permission bits of stat. Returns nil otherwise. The meaning of the bits is platform dependent; on Unix systems, see stat(2).

m = File.stat("/tmp").world_writable?         #=> 511
sprintf("%o", m)                              #=> "777"

Same as executable?, but tests using the real owner of the process.

Takes source, which can be a string of Ruby code, or an open File object. that contains Ruby source code. It parses and compiles using prism.

Optionally takes file, path, and line which describe the file path, real path and first line number of the ruby code in source which are metadata attached to the returned iseq.

file is used for ‘__FILE__` and exception backtrace. path is used for require_relative base. It is recommended these should be the same full path.

options, which can be true, false or a Hash, is used to modify the default behavior of the Ruby iseq compiler.

For details regarding valid compile options see ::compile_option=.

RubyVM::InstructionSequence.compile("a = 1 + 2")
#=> <RubyVM::InstructionSequence:<compiled>@<compiled>>

path = "test.rb"
RubyVM::InstructionSequence.compile(File.read(path), path, File.expand_path(path))
#=> <RubyVM::InstructionSequence:<compiled>@test.rb:1>

file = File.open("test.rb")
RubyVM::InstructionSequence.compile(file)
#=> <RubyVM::InstructionSequence:<compiled>@<compiled>:1>

path = File.expand_path("test.rb")
RubyVM::InstructionSequence.compile(File.read(path), path, path)
#=> <RubyVM::InstructionSequence:<compiled>@/absolute/path/to/test.rb:1>
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available

Returns integer 80, the default port to use for HTTP requests:

Net::HTTP.default_port # => 80

Sets the body stream for the request:

req = Net::HTTP::Post.new(uri)          # => #<Net::HTTP::Post POST>
req.body_stream                         # => nil
require 'stringio'
req.body_stream = StringIO.new('xyzzy') # => #<StringIO:0x0000027d1e5affa8>
req.body_stream                         # => #<StringIO:0x0000027d1e5affa8>

true if the response has a body.

Gets the entity body returned by the remote HTTP server.

If a block is given, the body is passed to the block, and the body is provided in fragments, as it is read in from the socket.

If dest argument is given, response is read into that variable, with dest#<< method (it could be String or IO, or any other object responding to <<).

Calling this method a second or subsequent time for the same HTTPResponse object will return the value already read.

http.request_get('/index.html') {|res|
  puts res.read_body
}

http.request_get('/index.html') {|res|
  p res.read_body.object_id   # 538149362
  p res.read_body.object_id   # 538149362
}

# using iterator
http.request_get('/index.html') {|res|
  res.read_body do |segment|
    print segment
  end
}

Validates typecode v, returns true or false.

Private setter for the typecode v.

See also URI::FTP.typecode=.

These are the comments that are associated with this location that exist before the start of this location.

Attach a comment to the leading comments of this location.

Raise an error because the given node is not supported.

No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
Search took: 5ms  ·  Total Results: 3609