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

rubocop: fix offences of the Layout/AccessModifierIndentation cop

This commit is contained in:
Kyrylo Silin 2019-02-24 19:52:27 +02:00
parent d202713f1c
commit 7b3421cad5
5 changed files with 13 additions and 15 deletions

View file

@ -13,17 +13,6 @@ Gemspec/RequiredRubyVersion:
Exclude:
- 'pry.gemspec'
# Offense count: 5
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, IndentationWidth.
# SupportedStyles: outdent, indent
Layout/AccessModifierIndentation:
Exclude:
- 'lib/pry/commands/change_inspector.rb'
- 'lib/pry/commands/gem_search.rb'
- 'lib/pry/commands/list_inspectors.rb'
- 'spec/method_spec.rb'
# Offense count: 2
# Cop supports --auto-correct.
Layout/AlignArray:

View file

@ -19,7 +19,8 @@ class Pry::Command::ChangeInspector < Pry::ClassCommand
end
end
private
private
def inspector_map
Pry::Inspector::MAP
end

View file

@ -29,7 +29,8 @@ class Pry::Command::GemSearch < Pry::ClassCommand
_pry_.pager.page list_as_string(gems, opts[:limit])
end
private
private
def list_as_string(gems, limit = 10)
gems[0..limit - 1].map do |gem|
name, version, info = gem.values_at 'name', 'version', 'info'

View file

@ -19,7 +19,8 @@ class Pry::Command::ListInspectors < Pry::ClassCommand
end
end
private
private
def inspector_map
Pry::Inspector::MAP
end

View file

@ -260,7 +260,13 @@ describe Pry::Method do
end
it 'should be able to find private and protected instance methods defined in a class' do
@class = Class.new { protected; def prot; 1; end; private; def priv; 1; end }
@class = Class.new do
protected
def prot; 1; end
private
def priv; 1; end
end
should_find_method('priv')
should_find_method('prot')
end