Sha256: 8bbf5a2acf8155a75abfb8e2519df3aee1e4569c1b1fe07344021a4b03af45f7

Contents?: true

Size: 580 Bytes

Versions: 104

Compression:

Stored size: 580 Bytes

Contents

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?)
      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

Version data entries

104 entries across 104 versions & 6 rubygems

Version Path
pry-0.9.11 lib/pry/commands/cat/abstract_formatter.rb
pry-0.9.11-i386-mswin32 lib/pry/commands/cat/abstract_formatter.rb
pry-0.9.11-i386-mingw32 lib/pry/commands/cat/abstract_formatter.rb
pry-0.9.11-java lib/pry/commands/cat/abstract_formatter.rb