Creates a code coverage badge based on the cobertura report generated by istanbul.

@param {Object} opts is the set of properties provided to the api.
@param {Function} callback is the CPS function to get the results.
775394
function istanbulCoberturaBadger(opts, callback) {
  // Resolve the options
  opts = extend({
    // Setting the default coverage file generated by istanbul cobertura report.
    istanbulReportFile: "./coverage/cobertura-coverage.xml",
    // The default location for the destination being the coverage directory from istanbul.
    destinationDir: null,
    // The shields host to be used for retrieving the badge. https://github.com/badges/shields
    shieldsHost: process.env.SHIELDS_HOST || "https://img.shields.io",
    // The style of shield icon to generate (plastic, flat-square, flat)
    shieldStyle: "flat",
    // The name of the badge file to be generated
    badgeFileName: "coverage",
    // The thresholds to be used to give colors to the badge.
    thresholds: defaultThresholds
  }, opts);

  opts.badgeFormat = opts.badgeFormat || "svg";

  reportParser(opts.istanbulReportFile, function(err, report) {
    if (err) {
      return callback(err);
    }

    // The color depends on the fixed thresholds (RED: 0 >= % < 60) (YELLOW: 60 >= % < 90) (GREEN: % >= 90)
    var color = report.overallPercent >= opts.thresholds.excellent ? "brightgreen" :
      (report.overallPercent >= opts.thresholds.good ? "yellow" : "red");

    // The shields service that will give badges.
    var url = opts.shieldsHost + "/badge/coverage-" + report.overallPercent;
    url += "%25-" + color + "." + opts.badgeFormat + "?style=" + opts.shieldStyle;

    // Save always as coverage image.
    var badgeFileName = path.join(opts.destinationDir, opts.badgeFileName + "." + opts.badgeFormat);

    downloader(url, badgeFileName, function(err, downloadResult) {
      if (err) {
        return callback(err);
      }

      report.url = url;
      report.badgeFile = downloadResult;
      report.color = color;

      return callback(null, report);
    });
  });
}
487894
function (opts, callback) {
    var xhttp = new XMLHttpRequest();
    xhttp.onreadystatechange = function() {
      if (this.readyState == 4 ) {
        if (this.status == 204){
          //success
          return callback(null);
        }else {
          return callback(this.statusText);
        }
      }
    };

    xhttp.open(opts.method, opts.host + '/' + opts.path, true);
    for (var header in opts.headers){
      var headerValue = opts.headers[header];
      xhttp.setRequestHeader(header, headerValue)
    }
    xhttp.send(opts.body);
  }
251363
function create (params, opts, cb) {
      if (!cb) {
        cb = opts
      }
      if (!opts || typeof opts === 'function') {
        opts = {}
      }

      let promise = null
      if (typeof cb !== 'function') [promise, cb] = asyncify()

      const { createOnly } = opts

      const tasks = [
        (job, next) => {
          const id = params.id || uuid()
          params.id = id
          const { name, description, metadata, user } = params

          Joi.validate({ id, name, description, metadata, user }, validationRules.create, (err) => {
            if (err) return next(Boom.badRequest(err))
            next()
          })
        },
        (job, next) => {
          job.params = params
          job.user = params.user
          next()
        },
        insertOrganization
      ]

      if (!createOnly) {
        tasks.push(
          createDefaultPolicies,
          insertOrgAdminUser
        )
      }

      db.withTransaction(tasks, (err, res) => {
        if (err) return cb(err)

        organizationOps.readById(res.organization.id, (err, organization) => {
          if (err) return cb(Boom.badImplementation(err))

          cb(null, { organization, user: res.user })
        })
      })

      return promise
    }
435345
function (opts) {
            opts.meta.classes = [];
            Y.each(this.data.classes, function (v) {
                if (v.external) {
                    return;
                }
                opts.meta.classes.push({
                    displayName: v.name,
                    name: v.name,
                    namespace: v.namespace,
                    module: v.module,
                    description: v.description,
                    access: v.access || 'public'
                });
            });
            opts.meta.classes.sort(this.nameSort);
            return opts;
        }
441916
public function codestyleCheck($opt = ['report|r' => 'summary'])
    {
        $this->say("Checking code style");

        $this->taskExec('php vendor/bin/phpcs')
            ->arg('.')
            ->arg('--standard=ruleset.xml')
            ->arg('--report=' . $opt['report'])
            ->arg('--ignore=tests,vendor,package,docs')
            ->run();
    }
1218988
function handler(opts) {
	Object.assign(values, opts);

	let templateMeta;
	let metalsmith;

	return Promise.resolve()

		// Resolve project name & folder
		.then(() => {
			values.inPlace = false;
			if (!values.projectName || values.projectName === ".") {
				values.inPlace = true;
				values.projectName = path.relative("../", process.cwd());
			}
			values.projectPath = path.resolve(values.projectName);
		})
		// check for template mapping
		.then(() => {
			return new Promise((resolve, reject) => {
				const configPath = path.join(os.homedir(), ".moleculer-templates.json");
				fs.exists(configPath, configExists => {
					if (configExists) {
						fs.readFile(configPath, (err, config) => {
							if (err) {
								reject(`Error reading config file from ${configPath}`);
							}
							values.aliasedTemplates = JSON.parse(config);
							resolve();
						});
					} else {
						resolve();
					}
				});
			});
		})
		// Resolve template URL from name
		.then(() => {
			let { templateName, templateRepo, aliasedTemplates } = values;
			if (aliasedTemplates[templateName]) {
				templateName = aliasedTemplates[templateName];
			}

			if (/^[./]|(^[a-zA-Z]:)/.test(templateName)) {
				values.tmp = path.isAbsolute(templateName) ? templateName : path.normalize(path.join(process.cwd(), templateName));

				console.log("Local template:", values.tmp);
			} else {

				if (templateName.indexOf("/") === -1) {
					templateRepo = `moleculerjs/moleculer-template-${templateName}`;
				} else {
					templateRepo = templateName;
				}

				values.templateRepo = templateRepo;
				values.tmp = getTempDir(templateName, true);

				console.log("Template repo:", templateRepo);
			}
		})

		// Download template
		.then(() => {
			if (values.templateRepo) {
				return new Promise((resolve, reject) => {
					let spinner = ora("Downloading template");
					spinner.start();
					download(values.templateRepo, values.tmp, {}, err => {
						spinner.stop();

						if (err)
							return reject(`Failed to download repo from '${values.templateRepo}'!`, err);

						resolve();
					});

				});
			}
		})

		// Prompt questions
		.then(() => {
			const { tmp } = values;
			if (fs.existsSync(path.join(tmp, "meta.js"))) {
				templateMeta = require(path.join(tmp, "meta.js"))(values);
				if (templateMeta.questions) {
					return inquirer.prompt(templateMeta.questions).then(answers => Object.assign(values, answers));
				}
			} else {
				templateMeta = {};
			}
		})

		// Check target directory
		.then(() => {
			if (fs.existsSync(values.projectPath)) {
                if (templateMeta.promptForProjectOverwrite === false) return;
				return inquirer.prompt([{
					type: "confirm",
					name: "continue",
					message: chalk.yellow.bold(`The '${values.projectName} directory is exists! Continue?`),
					default: false
				}]).then(answers => {
					if (!answers.continue)
						process.exit(0);
				});
			} else {
				console.log(`Create '${values.projectName}' folder...`);
				mkdirp(values.projectPath);
			}
		})

		// Build template
		.then(() => {
			return new Promise((resolve, reject) => {
				metalsmith = Metalsmith(values.tmp);
				Object.assign(metalsmith.metadata(), values);

				// Register custom template helpers
				if (templateMeta.helpers)
					Object.keys(templateMeta.helpers).map(key => Handlebars.registerHelper(key, templateMeta.helpers[key]));

				// metalsmith.before
				if (templateMeta.metalsmith && _.isFunction(templateMeta.metalsmith.before))
					templateMeta.metalsmith.before.call(templateMeta, metalsmith);

				metalsmith
					.use(filterFiles(templateMeta.filters, templateMeta.skip))
					.use(renderTemplate(templateMeta.skipInterpolation));

				// metalsmith.after
				if (templateMeta.metalsmith && _.isFunction(templateMeta.metalsmith.after))
					templateMeta.metalsmith.after.call(templateMeta, metalsmith);

				// Build
				metalsmith
					.clean(false)
					.source(values.templateDir)
					.destination(values.projectPath)
					.build(err => {
						if (err)
							return reject(err);

						// metalsmith.complete
						if (templateMeta.metalsmith && _.isFunction(templateMeta.metalsmith.complete))
							templateMeta.metalsmith.complete.call(templateMeta, metalsmith);

						resolve();
					});

			});
		})

		// Run 'npm install'
		.then(() => {
			return inquirer.prompt([{
				type: "confirm",
				name: "install",
				message: "Would you like to run 'npm install'?",
				default: true
			}]).then(({ install }) => {
				if (install) {
					console.log("\nRunning 'npm install'...");
					return exeq([
						"cd " + values.projectPath,
						"npm install"
					]);
				}
			});
		})

		// Show completeMessage
		.then(() => {
			return new Promise((resolve, reject) => {
				if (templateMeta.completeMessage)
					render(templateMeta.completeMessage, metalsmith.metadata(), (err, res) => {
						if (err)
							return reject(err);

						console.log(chalk.green.bold("\n" + res.split(/\r?\n/g).map(line => "   " + line).join("\n")));


						resolve();
					});
				else {
					console.log(chalk.green.bold("\nDone!"));
					resolve();
				}

			});
		})

		// Error handler
		.catch(err => fail(err));
}
1410
function RegistryClientV2(opts) {
    var self = this;
    assert.object(opts, 'opts');
    // One of `opts.name` or `opts.repo`.
    assert.ok((opts.name || opts.repo) && !(opts.name && opts.repo),
        'exactly one of opts.name or opts.repo must be given');
    if (opts.name) {
        assert.string(opts.name, 'opts.name');
    } else {
        assert.object(opts.repo, 'opts.repo');
    }
    assert.optionalObject(opts.log, 'opts.log');
    assert.optionalString(opts.username, 'opts.username');
    if (opts.username) {
        assert.string(opts.password,
            'opts.password required if username given');
    } else {
        assert.optionalString(opts.password, 'opts.password');
    }
    assert.optionalString(opts.token, 'opts.token');  // for Bearer auth
    assert.optionalBool(opts.insecure, 'opts.insecure');
    assert.optionalString(opts.scheme, 'opts.scheme');
    assert.optionalBool(opts.acceptManifestLists, 'opts.acceptManifestLists');
    assert.optionalNumber(opts.maxSchemaVersion, 'opts.maxSchemaVersion');
    // TODO: options to control the trust db for CA verification
    // TODO add passing through other restify options: userAgent, ...
    // Restify/Node HTTP client options.
    assert.optionalBool(opts.agent, 'opts.agent');
    assert.optionalString(opts.userAgent, 'opts.userAgent');

    this.log = _createLogger(opts.log);

    this.insecure = Boolean(opts.insecure);
    if (opts.name) {
        this.repo = common.parseRepo(opts.name);
    } else {
        this.repo = common.deepObjCopy(opts.repo);
    }
    if (opts.scheme) {
        this.repo.index.scheme = opts.scheme;
    } else if (!this.repo.index.scheme &&
        common.isLocalhost(this.repo.index.name))
    {
        // Per docker.git:registry/config.go#NewServiceConfig we special
        // case localhost to allow HTTP. Note that this lib doesn't do
        // the "try HTTPS, then fallback to HTTP if allowed" thing that
        // Docker-docker does, we'll just prefer HTTP for localhost.
        this.repo.index.scheme = 'http';
    }

    this.acceptManifestLists = opts.acceptManifestLists || false;
    this.maxSchemaVersion = opts.maxSchemaVersion || 1;
    this.username = opts.username;
    this.password = opts.password;
    this._loggedIn = false;
    this._loggedInScope = null; // Keeps track of the login type.
    this._authInfo = null;
    this._headers = {};

    _setAuthHeaderFromAuthInfo(this._headers, {
        token: opts.token,
        username: opts.username,
        password: opts.password
    });

    // XXX relevant for v2?
    //this._cookieJar = new tough.CookieJar();

    if (this.repo.index.official) {  // v1
        this._url = DEFAULT_V2_REGISTRY;
    } else {
        this._url = common.urlFromIndex(this.repo.index);
    }
    this.log.trace({url: this._url}, 'RegistryClientV2 url');

    this._commonHttpClientOpts = {
        log: this.log,
        agent: opts.agent,
        proxy: opts.proxy,
        rejectUnauthorized: !this.insecure,
        userAgent: opts.userAgent || common.DEFAULT_USERAGENT
    };
    this._clientsToClose = [];

    Object.defineProperty(this, '_api', {
        get: function () {
            if (self.__api === undefined) {
                self.__api = new DockerJsonClient(common.objMerge({
                    url: self._url
                }, self._commonHttpClientOpts));
                self._clientsToClose.push(self.__api);
            }
            return this.__api;
        }
    });

    Object.defineProperty(this, '_httpapi', {
        get: function () {
            if (self.__httpapi === undefined) {
                self.__httpapi = new restifyClients.HttpClient(common.objMerge({
                    url: self._url
                }, self._commonHttpClientOpts));
                self._clientsToClose.push(self.__httpapi);
            }
            return this.__httpapi;
        }
    });
}
1274777
function(callback) {
            // We have to check "failOnFirst" flag to make sure we did not
            // throw the error before.
            if (phpcsError && !options.failOnFirst) {
                this.emit('error', new gutil.PluginError(
                    'gulp-phpcs',
                    'PHP Code Sniffer failed on \n    ' + badFiles.join('\n    ')
                ));
            }

            callback();
        }
1340039
function gulp(opts) {
  opts = opts || {};

  var failOnError = opts['failOnError'] || false;
  var interimFiles = [];
  var failedValidations = [];

  return Through(
    function (file) {
      interimFiles.push(file.path);
      this.queue(file);
    },
    function () {
      var baseFile = opts.packageFile;

      interimFiles.forEach(function (file) {
        opts.packageFile = file;

        var results = validate(opts);

        if (hasErrors(results)) {
          failedValidations.push(file);
          log(results);
        }
      });

      opts.packageFile = baseFile;

      if (failOnError &&  failedValidations.length) {
        this.emit('error', new PluginError('dep-validate', 'Unable to validate dependencies'));
      } else {
        this.emit('end');
      }
    }
  );
}
497170
function wafr(options, callback) {
  const contractsPath = options.path;
  const optimizeCompiler = options.optimize;
  const sourcesExclude = options.exclude;
  const sourcesInclude = options.include;
  const focusContract = options.focus;
  const reportLogs = {
    contracts: {},
    status: 'success',
    failure: 0,
    success: 0,
    logs: {},
  };

  // get allinput sources
  getInputSources(contractsPath, sourcesExclude, sourcesInclude, focusContract, (inputError, sources) => {
    if (inputError) {
      throwError(`while getting input sources: ${inputError}`);
    }

    // build contract sources input for compiler
    const compilerInput = {
      sources: Object.assign({ 'wafr/Test.sol': testContract }, sources),
    };

    // compiling contracts
    log(`compiling contracts from ${Object.keys(sources).length} sources...`);

    // compile solc output (sync method)
    const output = solc.compile(compilerInput, optimizeCompiler);

    // output compiler warnings
    filterErrorErrors(output.errors).forEach((outputError) => {
      log(`while compiling contracts in path warning.. ${contractsPath}: ${outputError}`);
    });

    // handle all compiling errors
    if (filterErrorWarnings(output.errors).length > 0) {
      output.errors.forEach((outputError) => {
        throwError(`while compiling contracts in path ${contractsPath}: ${outputError}`);
      });
    } else {
      // compiling contracts
      log('contracts compiled!');

      const outputContracts = contractNameProcessing(options.onlyContractName, output.contracts);

      // add output to report
      reportLogs.contracts = outputContracts;

      // find and build test contracts array
      const testContracts = buildTestContractsArray(outputContracts);
      const startIndex = 0;

      // done function
      const contractComplete = (contractReport) => {
        // if contract failed, then all tests fail
        if (contractReport !== false) {
          if (contractReport.status === 'failure') {
            reportLogs.status = 'failure';
            reportLogs.failure += contractReport.failure;
          } else {
            reportLogs.success += contractReport.success;
          }
        }

        // if contract report is false, there is no more contracts to test
        if (contractReport === false) {
          // report done in log
          report(`

  ${reportLogs.failure && chalk.red(`${reportLogs.failure} not passing`) || ''}
  ${reportLogs.success && chalk.green(`${reportLogs.success} passing`) || ''}
`);

          // report logs
          callback(null, reportLogs);
        } else {
          reportLogs.logs[contractReport.name] = contractReport;
        }
      };

      // if no test contracts, end testing
      if (testContracts.length === 0) {
        contractComplete(false);
      } else {
        // test each contract sequentially
        testContractsSeq(startIndex, testContracts, contractComplete);
      }
    }
  });
}
516732
function Deferred(opts){
 	/**
	 * @define {object} Collection of public methods.
	 */
	var self = {};

	/**
	 * @define {object} options for the constructor 
	 */
	var opts = opts || {};

	/**
	 * @define {object} A promise object that will be returned
	 */
	var promise = {};

	/**
	 * @define {object} Event system for controlling events
	 */
	var event = Event();
	
	/**
	 * Promise then method
	 * This is for chaining promis callbacks
	 * @example promiseFunction().then(
	 * function(){ // success }, 
	 * function(){ // rejected }, 
	 * function(){ // notify } 
	 * ).then( ... );
	 * @param {function} sucess Success callback
	 * @param {function} reject Reject callback
	 * @param {function} notify notify callback
	 * @return {object} Returns the promise object
	 */
	function promiseThen(success, reject, notify){
		/**
		 * @define {object} Return a new promise
		 */
		var def = Deferred();

		/**
		 * Resolved promise
		 * @example example
		 * @param {string} A string key for the event system
		 * @param {function} A callback when event is triggered
		 * @return {object} Returns promise object
		 */
		event.on('resolve', function(){ 
			/**
			 * If the success callback returns a promise
			 * then resolve/reject/notify that returned promise
			 */
			var promise = success();
			if(!promise) return;
			promise.success(function(){
				/** handle the returned deferred object */
				def.resolve();
			});
			promise.error(function(){
				def.reject();
			});
			promise.notify(function(){
				def.notify();
			});
		});

		/**
		 * If promise is rejected/notify trigger the callback
		 */
		event.on('reject', function(){ 
			if(reject) reject();
		});

		event.on('notify', function(){ 
			if(notify) notify();
		});

		/**
		 * @return {object} Returns a promise object
		 */
		return def.promise; 
	}

	/**
	 * Promise methods
	 * @example promise.then( //new promise ).then(...)
	 * @example promise.success(...).error(...).notify(...)
	 * @param {function} callback A callback for the promise
	 * @return {object} Return the promise
	 */
	function promiseSuccess(callback){
		event.on('resolve', callback);
		return promise;
	}

	function promiseError(callback){
		event.on('reject', callback);
		return promise;
	}

	function promiseNotified(callback){
		event.on('notify', callback);
		return promise;
	}

	/**
	 * Deferred methods to trigger the promise
	 * @example def.resolve(args)
	 * @example def.reject(args)
	 * @example def.notify(args)
	 */
	function resolve(){
		var args = Array.prototype.slice.call(arguments);
		event.trigger('resolve', args);
	}

	function reject(){
		var args = Array.prototype.slice.call(arguments);
		event.trigger('reject', args);	
	}

	function notify(){
		var args = Array.prototype.slice.call(arguments);
		event.trigger('notify', args);		
	}

	/**
	 * Add the promise methods to the promise object
	 */
	promise.then = promiseThen;
	promise.success = promiseSuccess;
	promise.error = promiseError;
	promise.notify = promiseNotified;

	/**
	 * The promise object
	 * @public {object}
	 */
	self.promise = promise;

	/**
	 * Deferred public methods	
	 * @public {function}
	 */
	self.resolve = resolve;
	self.reject = reject;
	self.notify = notify;

	/**
	 * @return {object} return public methos
	 */
	return self;
}
113432
function get( opts, clbk ) {
	var scount;
	var fcount;
	var count;
	var pkgs;
	var eFLG;
	var out;
	var idx;
	var len;
	var i;

	// Output data store:
	out = {};
	out.meta = {};
	out.data = {};
	out.failures = {};

	// Number of completed requests:
	count = 0;
	scount = 0; // success
	fcount = 0; // failures

	// Request id:
	idx = 0;

	pkgs = opts.packages;
	len = pkgs.length;

	debug( 'Number of packages: %d.', len );
	out.meta.total = len;

	debug( 'Beginning queries...' );
	for ( i = 0; i < NUM_CONCURRENT_REQUESTS; i++ ) {
		next();
	}
	/**
	* FUNCTION: next()
	*	Requests package data for the next package in the queue. Once requests for all desired packages have completed, invokes the provided callback.
	*
	* @private
	* @returns {Void}
	*/
	function next() {
		if ( count === len ) {
			debug( 'Finished all queries.' );
			out.meta.success = scount;
			out.meta.failure = fcount;
			return clbk( null, out );
		}
		if ( idx < len ) {
			debug( 'Querying for package: `%s` (%d)...', pkgs[idx], idx );
			request( pkgs[idx], opts, onResponse( pkgs[idx], idx ) );
			idx += 1;
		}
	} // end FUNCTION next()

	/**
	* FUNCTION: onResponse( pkg, idx )
	*	Returns a response callback.
	*
	* @private
	* @param {String} pkg - package name
	* @param {Number} idx - request index
	* @returns {Function} response callback
	*/
	function onResponse( pkg, idx ) {
		/**
		* FUNCTION: onResponse( error, data )
		*	Callback invoked upon receiving a request response.
		*
		* @private
		* @param {Error|Null} error - error object
		* @param {Object} data - response data
		* @returns {Void}
		*/
		return function onResponse( error, data ) {
			if ( eFLG ) {
				return;
			}
			debug( 'Response received for package: `%s` (%d).', pkg, idx );
			if ( error ) {
				if ( error instanceof Error ) {
					eFLG = true;
					return clbk( error );
				}
				debug( 'Failed to resolve package `%s` (%d): %s', pkg, idx, error.message );
				out.failures[ pkg ] = error.message;
				fcount += 1;
			} else {
				debug( 'Successfully resolved package `%s` (%d).', pkg, idx );
				out.data[ pkg ] = data;
				scount += 1;
			}
			count += 1;
			debug( 'Request %d of %d complete.', count, len );
			next();
		}; // end FUNCTION onResponse()
	} // end FUNCTION onResponse()
}
1299042
private function getSignupEvent($signup, $opts) {

        $currentStatus = null;
        $previousAttendance = false;
        $previousPartialAttendance = false;
        foreach ($signup->statuses as $status) {
            if ($status->timecreated == $opts['event']['timecreated']) {
                $currentStatus = $status;
            } else if ($status->timecreated < $opts['event']['timecreated'] 
                && $status->statuscode == $this->statuscodes->partial) {
                $previousPartialAttendance = true;
            } else if ($status->timecreated < $opts['event']['timecreated'] 
                && $status->statuscode == $this->statuscodes->attended) {
                $previousAttendance = true;
            }
        }

        if (is_null($currentStatus)){
            // There is no status with a timestamp matching the event.
            return null;
        }

        $duration = null;
        $completion = null;
        if ($currentStatus->statuscode == $this->statuscodes->attended){
            if ($previousAttendance == true){
                // Attendance has already been recorded for this user and session.'
                return null;
            }
            $duration = $this->sessionDuration;
            $completion = true;
        } else if ($currentStatus->statuscode == $this->statuscodes->partial){
            if ($previousPartialAttendance == true){
                // Partial attendance has already been recorded for this user and session.
                return null;
            }
            $duration = $this->sessionDuration * $this->partialAttendanceDurationCredit;
            $completion = false;
        } else {
            // This user did not attend this session.
            return null;
        }

        return [
            'recipe' => 'training_session_attend',
            'attendee_id' => $signup->attendee->id,
            'attendee_url' => $signup->attendee->url,
            'attendee_name' => $signup->attendee->fullname,
            'attempt_duration' => "PT".(string) $duration."S",
            'attempt_completion' => $completion
        ];
    }
337875
function (opt) {
            return _.extend(
                /** @class OptionsTahta */
                {
                    arrTahta_id: null,
                    bGenel: true,
                    bKurumu: true,
                    bAnahtarlari: true,
                    bRolleri: true,
                    bUyeleri: true,
                    bAjanda: true,
                    optUye: {
                        bArrTahtaUyeRolId: true
                    }
                }, opt || {});
        }
719464
def _pv_callbacks(opts, key, callbacks)
        raise ArgumentError, "Callback list must be a hash!" unless callbacks.kind_of?(Hash)
        value = _pv_opts_lookup(opts, key)
        if value != nil
          callbacks.each do |message, zeproc|
            if zeproc.call(value) != true
              raise ValidationFailed, "Option #{key}'s value #{value} #{message}!"
            end
          end
        end
      end
747666
function Buildit(opts) {
	opts = opts || {};

	this.cwd = opts.baseUrl || process.cwd();
	this.name = opts.name;
	this.locals = {};
	this.externals = [];

	if (opts.define) {
		this.define = opts.define;
	}

	if (opts.exports) {
		this.exports = opts.exports;
	}

	if (opts.extensions) {
		this.extensions = opts.extensions;
	}
}
1350132
function (opts, cb) {
      var self = this
      opts = opts || {}
      var root = opts.root || RootKey
      var key = opts.key
      if (opts.all) {
        return this.delRoot(opts, cb)
      }
      if (!key) {
        return cb(new Error(ERR.FA_PARAMS.msg), ERR.FA_PARAMS)
      }
      mq.hdel(root, key, function (err, doc) {
        if (err) {
          cb(err, ERR.config.FA_DEL_CONFIG)
        } else {
          self.emit('delConfig', opts)
          cb(null, true)
        }
      })
    }