57c20328 by Adam Heath

Start of new idea. Doesn't do much of anything yet.

The plan is to allow for a kind of Copy-On-Write or Overlay feature to
be made available to Backbone models.
1 parent 482801c8
.*.swp
.tmp/
dist/
node_modules/
src/lib/
.grunt/
_SpecRunner.html
/* global module */
module.exports = function (grunt) {
/* global require */
'use strict';
var config = {};
config.base = 'src';
config.jshint = {
options: {
},
browserOptions: {
},
};
config.jscs = {
options: {
validateIndentation: 4,
reporter: 'console',
maxErrors: -1,
},
};
config.bower = {
directory: 'lib/bower',
};
config.jasmine = {
withCoverage: true,
};
var montyPython = require('grunt-monty-python')(grunt);
montyPython.createConfig(config);
};
{
"name": "backbone-model-overlay",
"version": "0.0.0",
"authors": [
"Adam Heath <doogie@brainfood.com>"
],
"main": [
"src/scripts/backbone-model-overlay.js"
],
"private": true,
"ignore": [
"**/.*",
"node_modules",
"src/lib"
],
"dependencies": {
"backbone": "",
"jquery": "",
"requirejs": "",
"underscore": ""
}
}
{
"name": "backbone-model-overlay",
"version": "0.0.0",
"main": [
"src/scripts/backbone-model-overlay.js"
],
"dependencies": {
"rivets": "",
"requirejs": ""
},
"devDependencies": {
"bower-requirejs": "~0.9.2",
"grunt": "~0",
"grunt-monty-python": "git+ssh://git@gitlab.brainfood.com:brainfood/grunt-monty-python.git"
},
"engines": {
"node": ">=0.8.0"
}
}
define(function(require) {
'use strict';
var module = require('module');
var Backbone = require('backbone');
var BackboneModelOverlay = Backbone.Model.extend({
initialize: function(data, options) {
BackboneModelOverlay.__super__.initialize.apply(this, arguments);
},
});
return BackboneModelOverlay;
});
define(function(require) {
'use strict';
var $ = require('jquery');
window.jQuery = $;
var _ = require('underscore');
var Backbone = require('backbone');
var BackboneModelOverlay = require('backbone-model-overlay');
describe('BackboneModelOverlay', function() {
it('exists', function() {
expect(BackboneModelOverlay).toBeDefined();
});
});
describe('BackboneModelOverlay', function() {
var model;
beforeEach(function() {
model = new BackboneModelOverlay();
});
describe('empty', function() {
it('get', function() {
expect(model.get('missing')).toBeUndefined();
});
it('toJSON', function() {
expect(model.toJSON()).toEqual({});
});
});
});
});
/* global require:true */
var require;
require = (function() {
'use strict';
var require = {
baseUrl: 'scripts',
config: {
'backbone-model-overlay': {},
},
shim: {
backbone: {
deps: ['underscore'],
exports: 'Backbone',
},
underscore: {
exports: '_',
},
},
paths: {
backbone: '../lib/bower/backbone/backbone',
underscore: '../lib/bower/underscore/underscore',
jquery: '../lib/bower/jquery/dist/jquery',
},
};
return require;
})();
/* global require */
define(function(require) {
'use strict';
});