require 'util/namespace'
require 'util/log'

class Util::ConfigFile
  include Util::Log
  def initialize(filename)
    @filename = filename
    @properties = {}
    begin
      IO.foreach(filename) do |line|
        @properties[$1.strip] = $2 if line =~ /([^=]*)=(.*)\/\/(.*)/ || line =~ /([^=]*)=(.*)/
      end
    rescue
      logger.error("ERROR Reading file #{filename} \n")
    end
  end

  def get(property)
    @properties[property] || raise("No #{property} property found in #{@filename}")
  end

  def port
    get('port')
  end
end

require 'util/namespace'
require 'util/log'

class Util::ConfigFile
  include Util::Log
  def initialize(filename)
    @filename = filename
    @properties = {}
    begin
      IO.foreach(filename) do |line|
        @properties[$1.strip] = $2 if line =~ /([^=]*)=(.*)\/\/(.*)/ || line =~ /([^=]*)=(.*)/
      end
    rescue
      logger.error("ERROR Reading file #{filename} \n")
    end
  end

  def get(property)
    return @properties[property]
  end

  def port
    return  @properties["port"]
  end
end
Revert "Blow up if we ask for an undefined property, stopping us interpolating madness"
Revert "Blow up if we ask for an undefined property, stopping us interpolating madness"

This reverts commit 6cc3a2a6ce96103aa857d77a2d94167059410bb6.
