logstash/lib/config/base.rb
Pete Fritchman 24169ef165 - refactor agent to be a real daemon
- refactor configs (all inherit from BaseConfig)
- move beef of agent code to lib/net/clients/
- use optionparser's ".order" instead of ".parse"
2009-10-20 17:40:44 +00:00

22 lines
622 B
Ruby

require 'yaml'
module LogStash; module Config
# Base config class. All configs need to know how to get to a broker.
class BaseConfig
attr_reader :mqhost
attr_reader :mqport
attr_reader :mquser
attr_reader :mqpass
attr_reader :mqvhost
def initialize(file)
obj = YAML::load(File.open(file).read())
@mqhost = obj["mqhost"] || "localhost"
@mqport = obj["mqport"] || 5672
@mquser = obj["mquser"] || "guest"
@mqpass = obj["mqpass"] || "guest"
@mqvhost = obj["mqvhost"] || "/"
end # def initialize
end # class BaseConfig
end; end # module LogStash::Config