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
monero_wallet_gen-0.1.0 vendor/bundle/ruby/2.3.0/gems/pry-0.11.3/lib/pry/commands/list_prompts.rb
sb_prime_table-0.1.1 vendor/bundle/ruby/2.4.0/gems/pry-0.11.3/lib/pry/commands/list_prompts.rb
sb_prime_table-0.1.0 vendor/bundle/ruby/2.4.0/gems/pry-0.11.3/lib/pry/commands/list_prompts.rb
comiditaULL-0.1.1 vendor/bundle/ruby/2.3.0/gems/pry-0.11.2/lib/pry/commands/list_prompts.rb
comidita_ull-0.1.1 vendor/bundle/ruby/2.3.0/gems/pry-0.11.2/lib/pry/commands/list_prompts.rb
comidita_ull-0.1.0 vendor/bundle/ruby/2.3.0/gems/pry-0.11.2/lib/pry/commands/list_prompts.rb
pry-0.11.3 lib/pry/commands/list_prompts.rb
pry-0.11.3-java lib/pry/commands/list_prompts.rb
pry-0.11.2 lib/pry/commands/list_prompts.rb
pry-0.11.2-java lib/pry/commands/list_prompts.rb
logstash-output-icinga-1.1.0 vendor/jruby/2.3.0/gems/pry-0.10.4-java/lib/pry/commands/list_prompts.rb
logstash-output-icinga-1.1.0 vendor/jruby/1.9/gems/pry-0.10.4-java/lib/pry/commands/list_prompts.rb
tdiary-5.0.6 vendor/bundle/gems/pry-0.11.0/lib/pry/commands/list_prompts.rb
pry-0.11.1 lib/pry/commands/list_prompts.rb
pry-0.11.1-java lib/pry/commands/list_prompts.rb
pry-0.11.0 lib/pry/commands/list_prompts.rb
pry-0.11.0-java lib/pry/commands/list_prompts.rb
logstash-filter-cache-redis-0.3.1 vendor/bundle/jruby/1.9/gems/pry-0.10.4-java/lib/pry/commands/list_prompts.rb
logstash-filter-cache-redis-0.3.0 vendor/bundle/jruby/1.9/gems/pry-0.10.4-java/lib/pry/commands/list_prompts.rb
logstash-filter-cache-redis-0.2.0 vendor/bundle/jruby/1.9/gems/pry-0.10.4-java/lib/pry/commands/list_prompts.rb