Sha256: c637428bec27478c283bbe83f678f45726e9ff54e360ee656df6409bd7cd76a9

Contents?: true

Size: 1.02 KB

Versions: 110

Compression:

Stored size: 1.02 KB

Contents

class Pry
  class Command::Ls < Pry::ClassCommand
    class Formatter
      attr_writer :grep
      attr_reader :_pry_

      def initialize(_pry_)
        @_pry_ = _pry_
        @target = _pry_.current_context
      end

      def write_out
        return false unless correct_opts?
        output_self
      end

      private

      def color(type, str)
        Pry::Helpers::Text.send _pry_.config.ls["#{type}_color"], str
      end

      # Add a new section to the output.
      # Outputs nothing if the section would be empty.
      def output_section(heading, body)
        return '' if body.compact.empty?
        fancy_heading = Pry::Helpers::Text.bold(color(:heading, heading))
        Pry::Helpers.tablify_or_one_line(fancy_heading, body)
      end

      def format_value(value)
        Pry::ColorPrinter.pp(value, '')
      end

      def correct_opts?
        @default_switch
      end

      def output_self
        raise NotImplementedError
      end

      def grep
        @grep || proc { |x| x }
      end

    end
  end
end

Version data entries

110 entries across 103 versions & 28 rubygems

Version Path
logstash-filter-cache-redis-0.1.0 vendor/bundle/jruby/1.9/gems/pry-0.10.4-java/lib/pry/commands/ls/formatter.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/pry-0.10.4/lib/pry/commands/ls/formatter.rb
tdiary-5.0.5 vendor/bundle/gems/pry-0.10.4/lib/pry/commands/ls/formatter.rb
logstash-filter-csharp-0.1.0 vendor/bundle/jruby/2.3.0/gems/pry-0.10.4-java/lib/pry/commands/ls/formatter.rb
logstash-filter-htmlentities-0.1.0 vendor/bundle/jruby/1.9/gems/pry-0.10.4-java/lib/pry/commands/ls/formatter.rb
logstash-output-icinga-1.0.0 vendor/jruby/1.9/gems/pry-0.10.4-java/lib/pry/commands/ls/formatter.rb
lazy_record-0.2.1 vendor/bundle/gems/pry-0.10.4/lib/pry/commands/ls/formatter.rb
lazy_record-0.2.0 vendor/bundle/gems/pry-0.10.4/lib/pry/commands/ls/formatter.rb
lazy_record-0.1.9 vendor/bundle/gems/pry-0.10.4/lib/pry/commands/ls/formatter.rb
lazy_record-0.1.8 vendor/bundle/gems/pry-0.10.4/lib/pry/commands/ls/formatter.rb
lazy_record-0.1.7 vendor/bundle/gems/pry-0.10.4/lib/pry/commands/ls/formatter.rb
lazy_record-0.1.6 vendor/bundle/gems/pry-0.10.4/lib/pry/commands/ls/formatter.rb
lazy_record-0.1.4 vendor/bundle/gems/pry-0.10.4/lib/pry/commands/ls/formatter.rb
tdiary-5.0.4 vendor/bundle/gems/pry-0.10.4/lib/pry/commands/ls/formatter.rb
mdg-1.0.1 vendor/bundle/ruby/2.3.0/gems/pry-0.10.4/lib/pry/commands/ls/formatter.rb
logstash-filter-zabbix-0.1.2 vendor/bundle/jruby/1.9/gems/pry-0.10.4-java/lib/pry/commands/ls/formatter.rb
lazy_record-0.1.3 vendor/bundle/gems/pry-0.10.4/lib/pry/commands/ls/formatter.rb
lazy_record-0.1.2 vendor/bundle/gems/pry-0.10.4/lib/pry/commands/ls/formatter.rb
lazy_record-0.1.1 vendor/bundle/gems/pry-0.10.4/lib/pry/commands/ls/formatter.rb
lazy_record-0.1.0 vendor/bundle/gems/pry-0.10.4/lib/pry/commands/ls/formatter.rb