Sha256: d5065ab4871de9cf1bf0227b7725ef253a4e4463324fa544197d2252b5d2e9a8

Contents?: true

Size: 475 Bytes

Versions: 26

Compression:

Stored size: 475 Bytes

Contents

module Byebug
  #
  # Custom exception exception to signal "command not found" errors
  #
  class CommandNotFound < NoMethodError
    def initialize(input, parent = nil)
      @input = input
      @parent = parent

      super("Unknown command '#{name}'. Try '#{help}'")
    end

    private

    def name
      build_cmd(@parent, @input)
    end

    def help
      build_cmd('help', @parent)
    end

    def build_cmd(*args)
      args.compact.join(' ')
    end
  end
end

Version data entries

26 entries across 25 versions & 3 rubygems

Version Path
byebug-8.0.1 lib/byebug/errors.rb
byebug-8.0.0 lib/byebug/errors.rb
byebug-7.0.0 lib/byebug/errors.rb
byebug-6.0.2 lib/byebug/errors.rb
byebug-6.0.1 lib/byebug/errors.rb
byebug-6.0.0 lib/byebug/errors.rb