From aa069398e3a29b2cd0e356c3ff549ba87d044758 Mon Sep 17 00:00:00 2001 From: Alex Blom Date: Sun, 29 May 2016 19:44:03 -0400 Subject: [PATCH] init / 0.1.0 --- .gitignore | 24 ++++++++++++++++++++++++ LICENSE.md | 9 +++++++++ README.md | 15 +++++++++++++++ blueprints/ember-cli-testdouble/index.js | 13 +++++++++++++ index.js | 22 ++++++++++++++++++++++ package.json | 24 ++++++++++++++++++++++++ vendor/shims/testdouble.js | 9 +++++++++ 7 files changed, 116 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE.md create mode 100644 README.md create mode 100644 blueprints/ember-cli-testdouble/index.js create mode 100644 index.js create mode 100644 package.json create mode 100644 vendor/shims/testdouble.js diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..64baa9b --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +# See http://help.github.com/ignore-files/ for more about ignoring files. + +# compiled output +/dist +!/dist/.keep +/tmp + +# dependencies +/node_modules +/bower_components/* + +# misc +/.sass-cache +/connect.lock +/coverage/* +/libpeerconnection.log +npm-debug.log +testem.log +.idea + + +# compiled output +/dist +/tmp diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..fb78feb --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,9 @@ +The MIT License (MIT) + +Copyright (c) 2016 Alex Blom + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..86fcb17 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +# Ember-cli-testdouble + +Shim for testdouble / ember-cli" + +## Usage + +``` +ember install ember-cli-testdouble +``` + +Then import as follows: + +``` +import td from 'testdouble'; +``` diff --git a/blueprints/ember-cli-testdouble/index.js b/blueprints/ember-cli-testdouble/index.js new file mode 100644 index 0000000..c9abaf5 --- /dev/null +++ b/blueprints/ember-cli-testdouble/index.js @@ -0,0 +1,13 @@ +'use strict'; + +module.exports = { + normalizeEntityName: function() { + // this prevents an error when the entityName is + // not specified (since that doesn't actually matter + // to us + }, + + afterInstall: function() { + return this.addBowerPackageToProject('testdouble', 'testdouble/testdouble.js#^1.4.2'); + } +}; diff --git a/index.js b/index.js new file mode 100644 index 0000000..98c6b7d --- /dev/null +++ b/index.js @@ -0,0 +1,22 @@ +/* jshint node: true */ +'use strict'; +var path = require('path'); + +module.exports = { + name: 'ember-cli-testdouble', + + included: function included(app) { + if (app.app) { + app = app.app; + } + this.app = app; + + app.import('bower_components/testdouble/dist/testdouble.js'); + app.import('vendor/shims/testdouble.js', { + type: 'vendor', + exports: { + 'testdouble': ['default'] + } + }); + } +}; diff --git a/package.json b/package.json new file mode 100644 index 0000000..408ddc1 --- /dev/null +++ b/package.json @@ -0,0 +1,24 @@ +{ + "name": "ember-cli-testdouble", + "version": "0.1.0", + "description": "Shim for testdouble / ember-cli", + "author": { + "name": "Alex Blom", + "email": "alex@isleofcode.com", + "url": "https://isleofcode.com" + }, + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/isleofcode/ember-cli-testdouble" + }, + "bugs": { + "url": "https://github.com/isleofcode/ember-cli-testdouble/issues" + }, + "dependences": {}, + "devDependencies": {}, + "keywords": [ + "ember-addon", + "testdouble" + ] +} diff --git a/vendor/shims/testdouble.js b/vendor/shims/testdouble.js new file mode 100644 index 0000000..14e9921 --- /dev/null +++ b/vendor/shims/testdouble.js @@ -0,0 +1,9 @@ +/* globals td */ + +define('testdouble', [], function() { + "use strict"; + + return { + 'default': td + }; +});