Skip to content

Commit

Permalink
Rubocop fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
HarlemSquirrel committed Oct 5, 2021
1 parent b35bedb commit 3bc26d6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/amazing_print/custom_defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def inspect_object(object)

def usual_rb
IRB::Irb.class_eval do
def output_value(omit = false)
def output_value(_omit = false) # rubocop:disable Style/OptionalBooleanParameter
ap @context.last_value
rescue NoMethodError
puts "(Object doesn't support #ai)"
Expand Down
6 changes: 3 additions & 3 deletions lib/amazing_print/formatters/base_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def limited(data, width, is_hash: false)
else
# Calculate how many elements to be displayed above and below the separator.
head = limit / 2
tail = head - (limit - 1) % 2
tail = head - ((limit - 1) % 2)

# Add the proper elements to the temp array and format the separator.
temp = data[0, head] + [nil] + data[-tail, tail]
Expand Down Expand Up @@ -118,13 +118,13 @@ def indented(&blk)
INDENT_CACHE = (0..100).map { |i| ' ' * i }.map(&:freeze).freeze

def indent(n = indentation)
INDENT_CACHE[n] || ' ' * n
INDENT_CACHE[n] || (' ' * n)
end

def outdent
i = indentation - options[:indent].abs

INDENT_CACHE[i] || ' ' * i
INDENT_CACHE[i] || (' ' * i)
end

def align(value, width)
Expand Down
2 changes: 1 addition & 1 deletion spec/methods_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ def self.m2; end
class World
def self.m1; end
end
out = (Hello.methods & World.methods - Class.methods).ai(plain: true)
out = (Hello.methods & (World.methods - Class.methods)).ai(plain: true)
expect(out).to eq("[\n [0] m1() Hello\n]")
end

Expand Down

0 comments on commit 3bc26d6

Please sign in to comment.