Skip to content

Commit

Permalink
Auto merge of #4944 - kellyselden:command-help-unit-tests, r=kellyselden
Browse files Browse the repository at this point in the history
whitespace and test code consolidation

to prep for command help unit tests.
  • Loading branch information
homu committed Oct 10, 2015
2 parents 7ac54f6 + a4ce741 commit 146a614
Show file tree
Hide file tree
Showing 2 changed files with 152 additions and 282 deletions.
18 changes: 9 additions & 9 deletions lib/models/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ Command.prototype.validateAndRun = function(args) {

if (this.works === 'insideProject' && !this.isWithinProject) {
return Promise.reject(new SilentError(
'You have to be inside an ember-cli project in order to use ' +
'the ' + chalk.green(this.name) + ' command.'
'You have to be inside an ember-cli project in order to use ' +
'the ' + chalk.green(this.name) + ' command.'
));
}

if (this.works === 'outsideProject' && this.isWithinProject) {
return Promise.reject(new SilentError(
'You cannot use the '+ chalk.green(this.name) +
' command inside an ember-cli project.'
'You cannot use the '+ chalk.green(this.name) +
' command inside an ember-cli project.'
));
}

Expand Down Expand Up @@ -162,7 +162,7 @@ Command.prototype.validateAndRun = function(args) {
Command.prototype.mergeDuplicateOption = function(key) {
var duplicateOptions, mergedOption, mergedAliases;
// get duplicates to merge
duplicateOptions = where(this.availableOptions, {'name': key});
duplicateOptions = where(this.availableOptions, { 'name': key });

if (duplicateOptions.length > 1) {
// TODO: warn on duplicates and overwriting
Expand All @@ -186,7 +186,7 @@ Command.prototype.mergeDuplicateOption = function(key) {
});

// remove duplicates from options
this.availableOptions = reject(this.availableOptions, {'name': key});
this.availableOptions = reject(this.availableOptions, { 'name': key });
this.availableOptions.push(mergedOption);
}
return this.availableOptions;
Expand Down Expand Up @@ -333,7 +333,7 @@ Command.prototype.validateAlias = function(option, alias) {
} else {
if (value[0] !== this.optionsAliases[key][0]) {
throw new SilentError('The "' + key + '" alias is already in use by the "' + this.optionsAliases[key][0] +
'" option and cannot be used by the "' + value[0] + '" option. Please use a different alias.');
'" option and cannot be used by the "' + value[0] + '" option. Please use a different alias.');
} else {
if (value[1] !== this.optionsAliases[key][1]) {
this.ui.writeLine(chalk.yellow('The "' + key + '" alias cannot be overridden. Please use a different alias.'));
Expand All @@ -356,8 +356,8 @@ Command.prototype.validateAlias = function(option, alias) {
@return {Object|null}
*/
Command.prototype.parseArgs = function(commandArgs) {
var knownOpts = {}; // Parse options
var commandOptions = {};
var knownOpts = {}; // Parse options
var commandOptions = {};
var parsedOptions;

var assembleAndValidateOption = function(option) {
Expand Down
Loading

0 comments on commit 146a614

Please sign in to comment.