INNER CODE UNIT · Ruby

self

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

    def self.read_conf(file=nil)
      conf = {:verbose=>false, :output=>"tabular", :mvc=>"", :gemfile_scan=>false, :gemfile_name=>"", :filename=>nil, :debug=>false, :exit_on_warn => false, :enabled_checks=> Dawn::Kb::BasicCheck::ALLOWED_FAMILIES}
      begin
        debug_me("returning a default config") if file.nil? or ! File.exist?(file)
        return conf if file.nil?
        file = file.chop if (not file.nil? and file.end_with? '/')
        return conf if ! File.exist?(file)
      rescue => e
        $logger.err "it seems you've found a bug in core.rb@#{__LINE__}: #{e.message}"
        return conf
      end

      cf = YAML.load_file(file)

      cc = cf[:enabled_checks]

      # TODO
      # I must add some sanity check here

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…