Sha256: 27d85e8476daf7747b799ec35ed7ee8f7f6e161e68db3ec3dc70cbfa1217e633

Contents?: true

Size: 798 Bytes

Versions: 159

Compression:

Stored size: 798 Bytes

Contents

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

    List the available prompts. You can use change-prompt to switch between
    them.
  BANNER

  def process
    output.puts heading("Available prompts") + "\n"
    prompt_map.each do |name, prompt|
      output.write "Name: #{text.bold(name)}"
      output.puts selected_prompt?(prompt) ? selected_text : ""
      output.puts prompt[:description]
      output.puts
    end
  end

private
  def prompt_map
    Pry::Prompt::MAP
  end

  def selected_text
    text.red " (selected) "
  end

  def selected_prompt?(prompt)
    _pry_.prompt == prompt[:value]
  end
  Pry::Commands.add_command(self)
end

Version data entries

159 entries across 152 versions & 35 rubygems

Version Path
logstash-filter-zabbix-0.1.1 vendor/bundle/jruby/1.9/gems/pry-0.10.4-java/lib/pry/commands/list_prompts.rb
logstash-input-fifo-0.9.1 vendor/bundle/jruby/1.9/gems/pry-0.10.4-java/lib/pry/commands/list_prompts.rb
logstash-input-fifo-0.9.0 vendor/bundle/jruby/1.9/gems/pry-0.10.4-java/lib/pry/commands/list_prompts.rb
logstash-input-salesforce-3.0.0 vendor/jruby/1.9/gems/pry-0.10.4-java/lib/pry/commands/list_prompts.rb
abaci-0.3.0 vendor/bundle/gems/pry-0.10.4/lib/pry/commands/list_prompts.rb
ivanvc-logstash-input-s3-3.1.1.4 vendor/local/gems/pry-0.10.4-java/lib/pry/commands/list_prompts.rb
ivanvc-logstash-input-s3-3.1.1.3 vendor/local/gems/pry-0.10.4-java/lib/pry/commands/list_prompts.rb
ivanvc-logstash-input-s3-3.1.1.2 vendor/local/gems/pry-0.10.4-java/lib/pry/commands/list_prompts.rb
gameboard-3.1.0 vendor/bundle/ruby/2.3.0/gems/pry-0.10.4/lib/pry/commands/list_prompts.rb
gameboard-3.0.0 vendor/bundle/ruby/2.3.0/gems/pry-0.10.4/lib/pry/commands/list_prompts.rb
pry-0.11.0.pre2 lib/pry/commands/list_prompts.rb
pry-0.11.0.pre2-java lib/pry/commands/list_prompts.rb
logstash-filter-delta-1.1.0 vendor/bundle/jruby/2.2.0/gems/pry-0.10.4-java/lib/pry/commands/list_prompts.rb
logstash-filter-delta-1.0.1 vendor/bundle/jruby/2.2.0/gems/pry-0.10.4-java/lib/pry/commands/list_prompts.rb
logstash-filter-base64-1.0.4 vendor/bundle/jruby/2.2.0/gems/pry-0.10.4-java/lib/pry/commands/list_prompts.rb
logstash-filter-base64-1.0.3 vendor/bundle/jruby/2.2.0/gems/pry-0.10.4-java/lib/pry/commands/list_prompts.rb
logstash-filter-delta-1.0.0 vendor/bundle/jruby/2.2.0/gems/pry-0.10.4-java/lib/pry/commands/list_prompts.rb
logstash-filter-base64-1.0.2 vendor/bundle/jruby/2.3.0/gems/pry-0.10.4-java/lib/pry/commands/list_prompts.rb
logstash-filter-base64-1.0.1 vendor/bundle/jruby/2.3.0/gems/pry-0.10.4-java/lib/pry/commands/list_prompts.rb
logstash-filter-base64-1.0.0 vendor/bundle/jruby/2.3.0/gems/pry-0.10.4-java/lib/pry/commands/list_prompts.rb