2014-12-30 05:11:24 +03:00
|
|
|
var assert = require('assert');
|
|
|
|
|
|
|
|
module.exports = function () {};
|
|
|
|
|
|
|
|
module.exports.prototype = {
|
|
|
|
configure: function (disallowObjectController) {
|
|
|
|
assert(
|
|
|
|
typeof disallowObjectController === 'boolean',
|
|
|
|
'disallowObjectController option requires boolean value'
|
|
|
|
);
|
|
|
|
assert(
|
|
|
|
disallowObjectController === true,
|
|
|
|
'disallowObjectController option requires true value or should be removed'
|
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
getOptionName: function () {
|
|
|
|
return 'disallowObjectController';
|
|
|
|
},
|
|
|
|
|
|
|
|
check: function (file, errors) {
|
|
|
|
var lines = file.getLines();
|
|
|
|
|
|
|
|
lines.forEach(function (line, index) {
|
2015-01-13 18:13:26 +03:00
|
|
|
var location = line.indexOf('ObjectController.extend');
|
2014-12-30 05:11:24 +03:00
|
|
|
|
|
|
|
if (location !== -1) {
|
|
|
|
errors.add('Ember.ObjectController is deprecated, please use Ember.Controller and access model properties directly.', index + 1, location + 1);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|