Sha256: 670a6ec31237ac531345dfcf554c803187c0115fc0d9a429fdd2ca3ae9cb4f26

Contents?: true

Size: 881 Bytes

Versions: 159

Compression:

Stored size: 881 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: #{text.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
    text.red " (selected) "
  end

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

Version data entries

159 entries across 152 versions & 35 rubygems

Version Path
pry-0.10.0-java lib/pry/commands/list_inspectors.rb
pry-0.10.0.rc1 lib/pry/commands/list_inspectors.rb
pry-0.10.0.rc1-i386-mswin32 lib/pry/commands/list_inspectors.rb
pry-0.10.0.rc1-i386-mingw32 lib/pry/commands/list_inspectors.rb
pry-0.10.0.rc1-x64-mingw32 lib/pry/commands/list_inspectors.rb
pry-0.10.0.rc1-java lib/pry/commands/list_inspectors.rb
pry-0.10.0.pre4 lib/pry/commands/list_inspectors.rb
pry-0.10.0.pre4-i386-mswin32 lib/pry/commands/list_inspectors.rb
pry-0.10.0.pre4-i386-mingw32 lib/pry/commands/list_inspectors.rb
pry-0.10.0.pre4-x64-mingw32 lib/pry/commands/list_inspectors.rb
pry-0.10.0.pre4-java lib/pry/commands/list_inspectors.rb
pry-0.10.0.pre3 lib/pry/commands/list_inspectors.rb
pry-0.10.0.pre3-i386-mswin32 lib/pry/commands/list_inspectors.rb
pry-0.10.0.pre3-i386-mingw32 lib/pry/commands/list_inspectors.rb
pry-0.10.0.pre3-java lib/pry/commands/list_inspectors.rb
pry-0.10.0.pre2 lib/pry/commands/list_inspectors.rb
pry-0.10.0.pre2-universal-mswin32 lib/pry/commands/list_inspectors.rb
pry-0.10.0.pre2-universal-mingw32 lib/pry/commands/list_inspectors.rb
pry-0.10.0.pre2-java lib/pry/commands/list_inspectors.rb