rumbda 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lambda/index.js +26 -3
- data/lib/rumbda/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9bb0b519c0f83fda894220d3b81d5b029a06964c
|
|
4
|
+
data.tar.gz: 4424dbe397c952ad834b1b25d6a45691be03a390
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 986cab720f0a0b5f2cfb9c77f69b15bbc12a2d814d369c67b553ef524404720e4d9014d1a70507d5a7e93e06f4ea0db78a2ae709d8814e0c7513fdecb68a0386
|
|
7
|
+
data.tar.gz: 9848ffec187755d1a46a33f0ccd6d47f9c91ddf70329253ae62002f951de8ecb7346239f881141b60ff4f7a5711be3340aaba3eb95f553af25437d7d47a7aaff
|
data/lambda/index.js
CHANGED
|
@@ -1,10 +1,33 @@
|
|
|
1
1
|
const exec = require('child_process').exec;
|
|
2
|
+
const fs = require('fs');
|
|
2
3
|
|
|
3
|
-
exports.handler = function(event, context) {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
exports.handler = function(event, context, callback) {
|
|
5
|
+
// In order to return a value and not deal with stdout rumbda watches a file.
|
|
6
|
+
const jsonFilePath = '/tmp/rumbda.' + Math.random() + '.json';
|
|
7
|
+
process.env['RUMBDA_RESULT_JSON_FILENAME'] = jsonFilePath;
|
|
8
|
+
|
|
9
|
+
const child = exec('./ruby_wrapper ' + "'" + JSON.stringify(event) + "'", (error, stdout, stderr) => {
|
|
10
|
+
if (error) {
|
|
11
|
+
callback(error);
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (fs.existsSync(jsonFilePath)) {
|
|
16
|
+
fs.readFile(jsonFilePath, 'utf8', function (err, data) {
|
|
17
|
+
fs.unlink(jsonFilePath);
|
|
18
|
+
|
|
19
|
+
if (err) {
|
|
20
|
+
callback(err);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
callback(null, (data.length > 0) ? JSON.parse(data) : null);
|
|
24
|
+
});
|
|
25
|
+
} else {
|
|
26
|
+
callback(null);
|
|
27
|
+
}
|
|
6
28
|
});
|
|
7
29
|
|
|
8
30
|
child.stdout.on('data', console.log);
|
|
9
31
|
child.stderr.on('data', console.error);
|
|
10
32
|
};
|
|
33
|
+
|
data/lib/rumbda/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rumbda
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- kleaver
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-
|
|
11
|
+
date: 2017-08-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: thor
|