<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -5,7 +5,15 @@ module OpenX
     class Base
       include Comparable
 
-      CONFIGURATION_YAML = File.join(ENV['HOME'], '.openx', 'credentials.yml')
+      # HOME || HOMEPATH is for Win32 users who do not have HOME set by default
+      #
+      # Configuration can be overridden for Rails at load time by doing this:
+      # OpenX::Services::Base.configuration = 
+      #   YAML.load_file(File.join(Rails.root, 'config', 'credentials.yml'))[Rails.env]
+      # 
+      # Rescue nil is there for Rails sites that are monitored by Monit,
+      # which does not set the environment variables as expected
+      CONFIGURATION_YAML = File.join((ENV['HOME'] || ENV['HOMEPATH']), '.openx', 'credentials.yml') rescue nil
 
       @@connection    = nil
       @@configuration = nil</diff>
      <filename>lib/openx/services/base.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>0d8a9803a4fd3f354335f056a2a89a9b83cbd585</id>
    </parent>
  </parents>
  <author>
    <name>Dan Sketcher</name>
    <email>dan@sketcher.net</email>
  </author>
  <url>http://github.com/touchlocal/openx/commit/169909f5acc822ca405c4a0c976a6fc8e347f12b</url>
  <id>169909f5acc822ca405c4a0c976a6fc8e347f12b</id>
  <committed-date>2009-11-05T17:24:28-08:00</committed-date>
  <authored-date>2009-11-05T17:24:28-08:00</authored-date>
  <message>Enviroment variable handling for non-*nix and non-standard environments</message>
  <tree>c6713b6779cb8d55fa30d53887ee2daf276183b4</tree>
  <committer>
    <name>Dan Sketcher</name>
    <email>dan@sketcher.net</email>
  </committer>
</commit>
