Sha256: 751f8d2e3f2388c27972787ee19979f03b1f033fa09949b2c9a90139fba74ad2

Contents?: true

Size: 1.03 KB

Versions: 6796

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

class Pry
  class Command
    class 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_instance.print == inspector[:value]
      end
      Pry::Commands.add_command(self)
    end
  end
end

Version data entries

6,796 entries across 6,792 versions & 31 rubygems

Version Path
cybrid_api_bank_ruby-0.123.149 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/list_inspectors.rb
cybrid_api_id_ruby-0.123.149 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/list_inspectors.rb
cybrid_api_organization_ruby-0.123.149 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/list_inspectors.rb
cybrid_api_bank_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/list_inspectors.rb
cybrid_api_id_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/list_inspectors.rb
cybrid_api_organization_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/list_inspectors.rb
cybrid_api_bank_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/list_inspectors.rb
cybrid_api_organization_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/list_inspectors.rb
cybrid_api_id_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/list_inspectors.rb
ory-client-1.16.2 vendor/bundle/ruby/3.1.0/gems/pry-0.14.2/lib/pry/commands/list_inspectors.rb
avalara_sdk-24.12.2 vendor/bundle/ruby/2.7.0/gems/pry-0.13.1/lib/pry/commands/list_inspectors.rb
cybrid_api_bank_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/list_inspectors.rb
cybrid_api_organization_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/list_inspectors.rb
cybrid_api_id_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/list_inspectors.rb
cybrid_api_bank_ruby-0.123.144 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/list_inspectors.rb
cybrid_api_id_ruby-0.123.144 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/list_inspectors.rb
cybrid_api_organization_ruby-0.123.144 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/list_inspectors.rb
ory-client-1.16.1 vendor/bundle/ruby/3.1.0/gems/pry-0.14.2/lib/pry/commands/list_inspectors.rb
ory-client-1.16.0 vendor/bundle/ruby/3.1.0/gems/pry-0.14.2/lib/pry/commands/list_inspectors.rb
cybrid_api_bank_ruby-0.123.143 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/list_inspectors.rb