Upgrade to new Ember, Ember CLI
This commit is contained in:
parent
58ed07e241
commit
0a2e0690f9
|
@ -68,6 +68,7 @@ class DockerManager::Upgrader
|
|||
def run(cmd)
|
||||
log "$ #{cmd}"
|
||||
msg = ""
|
||||
|
||||
clear_env = Hash[*ENV.map{|k,v| [k,nil]}
|
||||
.reject{ |k,v|
|
||||
["PWD","HOME","SHELL","PATH"].include?(k) ||
|
||||
|
|
|
@ -13,22 +13,8 @@ insert_final_newline = true
|
|||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.js]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.hbs]
|
||||
insert_final_newline = false
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.css]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.html]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.{diff,md}]
|
||||
trim_trailing_whitespace = false
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# See http://help.github.com/ignore-files/ for more about ignoring files.
|
||||
# See https://help.github.com/ignore-files/ for more about ignoring files.
|
||||
|
||||
# compiled output
|
||||
/dist
|
||||
|
@ -13,5 +13,5 @@
|
|||
/connect.lock
|
||||
/coverage/*
|
||||
/libpeerconnection.log
|
||||
npm-debug.log
|
||||
npm-debug.log*
|
||||
testem.log
|
||||
|
|
|
@ -27,6 +27,6 @@
|
|||
"strict": false,
|
||||
"white": false,
|
||||
"eqnull": true,
|
||||
"esnext": true,
|
||||
"esversion": 6,
|
||||
"unused": true
|
||||
}
|
||||
|
|
|
@ -1,21 +1,23 @@
|
|||
---
|
||||
language: node_js
|
||||
node_js:
|
||||
- "0.12"
|
||||
- "4"
|
||||
|
||||
sudo: false
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- node_modules
|
||||
- $HOME/.npm
|
||||
- $HOME/.cache # includes bowers cache
|
||||
|
||||
before_install:
|
||||
- export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH
|
||||
- "npm config set spin false"
|
||||
- "npm install -g npm@^2"
|
||||
- npm config set spin false
|
||||
- npm install -g bower
|
||||
- bower --version
|
||||
- npm install phantomjs-prebuilt
|
||||
- node_modules/phantomjs-prebuilt/bin/phantomjs --version
|
||||
|
||||
install:
|
||||
- npm install -g bower
|
||||
- npm install
|
||||
- bower install
|
||||
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"ignore_dirs": ["tmp", "dist"]
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
/* global require, module */
|
||||
|
||||
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
|
||||
|
||||
var app = new EmberApp({
|
||||
fingerprint: {
|
||||
enabled: false
|
||||
},
|
||||
vendorFiles: {
|
||||
'handlebars.js': null
|
||||
}
|
||||
});
|
||||
|
||||
app.import("bower_components/bootbox/bootbox.js");
|
||||
app.import("bower_components/message-bus/assets/message-bus.js");
|
||||
app.import("bower_components/momentjs/moment.js");
|
||||
app.import("bower_components/bootstrap/js/modal.js");
|
||||
|
||||
// Use `app.import` to add additional libraries to the generated
|
||||
// output files.
|
||||
//
|
||||
// If you need to use different assets in different
|
||||
// environments, specify an object as the first parameter. That
|
||||
// object's keys should be the environment name and the values
|
||||
// should be the asset to use in that environment.
|
||||
//
|
||||
// If the library that you are including contains AMD or ES6
|
||||
// modules that you would like to import into your application
|
||||
// please specify an object with the list of modules as keys
|
||||
// along with the exports of each module as its value.
|
||||
|
||||
module.exports = app.toTree();
|
|
@ -0,0 +1,52 @@
|
|||
# manager-client
|
||||
|
||||
This README outlines the details of collaborating on this Ember application.
|
||||
A short introduction of this app could easily go here.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
You will need the following things properly installed on your computer.
|
||||
|
||||
* [Git](https://git-scm.com/)
|
||||
* [Node.js](https://nodejs.org/) (with NPM)
|
||||
* [Bower](https://bower.io/)
|
||||
* [Ember CLI](https://ember-cli.com/)
|
||||
* [PhantomJS](http://phantomjs.org/)
|
||||
|
||||
## Installation
|
||||
|
||||
* `git clone <repository-url>` this repository
|
||||
* `cd manager-client`
|
||||
* `npm install`
|
||||
* `bower install`
|
||||
|
||||
## Running / Development
|
||||
|
||||
* `ember serve`
|
||||
* Visit your app at [http://localhost:4200](http://localhost:4200).
|
||||
|
||||
### Code Generators
|
||||
|
||||
Make use of the many generators for code, try `ember help generate` for more details
|
||||
|
||||
### Running Tests
|
||||
|
||||
* `ember test`
|
||||
* `ember test --server`
|
||||
|
||||
### Building
|
||||
|
||||
* `ember build` (development)
|
||||
* `ember build --environment production` (production)
|
||||
|
||||
### Deploying
|
||||
|
||||
Specify what it takes to deploy your app.
|
||||
|
||||
## Further Reading / Useful Links
|
||||
|
||||
* [ember.js](http://emberjs.com/)
|
||||
* [ember-cli](https://ember-cli.com/)
|
||||
* Development Browser Extensions
|
||||
* [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi)
|
||||
* [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/)
|
|
@ -1,14 +1,16 @@
|
|||
import Ember from 'ember';
|
||||
import Resolver from 'ember/resolver';
|
||||
import loadInitializers from 'ember/load-initializers';
|
||||
import Resolver from './resolver';
|
||||
import loadInitializers from 'ember-load-initializers';
|
||||
import config from './config/environment';
|
||||
|
||||
let App;
|
||||
|
||||
Ember.MODEL_FACTORY_INJECTIONS = true;
|
||||
|
||||
var App = Ember.Application.extend({
|
||||
App = Ember.Application.extend({
|
||||
modulePrefix: config.modulePrefix,
|
||||
podModulePrefix: config.podModulePrefix,
|
||||
Resolver: Resolver
|
||||
Resolver
|
||||
});
|
||||
|
||||
loadInitializers(App, config.modulePrefix);
|
||||
|
|
|
@ -3,12 +3,6 @@ import Ember from 'ember';
|
|||
export default Ember.Component.extend({
|
||||
classNameBindings: [':logs'],
|
||||
|
||||
render: function(buffer) {
|
||||
if (!Ember.isEmpty(this.get('output'))) {
|
||||
buffer.push(Ember.Handlebars.Utils.escapeExpression(this.get('output')));
|
||||
}
|
||||
},
|
||||
|
||||
_outputChanged: function() {
|
||||
Ember.run.scheduleOnce('afterRender', this, '_scrollBottom');
|
||||
this.rerender();
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
tagName: 'li',
|
||||
classNameBindings: ['active'],
|
||||
active: function() {
|
||||
return this.get('childViews').anyBy('active');
|
||||
}.property('childViews.@each.active')
|
||||
});
|
|
@ -1,10 +0,0 @@
|
|||
/* global moment:true */
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Handlebars.makeBoundHelper(function(dt) {
|
||||
if (Ember.isEmpty(dt)) {
|
||||
return new Ember.Handlebars.SafeString("—");
|
||||
}
|
||||
|
||||
return moment(dt).fromNow();
|
||||
});
|
|
@ -1,12 +1,14 @@
|
|||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Handlebars.makeBoundHelper(function(sha1, url, branch) {
|
||||
export default Ember.Helper.helper(function(params) {
|
||||
const [sha1, url, branch] = params;
|
||||
|
||||
if (Ember.isNone(url)) { return; }
|
||||
if (Ember.isNone(branch)) {
|
||||
return new Ember.Handlebars.SafeString("(<a href='" + url + "'>" + sha1 + "</a>)");
|
||||
return new Ember.String.htmlSafe("(<a href='" + url + "'>" + sha1 + "</a>)");
|
||||
}
|
||||
|
||||
var _url = url.substr(0, url.search(/(\.git)?$/));
|
||||
var _branch = (branch.indexOf('/') !== -1) ? branch.split('/')[1] : branch;
|
||||
return new Ember.Handlebars.SafeString("(<a href='" + _url + "/compare/" + sha1 + "..." + _branch + "'>" + sha1 + "</a>)");
|
||||
return new Ember.String.htmlSafe("(<a href='" + _url + "/compare/" + sha1 + "..." + _branch + "'>" + sha1 + "</a>)");
|
||||
});
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
{{content-for 'head'}}
|
||||
|
||||
<link rel="stylesheet" href="assets/vendor.css">
|
||||
<link rel="stylesheet" href="assets/docker-manager.css">
|
||||
<link rel="stylesheet" href="assets/manager-client.css">
|
||||
|
||||
{{content-for 'head-footer'}}
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
|||
{{content-for 'body'}}
|
||||
|
||||
<script src="assets/vendor.js"></script>
|
||||
<script src="assets/docker-manager.js"></script>
|
||||
<script src="assets/manager-client.js"></script>
|
||||
|
||||
{{content-for 'body-footer'}}
|
||||
</body>
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
/* global $:true */
|
||||
import ajax from "ic-ajax";
|
||||
import request from 'ember-ajax/request';
|
||||
|
||||
export default {
|
||||
name: "findCsrfToken",
|
||||
|
||||
initialize: function() {
|
||||
return ajax(Discourse.getURL('/session/csrf')).then(function(result) {
|
||||
initialize() {
|
||||
return request(Discourse.getURL('/session/csrf')).then(function(result) {
|
||||
var token = result.csrf;
|
||||
$.ajaxPrefilter(function(options, originalOptions, xhr) {
|
||||
if (!options.crossDomain) {
|
||||
|
|
|
@ -1,24 +1,22 @@
|
|||
import ajax from "ic-ajax";
|
||||
import request from 'ember-ajax/request';
|
||||
import Ember from 'ember';
|
||||
|
||||
var ProcessList = Ember.Object.extend({
|
||||
|
||||
init: function() {
|
||||
init() {
|
||||
this._super();
|
||||
},
|
||||
|
||||
refresh: function() {
|
||||
var self = this;
|
||||
return ajax(Discourse.getURL("/admin/docker/ps")).then(function(result) {
|
||||
self.set('output', result);
|
||||
return self;
|
||||
refresh() {
|
||||
return request(Discourse.getURL("/admin/docker/ps"), {dataType: 'text'}).then(result => {
|
||||
this.set('output', result);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
ProcessList.reopenClass({
|
||||
find: function() {
|
||||
var list = ProcessList.create();
|
||||
find() {
|
||||
const list = ProcessList.create();
|
||||
return list.refresh();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import ajax from "ic-ajax";
|
||||
import request from 'ember-ajax/request';
|
||||
import Ember from 'ember';
|
||||
|
||||
var loaded = [];
|
||||
|
@ -25,7 +25,8 @@ var Repo = Ember.Object.extend({
|
|||
repoAjax: function(url, args) {
|
||||
args = args || {};
|
||||
args.data = this.getProperties('path', 'version', 'branch');
|
||||
return ajax(Discourse.getURL(url), args);
|
||||
|
||||
return request(Discourse.getURL(url), args);
|
||||
},
|
||||
|
||||
findLatest: function() {
|
||||
|
@ -70,11 +71,11 @@ var Repo = Ember.Object.extend({
|
|||
});
|
||||
|
||||
Repo.reopenClass({
|
||||
findAll: function() {
|
||||
findAll() {
|
||||
return new Ember.RSVP.Promise(function (resolve) {
|
||||
if (loaded.length) { return resolve(loaded); }
|
||||
|
||||
ajax(Discourse.getURL("/admin/docker/repos")).then(function(result) {
|
||||
request(Discourse.getURL("/admin/docker/repos")).then(function(result) {
|
||||
loaded = result.repos.map(function(r) {
|
||||
return Repo.create(r);
|
||||
});
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
import Resolver from 'ember-resolver';
|
||||
|
||||
export default Resolver;
|
|
@ -1,13 +1,14 @@
|
|||
import Ember from 'ember';
|
||||
import config from './config/environment';
|
||||
|
||||
var Router = Ember.Router.extend({
|
||||
location: config.locationType
|
||||
const Router = Ember.Router.extend({
|
||||
location: config.locationType,
|
||||
rootURL: config.rootURL
|
||||
});
|
||||
|
||||
Router.map(function() {
|
||||
this.route("processes");
|
||||
this.resource('upgrade', { path: '/upgrade/:id' });
|
||||
this.route('upgrade', { path: '/upgrade/:id' });
|
||||
});
|
||||
|
||||
export default Router;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import Repo from 'docker-manager/models/repo';
|
||||
import Repo from 'manager-client/models/repo';
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Route.extend({
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import ProcessList from 'docker-manager/models/process-list';
|
||||
import ProcessList from 'manager-client/models/process-list';
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Route.extend({
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import Repo from 'docker-manager/models/repo';
|
||||
import Repo from 'manager-client/models/repo';
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Route.extend({
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<header class="container">
|
||||
{{#link-to 'index'}}<img {{bind-attr src="logoUrl"}} class="logo">{{/link-to}}
|
||||
{{#link-to 'index'}}<img src={{logoUrl}} class="logo">{{/link-to}}
|
||||
<h1>{{#link-to 'index'}}Upgrade{{/link-to}}</h1>
|
||||
</header>
|
||||
|
||||
|
@ -9,18 +9,23 @@
|
|||
<div id="banner">
|
||||
<div id="banner-content">
|
||||
<div class="close" {{action "dismiss"}}><i class="fa fa-times" title="Dismiss this banner."></i></div>
|
||||
{{#each row in banner}}
|
||||
<p>{{{row}}}</p>
|
||||
{{#each banner as |row|}}
|
||||
<p>{{{row}}}</p>
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<ul class="nav nav-tabs">
|
||||
{{#x-tab route="index"}}Versions{{/x-tab}}
|
||||
{{#x-tab route="processes"}}Processes{{/x-tab}}
|
||||
<li><a {{bind-attr href="returnToSiteUrl"}}>Return to site</a></li>
|
||||
<li><a {{bind-attr href="backupsUrl"}}>Backups</a></li>
|
||||
{{#link-to "index" tagName="li"}}
|
||||
{{#link-to "index"}}Versions{{/link-to}}
|
||||
{{/link-to}}
|
||||
{{#link-to "processes" tagName="li"}}
|
||||
{{#link-to "processes"}}Processes{{/link-to}}
|
||||
{{/link-to}}
|
||||
|
||||
<li><a href={{returnToSiteUrl}}>Return to site</a></li>
|
||||
<li><a href={{backupsUrl}}>Backups</a></li>
|
||||
</ul>
|
||||
|
||||
{{outlet}}
|
||||
|
|
|
@ -12,13 +12,19 @@
|
|||
<h4>New Version Available!</h4>
|
||||
<ul>
|
||||
<li>Remote Version: {{fmt-commit repo.latest.version repo.url repo.branch}}</li>
|
||||
<li>Last Updated: {{fmt-ago repo.latest.date}}</li>
|
||||
<li>Last Updated:
|
||||
{{#if repo.latest.date}}
|
||||
{{moment-from-now repo.latest.date interval=1000}}
|
||||
{{else}}
|
||||
—
|
||||
{{/if}}
|
||||
</li>
|
||||
<li class='new-commits'>{{repo.latest.commits_behind}} new commits</li>
|
||||
</ul>
|
||||
{{#if repo.upgrading}}
|
||||
<button class="btn" {{action "upgrade"}}>Currently Upgrading...</button>
|
||||
{{else}}
|
||||
<button class="btn" {{action "upgrade"}} {{bind-attr disabled="upgradeDisabled"}}>Upgrade to the Latest Version</button>
|
||||
<button class="btn" {{action "upgrade"}} disabled={{upgradeDisabled}}>Upgrade to the Latest Version</button>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
{{output}}
|
|
@ -1 +0,0 @@
|
|||
{{#link-to route}}{{yield}}{{/link-to}}
|
|
@ -16,7 +16,7 @@
|
|||
<p>{{model.name}} is at the newest version {{fmt-commit model.version model.url model.branch}}.</p>
|
||||
{{else}}
|
||||
<div style='clear: both'>
|
||||
<button {{action "start"}} {{bind-attr disabled="model.upgrading"}} class='btn'>{{upgradeButtonText}}</button>
|
||||
<button {{action "start"}} disabled={{model.upgrading}} class='btn'>{{upgradeButtonText}}</button>
|
||||
{{#if model.upgrading}}
|
||||
<button {{action "resetUpgrade"}} class="btn unlock">Reset Upgrade</button>
|
||||
{{/if}}
|
||||
|
|
|
@ -1,18 +1,9 @@
|
|||
{
|
||||
"name": "docker-manager",
|
||||
"name": "manager-client",
|
||||
"dependencies": {
|
||||
"ember": "1.11.0",
|
||||
"ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3",
|
||||
"ember-cli-test-loader": "ember-cli-test-loader#0.1.3",
|
||||
"ember-load-initializers": "ember-cli/ember-load-initializers#0.1.4",
|
||||
"ember-qunit": "0.3.3",
|
||||
"ember-qunit-notifications": "0.0.7",
|
||||
"ember-resolver": "~0.1.15",
|
||||
"jquery": "1.11.1",
|
||||
"loader.js": "ember-cli/loader.js#3.2.0",
|
||||
"qunit": "~1.17.1",
|
||||
"ember": "~2.10.0",
|
||||
"bootbox": "~4.3.0",
|
||||
"message-bus": "https://github.com/SamSaffron/message_bus.git#84f733c14e5b4e7f2464b5b45944ceccec727899",
|
||||
"momentjs": "~2.8.4"
|
||||
"ember-cli-shims": "0.1.3",
|
||||
"message-bus": "https://github.com/SamSaffron/message_bus.git#84f733c14e5b4e7f2464b5b45944ceccec727899"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,14 +2,18 @@
|
|||
|
||||
module.exports = function(environment) {
|
||||
var ENV = {
|
||||
modulePrefix: 'docker-manager',
|
||||
modulePrefix: 'manager-client',
|
||||
environment: environment,
|
||||
baseURL: '/',
|
||||
locationType: 'auto',
|
||||
rootURL: '/',
|
||||
locationType: 'hash',
|
||||
EmberENV: {
|
||||
FEATURES: {
|
||||
// Here you can enable experimental features on an ember canary build
|
||||
// e.g. 'with-controller': true
|
||||
},
|
||||
EXTEND_PROTOTYPES: {
|
||||
// Prevent Ember Data from overriding Date.parse.
|
||||
Date: false
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -29,7 +33,6 @@ module.exports = function(environment) {
|
|||
|
||||
if (environment === 'test') {
|
||||
// Testem prefers this...
|
||||
ENV.baseURL = '/';
|
||||
ENV.locationType = 'none';
|
||||
|
||||
// keep test console output quieter
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
/*jshint node:true*/
|
||||
/* global require, module */
|
||||
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
|
||||
|
||||
|
||||
module.exports = function(defaults) {
|
||||
var app = new EmberApp(defaults, {
|
||||
// Add options here
|
||||
});
|
||||
|
||||
// Use `app.import` to add additional libraries to the generated
|
||||
// output files.
|
||||
//
|
||||
// If you need to use different assets in different
|
||||
// environments, specify an object as the first parameter. That
|
||||
// object's keys should be the environment name and the values
|
||||
// should be the asset to use in that environment.
|
||||
//
|
||||
// If the library that you are including contains AMD or ES6
|
||||
// modules that you would like to import into your application
|
||||
// please specify an object with the list of modules as keys
|
||||
// along with the exports of each module as its value.
|
||||
app.import("bower_components/bootbox/bootbox.js");
|
||||
app.import("bower_components/message-bus/assets/message-bus.js");
|
||||
app.import("bower_components/bootstrap/js/modal.js");
|
||||
|
||||
return app.toTree();
|
||||
};
|
|
@ -1,37 +1,45 @@
|
|||
{
|
||||
"name": "docker-manager",
|
||||
"name": "manager-client",
|
||||
"version": "0.0.0",
|
||||
"description": "Small description for docker-manager goes here",
|
||||
"private": true,
|
||||
"description": "Small description for manager-client goes here",
|
||||
"license": "MIT",
|
||||
"author": "",
|
||||
"directories": {
|
||||
"doc": "doc",
|
||||
"test": "tests"
|
||||
},
|
||||
"repository": "",
|
||||
"scripts": {
|
||||
"start": "ember server",
|
||||
"build": "ember build",
|
||||
"start": "ember server",
|
||||
"test": "ember test"
|
||||
},
|
||||
"repository": "",
|
||||
"engines": {
|
||||
"node": ">= 0.10.0"
|
||||
},
|
||||
"author": "",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"broccoli-asset-rev": "^2.0.2",
|
||||
"ember-cli": "0.2.5",
|
||||
"ember-cli-app-version": "0.3.3",
|
||||
"ember-cli-babel": "^5.0.0",
|
||||
"ember-cli-dependency-checker": "^1.0.0",
|
||||
"ember-cli-htmlbars": "0.7.6",
|
||||
"ember-cli-ic-ajax": "0.1.1",
|
||||
"ember-cli-inject-live-reload": "^1.3.0",
|
||||
"ember-cli-qunit": "0.3.13",
|
||||
"ember-cli-sass": "^4.0.0",
|
||||
"ember-cli-uglify": "^1.0.1",
|
||||
"ember-export-application-global": "^1.0.2",
|
||||
"ember-cli-font-awesome": "0.0.4",
|
||||
"ember-cli-ic-ajax": "0.1.1"
|
||||
}
|
||||
"broccoli-asset-rev": "^2.4.5",
|
||||
"ember-ajax": "2.5.3",
|
||||
"ember-cli": "2.10.0",
|
||||
"ember-cli-app-version": "^2.0.0",
|
||||
"ember-cli-babel": "^5.1.7",
|
||||
"ember-cli-dependency-checker": "^1.3.0",
|
||||
"ember-cli-htmlbars": "^1.0.10",
|
||||
"ember-cli-htmlbars-inline-precompile": "^0.3.3",
|
||||
"ember-cli-inject-live-reload": "^1.4.1",
|
||||
"ember-cli-jshint": "^2.0.1",
|
||||
"ember-cli-moment-shim": "3.0.1",
|
||||
"ember-cli-qunit": "^3.0.1",
|
||||
"ember-cli-release": "^0.2.9",
|
||||
"ember-cli-sass": "6.1.0",
|
||||
"ember-cli-sri": "^2.1.0",
|
||||
"ember-cli-test-loader": "^1.1.0",
|
||||
"ember-cli-uglify": "^1.2.0",
|
||||
"ember-export-application-global": "^1.0.5",
|
||||
"ember-load-initializers": "^0.5.1",
|
||||
"ember-moment": "7.3.0",
|
||||
"ember-resolver": "^2.0.3",
|
||||
"loader.js": "^4.0.10"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.12.0"
|
||||
},
|
||||
"private": true
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
/*jshint node:true*/
|
||||
module.exports = {
|
||||
"framework": "qunit",
|
||||
"test_page": "tests/index.html?hidepassed",
|
||||
"disable_watching": true,
|
||||
|
@ -9,4 +10,4 @@
|
|||
"PhantomJS",
|
||||
"Chrome"
|
||||
]
|
||||
}
|
||||
};
|
|
@ -26,7 +26,7 @@
|
|||
"node": false,
|
||||
"browser": false,
|
||||
"boss": true,
|
||||
"curly": false,
|
||||
"curly": true,
|
||||
"debug": false,
|
||||
"devel": false,
|
||||
"eqeqeq": true,
|
||||
|
@ -47,5 +47,6 @@
|
|||
"strict": false,
|
||||
"white": false,
|
||||
"eqnull": true,
|
||||
"esnext": true
|
||||
"esversion": 6,
|
||||
"unused": true
|
||||
}
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
import Ember from 'ember';
|
||||
|
||||
export default function destroyApp(application) {
|
||||
Ember.run(application, 'destroy');
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
import { module } from 'qunit';
|
||||
import Ember from 'ember';
|
||||
import startApp from '../helpers/start-app';
|
||||
import destroyApp from '../helpers/destroy-app';
|
||||
|
||||
const { RSVP: { Promise } } = Ember;
|
||||
|
||||
export default function(name, options = {}) {
|
||||
module(name, {
|
||||
beforeEach() {
|
||||
this.application = startApp();
|
||||
|
||||
if (options.beforeEach) {
|
||||
return options.beforeEach.apply(this, arguments);
|
||||
}
|
||||
},
|
||||
|
||||
afterEach() {
|
||||
let afterEach = options.afterEach && options.afterEach.apply(this, arguments);
|
||||
return Promise.resolve(afterEach).then(() => destroyApp(this.application));
|
||||
}
|
||||
});
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
import Resolver from 'ember/resolver';
|
||||
import Resolver from '../../resolver';
|
||||
import config from '../../config/environment';
|
||||
|
||||
var resolver = Resolver.create();
|
||||
const resolver = Resolver.create();
|
||||
|
||||
resolver.namespace = {
|
||||
modulePrefix: config.modulePrefix,
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
import Ember from 'ember';
|
||||
import Application from '../../app';
|
||||
import Router from '../../router';
|
||||
import config from '../../config/environment';
|
||||
|
||||
export default function startApp(attrs) {
|
||||
var application;
|
||||
let application;
|
||||
|
||||
var attributes = Ember.merge({}, config.APP);
|
||||
attributes = Ember.merge(attributes, attrs); // use defaults, but you can override;
|
||||
// use defaults, but you can override
|
||||
let attributes = Ember.assign({}, config.APP, attrs);
|
||||
|
||||
Ember.run(function() {
|
||||
Ember.run(() => {
|
||||
application = Application.create(attributes);
|
||||
application.setupForTesting();
|
||||
application.injectTestHelpers();
|
||||
|
|
|
@ -3,31 +3,31 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>DockerManager Tests</title>
|
||||
<title>ManagerClient Tests</title>
|
||||
<meta name="description" content="">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
{{content-for 'head'}}
|
||||
{{content-for 'test-head'}}
|
||||
{{content-for "head"}}
|
||||
{{content-for "test-head"}}
|
||||
|
||||
<link rel="stylesheet" href="assets/vendor.css">
|
||||
<link rel="stylesheet" href="assets/docker-manager.css">
|
||||
<link rel="stylesheet" href="assets/test-support.css">
|
||||
<link rel="stylesheet" href="{{rootURL}}assets/vendor.css">
|
||||
<link rel="stylesheet" href="{{rootURL}}assets/manager-client.css">
|
||||
<link rel="stylesheet" href="{{rootURL}}assets/test-support.css">
|
||||
|
||||
{{content-for 'head-footer'}}
|
||||
{{content-for 'test-head-footer'}}
|
||||
{{content-for "head-footer"}}
|
||||
{{content-for "test-head-footer"}}
|
||||
</head>
|
||||
<body>
|
||||
{{content-for "body"}}
|
||||
{{content-for "test-body"}}
|
||||
|
||||
{{content-for 'body'}}
|
||||
{{content-for 'test-body'}}
|
||||
<script src="assets/vendor.js"></script>
|
||||
<script src="assets/test-support.js"></script>
|
||||
<script src="assets/docker-manager.js"></script>
|
||||
<script src="testem.js"></script>
|
||||
<script src="assets/test-loader.js"></script>
|
||||
<script src="/testem.js" integrity=""></script>
|
||||
<script src="{{rootURL}}assets/vendor.js"></script>
|
||||
<script src="{{rootURL}}assets/test-support.js"></script>
|
||||
<script src="{{rootURL}}assets/manager-client.js"></script>
|
||||
<script src="{{rootURL}}assets/tests.js"></script>
|
||||
|
||||
{{content-for 'body-footer'}}
|
||||
{{content-for 'test-body-footer'}}
|
||||
{{content-for "body-footer"}}
|
||||
{{content-for "test-body-footer"}}
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue