require 'yaml' require 'open-uri' module Deputy VERSION = File.read( File.join(File.dirname(__FILE__),'..','VERSION') ).strip def self.send_report(metric, value) url = "#{sheriff_url}/report/#{metric}/#{value}" open(url).read rescue => e e.message << url raise e end def self.sheriff_url config['sheriff_url'].sub(%r{/$},'') end def self.config file = File.expand_path('~/.deputy.yml') YAML.load(File.read(file)) rescue => e e.message << " -- do you have a #{file} ?" end end