Returns a string representation of the syntax tree with the errors displayed inline.
Returns full path to the directory where gem’s extensions are installed.
Returns path to the extensions directory.
Location of RubyGems.org credentials
Really verbose mode gives you extra output.
Indicated, based on the requested domain, if local gems should be considered.
Indicated, based on the requested domain, if remote gems should be considered.
Builds extensions. Valid types of extensions are extconf.rb files, configure scripts and rakefiles or mkrf_conf files.
Prepares the gem for signing and checksum generation. If a signing certificate and key are not present only checksum generation is set up.
Dump only the raw version string, not the complete object. It’s a string for backwards (RubyGems 1.3.5 and earlier) compatibility.
Load custom marshal format. It’s a string for backwards (RubyGems 1.3.5 and earlier) compatibility.
remove trailing zeros segments before first letter or at the end of the version
Combines sets
into a ComposedSet
that allows specification lookup in a uniform manner. If one of the sets
is itself a ComposedSet
its sets are flattened into the result ComposedSet
.
The path where this gem installs its extensions.
Duplicates Array
and Gem::Requirement
attributes from other_spec
so state isn’t shared.
Is this specification missing its extensions? When this returns true you probably want to build_extensions
Display a warning on stderr. Will ask question
if it is not nil.
Display an error message in a location expected to get error messages. Will ask question
if it is not nil.
A neighbor is code that is at or above the current indent line.
First we build a block with all neighbors. If we can’t go further then we decrease the indentation threshold and expand via indentation i.e. ‘expand_indent`
Handles two general cases.
## Case #1: Check code inside of methods/classes/etc.
It’s important to note, that not everything in a given indentation level can be parsed as valid code even if it’s part of valid code. For example:
1 hash = { 2 name: "richard", 3 dog: "cinco", 4 }
In this case lines 2 and 3 will be neighbors, but they’re invalid until ‘expand_indent` is called on them.
When we are adding code within a method or class (at the same indentation level), use the empty lines to denote the programmer intended logical chunks. Stop and check each one. For example:
1 def dog 2 print "dog" 3 4 hash = { 5 end
If we did not stop parsing at empty newlines then the block might mistakenly grab all the contents (lines 2, 3, and 4) and report them as being problems, instead of only line 4.
## Case #2: Expand/grab other logical blocks
Once the search algorithm has converted all lines into blocks at a given indentation it will then ‘expand_indent`. Once the blocks that generates are expanded as neighbors we then begin seeing neighbors being other logical blocks i.e. a block’s neighbors may be another method or class (something with keywords/ends).
For example:
1 def bark 2 3 end 4 5 def sit 6 end
In this case if lines 4, 5, and 6 are in a block when it tries to expand neighbors it will expand up. If it stops after line 2 or 3 it may cause problems since there’s a valid kw/end pair, but the block will be checked without it.
We try to resolve this edge case with ‘lookahead_balance_one_line` below.