fdk 0.0.15 → 0.0.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fdk/call.rb +1 -0
- data/lib/fdk/listener.rb +2 -2
- data/lib/fdk/runner.rb +19 -2
- data/lib/fdk/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65e2394fdcb3ded2289d375557641ce03ad38781
|
4
|
+
data.tar.gz: 6587cea06ad9da035c853218d52ffc6af9733fae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85cf5dd30e50be0b4301ceda4954f2fce48c978c69584d10d0e282f5036da583a2ff49bc5610d2b676b511fd929f1410f9e882fa81aac6cad7862cfb7a8855c1
|
7
|
+
data.tar.gz: 89d8e019779503fd53d00026dfa412fccc87b4c75eae36f11ff1568b124e287a331338b0a192ed2de62f5e322f96779798c58363f43152a488fba4a4e0048c2a
|
data/lib/fdk/call.rb
CHANGED
data/lib/fdk/listener.rb
CHANGED
@@ -38,8 +38,8 @@ module FDK
|
|
38
38
|
|
39
39
|
handle_requests(socket: local_socket, fn_block: block)
|
40
40
|
rescue StandardError => e
|
41
|
-
|
42
|
-
|
41
|
+
FDK.log(entry: "Error in request handling #{e}")
|
42
|
+
FDK.log(entry: e.backtrace)
|
43
43
|
end
|
44
44
|
local_socket.close
|
45
45
|
end
|
data/lib/fdk/runner.rb
CHANGED
@@ -7,10 +7,27 @@ require "set"
|
|
7
7
|
# Executes it with input
|
8
8
|
# Responds with output
|
9
9
|
module FDK
|
10
|
-
|
10
|
+
FDK_LOG_THRESHOLD = "FDK_LOG_THRESHOLD".freeze
|
11
|
+
FDK_LOG_DEBUG = 0
|
12
|
+
FDK_LOG_DEFAULT = 1
|
13
|
+
|
14
|
+
def self.log_threshold
|
15
|
+
@log_threshold ||= ENV[FDK_LOG_THRESHOLD] ? ENV[FDK_LOG_THRESHOLD].to_i : FDK_LOG_DEFAULT
|
16
|
+
end
|
17
|
+
|
18
|
+
# Writes the entry to STDERR if the log_level >= log_threshold
|
19
|
+
# If no log level is specified, 1 is assumed.
|
20
|
+
def self.log(entry:, log_level: FDK_LOG_DEFAULT)
|
21
|
+
STDERR.puts(entry) if log_level >= log_threshold
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.log_error(error:)
|
25
|
+
log(entry: error.message)
|
26
|
+
log(entry: error.backtrace.join("\n"), log_level: FDK_LOG_DEBUG)
|
27
|
+
end
|
11
28
|
|
12
29
|
def self.debug(msg)
|
13
|
-
|
30
|
+
log(entry: msg, log_level: FDK_LOG_DEBUG)
|
14
31
|
end
|
15
32
|
|
16
33
|
def self.handle(target:)
|
data/lib/fdk/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Travis Reeder
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2018-
|
13
|
+
date: 2018-11-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: json
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 0.2.1
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.60'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.60'
|
55
69
|
description: Ruby Function Developer Kit for Fn Project.
|
56
70
|
email:
|
57
71
|
- treeder@gmail.com
|