Sha256: ca5aa1dfa5253da4f238d924fa05e427aba1cf119dcca4186a00c2a7e86db357

Contents?: true

Size: 1.08 KB

Versions: 6821

Compression:

Stored size: 1.08 KB

Contents

# frozen_string_literal: true

module Byebug
  #
  # Reopens the +info+ command to define the +display+ subcommand
  #
  class InfoCommand < Command
    #
    # Information about display expressions
    #
    class DisplayCommand < Command
      self.allow_in_post_mortem = true

      def self.regexp
        /^\s* d(?:isplay)? \s*$/x
      end

      def self.description
        <<-DESCRIPTION
          inf[o] d[display]

          #{short_description}
        DESCRIPTION
      end

      def self.short_description
        "List of expressions to display when program stops"
      end

      def execute
        return puts("There are no auto-display expressions now.") unless Byebug.displays.find { |d| d[0] }

        puts "Auto-display expressions now in effect:"
        puts "Num Enb Expression"

        Byebug.displays.each_with_index do |d, i|
          interp = format(
            "%<number>3d: %<status>s  %<expression>s",
            number: i + 1,
            status: d[0] ? "y" : "n",
            expression: d[1]
          )

          puts(interp)
        end
      end
    end
  end
end

Version data entries

6,821 entries across 6,817 versions & 33 rubygems

Version Path
ory-client-0.0.1.alpha85 vendor/bundle/ruby/2.5.0/gems/byebug-11.1.3/lib/byebug/commands/info/display.rb
ory-client-0.0.1.alpha84 vendor/bundle/ruby/2.5.0/gems/byebug-11.1.3/lib/byebug/commands/info/display.rb
ory-client-0.0.1.alpha83 vendor/bundle/ruby/2.5.0/gems/byebug-11.1.3/lib/byebug/commands/info/display.rb
ory-client-0.0.1.alpha82 vendor/bundle/ruby/2.5.0/gems/byebug-11.1.3/lib/byebug/commands/info/display.rb
ory-client-0.0.1.alpha81 vendor/bundle/ruby/2.5.0/gems/byebug-11.1.3/lib/byebug/commands/info/display.rb
ory-client-0.0.1.alpha80 vendor/bundle/ruby/2.5.0/gems/byebug-11.1.3/lib/byebug/commands/info/display.rb
ory-client-0.0.1.alpha79 vendor/bundle/ruby/2.5.0/gems/byebug-11.1.3/lib/byebug/commands/info/display.rb
ory-client-0.0.1.alpha78 vendor/bundle/ruby/2.5.0/gems/byebug-11.1.3/lib/byebug/commands/info/display.rb
ory-client-0.0.1.alpha77 vendor/bundle/ruby/2.5.0/gems/byebug-11.1.3/lib/byebug/commands/info/display.rb
ory-client-0.0.1.alpha76 vendor/bundle/ruby/2.5.0/gems/byebug-11.1.3/lib/byebug/commands/info/display.rb
ory-client-0.0.1.alpha75 vendor/bundle/ruby/2.5.0/gems/byebug-11.1.3/lib/byebug/commands/info/display.rb
ory-client-0.0.1.alpha74 vendor/bundle/ruby/2.5.0/gems/byebug-11.1.3/lib/byebug/commands/info/display.rb
ory-client-0.0.1.alpha73 vendor/bundle/ruby/2.5.0/gems/byebug-11.1.3/lib/byebug/commands/info/display.rb
ory-client-0.0.1.alpha72 vendor/bundle/ruby/2.5.0/gems/byebug-11.1.3/lib/byebug/commands/info/display.rb
ory-client-0.0.1.alpha71 vendor/bundle/ruby/2.5.0/gems/byebug-11.1.3/lib/byebug/commands/info/display.rb
ory-client-0.0.1.alpha70 vendor/bundle/ruby/2.5.0/gems/byebug-11.1.3/lib/byebug/commands/info/display.rb
ory-client-0.0.1.alpha69 vendor/bundle/ruby/2.5.0/gems/byebug-11.1.3/lib/byebug/commands/info/display.rb
ory-client-0.0.1.alpha68 vendor/bundle/ruby/2.5.0/gems/byebug-11.1.3/lib/byebug/commands/info/display.rb
ory-client-0.0.1.alpha67 vendor/bundle/ruby/2.5.0/gems/byebug-11.1.3/lib/byebug/commands/info/display.rb
ory-client-0.0.1.alpha66 vendor/bundle/ruby/2.5.0/gems/byebug-11.1.3/lib/byebug/commands/info/display.rb