├── .bowerrc ├── .gitignore ├── Brocfile.js ├── CHANGELOG.md ├── README.md ├── addon └── .gitkeep ├── app └── .gitkeep ├── blueprints └── divshot │ ├── files │ └── divshot.json │ └── index.js ├── bower.json ├── index.js ├── lib └── commands │ └── divshot.js ├── package.json ├── testem.json ├── tests ├── .jshintrc ├── dummy │ ├── .editorconfig │ ├── .jshintrc │ ├── app │ │ ├── app.js │ │ ├── components │ │ │ └── .gitkeep │ │ ├── controllers │ │ │ └── .gitkeep │ │ ├── helpers │ │ │ └── .gitkeep │ │ ├── index.html │ │ ├── models │ │ │ └── .gitkeep │ │ ├── router.js │ │ ├── routes │ │ │ └── .gitkeep │ │ ├── styles │ │ │ ├── .gitkeep │ │ │ └── app.css │ │ ├── templates │ │ │ ├── .gitkeep │ │ │ ├── application.hbs │ │ │ └── components │ │ │ │ └── .gitkeep │ │ └── views │ │ │ └── .gitkeep │ ├── config │ │ └── environment.js │ ├── public │ │ ├── .gitkeep │ │ ├── crossdomain.xml │ │ └── robots.txt │ └── tests │ │ └── helpers │ │ └── start-app.js ├── helpers │ └── resolver.js ├── index.html ├── mocha-jshint-nodetest.js ├── runner.js ├── test-helper.js └── unit │ ├── .gitkeep │ └── commands │ └── divshot-nodetest.js └── vendor └── .gitkeep /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "bower_components" 3 | } 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | 7 | # dependencies 8 | /node_modules 9 | /bower_components/* 10 | 11 | # misc 12 | /.sass-cache 13 | /connect.lock 14 | /coverage/* 15 | /libpeerconnection.log 16 | npm-debug.log 17 | testem.log 18 | -------------------------------------------------------------------------------- /Brocfile.js: -------------------------------------------------------------------------------- 1 | /* global require, module */ 2 | 3 | var EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); 4 | 5 | var app = new EmberAddon(); 6 | 7 | // Use `app.import` to add additional libraries to the generated 8 | // output files. 9 | // 10 | // If you need to use different assets in different 11 | // environments, specify an object as the first parameter. That 12 | // object's keys should be the environment name and the values 13 | // should be the asset to use in that environment. 14 | // 15 | // If the library that you are including contains AMD or ES6 16 | // modules that you would like to import into your application 17 | // please specify an object with the list of modules as keys 18 | // along with the exports of each module as its value. 19 | 20 | module.exports = app.toTree(); 21 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ### Master 2 | 3 | ### 0.1.7 4 | 5 | * Add support to pass through `--token`, `--app`, and other options to the underlying `divshot` commands. 6 | 7 | ### 0.1.6 8 | 9 | * Default the Ember build environment to `production`, allow `--environment=development` to be specified. 10 | 11 | ### 0.1.4 12 | 13 | * Fix generator issue with backwards compat (with ember-cli < 0.0.43). Previously, running `ember g divshot` 14 | would error in 0.0.42. 15 | 16 | ### 0.1.3 17 | 18 | * Add `.divshot-cache` to `.gitignore` when running `ember g divshot`. 19 | 20 | ### 0.1.2 21 | 22 | * Fix repo URL in `package.json`. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ember-cli-divshot 2 | 3 | Simple wrapper for the `divshot-cli` package. Allows usage of divshot deployment from an ember-cli app with ease. 4 | 5 | ## DEPRECATED 6 | 7 | Divshot has joined the Firebase team, and the existing `divshot` package and deployment system will be going away soonish. Due to this change, ember-cli-divshot is deprecated. 8 | 9 | See https://www.firebase.com/blog/2015-10-13-divshot-joins-firebase.html for more details. 10 | 11 | ## Usage 12 | 13 | ### Installation 14 | 15 | From within your Ember CLI application run: 16 | 17 | ```bash 18 | npm install --save-dev ember-cli-divshot 19 | ``` 20 | 21 | ### Setting up Divshot 22 | 23 | From within your Ember CLI application run: 24 | 25 | ```bash 26 | ember generate divshot 27 | ``` 28 | 29 | ### Deploy 30 | 31 | ```bash 32 | ember divshot push 33 | ``` 34 | 35 | By default, the `--environment=production` option will be set for the Ember CLI build step. If 36 | you'd like to specify the development environment, you can do so with the following command: 37 | 38 | ```bash 39 | ember divshot push --environment=development 40 | ``` 41 | 42 | #### Specifying the Divshot environmnet 43 | 44 | The default Divshot environment is `development`, however you can push directly to staging: 45 | 46 | ```bash 47 | ember divshot push staging 48 | ``` 49 | 50 | Or production: 51 | 52 | ```bash 53 | ember divshot push production 54 | ``` 55 | 56 | #### Specifying the Divshot option arguments (see [here](https://github.com/divshot/divshot-cli) for available options) 57 | 58 | ```bash 59 | ember divshot push production --token OAUTH_TOKEN 60 | ``` 61 | 62 | ## Contributing 63 | 64 | ### Running Tests 65 | 66 | * `npm test` 67 | 68 | ## License 69 | 70 | MIT 71 | -------------------------------------------------------------------------------- /addon/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rwjblue/ember-cli-divshot/55f63e540f237357676a1c7d93c84804ac106abc/addon/.gitkeep -------------------------------------------------------------------------------- /app/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rwjblue/ember-cli-divshot/55f63e540f237357676a1c7d93c84804ac106abc/app/.gitkeep -------------------------------------------------------------------------------- /blueprints/divshot/files/divshot.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "<%= dasherizedPackageName %>", 3 | "root": "./dist", 4 | "routes": { 5 | "/tests": "tests/index.html", 6 | "/tests/**": "tests/index.html", 7 | "/**": "index.html" 8 | }, 9 | "cache_control": { 10 | "/assets/**": 31536000 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /blueprints/divshot/index.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var path = require('path'); 3 | 4 | module.exports = { 5 | normalizeEntityName: function() { 6 | // this prevents an error when the entityName is 7 | // not specified (since that doesn't actually matter 8 | // to us 9 | }, 10 | 11 | afterInstall: function() { 12 | return this.insertIntoFile('.gitignore', '.divshot-cache'); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dummy", 3 | "dependencies": { 4 | "handlebars": "~1.3.0", 5 | "jquery": "^1.11.1", 6 | "qunit": "~1.12.0", 7 | "ember-qunit": "~0.1.8", 8 | "ember": "1.6.1", 9 | "ember-resolver": "~0.1.7", 10 | "loader": "stefanpenner/loader.js#1.0.1", 11 | "ember-cli-shims": "stefanpenner/ember-cli-shims#0.0.2", 12 | "ember-load-initializers": "stefanpenner/ember-load-initializers#0.0.2", 13 | "ember-qunit-notifications": "^0.0.3", 14 | "ember-cli-test-loader": "rjackson/ember-cli-test-loader#0.0.2" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | 3 | module.exports = { 4 | name: 'ember-cli-divshot', 5 | 6 | includedCommands: function() { 7 | return { 8 | 'divshot': require('./lib/commands/divshot') 9 | } 10 | }, 11 | 12 | blueprintsPath: function() { 13 | return path.join(__dirname, 'blueprints'); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/commands/divshot.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'divshot', 3 | description: 'Passes through commands to divshot-cli.', 4 | 5 | availableOptions: [ 6 | { name: 'token', type: String, aliases: ['t'], description: 'override your current user authentication token' }, 7 | { name: 'timeout', type: String, description: 'set command timeout, in milliseconds' }, 8 | { name: 'app', type: String, aliases: ['a'], description: "override the directory's app name" }, 9 | { name: 'config', type: String, aliases: ['c'], description: 'use a different config file' }, 10 | { name: 'org', type: String, aliases: ['o'], description: 'set command to operate on the given organization' } 11 | ], 12 | 13 | runCommand: function(command, args) { 14 | var path = require('path'); 15 | var RSVP = require('rsvp'); 16 | var Promise = RSVP.Promise; 17 | var spawn = require('child_process').spawn; 18 | return new Promise(function(resolve, reject) { 19 | var child = spawn(command, args); 20 | var result = { 21 | output: [], 22 | errors: [], 23 | code: null 24 | }; 25 | 26 | child.stdout.on('data', function (data) { 27 | var string = data.toString(); 28 | 29 | console.log(string); 30 | 31 | result.output.push(string); 32 | }); 33 | 34 | child.stderr.on('data', function (data) { 35 | var string = data.toString(); 36 | 37 | console.error(string); 38 | 39 | result.errors.push(string); 40 | }); 41 | 42 | child.on('close', function (code) { 43 | result.code = code; 44 | 45 | if (code === 0) { 46 | resolve(result); 47 | } else { 48 | reject(result); 49 | } 50 | }); 51 | }); 52 | }, 53 | 54 | triggerBuild: function(commandOptions) { 55 | var BuildTask = this.tasks.Build; 56 | var buildTask = new BuildTask({ 57 | ui: this.ui, 58 | analytics: this.analytics, 59 | project: this.project 60 | }); 61 | 62 | commandOptions.environment = commandOptions.environment || 'production'; 63 | commandOptions.outputPath = 'dist'; 64 | return buildTask.run(commandOptions); 65 | }, 66 | 67 | buildDivshotArgs: function(options){ 68 | var divshotOptArgs = []; 69 | var possibleOptions = []; 70 | this.availableOptions.forEach(function(available){ 71 | possibleOptions.push(available.name); 72 | }); 73 | Object.keys(options).forEach(function(optionKey){ 74 | if(possibleOptions.indexOf(optionKey) > -1){ 75 | divshotOptArgs.push('--' + optionKey); 76 | divshotOptArgs.push(options[optionKey]); 77 | } 78 | }); 79 | return divshotOptArgs; 80 | }, 81 | 82 | run: function(options, rawArgs) { 83 | var self = this; 84 | var path = require('path'); 85 | var command = path.join(__dirname, '..', '..', 'node_modules', 'divshot-cli', 'bin', 'divshot.js'); 86 | var divshotArgs = rawArgs.concat(this.buildDivshotArgs(options)); 87 | return this.triggerBuild(options) 88 | .then(function() { 89 | return self.runCommand(command, divshotArgs); 90 | }); 91 | } 92 | }; 93 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ember-cli-divshot", 3 | "version": "0.1.7", 4 | "directories": { 5 | "doc": "doc", 6 | "test": "test" 7 | }, 8 | "scripts": { 9 | "start": "ember server", 10 | "build": "ember build", 11 | "test": "node tests/runner.js" 12 | }, 13 | "repository": "https://github.com/rwjblue/ember-cli-divshot", 14 | "engines": { 15 | "node": ">= 0.10.0" 16 | }, 17 | "keywords": [ 18 | "ember-addon" 19 | ], 20 | "author": "", 21 | "license": "MIT", 22 | "devDependencies": { 23 | "abbrev": "^1.0.5", 24 | "broccoli-ember-hbs-template-compiler": "^1.5.0", 25 | "chai": "~1.9.1", 26 | "ember-cli": "^0.0.46", 27 | "glob": "~4.0.5", 28 | "mocha": "^1.21.4", 29 | "mocha-jshint": "^0.0.9" 30 | }, 31 | "dependencies": { 32 | "divshot-cli": "1.x.x", 33 | "rsvp": "~3.0.9" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /testem.json: -------------------------------------------------------------------------------- 1 | { 2 | "framework": "qunit", 3 | "test_page": "tests/index.html", 4 | "launch_in_ci": ["PhantomJS"], 5 | "launch_in_dev": ["PhantomJS", "Chrome"] 6 | } 7 | -------------------------------------------------------------------------------- /tests/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "predef": [ 3 | "document", 4 | "window", 5 | "location", 6 | "setTimeout", 7 | "$", 8 | "QUnit", 9 | "define", 10 | "console", 11 | "equal", 12 | "notEqual", 13 | "notStrictEqual", 14 | "test", 15 | "asyncTest", 16 | "testBoth", 17 | "testWithDefault", 18 | "raises", 19 | "throws", 20 | "deepEqual", 21 | "start", 22 | "stop", 23 | "ok", 24 | "strictEqual", 25 | "module", 26 | "moduleFor", 27 | "moduleForComponent", 28 | "moduleForModel", 29 | "process", 30 | "expect", 31 | "visit", 32 | "exists", 33 | "fillIn", 34 | "click", 35 | "keyEvent", 36 | "find", 37 | "findWithAssert", 38 | "wait", 39 | "DS", 40 | "keyEvent", 41 | "isolatedContainer", 42 | "startApp", 43 | "andThen", 44 | "currentURL", 45 | "currentPath", 46 | "currentRouteName" 47 | ], 48 | "node": false, 49 | "browser": false, 50 | "boss": true, 51 | "curly": false, 52 | "debug": false, 53 | "devel": false, 54 | "eqeqeq": true, 55 | "evil": true, 56 | "forin": false, 57 | "immed": false, 58 | "laxbreak": false, 59 | "newcap": true, 60 | "noarg": true, 61 | "noempty": false, 62 | "nonew": false, 63 | "nomen": false, 64 | "onevar": false, 65 | "plusplus": false, 66 | "regexp": false, 67 | "undef": true, 68 | "sub": true, 69 | "strict": false, 70 | "white": false, 71 | "eqnull": true, 72 | "esnext": true 73 | } 74 | -------------------------------------------------------------------------------- /tests/dummy/.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | 8 | [*] 9 | end_of_line = lf 10 | charset = utf-8 11 | trim_trailing_whitespace = true 12 | insert_final_newline = true 13 | indent_style = space 14 | indent_size = 2 15 | 16 | [*.js] 17 | indent_style = space 18 | indent_size = 2 19 | 20 | [*.hbs] 21 | indent_style = space 22 | indent_size = 2 23 | 24 | [*.css] 25 | indent_style = space 26 | indent_size = 2 27 | 28 | [*.html] 29 | indent_style = space 30 | indent_size = 2 31 | 32 | [*.md] 33 | trim_trailing_whitespace = false 34 | -------------------------------------------------------------------------------- /tests/dummy/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "predef": { 3 | "document": true, 4 | "window": true, 5 | "DummyENV": true 6 | }, 7 | "browser" : true, 8 | "boss" : true, 9 | "curly": true, 10 | "debug": false, 11 | "devel": true, 12 | "eqeqeq": true, 13 | "evil": true, 14 | "forin": false, 15 | "immed": false, 16 | "laxbreak": false, 17 | "newcap": true, 18 | "noarg": true, 19 | "noempty": false, 20 | "nonew": false, 21 | "nomen": false, 22 | "onevar": false, 23 | "plusplus": false, 24 | "regexp": false, 25 | "undef": true, 26 | "sub": true, 27 | "strict": false, 28 | "white": false, 29 | "eqnull": true, 30 | "esnext": true, 31 | "unused": true 32 | } 33 | -------------------------------------------------------------------------------- /tests/dummy/app/app.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import Resolver from 'ember/resolver'; 3 | import loadInitializers from 'ember/load-initializers'; 4 | 5 | Ember.MODEL_FACTORY_INJECTIONS = true; 6 | 7 | var App = Ember.Application.extend({ 8 | modulePrefix: 'dummy', // TODO: loaded via config 9 | Resolver: Resolver 10 | }); 11 | 12 | loadInitializers(App, 'dummy'); 13 | 14 | export default App; 15 | -------------------------------------------------------------------------------- /tests/dummy/app/components/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rwjblue/ember-cli-divshot/55f63e540f237357676a1c7d93c84804ac106abc/tests/dummy/app/components/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rwjblue/ember-cli-divshot/55f63e540f237357676a1c7d93c84804ac106abc/tests/dummy/app/controllers/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/helpers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rwjblue/ember-cli-divshot/55f63e540f237357676a1c7d93c84804ac106abc/tests/dummy/app/helpers/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Dummy 7 | 8 | 9 | 10 | {{BASE_TAG}} 11 | 12 | 13 | 14 | 15 | 16 | 20 | 21 | 22 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /tests/dummy/app/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rwjblue/ember-cli-divshot/55f63e540f237357676a1c7d93c84804ac106abc/tests/dummy/app/models/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/router.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | var Router = Ember.Router.extend({ 4 | location: DummyENV.locationType 5 | }); 6 | 7 | Router.map(function() { 8 | }); 9 | 10 | export default Router; 11 | -------------------------------------------------------------------------------- /tests/dummy/app/routes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rwjblue/ember-cli-divshot/55f63e540f237357676a1c7d93c84804ac106abc/tests/dummy/app/routes/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/styles/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rwjblue/ember-cli-divshot/55f63e540f237357676a1c7d93c84804ac106abc/tests/dummy/app/styles/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/styles/app.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | margin: 20px; 3 | } 4 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rwjblue/ember-cli-divshot/55f63e540f237357676a1c7d93c84804ac106abc/tests/dummy/app/templates/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/templates/application.hbs: -------------------------------------------------------------------------------- 1 |

Welcome to Ember.js

2 | 3 | {{outlet}} 4 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/components/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rwjblue/ember-cli-divshot/55f63e540f237357676a1c7d93c84804ac106abc/tests/dummy/app/templates/components/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/views/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rwjblue/ember-cli-divshot/55f63e540f237357676a1c7d93c84804ac106abc/tests/dummy/app/views/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/config/environment.js: -------------------------------------------------------------------------------- 1 | /* jshint node: true */ 2 | 3 | module.exports = function(environment) { 4 | var ENV = { 5 | environment: environment, 6 | baseURL: '/', 7 | locationType: 'auto', 8 | EmberENV: { 9 | FEATURES: { 10 | // Here you can enable experimental features on an ember canary build 11 | // e.g. 'with-controller': true 12 | } 13 | }, 14 | 15 | APP: { 16 | // Here you can pass flags/options to your application instance 17 | // when it is created 18 | } 19 | }; 20 | 21 | if (environment === 'development') { 22 | // ENV.APP.LOG_RESOLVER = true; 23 | ENV.APP.LOG_ACTIVE_GENERATION = true; 24 | // ENV.APP.LOG_TRANSITIONS = true; 25 | // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; 26 | ENV.APP.LOG_VIEW_LOOKUPS = true; 27 | } 28 | 29 | if (environment === 'test') { 30 | 31 | } 32 | 33 | if (environment === 'production') { 34 | 35 | } 36 | 37 | return ENV; 38 | }; 39 | -------------------------------------------------------------------------------- /tests/dummy/public/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rwjblue/ember-cli-divshot/55f63e540f237357676a1c7d93c84804ac106abc/tests/dummy/public/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/public/crossdomain.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 16 | -------------------------------------------------------------------------------- /tests/dummy/public/robots.txt: -------------------------------------------------------------------------------- 1 | # robotstxt.org/ 2 | 3 | User-agent: * 4 | -------------------------------------------------------------------------------- /tests/dummy/tests/helpers/start-app.js: -------------------------------------------------------------------------------- 1 | /* global require */ 2 | 3 | var Application = require('dummy/app')['default']; 4 | var Router = require('dummy/router')['default']; 5 | import Ember from 'ember'; 6 | 7 | export default function startApp(attrs) { 8 | var App; 9 | 10 | var attributes = Ember.merge({ 11 | // useful Test defaults 12 | rootElement: '#ember-testing', 13 | LOG_ACTIVE_GENERATION: false, 14 | LOG_VIEW_LOOKUPS: false 15 | }, attrs); // but you can override; 16 | 17 | Router.reopen({ 18 | location: 'none' 19 | }); 20 | 21 | Ember.run(function() { 22 | App = Application.create(attributes); 23 | App.setupForTesting(); 24 | App.injectTestHelpers(); 25 | }); 26 | 27 | App.reset(); // this shouldn't be needed, i want to be able to "start an app at a specific URL" 28 | 29 | return App; 30 | } 31 | -------------------------------------------------------------------------------- /tests/helpers/resolver.js: -------------------------------------------------------------------------------- 1 | import Resolver from 'ember/resolver'; 2 | 3 | var resolver = Resolver.create(); 4 | 5 | resolver.namespace = { 6 | modulePrefix: 'dummy' 7 | }; 8 | 9 | export default resolver; 10 | -------------------------------------------------------------------------------- /tests/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Dummy Tests 7 | 8 | 9 | 10 | {{BASE_TAG}} 11 | 12 | 13 | 14 | 15 | 31 | 32 | 33 |
34 |
35 | 36 | 40 | 41 | 42 | 43 | 44 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /tests/mocha-jshint-nodetest.js: -------------------------------------------------------------------------------- 1 | var mochaJSHint = require('mocha-jshint'); 2 | 3 | mochaJSHint([ 4 | 'lib' 5 | ]); 6 | -------------------------------------------------------------------------------- /tests/runner.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var glob = require('glob'); 4 | var Mocha = require('mocha'); 5 | 6 | var mocha = new Mocha({ 7 | reporter: 'spec' 8 | }); 9 | 10 | var arg = process.argv[2]; 11 | var root = 'tests/'; 12 | 13 | function addFiles(mocha, files) { 14 | glob.sync(root + files).forEach(mocha.addFile.bind(mocha)); 15 | } 16 | 17 | addFiles(mocha, '/**/*-nodetest.js'); 18 | 19 | if (arg === 'all') { 20 | addFiles(mocha, '/**/*-nodetest-slow.js'); 21 | } 22 | 23 | mocha.run(function(failures) { 24 | process.on('exit', function() { 25 | process.exit(failures); 26 | }); 27 | }); 28 | -------------------------------------------------------------------------------- /tests/test-helper.js: -------------------------------------------------------------------------------- 1 | import resolver from './helpers/resolver'; 2 | import { setResolver } from 'ember-qunit'; 3 | 4 | setResolver(resolver); 5 | 6 | document.write('
'); 7 | 8 | QUnit.config.urlConfig.push({ id: 'nocontainer', label: 'Hide container'}); 9 | if (QUnit.urlParams.nocontainer) { 10 | document.getElementById('ember-testing-container').style.visibility = 'hidden'; 11 | } else { 12 | document.getElementById('ember-testing-container').style.visibility = 'visible'; 13 | } 14 | -------------------------------------------------------------------------------- /tests/unit/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rwjblue/ember-cli-divshot/55f63e540f237357676a1c7d93c84804ac106abc/tests/unit/.gitkeep -------------------------------------------------------------------------------- /tests/unit/commands/divshot-nodetest.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var assert = require('chai').assert; 4 | var MockUI = require('ember-cli/tests/helpers/mock-ui'); 5 | var MockAnalytics = require('ember-cli/tests/helpers/mock-analytics'); 6 | var Command = require('ember-cli/lib/models/command'); 7 | var Task = require('ember-cli/lib/models/task'); 8 | var RSVP = require('rsvp'); 9 | 10 | var DivshotCommandBase = require('../../../lib/commands/divshot'); 11 | 12 | describe('divshot command', function() { 13 | var ui; 14 | var tasks; 15 | var analytics; 16 | var project; 17 | var fakeSpawn; 18 | var CommandUnderTest; 19 | var buildTaskCalled; 20 | var buildTaskReceivedProject; 21 | 22 | before(function() { 23 | CommandUnderTest = Command.extend(DivshotCommandBase); 24 | }); 25 | 26 | beforeEach(function() { 27 | buildTaskCalled = false; 28 | ui = new MockUI(); 29 | analytics = new MockAnalytics(); 30 | tasks = { 31 | Build: Task.extend({ 32 | run: function() { 33 | buildTaskCalled = true; 34 | buildTaskReceivedProject = !!this.project; 35 | 36 | return RSVP.resolve(); 37 | } 38 | }) 39 | }; 40 | 41 | project = { 42 | isEmberCLIProject: function(){ 43 | return true; 44 | } 45 | }; 46 | }); 47 | 48 | it('shells out to `divshot` command line utility', function() { 49 | return new CommandUnderTest({ 50 | ui: ui, 51 | analytics: analytics, 52 | project: project, 53 | environment: { }, 54 | tasks: tasks, 55 | settings: {}, 56 | runCommand: function(command, args) { 57 | assert.include(command, 'divshot-cli/bin/divshot.js'); 58 | assert.deepEqual(args, ['push']); 59 | } 60 | }).validateAndRun(['push']); 61 | }); 62 | 63 | it('accecpts `divshot` option arguments', function() { 64 | return new CommandUnderTest({ 65 | ui: ui, 66 | analytics: analytics, 67 | project: project, 68 | environment: { }, 69 | tasks: tasks, 70 | settings: {}, 71 | runCommand: function(command, args) { 72 | assert.include(command, 'divshot-cli/bin/divshot.js'); 73 | assert.deepEqual(args, ['push', '--token', '1234']); 74 | } 75 | }).validateAndRun(['push', '--token', '1234']); 76 | }); 77 | 78 | it('runs build before running the command', function() { 79 | return new CommandUnderTest({ 80 | ui: ui, 81 | analytics: analytics, 82 | project: project, 83 | environment: { }, 84 | tasks: tasks, 85 | settings: {}, 86 | runCommand: function(command, args) { 87 | assert(buildTaskCalled, 88 | 'expected build task to be called'); 89 | assert(buildTaskReceivedProject, 90 | 'expected build task to receive project'); 91 | } 92 | }).validateAndRun(['push']); 93 | }); 94 | }); 95 | 96 | -------------------------------------------------------------------------------- /vendor/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rwjblue/ember-cli-divshot/55f63e540f237357676a1c7d93c84804ac106abc/vendor/.gitkeep --------------------------------------------------------------------------------