Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
32 lines
598 B
JavaScript
Executable file
32 lines
598 B
JavaScript
Executable file
'use strict';
|
|
|
|
/* global module */
|
|
|
|
var appRoot = require('app-root-path');
|
|
|
|
// TODO Export this helper in its own npm package
|
|
|
|
function FromApp(app) {
|
|
this.app = app;
|
|
return this;
|
|
}
|
|
|
|
FromApp.prototype = {
|
|
filePath: function(relativePath) {
|
|
var app = this.app;
|
|
|
|
if (['dialer', 'contacts'].indexOf(app) !== -1) {
|
|
app = 'communications/' + app;
|
|
}
|
|
|
|
return appRoot + '/apps/' + app + '/test/marionette/' + relativePath;
|
|
},
|
|
|
|
require: function(resource) {
|
|
return require(this.filePath(resource));
|
|
}
|
|
};
|
|
|
|
module.exports = function(app) {
|
|
return new FromApp(app);
|
|
};
|