Sha256: 901fa04121aaf06b1d837fb77246690e7dc16dae456717553ef45dfc1edf47c8

Contents?: true

Size: 871 Bytes

Versions: 15

Compression:

Stored size: 871 Bytes

Contents

class Pry::Command::ListInspectors < Pry::ClassCommand
  match 'list-inspectors'
  group 'Input and Output'
  description 'List the inspector procs available for use.'
  banner <<-BANNER
    Usage: list-inspectors

    List the inspector procs available to print return values. You can use
    change-inspector to switch between them.
  BANNER

  def process
    output.puts heading("Available inspectors") + "\n"
    inspector_map.each do |name, inspector|
      output.write "Name: #{bold(name)}"
      output.puts selected_inspector?(inspector) ? selected_text : ""
      output.puts inspector[:description]
      output.puts
    end
  end

private
  def inspector_map
    Pry::Inspector::MAP
  end

  def selected_text
    red " (selected) "
  end

  def selected_inspector?(inspector)
    _pry_.print == inspector[:value]
  end
  Pry::Commands.add_command(self)
end

Version data entries

15 entries across 15 versions & 7 rubygems

Version Path
argon-1.3.1 vendor/bundle/ruby/2.7.0/gems/pry-0.12.2/lib/pry/commands/list_inspectors.rb
symbolic_enum-1.1.5 vendor/bundle/ruby/2.7.0/gems/pry-0.12.2/lib/pry/commands/list_inspectors.rb
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/pry-0.12.2/lib/pry/commands/list_inspectors.rb
chatops-rpc-0.0.2 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/pry-0.12.2/lib/pry/commands/list_inspectors.rb
chatops-rpc-0.0.1 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/pry-0.12.2/lib/pry/commands/list_inspectors.rb
chess_engine-0.0.2 vendor/bundle/gems/pry-0.12.2/lib/pry/commands/list_inspectors.rb
chess_engine-0.0.1 vendor/bundle/gems/pry-0.12.2/lib/pry/commands/list_inspectors.rb
alimentos-alu0100945645-0.1.0 vendor/bundle/ruby/2.3.0/gems/pry-0.12.2/lib/pry/commands/list_inspectors.rb
alimentos-alu0100945645-1.0.0 vendor/bundle/ruby/2.3.0/gems/pry-0.12.2/lib/pry/commands/list_inspectors.rb
pry-0.12.2-java lib/pry/commands/list_inspectors.rb
pry-0.12.2 lib/pry/commands/list_inspectors.rb
pry-0.12.1 lib/pry/commands/list_inspectors.rb
pry-0.12.1-java lib/pry/commands/list_inspectors.rb
pry-0.12.0 lib/pry/commands/list_inspectors.rb
pry-0.12.0-java lib/pry/commands/list_inspectors.rb