1 | var _ = require('lodash');
|
2 |
|
3 | const PLATFORMS = [
|
4 | require('./node'),
|
5 | require('./ruby'),
|
6 | require('./scala'),
|
7 | require('./python'),
|
8 | require('./minimal')
|
9 | ];
|
10 |
|
11 | module.exports = {
|
12 | all: PLATFORMS,
|
13 | find: function(name) {
|
14 | return _.find(PLATFORMS, { name: name });
|
15 | },
|
16 | detect: function(dir) {
|
17 | return _.reduce(PLATFORMS, function(match, platform) {
|
18 | if (match) return match;
|
19 | return platform.detect(dir) ? platform : undefined;
|
20 | }, undefined);
|
21 | }
|
22 | }
|