title: Access 'ENV' variable in YAML file
body: <p>I have a custom <code>yaml</code> file that needs to use an <code>ENV</code> variable.</p>
  
  <pre><code>YAML.load_file('config/databases.yml')
  </code></pre>
  
  <p>Need to access the PASSWORD variable from the <code>ENV</code> variable like the below from the <code>yaml</code> file</p>
  
  <pre><code>TEST: 
       PASSWORD:  ENV["TEST_DB_PW"]
  </code></pre>
  
  <p>This is not a RAILS app. </p>
  
  <p>How do I do this? <code>&lt;% ENV["TEST_DB_PW"] %&gt;</code> works on RAILS but does not work if it is a simple ruby script.</p>
  
  <pre><code>require 'yaml'
  class Databases
    def initialize
      if File.exist?('config/databases.yml')
        @databases=YAML.load_file('config/databases.yml')
      else
        # You screwed up... 
      end
    end
  end
  
  def print_data
   @databases['TEST']['PASSWORD']
  end
  </code></pre>
  
  <p><code>print_data</code> needs resolving to the <code>ENV</code> parameter referenced in the <code>YAML</code> file.</p>