1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00
Commit graph

25 commits

Author SHA1 Message Date
Arlandis Word
59e7afd40b Fix rubocop empty line after guard clause style violations 2018-10-14 09:44:58 -04:00
Kyrylo Silin
4cc13f9a40 rubocop: fix offences of the Layout/ExtraSpacing cop 2018-10-13 00:54:00 +08:00
Dmitry Gutov
cf3cef5473 require 'set'
It's not loaded in a bare pry session.
2018-01-22 17:39:58 +03:00
robert
fa67de2f98 use Set instead of Array.
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"]
2017-06-03 15:30:59 +01:00
robert
477429078a avoids intermediate string's and to_sym coercion in to_ignore. 2017-06-03 14:55:01 +01:00
Dmitry Gutov
6a29ed8342 Really ignore old Argon2::Password and the like in the methods scan 2016-12-12 13:54:55 +02:00
Dmitry Gutov
67a497fa1c Move uniq! before sort!
uniq! uses a hash table anyway.
But now sort! needs to deal with a shorter list.
2016-12-12 04:28:16 +02:00
Dmitry Gutov
8c4083791a Fix a typo 2016-12-12 03:46:57 +02:00
Dmitry Gutov
353a42b706 Skip modules that mess with Class#hash
Like Argon2::Password in argon2 < v1.1.1.
2016-12-12 03:24:09 +02:00
Dmitry Gutov
26e330f382 Compute them just one, of course 2016-12-12 03:21:35 +02:00
Dmitry Gutov
cbb148f79f Generate the ignored modules list a different way
Traversing via constant lookup is constant-time, as opposed to
O(number of defined modules).  And it doesn't use Module#name.

So this is fast.
2016-12-12 02:35:41 +02:00
Dmitry Gutov
6ab8c95594 Speed up completion by caching the ignored modules
Relates to #1540.
2016-12-12 02:02:48 +02:00
Matijs van Zuijlen
96b61f14aa Fix some warnings 2015-01-23 14:03:36 +01:00
Conrad Irwin
299494e4c3 Don't use side-effecty string append [Fixes #1223] 2014-05-26 22:13:14 -07:00
Conrad Irwin
bb5745aa55 Catch completion errors [Fixes #841] 2014-05-05 23:42:38 -07:00
Ryan Fitzgerald
a9a49ee8a3 Make object path resolution more robust (fix #957)
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.
2014-04-28 00:41:19 -07:00
Ryan Fitzgerald
2467871169 Extract object path resolution into a class 2014-04-27 17:28:56 -07:00
Johnny Five
4e11c93185 fully qualify constant name. closes #1193 2014-04-27 14:13:44 -07:00
robert
7e612a3156 pass the right 'input' to InputCompleter#call, improve docs. 2014-04-27 14:13:37 -07:00
robert
f569d3b119 remove useless if 2014-04-27 14:13:33 -07:00
robert
3fd66b6403 input becomes primary argument in #initialize.
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.
2014-04-27 14:13:30 -07:00
robert
4bab51f53c rewrite Pry::InputCompleter as a class who wraps '_pry_'.
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.
2014-04-27 14:12:45 -07:00
robert
cf0e8c1051 label and re-use regexp's in Pry::InputCompleter. 2014-04-27 14:12:37 -07:00
yui-knk
e99ae3df08 Fix yard documentation warnings(fix #1163) 2014-03-16 23:54:45 +09:00
Robert Gleeson
97c28898e1 lazy load Pry::InputCompleter or Pry::BondCompleter
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")
2014-03-16 04:24:12 +01:00
Renamed from lib/pry/completion.rb (Browse further)