The tests are a bit faster, before this change i ran the tests 10 times:
["5.49", "5.56", "5.53", "5.27", "5.26", "5.24", "5.48", "5.19", "5.28"]
After this change i ran them again:
["5.02", "5.25", "4.85", "4.97", "4.9", "4.86", "4.83", "4.87", "4.86"]
This fixes#957 and should make object path resolution more predictable
in general. Instead of splitting the path on "/" before doing any
parsing, we use `StringScanner` and `complete_expression?` to scan
through the string looking for complete slash-delimited Ruby
expressions.
It also turned out that separating the code for handling "-" from the
path-resolution code simplified things a lot. It doesn't really make
sense for "-" to be in there anyway, since paths like "foo/-/bar" don't
mean anything.
with `_pry_` as an optional second. in the repl the second argument will
always be met but to avoid needing a pry instance around to use Pry::InputCompleter,
it uses the first argument(`input`) when implementing auto completion, and
'pry' can be used if its around/available.
this commit changes InputCompleter from a module implemented on top
of singleton/class methods to a class who wraps '_pry_' and reads
from _pry_.input, who is assumed to be Readline.
pry-bond will also need to be updated to have a similar style API.
prior to commit both would be loaded but in most cases you'd only use
one or the other. when `bond` is available and `_pry_.config.completer`
has not been set to nil before the pry session has started & editline is
not being used(OSX only), then "pry/bond_completer" is loaded. otherwise
the default fallback is Pry::InputCompleter("pry/input_completer")