├── .gitignore ├── LICENSE.md ├── README.md ├── index.js └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Robert Jackson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## ember-cli-ic-ajax 2 | 3 | This addon that adds `ic-ajax` to the generated Ember CLI output (in `vendor.js`). 4 | 5 | ### Installation / Usage 6 | 7 | From within your Ember CLI application (must be > 0.0.34), run the following: 8 | 9 | ```bash 10 | npm install --save-dev ember-cli-ic-ajax 11 | ``` 12 | 13 | ### References 14 | 15 | * [ic-ajax](https://github.com/instructure/ic-ajax) 16 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | name: 'Ember CLI ic-ajax', 5 | 6 | init: function(name) { 7 | this._super.init && this._super.init.apply(this, arguments); 8 | 9 | var assets_path = require('path').join('ic-ajax','dist','cjs','main.js'); 10 | this.treePaths['vendor'] = require.resolve('ic-ajax').replace(assets_path, ''); 11 | }, 12 | 13 | included: function(app) { 14 | var options = this.app.options.icAjaxOptions || {enabled: true}; 15 | 16 | if (options.enabled) { 17 | this.app.import('vendor/ic-ajax/dist/named-amd/main.js', { 18 | exports: { 19 | 'ic-ajax': [ 20 | 'default', 21 | 'defineFixture', 22 | 'lookupFixture', 23 | 'raw', 24 | 'request', 25 | ] 26 | } 27 | }); 28 | } 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ember-cli-ic-ajax", 3 | "version": "1.0.0", 4 | "description": "Include ic-ajax into an ember-cli application.", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/rjackson/ember-cli-ic-ajax" 12 | }, 13 | "keywords": [ 14 | "ember-addon" 15 | ], 16 | "author": "Robert Jackson", 17 | "license": "MIT", 18 | "dependencies": { 19 | "ic-ajax": "~2.0.1" 20 | }, 21 | "bundledDependencies": [ 22 | "ic-ajax" 23 | ], 24 | "bugs": { 25 | "url": "https://github.com/rjackson/ember-cli-ic-ajax/issues" 26 | }, 27 | "homepage": "https://github.com/rjackson/ember-cli-ic-ajax", 28 | "devDependencies": {} 29 | } 30 | --------------------------------------------------------------------------------