Results for: "partition"

Return a progress reporter object chosen from the current verbosity.

Return a download reporter object chosen from the current verbosity

Expands code to the next lowest indentation

For example:

1 def dog
2   print "dog"
3 end

If a block starts on line 2 then it has captured all it’s “neighbors” (code at the same indentation or higher). To continue expanding, this block must capture lines one and three which are at a different indentation level.

This method allows fully expanded blocks to decrease their indentation level (so they can expand to capture more code up and down). It does this conservatively as there’s no undo (currently).

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.

No documentation available
No documentation available

Used to hide lines

The search alorithm will group lines into blocks then if those blocks are determined to represent valid code they will be hidden

Opening characters like ‘{` need closing characters # like `}`.

When a mis-match count is detected, suggest the missing member.

For example if there are 3 ‘}` and only two `{` return `“{”`

No documentation available

do nothing

raise InvalidURIError

do nothing

Returns default port.

Returns default port.

Checks the password v component for RFC2396 compliance and against the URI::Parser Regexp for :USERINFO.

Can not have a registry or opaque component defined, with a user component defined.

Protected setter for the password component v.

See also URI::Generic.password=.

Returns the userinfo ui as [user, password] if properly formatted as ‘user:password’.

Escapes ‘user:password’ v based on RFC 1738 section 3.1.

Returns the password component after URI decoding.

Checks the port v component for RFC2396 compliance and against the URI::Parser Regexp for :PORT.

Can not have a registry or opaque component defined, with a port component defined.

Protected setter for the port component v.

See also URI::Generic.port=.

Checks the path v component for RFC2396 compliance and against the URI::Parser Regexp for :ABS_PATH and :REL_PATH.

Can not have a opaque component defined, with a path component defined.

Protected setter for the path component v.

See also URI::Generic.path=.

Checks the opaque v component for RFC2396 compliance and against the URI::Parser Regexp for :OPAQUE.

Can not have a host, port, user, or path component defined, with an opaque component defined.

Protected setter for the opaque component v.

See also URI::Generic.opaque=.

Search took: 5ms  ·  Total Results: 3946