diff --git a/.travis.yml b/.travis.yml index 76a5828..9d88e5d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,4 +40,4 @@ install: - bower install script: - - ember try $EMBER_TRY_SCENARIO test && mocha tests/**/*-test-node.js + - ember try $EMBER_TRY_SCENARIO test && npm run test-mocha diff --git a/index.js b/index.js index 0319885..e0476f5 100644 --- a/index.js +++ b/index.js @@ -5,11 +5,9 @@ var fs = require('fs'); var path = require('path'); var util = require('util'); -var renameFiles = require('broccoli-rename-files'); var mergeTrees = require('broccoli-merge-trees'); var funnel = require('broccoli-funnel'); -var removeFiles = require('broccoli-file-remover'); -var replaceString = require('broccoli-string-replace'); +var replaceString = require('broccoli-replace'); var assign = require('object-assign'); var colors = require('colors'); @@ -99,13 +97,12 @@ module.exports = { if (this.options.enabled && type === 'all') { if (this.options.output) { - renamedIndexTree = renameFiles(funnel(tree, { + renamedIndexTree = funnel(tree, { srcDir: '.', files: ['index.html'], - destDir: this.options.destDir || '.' - }), { - transformFilename: function() { - return this.options.output; + destDir: this.options.destDir || '.', + getDestinationPath: function() { + return this.options.output; }.bind(this) }); } @@ -130,19 +127,23 @@ module.exports = { renamedIndexTree = replaceString(renamedIndexTree, { files: file, - pattern: { - match: content.includeInOutput ? markersRegExp : injectedContentRegExp, - replacement: '' - } + patterns: [ + { + match: content.includeInOutput ? markersRegExp : injectedContentRegExp, + replacement: '' + } + ] }); } indexTree = replaceString(indexTree, { files: indexFiles, - pattern: { - match: content.includeInIndexHtml ? markersRegExp : injectedContentRegExp, - replacement: '' - } + patterns: [ + { + match: content.includeInIndexHtml ? markersRegExp : injectedContentRegExp, + replacement: '' + } + ] }); }, this); diff --git a/tests/unit/addon-tree-test-node.js b/mocha-tests/addon-tree-test-node.js similarity index 99% rename from tests/unit/addon-tree-test-node.js rename to mocha-tests/addon-tree-test-node.js index a3e2894..59cda0e 100644 --- a/tests/unit/addon-tree-test-node.js +++ b/mocha-tests/addon-tree-test-node.js @@ -24,7 +24,7 @@ function findEmberIndex(app) { describe('Addon', function () { var builder; - this.timeout(15000); + this.timeout(60000); afterEach(function () { if (builder) { diff --git a/package.json b/package.json index 8ec4f6c..db6b5f9 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "start": "ember server", "build": "ember build", "test": "ember try:testall && npm run test-mocha", - "test-mocha": "mocha tests/**/*-test-node.js" + "test-mocha": "mocha mocha-tests" }, "repository": "https://github.com/ramybenaroya/ember-index", "engines": { @@ -23,10 +23,10 @@ "broccoli-asset-rev": "^2.2.2", "chai": "^3.0.0", "ember-cli": "1.13.12", - "ember-cli-app-version": "^1.0.0", + "ember-cli-app-version": "^3.2.0", "ember-cli-dependency-checker": "^1.1.0", "ember-cli-htmlbars": "1.0.1", - "ember-cli-htmlbars-inline-precompile": "^0.3.1", + "ember-cli-htmlbars-inline-precompile": "^0.4.0", "ember-cli-ic-ajax": "0.2.4", "ember-cli-inject-live-reload": "^1.3.1", "ember-cli-qunit": "1.0.4", @@ -34,7 +34,7 @@ "ember-cli-uglify": "^1.0.1", "ember-disable-prototype-extensions": "^1.0.0", "ember-disable-proxy-controllers": "^1.0.1", - "ember-export-application-global": "^1.0.4", + "ember-export-application-global": "^2.0.0", "ember-try": "~0.0.8", "mocha": "^2.2.5" }, @@ -43,13 +43,11 @@ "index" ], "dependencies": { - "broccoli-file-remover": "^0.3.1", "broccoli-funnel": "^1.1.0", "broccoli-merge-trees": "^0.2.1", - "broccoli-rename-files": "0.0.3", - "broccoli-string-replace": "^0.1.2", + "broccoli-replace": "^0.12.0", "colors": "^1.1.2", - "ember-cli-babel": "^5.1.5", + "ember-cli-babel": "^6.16.0", "object-assign": "^3.0.0" }, "ember-addon": {