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

This reverts commit 5599b0a976
.
And fixes jruby-head.
https://travis-ci.org/pry/pry/jobs/30420112
27 lines
592 B
Ruby
27 lines
592 B
Ruby
class Pry
|
|
class Command::Cat
|
|
class AbstractFormatter
|
|
include Pry::Helpers::CommandHelpers
|
|
include Pry::Helpers::BaseHelpers
|
|
|
|
private
|
|
def decorate(content)
|
|
content.code_type = code_type
|
|
content.between(*between_lines).
|
|
with_line_numbers(use_line_numbers?).highlighted
|
|
end
|
|
|
|
def code_type
|
|
opts[:type] || :ruby
|
|
end
|
|
|
|
def use_line_numbers?
|
|
opts.present?(:'line-numbers') || opts.present?(:ex)
|
|
end
|
|
|
|
def between_lines
|
|
[opts[:start] || 1, opts[:end] || -1]
|
|
end
|
|
end
|
|
end
|
|
end
|