Class: Gobuster::Command::Duration Private

Inherits:
CommandMapper::Types::Str
  • Object
show all
Defined in:
lib/gobuster/command.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Represents the type for --delay and --timeout options.

Instance Method Summary collapse

Instance Method Details

#validate(value) ⇒ true, (false, String)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Validates the given value.



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/gobuster/command.rb', line 26

def validate(value)
  valid, message = super(value)

  unless valid
    return [valid, message]
  end

  value = value.to_s

  unless value =~ /\A\d+(?:m|s|ms|ns)\z/
    return [false, "must be a number and end with 'm', 's', 'ms', or 'ns'"]
  end

  return true
end