Skip to content

Commit

Permalink
Merge pull request #154 from notmessenger/Issue152
Browse files Browse the repository at this point in the history
Closes #152
  • Loading branch information
notmessenger committed Mar 1, 2016
2 parents 650b395 + 6463ad6 commit 1d71a0e
Show file tree
Hide file tree
Showing 16 changed files with 150 additions and 107 deletions.
17 changes: 9 additions & 8 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
bower_components/
tests/
tmp/
dist/

/bower_components
/config/ember-try.js
/dist
/tests
/tmp
**/.gitkeep
.bowerrc
.editorconfig
.ember-cli
.gitignore
.jshintrc
.watchmanconfig
.travis.yml
.npmignore
**/.gitkeep
bower.json
ember-cli-build.js
Brocfile.js
testem.json
2 changes: 1 addition & 1 deletion .watchmanconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ignore_dirs": ["tmp"]
"ignore_dirs": ["tmp", "dist"]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Latest Release](https://img.shields.io/github/release/softlayer/sl-ember-behavior.svg)](https://github.com/softlayer/sl-ember-behavior/releases) ![Ember CLI version](https://img.shields.io/badge/ember%20cli-1.13.8-blue.svg) [![License](https://img.shields.io/npm/l/sl-ember-behavior.svg)](LICENSE.md) [![Downloads](https://img.shields.io/npm/dm/sl-ember-behavior.svg)](https://www.npmjs.com/package/sl-ember-behavior)
[![Latest Release](https://img.shields.io/github/release/softlayer/sl-ember-behavior.svg)](https://github.com/softlayer/sl-ember-behavior/releases) ![Ember CLI version](https://img.shields.io/badge/ember%20cli-2.3.0-blue.svg) [![License](https://img.shields.io/npm/l/sl-ember-behavior.svg)](LICENSE.md) [![Downloads](https://img.shields.io/npm/dm/sl-ember-behavior.svg)](https://www.npmjs.com/package/sl-ember-behavior)

[![Dependencies](https://img.shields.io/david/softlayer/sl-ember-behavior.svg)](https://david-dm.org/softlayer/sl-ember-behavior) [![Dev Dependencies](https://img.shields.io/david/dev/softlayer/sl-ember-behavior.svg)](https://david-dm.org/softlayer/sl-ember-behavior#info=devDependencies)

Expand Down
15 changes: 4 additions & 11 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
{
"name": "sl-ember-behavior",
"dependencies": {
"ember": "1.13.7",
"ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3",
"ember-cli-test-loader": "ember-cli-test-loader#0.2.1",
"ember-load-initializers": "ember-cli/ember-load-initializers#0.1.5",
"ember-qunit": "0.4.14",
"ember-qunit-notifications": "0.0.7",
"ember-resolver": "~0.1.18",
"jquery": "1.11.3",
"loader.js": "ember-cli/loader.js#3.3.0",
"qunit": "~1.18.0",
"sinonjs": "~1.14.1"
"ember": "~2.3.1",
"ember-cli-shims": "0.1.0",
"ember-cli-test-loader": "0.2.2",
"ember-qunit-notifications": "0.1.0"
},
"devDependencies": {
"blanket": "~1.1.5"
Expand Down
41 changes: 25 additions & 16 deletions config/ember-try.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,43 @@
/*jshint node:true*/
module.exports = {
scenarios: [
{
name: 'default',
dependencies: { }
bower: {
dependencies: { }
}
},
{
name: 'ember-release',
dependencies: {
'ember': 'components/ember#release'
},
resolutions: {
'ember': 'release'
bower: {
dependencies: {
'ember': 'components/ember#release'
},
resolutions: {
'ember': 'release'
}
}
},
{
name: 'ember-beta',
dependencies: {
'ember': 'components/ember#beta'
},
resolutions: {
'ember': 'beta'
bower: {
dependencies: {
'ember': 'components/ember#beta'
},
resolutions: {
'ember': 'beta'
}
}
},
{
name: 'ember-canary',
dependencies: {
'ember': 'components/ember#canary'
},
resolutions: {
'ember': 'canary'
bower: {
dependencies: {
'ember': 'components/ember#canary'
},
resolutions: {
'ember': 'canary'
}
}
}
]
Expand Down
1 change: 1 addition & 0 deletions config/environment.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*jshint node:true*/
'use strict';

module.exports = function(/* environment, appConfig */) {
Expand Down
69 changes: 36 additions & 33 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
@@ -1,44 +1,47 @@
/* jshint node:true*/
/* global require, module */
const EmberApp = require( 'ember-cli/lib/broccoli/ember-addon' );
const EmberAddon = require( 'ember-cli/lib/broccoli/ember-addon' );
const packageConfig = require( './package.json' );
const replace = require( 'broccoli-string-replace' );

module.exports = function( defaults ) {
const app = new EmberApp( defaults, {
// Add options here
});
const app = new EmberAddon( defaults, {
// Add options here
});

/*
This build file specifes the options for the dummy test app of this
addon, located in `/tests/dummy`
This build file does *not* influence how the addon or the app using it
behave. You most likely want to be modifying `./index.js` or app's build file
*/
/*
This build file specifies the options for the dummy test app of this
addon, located in `/tests/dummy`
This build file does *not* influence how the addon or the app using it
behave. You most likely want to be modifying `./index.js` or app's build file
*/

app.import( app.bowerDirectory + '/ember/ember-template-compiler.js', {
type: 'test'
});
app.import( app.bowerDirectory + '/ember/ember-template-compiler.js', {
type: 'test'
});

const tree = replace( app.toTree(), {
files: [
'index.html',
'assets/dummy.js'
],
const tree = replace( app.toTree(), {
files: [
'index.html',
'assets/dummy.js'
],

patterns: [
{
match: /REPLACE_META_DESCRIPTION/g,
replacement: packageConfig[ 'description' ]
}, {
match: /REPLACE_META_KEYWORDS/g,
replacement: packageConfig[ 'keywords' ].join( ', ' ) +
', ember, ember cli'
}, {
match: /REPLACE_APPLICATION_VERSION/g,
replacement: packageConfig[ 'version' ]
}
]
});
patterns: [
{
match: /REPLACE_META_DESCRIPTION/g,
replacement: packageConfig[ 'description' ]
},
{
match: /REPLACE_META_KEYWORDS/g,
replacement: packageConfig[ 'keywords' ].join( ', ' ) +
', ember, ember cli'
},
{
match: /REPLACE_APPLICATION_VERSION/g,
replacement: packageConfig[ 'version' ]
}
]
});

return tree;
return tree;
};
40 changes: 22 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,29 +41,33 @@
"author": "Jeremy Brown <jeremy@notmessenger.com> (http://www.notmessenger.com)",
"license": "MIT",
"dependencies": {
"ember-cli-babel": "^5.0.0",
"ember-cli-htmlbars": "1.0.0"
"ember-cli-babel": "^5.1.6",
"ember-cli-htmlbars": "^1.0.3"
},
"devDependencies": {
"broccoli-asset-rev": "^2.1.2",
"broccoli-string-replace": "0.1.0",
"ember-cli": "1.13.8",
"ember-cli-app-version": "0.5.0",
"ember-cli-blanket": "0.6.2",
"ember-cli-dependency-checker": "^1.0.1",
"broccoli-asset-rev": "^2.4.2",
"broccoli-string-replace": "0.1.1",
"ember-ajax": "0.7.1",
"ember-cli": "2.3.0",
"ember-cli-app-version": "^1.0.0",
"ember-cli-blanket": "0.8.0",
"ember-cli-dependency-checker": "^1.2.0",
"ember-cli-doc-server": "1.1.0",
"ember-cli-htmlbars-inline-precompile": "^0.2.0",
"ember-cli-ic-ajax": "0.2.1",
"ember-cli-htmlbars-inline-precompile": "^0.3.1",
"ember-cli-inject-live-reload": "^1.3.1",
"ember-cli-jsdoc": "1.3.0",
"ember-cli-qunit": "^1.0.0",
"ember-cli-jsdoc": "1.3.1",
"ember-cli-qunit": "^1.2.1",
"ember-cli-uglify": "^1.2.0",
"ember-disable-prototype-extensions": "^1.0.0",
"ember-disable-proxy-controllers": "^1.0.0",
"ember-export-application-global": "^1.0.3",
"ember-sinon": "0.2.1",
"ember-try": "0.0.6",
"phantomjs": "1.9.18",
"ember-disable-prototype-extensions": "^1.1.0",
"ember-disable-proxy-controllers": "^1.0.1",
"ember-export-application-global": "^1.0.4",
"ember-load-initializers": "^0.5.0",
"ember-resolver": "^2.0.3",
"ember-sinon": "0.5.0",
"ember-try": "^0.1.2",
"loader.js": "^4.0.0",
"phantomjs": "1.9.19",
"sl-ember-test-helpers": "1.12.0",
"sl-eslint": "0.4.0"
}
}
6 changes: 3 additions & 3 deletions tests/dummy/app/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
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;
Expand All @@ -10,7 +10,7 @@ Ember.MODEL_FACTORY_INJECTIONS = true;
App = Ember.Application.extend({
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
Resolver: Resolver
Resolver
});

loadInitializers( App, config.modulePrefix );
Expand Down
8 changes: 4 additions & 4 deletions tests/dummy/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@
<meta name="description" content="REPLACE_META_DESCRIPTION">
<meta name="author" content="SoftLayer, an IBM Company">

{{content-for 'head'}}
{{content-for "head"}}

<link rel="icon" href="favicon.png" type="image/png">
<link rel="stylesheet" href="assets/vendor.css">
<link rel="stylesheet" href="assets/dummy.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.min.css">

{{content-for 'head-footer'}}
{{content-for "head-footer"}}
</head>
<body>
{{content-for 'body'}}
{{content-for "body"}}

<script src="assets/vendor.js"></script>
<script src="assets/dummy.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/js/bootstrap.min.js"></script>

{{content-for 'body-footer'}}
{{content-for "body-footer"}}
</body>
</html>
3 changes: 3 additions & 0 deletions tests/dummy/app/resolver.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Resolver from 'ember-resolver';

export default Resolver;
5 changes: 5 additions & 0 deletions tests/helpers/destroy-app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Ember from 'ember';

export default function destroyApp( application ) {
Ember.run( application, 'destroy' );
}
23 changes: 23 additions & 0 deletions tests/helpers/module-for-acceptance.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { module } from 'qunit';
import startApp from '../helpers/start-app';
import destroyApp from '../helpers/destroy-app';

export default function( name, options = {} ) {
module( name, {
beforeEach() {
this.application = startApp();

if ( options.beforeEach ) {
options.beforeEach.apply( this, arguments );
}
},

afterEach() {
destroyApp( this.application );

if ( options.afterEach ) {
options.afterEach.apply( this, arguments );
}
}
});
}
2 changes: 1 addition & 1 deletion tests/helpers/resolver.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Resolver from 'ember/resolver';
import Resolver from '../../resolver';
import config from '../../config/environment';

const resolver = Resolver.create();
Expand Down
2 changes: 1 addition & 1 deletion tests/helpers/start-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default function startApp( attrs ) {
let application;

let attributes = Ember.merge( {}, config.APP );
attributes = Ember.merge( attributes, attrs ); // use defaults, but you can override;
attributes = Ember.merge( attributes, attrs ); // use defaults, but you can override;

Ember.run( function() {
application = Application.create( attributes );
Expand Down
21 changes: 11 additions & 10 deletions tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<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/dummy.css">
Expand All @@ -21,22 +21,23 @@
}
</style>

{{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/dummy.js"></script>
<script src="/assets/blanket-options.js"></script>
<script src="/assets/blanket-loader.js"></script>
<script src="assets/blanket-options.js"></script>
<script src="assets/blanket-loader.js"></script>
<script src="testem.js"></script>
<script src="assets/tests.js"></script>
<script src="assets/test-loader.js"></script>

{{content-for 'body-footer'}}
{{content-for 'test-body-footer'}}
{{content-for "body-footer"}}
{{content-for "test-body-footer"}}
</body>
</html>

0 comments on commit 1d71a0e

Please sign in to comment.