Skip to content

Commit f93289b

Browse files
committed
The index-hash tag strategy can be used for any file (via filePattern), so let's call it file-hash.
1 parent 0a1f446 commit f93289b

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

lib/tags/index-hash.js renamed to lib/tags/file-hash.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ var fs = require('fs');
33
var path = require('path');
44
var minimatch = require('minimatch');
55
var Fingerprint = require('broccoli-asset-rev/lib/fingerprint');
6+
var Promise = require('ember-cli/lib/ext/promise');
67

78
var denodeify = require('rsvp').denodeify;
89
var readFile = denodeify(fs.readFile);
@@ -22,7 +23,7 @@ module.exports = CoreObject.extend({
2223
var filePaths = distFiles.filter(minimatch.filter(filePattern, { matchBase: true }));
2324

2425
if (!filePaths.length) {
25-
return Promise.reject('`' + filePattern + '` does not exist in distDir');
26+
return Promise.reject('`' + filePattern + '` does not exist in distDir `' + distDir + '`');
2627
}
2728

2829
var filePath = path.join(distDir, filePaths[0]);

lib/tags/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
"index-hash": require('./index-hash')
2+
"file-hash": require('./file-hash')
33
};

lib/utilities/validate-config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = function(ui, config) {
99
ui.writeLine(blue('- validating config'));
1010

1111
var defaultConfig = {
12-
type: 'index-hash',
12+
type: 'file-hash',
1313
filePattern: 'index.html'
1414
};
1515

tests/unit/index-nodetest.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ describe('the index', function() {
3939
},
4040
config: {
4141
tag: {
42-
type: 'index-hash',
42+
type: 'file-hash',
4343
filePattern: 'eeee'
4444
}
4545
}
@@ -66,7 +66,7 @@ describe('the index', function() {
6666
},
6767
config: {
6868
tag: {
69-
type: 'index-hash',
69+
type: 'file-hash',
7070
filePattern: 'index.html'
7171
},
7272
}

tests/unit/lib/tags/index-hash-nodetest.js renamed to tests/unit/lib/tags/file-hash-nodetest.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
var assert = require('ember-cli/tests/helpers/assert');
44

5-
describe('the index-hash tag', function() {
5+
describe('the file-hash tag', function() {
66
var Tag;
77

88
before(function() {
9-
Tag = require('../../../../lib/tags/index-hash');
9+
Tag = require('../../../../lib/tags/file-hash');
1010
});
1111

1212
describe('#generate', function() {
@@ -40,7 +40,7 @@ describe('the index-hash tag', function() {
4040

4141
return assert.isRejected(subject.generate())
4242
.then(function(error) {
43-
assert.equal(error, '`some-file-that-does-not-exist` does not exist in distDir');
43+
assert.equal(error, '`some-file-that-does-not-exist` does not exist in distDir `/Users/lmelia/p/ember/ember-cli-deploy-tag/tests/fixtures`');
4444
});
4545
});
4646

0 commit comments

Comments
 (0)