INNER CODE UNIT · Ruby
self
thesp0nge/dawnscanner · lib/dawn/core.rb:127
def self.is_good_target?(target)
(File.exist?(target) and File.directory?(target))
end
def self.find_conf(create_if_none = false)
conf_name = 'dawnscanner.yml'
path_order = [
'./',
'~/',
'/usr/local/etc/',
]
path_order.each do |p|
fn = p + conf_name if p.start_with?('/')
# if outside $HOME the config file must be hidden
fn = File.expand_path(p) + '/.'+conf_name if ! p.start_with?('/')
debug_me("found a config file: " + fn) if File.exist?(fn)
return fn if File.exist?(fn)
end