module Mashery def self.load_rails_config! if File.exists? rails_config load_config! rails_config else # raise MissingConfig.new end end def self.rails_config Rails.root.join("config", "mashery.yml") end class Engine < ::Rails::Engine initializer "load_mashery_config" do Mashery.load_rails_config! end end end