Class: Arachni::OptPath

Inherits:
OptBase show all
Defined in:
lib/arachni/component_options.rb

Overview

File system path option.

Instance Attribute Summary

Attributes inherited from OptBase

#default, #desc, #enums, #name, #owner, #required

Instance Method Summary collapse

Methods inherited from OptBase

#empty_required_value?, #initialize, #normalize, #required?, #to_h, #type?

Constructor Details

This class inherits a constructor from Arachni::OptBase

Instance Method Details

#typeObject



349
350
351
# File 'lib/arachni/component_options.rb', line 349

def type
    return 'path'
end

#valid?(value) ⇒ Boolean

Returns:

  • (Boolean)


353
354
355
356
357
358
359
360
361
362
# File 'lib/arachni/component_options.rb', line 353

def valid?(value)
    return false if empty_required_value?(value)

    if ((value != nil and value.empty? == false) and
        (File.exists?(value) == false))
        return false
    end

    return super
end