mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Merge pull request #1962 from pry/rubocop-lint-empty-when
rubocop: fix offences of the Lint/EmptyWhen cop
This commit is contained in:
commit
f92e221bbc
2 changed files with 3 additions and 18 deletions
|
@ -13,11 +13,6 @@ Gemspec/RequiredRubyVersion:
|
|||
Exclude:
|
||||
- 'pry.gemspec'
|
||||
|
||||
# Offense count: 2
|
||||
Lint/EmptyWhen:
|
||||
Exclude:
|
||||
- 'lib/pry/input_completer.rb'
|
||||
|
||||
# Offense count: 6
|
||||
Lint/HandleExceptions:
|
||||
Exclude:
|
||||
|
|
|
@ -35,12 +35,6 @@ class Pry
|
|||
yield
|
||||
].freeze
|
||||
|
||||
Operators = %w[
|
||||
% & * ** + - /
|
||||
< << <= <=> == === =~ > >= >>
|
||||
[] []= ^ ! != !~
|
||||
].freeze
|
||||
|
||||
WORD_ESCAPE_STR = " \t\n\"\\'`><=;|&{(".freeze
|
||||
|
||||
def initialize(input, pry = nil)
|
||||
|
@ -220,13 +214,9 @@ class Pry
|
|||
|
||||
def select_message(path, receiver, message, candidates)
|
||||
candidates.grep(/^#{message}/).collect do |e|
|
||||
case e
|
||||
when /^[a-zA-Z_]/
|
||||
path.call(receiver + "." << e)
|
||||
when /^[0-9]/
|
||||
when *Operators
|
||||
# receiver + " " << e
|
||||
end
|
||||
next unless e =~ /^[a-zA-Z_]/
|
||||
|
||||
path.call(receiver + "." << e)
|
||||
end.compact
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue