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
asana2flowdock-1.0.0 vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/lib/pry/commands/cat/abstract_formatter.rb
whos_dated_who-0.1.0 vendor/bundle/gems/pry-0.10.0/lib/pry/commands/cat/abstract_formatter.rb
whos_dated_who-0.0.1 vendor/bundle/gems/pry-0.10.0/lib/pry/commands/cat/abstract_formatter.rb
pry-0.10.0 lib/pry/commands/cat/abstract_formatter.rb
pry-0.10.0-i386-mswin32 lib/pry/commands/cat/abstract_formatter.rb
pry-0.10.0-i386-mingw32 lib/pry/commands/cat/abstract_formatter.rb
pry-0.10.0-x64-mingw32 lib/pry/commands/cat/abstract_formatter.rb
pry-0.10.0-java lib/pry/commands/cat/abstract_formatter.rb
pry-0.10.0.rc1 lib/pry/commands/cat/abstract_formatter.rb
pry-0.10.0.rc1-i386-mswin32 lib/pry/commands/cat/abstract_formatter.rb
pry-0.10.0.rc1-i386-mingw32 lib/pry/commands/cat/abstract_formatter.rb
pry-0.10.0.rc1-x64-mingw32 lib/pry/commands/cat/abstract_formatter.rb
pry-0.10.0.rc1-java lib/pry/commands/cat/abstract_formatter.rb
pry-0.10.0.pre4 lib/pry/commands/cat/abstract_formatter.rb
pry-0.10.0.pre4-i386-mswin32 lib/pry/commands/cat/abstract_formatter.rb
pry-0.10.0.pre4-i386-mingw32 lib/pry/commands/cat/abstract_formatter.rb
pry-0.10.0.pre4-x64-mingw32 lib/pry/commands/cat/abstract_formatter.rb
pry-0.10.0.pre4-java lib/pry/commands/cat/abstract_formatter.rb
pry-0.10.0.pre3 lib/pry/commands/cat/abstract_formatter.rb
pry-0.10.0.pre3-i386-mswin32 lib/pry/commands/cat/abstract_formatter.rb