Represents an optional parameter to a method, block, or lambda definition.
def a(b = 1) ^^^^^ end
Represents a singleton class declaration involving the ‘class` keyword.
class << self end ^^^^^^^^^^^^^^^^^
Represents the use of the ‘__ENCODING__` keyword.
__ENCODING__ ^^^^^^^^^^^^
Represents a string literal, a string contained within a ‘%w` list, or plain string content within an interpolated string.
"foo" ^^^^^ %w[foo] ^^^ "foo #{bar} baz" ^^^^ ^^^^
A cache that can be used to quickly compute code unit offsets from byte offsets. It purposefully provides only a single []
method to access the cache in order to minimize surface area.
Note that there are some known issues here that may or may not be addressed in the future:
The first is that there are issues when the cache computes values that are not on character boundaries. This can result in subsequent computations being off by one or more code units.
The second is that this cache is currently unbounded. In theory we could introduce some kind of LRU cache to limit the number of entries, but this has not yet been implemented.
This represents a location in the source.
This represents a comment that was encountered during parsing. It is the base class for all comment types.
InlineComment
objects are the most common. They correspond to comments in the source file like this one that start with #.
This represents a magic comment that was encountered during parsing.
Resolv::Hosts
is a hostname resolver that uses the system hosts file.
Resolv::DNS
is a DNS
stub resolver.
Information taken from the following places:
STD0013
RFC 1035
etc.
Resolv::MDNS
is a one-shot Multicast DNS
(mDNS) resolver. It blindly makes queries to the mDNS addresses without understanding anything about multicast ports.
Information taken form the following places:
RFC 6762
BasicSpecification
is an abstract class which implements some common code used by both Specification and StubSpecification.
Base class for all Gem
commands. When creating a new gem command, define initialize, execute
, arguments
, defaults_str
, description
and usage
(as appropriate). See the above mentioned methods for details.
A very good example to look at is Gem::Commands::ContentsCommand
The command manager registers and installs all the individual sub-commands supported by the gem command.
Extra commands can be provided by writing a rubygems_plugin.rb file in an installed gem. You should register your command against the Gem::CommandManager
instance, like this:
# file rubygems_plugin.rb require 'rubygems/command_manager' Gem::CommandManager.instance.register_command :edit
You should put the implementation of your command in rubygems/commands.
# file rubygems/commands/edit_command.rb class Gem::Commands::EditCommand < Gem::Command # ... end
See Gem::Command
for instructions on writing gem commands.
Gem::DependencyList
is used for installing and uninstalling gems in the correct order to avoid conflicts.
Base exception class for RubyGems. All exception raised by RubyGems are a subclass of this one.