Skip to content

Commit

Permalink
Updated JSCS & other dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
wbyoung committed Oct 5, 2015
1 parent 86554a7 commit da08cda
Show file tree
Hide file tree
Showing 40 changed files with 441 additions and 210 deletions.
4 changes: 1 addition & 3 deletions .jscsfilter
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
'use strict';

var _ = require('lodash');

module.exports = function(e) {
var report = true;
var isTestFile = _.startsWith(e.filename, './test/');
var isTestFile = !!e.filename.match(/^\.\/test\//);
if (isTestFile && e.message === 'jsdoc definition required') {
report = false;
}
Expand Down
3 changes: 0 additions & 3 deletions .jscsrc
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
"ignoreSingleLine": true
},
"safeContextKeyword": "self",
"plugins": [
"jscs-jsdoc"
],
"jsDoc": {
"checkAnnotations": {
"preset": "jsdoc3",
Expand Down
13 changes: 10 additions & 3 deletions lib/adapters/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,21 @@ var Phrasing = require('../dialect/phrasing');
var Procedures = require('../dialect/procedures');

/**
* @class Adapter
* @classdesc
*
* The base Adapter class is the extension point for custom database adapters.
* As a user of Azul, you typically won't use this, but if you're looking to
* add support for a custom database, you should start here.
*
* @public
* @constructor
*/
var Adapter = Class.extend(/** @lends Adapter# */ {

/**
* Create an adapter.
*
* @public
* @constructor
*/
init: function(connection) {
var cls = this.__identity__;
this._super();
Expand Down
24 changes: 20 additions & 4 deletions lib/adapters/mixins/returning.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,24 @@ var Promise = require('bluebird');
var Statement = require('../../types/statement');

/**
* @class PseudoReturn
* @classdesc
*
* The pseudo-return class. This is used as a marker to allow embedding of a
* pseudo-return item & extraction of that item by using type checking.
*
* It's really just a wrapper around a field name (string) that can be type
* checked.
*
* @protected
* @constructor PseudoReturn
* @param {String} field The field name that's requested to be returned.
*/
var PseudoReturn = Class.extend(/** @lends PseudoReturn# */ {

/**
* Create a pseudo return object.
*
* @protected
* @constructor PseudoReturn
* @param {String} field The field name that's requested to be returned.
*/
init: function(field) {
this._field = field;
},
Expand All @@ -44,6 +51,14 @@ var PseudoReturn = Class.extend(/** @lends PseudoReturn# */ {
* @mixin EmbedPseudoReturn
*/
var EmbedPseudoReturn = Mixin.create(/** @lends EmbedPseudoReturn# */ {

/**
* Override of {@link Phrasing#insert}.
*
* @method
* @public
* @see {@link Phrasing#insert}
*/
insert: function(data) {
var returning = data.returning;
var result = this._super(_.extend(data, { returning: undefined }));
Expand All @@ -54,6 +69,7 @@ var EmbedPseudoReturn = Mixin.create(/** @lends EmbedPseudoReturn# */ {
}
return Statement.create(value, args);
},

});

/**
Expand Down
15 changes: 11 additions & 4 deletions lib/adapters/sqlite3/sqlite3.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,20 @@ var EmbedPseudoReturn = returning.EmbedPseudoReturn;
var ExtractPseudoReturn = returning.ExtractPseudoReturn;

/**
* SQLite3 Adapter.
*
* @public
* @constructor
* @class SQLite3Adapter
* @extends Adapter
* @classdesc
*
* SQLite3 Adapter.
*/
var SQLite3Adapter = Adapter.extend(/** @lends SQLite3Adapter# */ {

/**
* Create a SQLite3 adapter.
*
* @public
* @constructor
*/
init: function() {
this._super.apply(this, arguments);
this._connections = {};
Expand Down
17 changes: 12 additions & 5 deletions lib/condition/condition.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ var Node = require('./node');


/**
* @class Condition
* @classdesc
*
* Conditions allow the construction of expressions to limit queries. They are
* usually constructed using the more terse `w` syntax (an abbreviation for
* where). This syntax will be used throughout the documentation here. Basic
Expand All @@ -34,13 +37,17 @@ var Node = require('./node');
*
* select('cities').where({ name: 'Portland' })
* select('cities').where(w({ name: 'Portland' }))
*
* @public
* @constructor
* @param {...(Object|Condition)} conditions Objects used to express a
* condition.
*/
var Condition = Class.extend({ /** @lends Condition# */

/**
* Create a condition.
*
* @public
* @constructor
* @param {...(Object|Condition)} conditions Objects used to express a
* condition.
*/
init: function() {
this._super();

Expand Down
19 changes: 13 additions & 6 deletions lib/condition/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,22 @@ var Class = require('corazon/class');
var property = require('corazon/property');

/**
* A condition expression node (tree).
* @class Node
* @classdesc
*
* @private
* @constructor
* @param {String} type The node type.
* @param {Array.<Node>} children The children of this node.
* @param {Object} attrs The attributes for the node.
* A condition expression node (tree).
*/
var Node = Class.extend(/** @lends Node# */ {

/**
* Create a node.
*
* @private
* @constructor
* @param {String} type The node type.
* @param {Array.<Node>} children The children of this node.
* @param {Object} attrs The attributes for the node.
*/
init: function(type, children, attrs) {
this._super();
this._type = type;
Expand Down
15 changes: 11 additions & 4 deletions lib/condition/operation.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@
var Class = require('corazon/class');

/**
* The base operation class.
* @class Operation
* @classdesc
*
* @private
* @constructor
* @param {String} name The operation name/symbol.
* The base operation class.
*/
var Operation = Class.extend(/** @lends Operation# */ {

/**
* Create an operation.
*
* @private
* @constructor
* @param {String} name The operation name/symbol.
*/
init: function(name) {
this._super();
this.name = name;
Expand Down
15 changes: 11 additions & 4 deletions lib/dialect/phrasing.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,23 @@
var Class = require('corazon/class');

/**
* @class Phrasing
* @classdesc
*
* The phrasing class is used to build full statements to send to the database.
* It is responsible for the ordering & overall structure of the queries, and
* should use the {@link Grammar} and {@link Translator} classes to take care
* of basic formatting & quick translations.
*
* @public
* @constructor
* @param {Grammar} grammar The grammar to use when building phrases.
*/
var Phrasing = Class.extend(/** @lends Phrasing# */ {

/**
* Create a phrasing.
*
* @public
* @constructor
* @param {Grammar} grammar The grammar to use when building phrases.
*/
init: function(grammar, translator) {
this._super();
this._grammar = grammar;
Expand Down
14 changes: 10 additions & 4 deletions lib/dialect/procedures.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,23 @@
var Class = require('corazon/class');
var Promise = require('bluebird');


/**
* @class Procedures
* @classdesc
*
* The procedures class is responsible for complex procedures that cannot be
* expressed in single queries.
*
* @public
* @constructor
*/
var Procedures = Class.extend();

Procedures.reopen(/** @lends Procedures# */ {

/**
* Create a procedure.
*
* @public
* @constructor
*/
init: function(grammar, phrasing) {
this._super();
this._grammar = grammar;
Expand Down
17 changes: 12 additions & 5 deletions lib/query/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,27 @@ var property = require('corazon/property');
*/

/**
* @class BaseQuery
* @classdesc
*
* Queries are the building block of Azul's database abstraction layer. They
* are immutable, chainable objects. Each operation that you perform on a query
* will return a duplicated query rather than the original. The duplicated
* query will be configured as requested.
*
* Generally, you will not create queries directly. Instead, you will receive
* a query object via one of many convenience methods.
*
* @protected
* @constructor BaseQuery
* @mixes Transform
* @param {Adapter} adapter The adapter to use when using the query.
*/
var BaseQuery = Class.extend(/** @lends BaseQuery# */ {

/**
* Create a base query.
*
* @protected
* @constructor BaseQuery
* @mixes Transform
* @param {Adapter} adapter The adapter to use when using the query.
*/
init: function(adapter) {
this._super();
this._adapter = adapter;
Expand Down
19 changes: 12 additions & 7 deletions lib/query/delete.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,28 @@ var Transaction = require('./mixins/transaction');
*/

/**
* A delete query.
*
* You will not create this query object directly. Instead, you will
* receive it via {@link EntryQuery#delete}.
*
* @protected
* @constructor DeleteQuery
* @class DeleteQuery
* @extends BaseQuery
* @mixes Where
* @mixes Transaction
* @classdesc
*
* A delete query.
*/
var DeleteQuery = BaseQuery.extend();

DeleteQuery.reopen(Where);
DeleteQuery.reopen(Transaction);

DeleteQuery.reopen(/** @lends DeleteQuery# */ {

/**
* You will not create this query object directly. Instead, you will
* receive it via {@link EntryQuery#delete}.
*
* @protected
* @constructor DeleteQuery
*/
init: function() { throw new Error('DeleteQuery must be spawned.'); },

/**
Expand Down
7 changes: 5 additions & 2 deletions lib/query/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ _.mixin({ toSentenceSerial: _.str.toSentenceSerial });


/**
* @class EntryQuery
* @extends BaseQuery
* @mixes Transaction
* @classdesc
*
* Queries are the building block of Azul's database abstraction layer. They
* are immutable, chainable objects. Each operation that you perform on a query
* will return a duplicated query rather than the original. The duplicated
Expand All @@ -20,8 +25,6 @@ _.mixin({ toSentenceSerial: _.str.toSentenceSerial });
* @protected
* @constructor EntryQuery
* @param {Adapter} adapter The adapter to use when using the query.
* @extends BaseQuery
* @mixes Transaction
*/
var EntryQuery = BaseQuery.extend();

Expand Down
19 changes: 12 additions & 7 deletions lib/query/insert.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,22 @@ var Transaction = require('./mixins/transaction');
*/

/**
* An insert query.
*
* You will not create this query object directly. Instead, you will
* receive it via {@link EntryQuery#insert}.
*
* @protected
* @constructor InsertQuery
* @class InsertQuery
* @extends BaseQuery
* @mixes Transaction
* @classdesc
*
* An insert query.
*/
var InsertQuery = BaseQuery.extend(Transaction, /** @lends InsertQuery# */ {

/**
* You will not create this query object directly. Instead, you will
* receive it via {@link EntryQuery#insert}.
*
* @protected
* @constructor InsertQuery
*/
init: function() { throw new Error('InsertQuery must be spawned.'); },

/**
Expand Down
4 changes: 4 additions & 0 deletions lib/query/mixins/group_by.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ var Mixin = require('corazon/mixin');
* @mixin GroupBy
*/
module.exports = Mixin.create(/** @lends GroupBy# */ {

/**
* Mixin initialization.
*/
init: function() {
this._super();
this._groupBy = undefined;
Expand Down

0 comments on commit da08cda

Please sign in to comment.