INNER CODE UNIT · Ruby

self

thesp0nge/dawnscanner · lib/dawn/core.rb:131

    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

      # Dawn didn't find a config file.
      # If create_if_none flag is set to false, than I'll return nil so the
      # read_conf method will return the default configuration

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…