Sha256: ea480451057a69b274642527d8f38bd68418f2dc6246b5b8b8aaf9ba5444c1b2

Contents?: true

Size: 697 Bytes

Versions: 19

Compression:

Stored size: 697 Bytes

Contents

require 'byebug/command'
require 'byebug/helpers/eval'

module Byebug
  #
  # Spawns a subdebugger and evaluates the given expression
  #
  class DebugCommand < Command
    include Helpers::EvalHelper

    def self.regexp
      /^\s* debug (?:\s+(\S+))? \s*$/x
    end

    def self.description
      <<-EOD
        debug <expression>

        #{short_description}

        Allows, for example, setting breakpoints on expressions evaluated from
        the debugger's prompt.
      EOD
    end

    def self.short_description
      'Spawns a subdebugger'
    end

    def execute
      return puts(help) unless @match[1]

      puts safe_inspect(separate_thread_eval(@match[1]))
    end
  end
end

Version data entries

19 entries across 18 versions & 3 rubygems

Version Path
dirwatch-0.0.2 vendor/bundle/ruby/2.3.0/gems/byebug-9.1.0/lib/byebug/commands/debug.rb
tdiary-5.0.6 vendor/bundle/gems/byebug-9.1.0/lib/byebug/commands/debug.rb
byebug-9.1.0 lib/byebug/commands/debug.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/byebug-9.0.6/lib/byebug/commands/debug.rb
tdiary-5.0.5 vendor/bundle/gems/byebug-9.0.6/lib/byebug/commands/debug.rb
tdiary-5.0.4 vendor/bundle/gems/byebug-9.0.6/lib/byebug/commands/debug.rb
byebug-9.0.6 lib/byebug/commands/debug.rb
byebug-9.0.5 lib/byebug/commands/debug.rb
byebug-9.0.4 lib/byebug/commands/debug.rb
byebug-9.0.3 lib/byebug/commands/debug.rb
byebug-9.0.2 lib/byebug/commands/debug.rb
byebug-9.0.1 lib/byebug/commands/debug.rb
byebug-9.0.0 lib/byebug/commands/debug.rb
byebug-8.2.5 lib/byebug/commands/debug.rb
byebug-8.2.4 lib/byebug/commands/debug.rb
byebug-8.2.3 lib/byebug/commands/debug.rb
byebug-8.2.2 lib/byebug/commands/debug.rb
byebug-8.2.1 lib/byebug/commands/debug.rb
byebug-8.2.0 lib/byebug/commands/debug.rb