From 8ee26ebd7bf75294031836e24c562779e442ffd0 Mon Sep 17 00:00:00 2001 From: Kyrylo Silin Date: Sat, 2 Mar 2019 11:10:11 +0200 Subject: [PATCH] rubocop: fix offences of the Style/Lambda cop --- .rubocop_todo.yml | 9 --------- lib/pry/commands/ls/methods.rb | 2 +- spec/pry_spec.rb | 2 +- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 70db2ce3..056dfa2e 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -274,15 +274,6 @@ Style/IfInsideElse: - 'lib/pry/slop/commands.rb' - 'lib/pry/slop/option.rb' -# Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: line_count_dependent, lambda, literal -Style/Lambda: - Exclude: - - 'lib/pry/commands/ls/methods.rb' - - 'spec/pry_spec.rb' - # Offense count: 5 # Cop supports --auto-correct. Style/LineEndConcatenation: diff --git a/lib/pry/commands/ls/methods.rb b/lib/pry/commands/ls/methods.rb index fa7d54fb..8cdea96c 100644 --- a/lib/pry/commands/ls/methods.rb +++ b/lib/pry/commands/ls/methods.rb @@ -48,7 +48,7 @@ class Pry else _pry_.config.ls.ceiling.dup end - lambda { |klass| !ceiling.include?(klass) } + ->(klass) { !ceiling.include?(klass) } end end end diff --git a/spec/pry_spec.rb b/spec/pry_spec.rb index 25986623..bf032151 100644 --- a/spec/pry_spec.rb +++ b/spec/pry_spec.rb @@ -411,7 +411,7 @@ describe Pry do describe "Pry.binding_for" do it 'should return TOPLEVEL_BINDING if parameter self is main' do - _main_ = lambda { TOPLEVEL_BINDING.eval('self') } + _main_ = -> { TOPLEVEL_BINDING.eval('self') } expect(Pry.binding_for(_main_.call).is_a?(Binding)).to eq true expect(Pry.binding_for(_main_.call)).to eq TOPLEVEL_BINDING expect(Pry.binding_for(_main_.call)).to eq Pry.binding_for(_main_.call)