Results for: "to_proc"

Emit a sequence with list and tag

Emit a sequence with map and tag

Emit an arbitrary object obj and tag

Called when the document starts with the declared version, tag_directives, if the document is implicit.

version will be an array of integers indicating the YAML version being dealt with, tag_directives is a list of tuples indicating the prefix and suffix of each tag, and implicit is a boolean indicating whether the document is started implicitly.

Example

Given the following YAML:

%YAML 1.1
%TAG ! tag:tenderlovemaking.com,2009:
--- !squee

The parameters for start_document must be this:

version         # => [1, 1]
tag_directives  # => [["!", "tag:tenderlovemaking.com,2009:"]]
implicit        # => false

Called with the document ends. implicit is a boolean value indicating whether or not the document has an implicit ending.

Example

Given the following YAML:

---
  hello world

implicit will be true. Given this YAML:

---
  hello world
...

implicit will be false.

Called before each event with line/column information.

No documentation available

Handles start_document events with version, tag_directives, and implicit styling.

See Psych::Handler#start_document

Handles end_document events with version, tag_directives, and implicit styling.

See Psych::Handler#start_document

No documentation available

Start a document emission with YAML version, tags, and an implicit start.

See Psych::Handler#start_document

End a document emission with an implicit ending.

See Psych::Handler#end_document

Returns the raw error code indicating the cause of the hostname resolution failure.

begin
  Addrinfo.getaddrinfo("ruby-lang.org", nil)
rescue Socket::ResolutionError => e
  if e.error_code == Socket::EAI_AGAIN
    puts "Temporary failure in name resolution."
  end
end

Note that error codes depend on the operating system.

No documentation available

Replace %w+% into the environment value of what is contained between the %‘s This method is used for REG_EXPAND_SZ.

For detail, see expandEnvironmentStrings Win32 API.

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_prism("a = 1 + 2")
#=> <RubyVM::InstructionSequence:<compiled>@<compiled>>

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

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

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

Like Net::HTTP.get, but writes the returned body to $stdout; returns nil.

Like Net::HTTP.get, but writes the returned body to $stdout; returns nil.

Returns a string representation of the syntax tree with the errors displayed inline.

Raise an error because the given node is not supported.

Mark a command-line option as deprecated, and optionally specify a deprecation horizon.

Note that with the current implementation, every version of the option needs to be explicitly deprecated, so to deprecate an option defined as

add_option('-t', '--[no-]test', 'Set test mode') do |value, options|
  # ... stuff ...
end

you would need to explicitly add a call to ‘deprecate_option` for every version of the option you want to deprecate, like

deprecate_option('-t')
deprecate_option('--test')
deprecate_option('--no-test')

Indicated, based on the requested domain, if local gems should be considered.

Creates a DependencyList from the current specs.

Return a hash of predecessors. result[spec] is an Array of gemspecs that have a dependency satisfied by the named gemspec.

Turn an array of [name, version, platform] into an array of NameTuple objects.

Search took: 2ms  ·  Total Results: 1563