1
0
Fork 0
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:
Kyrylo Silin 2019-03-03 18:32:43 +02:00 committed by GitHub
commit f92e221bbc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 18 deletions

View file

@ -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:

View file

@ -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_]/
next unless e =~ /^[a-zA-Z_]/
path.call(receiver + "." << e)
when /^[0-9]/
when *Operators
# receiver + " " << e
end
end.compact
end