Represents the use of the forwarding parameter in a method, block, or lambda declaration.
def foo(...) ^^^ end
Represents the use of the ‘super` keyword without parentheses or arguments.
super ^^^^^
Represents using a trailing comma to indicate an implicit rest parameter.
foo { |bar,| } ^ foo in [bar,] ^ for foo, in bar do end ^ foo, = bar ^
Represents the use of the ‘&&=` operator on a call to the `[]` method.
foo.bar[baz] &&= value ^^^^^^^^^^^^^^^^^^^^^^
Represents the use of an assignment operator on a call to ‘[]`.
foo.bar[baz] += value ^^^^^^^^^^^^^^^^^^^^^
Represents the use of the ‘||=` operator on a call to `[]`.
foo.bar[baz] ||= value ^^^^^^^^^^^^^^^^^^^^^^
Represents a regular expression literal used in the predicate of a conditional to implicitly match against the last line read by an IO
object.
if /foo/i then end ^^^^^^
Represents a node that is missing from the source and results in a syntax error.
Represents the use of the ‘^` operator for pinning a variable in a pattern matching expression.
foo in ^bar ^^^^
Represents a singleton class declaration involving the ‘class` keyword.
class << self end ^^^^^^^^^^^^^^^^^
Represents the use of the ‘__ENCODING__` keyword.
__ENCODING__ ^^^^^^^^^^^^
InlineComment
objects are the most common. They correspond to comments in the source file like this one that start with #.
This represents a warning that was encountered during parsing.
Installs a gem along with all its dependencies from local and remote gems.
Raised when trying to activate a gem, and that gem does not exist on the system. Instead of rescuing from this class, make sure to rescue from the superclass Gem::LoadError
to catch all types of load errors.
Raised when trying to activate a gem, and the gem exists on the system, but not the requested version. Instead of rescuing from this class, make sure to rescue from the superclass Gem::LoadError
to catch all types of load errors.
Raised when removing a gem with the uninstall command fails
The installer installs the files contained in the .gem into the Gem.home.
Gem::Installer
does the work of putting files in all the right places on the filesystem including unpacking the gem into its gem dir, installing the gemspec in the specifications dir, storing the cached gem in the cache dir, and installing either wrappers or symlinks for executables.
The installer invokes pre and post install hooks. Hooks can be added either through a rubygems_plugin.rb file in an installed gem or via a rubygems/defaults/#{RUBY_ENGINE}.rb or rubygems/defaults/operating_system.rb file. See Gem.pre_install
and Gem.post_install
for details.