Sha256: e070ced63f6b52b43ccd185ff26ce8dd4d7a5f1356eee00833caa5107ce84148

Contents?: true

Size: 679 Bytes

Versions: 6796

Compression:

Stored size: 679 Bytes

Contents

# frozen_string_literal: true

class Pry
  class Command
    class 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
end

Version data entries

6,796 entries across 6,792 versions & 31 rubygems

Version Path
cybrid_api_bank_ruby-0.123.149 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/cat/abstract_formatter.rb
cybrid_api_id_ruby-0.123.149 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/cat/abstract_formatter.rb
cybrid_api_organization_ruby-0.123.149 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/cat/abstract_formatter.rb
cybrid_api_bank_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/cat/abstract_formatter.rb
cybrid_api_id_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/cat/abstract_formatter.rb
cybrid_api_organization_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/cat/abstract_formatter.rb
cybrid_api_bank_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/cat/abstract_formatter.rb
cybrid_api_organization_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/cat/abstract_formatter.rb
cybrid_api_id_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/cat/abstract_formatter.rb
ory-client-1.16.2 vendor/bundle/ruby/3.1.0/gems/pry-0.14.2/lib/pry/commands/cat/abstract_formatter.rb
avalara_sdk-24.12.2 vendor/bundle/ruby/2.7.0/gems/pry-0.13.1/lib/pry/commands/cat/abstract_formatter.rb
cybrid_api_bank_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/cat/abstract_formatter.rb
cybrid_api_organization_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/cat/abstract_formatter.rb
cybrid_api_id_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/cat/abstract_formatter.rb
cybrid_api_bank_ruby-0.123.144 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/cat/abstract_formatter.rb
cybrid_api_id_ruby-0.123.144 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/cat/abstract_formatter.rb
cybrid_api_organization_ruby-0.123.144 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/cat/abstract_formatter.rb
ory-client-1.16.1 vendor/bundle/ruby/3.1.0/gems/pry-0.14.2/lib/pry/commands/cat/abstract_formatter.rb
ory-client-1.16.0 vendor/bundle/ruby/3.1.0/gems/pry-0.14.2/lib/pry/commands/cat/abstract_formatter.rb
cybrid_api_bank_ruby-0.123.143 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/cat/abstract_formatter.rb