Code coverage report for lib/service.js

Statements: 100% (13 / 13)      Branches: 100% (0 / 0)      Functions: 100% (4 / 4)      Lines: 100% (12 / 12)     

All files » lib/ » service.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 271     4   1   4 4 4 4         1 1       1 1       1  
var Service,
    path = require('path');
 
Service = function(name, global_config, output_directory) { this.init(name, global_config, output_directory); };
 
Service.prototype = {
  init: function(name, global_config, output_directory) {
    this.name = name;
    this.config = global_config.services[name];
    this.output_directory = output_directory;
    this.directory = path.resolve(output_directory, name);
    //console.debug("Configuration for %s: %s", service_name, global_config);
  },
 
  execute: function() {
    var service = this._load_service();
    return service(this);
  },
 
  _load_service: function() {
    var service_path = path.resolve(__dirname, 'services/' + this.name + '.js');
    return require(service_path);
  }
};
 
module.exports = Service;