Skip to content
Browse files

Rename `add_line_numbers` to `add_line_number`

Rename the instance method of `Pry::Code::LOC`.

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
  • Loading branch information...
1 parent 8b2fb32 commit e006cee3ea94f088efc872204e808c19ed33dded @kyrylo kyrylo committed Jan 5, 2013
Showing with 5 additions and 5 deletions.
  1. +5 −5 lib/pry/code.rb
View
10 lib/pry/code.rb
@@ -79,7 +79,7 @@ def colorize(code_type)
#
# @param [Integer] max_width
# @return [void]
- def add_line_numbers(max_width = 0)
+ def add_line_number(max_width = 0)
padded = lineno.to_s.rjust(max_width)
colorized_lineno = Pry::Helpers::BaseHelpers.colorize_code(padded)
tuple[0] = "#{ colorized_lineno }: #{ line }"
@@ -374,10 +374,10 @@ def to_s
max_width = @lines.last.lineno.to_s.length if @lines.length > 0
lines = @lines.map(&:dup).each do |loc|
- loc.colorize(@code_type) if Pry.color
- loc.add_line_numbers(max_width) if @with_line_numbers
- loc.add_marker(@marker_lineno) if @with_marker
- loc.indent(@indentation_num) if @with_indentation
+ loc.colorize(@code_type) if Pry.color
+ loc.add_line_number(max_width) if @with_line_numbers
+ loc.add_marker(@marker_lineno) if @with_marker
+ loc.indent(@indentation_num) if @with_indentation
end
lines.map { |loc| "#{ loc.line }\n" }.join

0 comments on commit e006cee

Please sign in to comment.
Something went wrong with that request. Please try again.