var T      = require ( "./Tango" ) ;

/**
 * Description
 * @constructor
 * Singleton
 * @return 
 */
var Gepard = function()
{
  this.className = "Gepard" ;
  this._logDir = null ;
  this.version = "" ;
};
/**
 * Description
 * @method toString
 * @return string
 */
Gepard.prototype.toString = function()
{
  return "(" + this.className + ")[_logDir=" + this._logDir + "]" ;
};
Gepard.prototype.getVersion = function()
{
  if ( this.version )
  {
    return this.version ;
  }
  var fs  = require ( "fs" ) ;
  try
  {
    var package_json = JSON.parse ( fs.readFileSync ( __dirname + "/../package.json", 'utf8' ) ) ;
    this.version  = package_json.version ;
  }
  catch ( exc )
  {
    this.version = "X" ;
  }
  return this.version ;
};
/**
 * Description
 * @return string 
 */
Gepard.prototype.getLogDirectory = function()
{
  var s = T.getProperty ( "GEPARD_LOG" ) ;
  var fs = require ( "fs" ) ;
  if ( s )
  {
    this._logDir = s ;
  }
  else
  {
    this._logDir = T.resolve ( "%HOME%/log" ) ;
    T.setProperty ( "GEPARD_LOG", this._logDir ) ;
  }
  try
  {
    fs.statSync ( this._logDir ).isDirectory() ;
  }
  catch ( exc )
  {
    try
    {
      fs.mkdirSync ( this._logDir ) ;
    }
    catch ( exc )
    {
      console.log ( exc ) ;
    }
  }
  return this._logDir ;
};

module.exports = new Gepard() ;

@@ -942,23 +942,23 @@
 ;%0A  
-%7D%0A  else%0A  %7B
+  return ;
 %0A  
+%7D%0A
   th
@@ -1001,18 +1001,16 @@
 %22 ) ;%0A  
- 
- 
 T.setPro
@@ -1048,20 +1048,16 @@
 Dir ) ;%0A
-  %7D%0A
   try%0A  

handle default log-dir for Broker under cygwin