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:
|
Exclude:
|
||||||
- 'pry.gemspec'
|
- 'pry.gemspec'
|
||||||
|
|
||||||
# Offense count: 2
|
|
||||||
Lint/EmptyWhen:
|
|
||||||
Exclude:
|
|
||||||
- 'lib/pry/input_completer.rb'
|
|
||||||
|
|
||||||
# Offense count: 6
|
# Offense count: 6
|
||||||
Lint/HandleExceptions:
|
Lint/HandleExceptions:
|
||||||
Exclude:
|
Exclude:
|
||||||
|
|
|
@ -35,12 +35,6 @@ class Pry
|
||||||
yield
|
yield
|
||||||
].freeze
|
].freeze
|
||||||
|
|
||||||
Operators = %w[
|
|
||||||
% & * ** + - /
|
|
||||||
< << <= <=> == === =~ > >= >>
|
|
||||||
[] []= ^ ! != !~
|
|
||||||
].freeze
|
|
||||||
|
|
||||||
WORD_ESCAPE_STR = " \t\n\"\\'`><=;|&{(".freeze
|
WORD_ESCAPE_STR = " \t\n\"\\'`><=;|&{(".freeze
|
||||||
|
|
||||||
def initialize(input, pry = nil)
|
def initialize(input, pry = nil)
|
||||||
|
@ -220,13 +214,9 @@ class Pry
|
||||||
|
|
||||||
def select_message(path, receiver, message, candidates)
|
def select_message(path, receiver, message, candidates)
|
||||||
candidates.grep(/^#{message}/).collect do |e|
|
candidates.grep(/^#{message}/).collect do |e|
|
||||||
case e
|
next unless e =~ /^[a-zA-Z_]/
|
||||||
when /^[a-zA-Z_]/
|
|
||||||
path.call(receiver + "." << e)
|
path.call(receiver + "." << e)
|
||||||
when /^[0-9]/
|
|
||||||
when *Operators
|
|
||||||
# receiver + " " << e
|
|
||||||
end
|
|
||||||
end.compact
|
end.compact
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue