Skip to content

Commit

Permalink
Merge pull request #284 from mike-north/initializer-warn-fixes
Browse files Browse the repository at this point in the history
Fix initializer deprecation warnings
  • Loading branch information
mike-north committed Feb 1, 2016
2 parents aa25e38 + 63b9576 commit 9876e8d
Show file tree
Hide file tree
Showing 20 changed files with 104 additions and 68 deletions.
1 change: 1 addition & 0 deletions .jscsrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"preset": "ember-suave",
"excludeFiles": ["blanket-options.js"],
"requireParenthesesAroundArrowParam": null
}
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ dist/
.npmignore
**/.gitkeep
bower.json
ember-cli-build.js
Brocfile.js
testem.json
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ cache:
- node_modules

env:
- EMBER_TRY_SCENARIO=ember-1.11
- EMBER_TRY_SCENARIO=ember-1.12
- EMBER_TRY_SCENARIO=ember-1.13
- EMBER_TRY_SCENARIO=ember-2.0
- EMBER_TRY_SCENARIO=ember-2.1
- EMBER_TRY_SCENARIO=ember-2.2
- EMBER_TRY_SCENARIO=ember-release
- EMBER_TRY_SCENARIO=ember-beta
- ALLOW_DEPRECATIONS=true EMBER_TRY_SCENARIO=ember-canary
Expand Down
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"]
}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ Ember.js version | ember-cli-materialize version
-----------------|--------------
`< 1.10.0` | Not supported
`1.10.0 <= x < 1.11.0`| [`v0.16.4`](https://github.com/mike-north/ember-cli-materialize/tree/v0.16.4)
`x >= 1.11.0` | [![npm version](https://badge.fury.io/js/ember-cli-materialize.svg)](http://badge.fury.io/js/ember-cli-materialize)
`1.11.0 <= x < 1.13.0`| [`v0.18.6`](https://github.com/mike-north/ember-cli-materialize/tree/v0.18.6)
`x >= 1.13.0` | [![npm version](https://badge.fury.io/js/ember-cli-materialize.svg)](http://badge.fury.io/js/ember-cli-materialize)


## Main features
Expand Down
3 changes: 2 additions & 1 deletion addon/mixins/uses-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const { computed } = Ember;

export default Ember.Mixin.create({
_mdSettings: computed(function() {
return this.get('container').lookup('service:materialize-settings');
const owner = Ember.getOwner ? Ember.getOwner(this) : this.get('container');
return owner.lookup('service:materialize-settings');
})
});
4 changes: 3 additions & 1 deletion app/initializers/add-modals-container.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export function initialize (container, application){

export function initialize () {
const application = arguments[1] || arguments[0];
var rootEl = document.querySelector(application.rootElement);
var modalContainerEl = document.createElement('div');
var emberModalDialog = application.emberModalDialog || {};
Expand Down
3 changes: 2 additions & 1 deletion app/initializers/md-settings.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import config from '../config/environment';
import MaterializeSettings from 'ember-cli-materialize/services/md-settings';

export function initialize(container, application) {
export function initialize() {
const { materializeDefaults } = config;
const application = arguments[1] || arguments[0];

application.register('config:materialize', materializeDefaults, { instantiate: false });
application.register('service:materialize-settings', MaterializeSettings);
Expand Down
2 changes: 1 addition & 1 deletion blueprints/ember-cli-materialize/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {
this.addPackageToProject('ember-radio-button', '1.0.7'),
this.addPackageToProject('ember-new-computed', '~1.0.0'),
this.addPackageToProject('ember-key-responder', '~0.4.0'),
this.addPackageToProject('ember-modal-dialog', '~0.7.5'),
this.addPackageToProject('ember-modal-dialog', '~0.8.0'),
this.addPackageToProject('ember-cli-sass', '^3.3.0'),
this.addPackageToProject('ember-legacy-views', '^0.2.0')
]);
Expand Down
21 changes: 11 additions & 10 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@
"name": "ember-cli-materialize",
"dependencies": {
"blanket": "~1.1.5",
"ember": "1.13.2",
"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.5",
"ember-qunit": "0.4.9",
"ember-qunit-notifications": "0.0.7",
"ember": "1.13.12",
"ember-cli-shims": "0.0.6",
"ember-cli-test-loader": "0.2.1",
"ember-load-initializers": "0.1.7",
"ember-qunit": "0.4.16",
"ember-qunit-notifications": "0.1.0",
"ember-resolver": "~0.1.20",
"jquery": "^1.11.3",
"loader.js": "ember-cli/loader.js#3.2.1",
"jquery": "1.11.3",
"loader.js": "ember-cli/loader.js#3.4.0",
"materialize": "~0.97.0",
"qunit": "~1.18.0"
"qunit": "~1.20.0"
},
"resolutions": {
"jquery": "^1.11.3"
"jquery": "1.11.3",
"qunit-notifications": "~0.1.0"
}
}
29 changes: 18 additions & 11 deletions config/ember-try.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
module.exports = {
scenarios: [
{
name: 'ember-1.11',
name: 'ember-1.12',
dependencies: {
'ember': '~1.11.0',
'ember-load-initializers': 'ember-cli/ember-load-initializers#0.0.2'
'ember': '~1.12.0'
}
},
{
name: 'ember-1.12',
name: 'ember-1.13',
dependencies: {
'ember': '~1.12.0'
'ember': '~1.13.0'
}
},
{
name: 'ember-2.0',
dependencies: {
'ember': '~2.0.0'
}
},
{
name: 'default',
dependencies: {}
name: 'ember-2.1',
dependencies: {
'ember': '~2.1.0'
}
},
{
name: 'ember-1.13',
name: 'ember-2.2',
dependencies: {
'ember': '~1.13.0'
'ember': '~2.2.0'
}
},
{
Expand All @@ -35,10 +42,10 @@ module.exports = {
{
name: 'ember-beta',
dependencies: {
'ember': '2.0.0-beta.5'
'ember': 'components/ember#beta'
},
resolutions: {
'ember': '2.0.0-beta.5'
'ember': 'beta'
}
},
{
Expand Down
27 changes: 14 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ember-cli-materialize",
"description": "An ember-cli addon for using Materialize (CSS Framework based on Material Design) in Ember applications.",
"version": "0.18.6",
"version": "0.18.7",
"directories": {
"doc": "doc",
"test": "tests"
Expand Down Expand Up @@ -29,32 +29,33 @@
],
"license": "MIT",
"devDependencies": {
"broccoli-asset-rev": "^2.1.2",
"broccoli-asset-rev": "^2.2.0",
"coveralls": "^2.11.4",
"ember-anchor": "~0.0.2",
"ember-cli": "1.13.8",
"ember-anchor": "~0.0.8",
"ember-cli": "1.13.15",
"ember-cli-app-version": "^1.0.0",
"ember-cli-blanket": "0.5.4",
"ember-cli-content-security-policy": "0.4.0",
"ember-cli-dependency-checker": "^1.0.1",
"ember-cli-dependency-checker": "^1.1.0",
"ember-cli-github-pages": "0.0.6",
"ember-cli-htmlbars-inline-precompile": "^0.2.0",
"ember-cli-htmlbars-inline-precompile": "^0.3.1",
"ember-cli-ic-ajax": "0.2.4",
"ember-cli-inject-live-reload": "^1.3.1",
"ember-cli-qunit": "^1.0.0",
"ember-cli-qunit": "^1.0.4",
"ember-cli-sass": "3.3.0",
"ember-cli-uglify": "^1.2.0",
"ember-code-snippet": "mike-north/ember-code-snippet#global",
"ember-composability": "~0.2.0",
"ember-disable-prototype-extensions": "^1.0.0",
"ember-disable-proxy-controllers": "^1.0.0",
"ember-export-application-global": "^1.0.3",
"ember-disable-proxy-controllers": "^1.0.1",
"ember-export-application-global": "^1.0.4",
"ember-key-responder": "~0.4.0",
"ember-legacy-views": "0.2.0",
"ember-modal-dialog": "~0.7.5",
"ember-modal-dialog": "~0.8.0",
"ember-new-computed": "~1.0.2",
"ember-radio-button": "1.0.7",
"ember-suave": "^1.1.0",
"ember-try": "0.0.8"
"ember-try": "~0.0.8"
},
"keywords": [
"materialize",
Expand All @@ -63,8 +64,8 @@
"ember-addon"
],
"dependencies": {
"ember-cli-babel": "^5.1.3",
"ember-cli-htmlbars": "^1.0.0",
"ember-cli-babel": "^5.1.5",
"ember-cli-htmlbars": "^1.0.1",
"rsvp": "^3.0.18"
},
"ember-addon": {
Expand Down
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);
}
}
});
}
22 changes: 11 additions & 11 deletions tests/helpers/resolver.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import Resolver from 'ember/resolver';
import config from '../../config/environment';

const resolver = Resolver.create();

resolver.namespace = {
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix
};

export default resolver;
import Resolver from 'ember/resolver';
import config from '../../config/environment';

const resolver = Resolver.create();

resolver.namespace = {
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix
};

export default resolver;
2 changes: 1 addition & 1 deletion tests/helpers/start-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function startApp(attrs) {
let attributes = Ember.merge({}, config.APP);
attributes = Ember.merge(attributes, attrs); // use defaults, but you can override;

Ember.run(function() {
Ember.run(() => {
application = Application.create(attributes);
application.setupForTesting();
application.injectTestHelpers();
Expand Down
3 changes: 2 additions & 1 deletion tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
<script src="assets/dummy.js"></script>
<script src="assets/blanket-options.js"></script>
<script src="assets/blanket-loader.js"></script>
<script src="testem.js"></script>
<script src="testem.js" integrity=""></script>
<script src="assets/tests.js"></script>
<script src="assets/test-loader.js"></script>

{{content-for 'body-footer'}}
Expand Down
1 change: 0 additions & 1 deletion tests/integration/components/md-select-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ test('basic usage', function(assert) {
optionLabelPath="content.value"
optionValuePath="content" class="col s12"}}
`);

assert.equal(this.$().text().trim(), `Framework
▼Please choose...Materialize CSSEmber-CLI MaterializePlease choose...Materialize CSSEmber-CLI Materialize`);

Expand Down
5 changes: 4 additions & 1 deletion tests/unit/components/materialize-button-dropdown-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,13 @@ test('dropdown shown at origin', function(assert) {

const dropdownContentId = `#${component.get('_dropdownContentId')}`;
const dropdownElement = $(dropdownContentId);
assert.equal(dropdownElement.css('top'), 'auto', 'Initially auto');

component.$().click();
Ember.run(function() {
Ember.run.schedule('afterRender', function() {
assert.equal(`${component.$().position().top}px`, dropdownElement.css('top'));
const dropdownPosString = dropdownElement.css('top');
assert.equal(parseInt(component.$().position().top, 10), parseInt(dropdownPosString.substring(0, dropdownPosString.length - 2), 10));
});
});
});
Expand Down
10 changes: 0 additions & 10 deletions tests/unit/components/materialize-radios-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,6 @@ moduleForComponent('md-radios', {
integration: true
});

test('no parameters, no block', function(assert) {
assert.expect(1);

this.render(hbs `
{{md-radios}}
`);

assert.equal(this.$('.md-radios').toArray().length, 1, 'component renders');
});

test('simple array test, with initial selection', function(assert) {
this.setProperties({
content: Ember.A(['Dexter Morgan', 'Deborah Morgan', 'Harry Morgan']),
Expand Down

0 comments on commit 9876e8d

Please sign in to comment.