Commit eb188a5f authored by Marcel Hoppe's avatar Marcel Hoppe

add yaml source class

parent 02b843b3
module ActiveBunny
class YAMLSource
attr_accessor :path
def initialize(path)
@path = path.to_s
# returns a config hash from the YML file
def load
result = YAML.load([Rails.env.to_sym] if @path and File.exist?(@path)
result || {}
rescue Psych::SyntaxError => e
raise "YAML syntax error occurred while parsing #{@path}. Please note that YAML must be consistently indented using spaces. Tabs are not allowed. Error: #{e.message}"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment