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, default = nil)
    @properties[property] || default.nil? ? raise("No #{property} property found in #{@filename}") : default
  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, default)
    @properties[property] || default.nil? ? raise("No #{property} property found in #{@filename}") : default
  end

  def port
    get('port')
  end
end

Revert "Default value for default"
Revert "Default value for default"

This reverts commit 6cbe9da329e996bda09c9f39bffeb479a6bb60a8.
