class S3Antivirus::Config
Attributes
data[R]
Public Class Methods
new(path=nil)
click to toggle source
# File lib/s3_antivirus/config.rb, line 6 def initialize(path=nil) @data = load(path) end
Public Instance Methods
load(path)
click to toggle source
# File lib/s3_antivirus/config.rb, line 10 def load(path) YAML.load_file(lookup_path(path)) end
lookup_path(path=nil)
click to toggle source
# File lib/s3_antivirus/config.rb, line 14 def lookup_path(path=nil) paths = [ path, "./s3-antivirus.conf", "#{ENV['HOME']}/.s3-antivirus.conf", "/etc/s3-antivirus.conf" ].compact found = paths.find { |p| File.exist?(p) } unless found logger.fatal("FATAL: unable to find the s3-antivirus.conf file. Paths considered: #{paths}") exit 1 end found end