tanker-core 2.6.0.beta.1 → 2.6.1.beta.2
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 814930f2f9c925df6a233f6b51ee6d6cc29188262fa99f8cb19e1b0ab38b6a4d
|
4
|
+
data.tar.gz: 75d4fa855111861deb3cb8246dfea36e50428a8e39555f7f7ebd1f592f32b3f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 856c8fc0df9885311250c7e448b26ad3f78abecd37f2e05224d62fb37ebd95918b2d1b55a1807dba2b20ace20c96d823e93076aefa730c9320064217f8330e32
|
7
|
+
data.tar.gz: 7d66eb9417c49943d722d651e527269d47a423c8a8f32d530afd8a9e1159bc7fa1ae9fe9aab68e6760d3c86f5f28c45c88390105a5eae8df722b1c098310964b
|
data/lib/tanker/core/init.rb
CHANGED
@@ -3,9 +3,34 @@
|
|
3
3
|
module Tanker
|
4
4
|
# Main entry point for the Tanker SDK. Can open a Tanker session.
|
5
5
|
class Core
|
6
|
-
|
6
|
+
@log_handler_lock = Mutex.new
|
7
|
+
@log_handler_set = 0
|
8
|
+
|
9
|
+
def self.test_and_set_log_handler
|
10
|
+
@log_handler_lock.synchronize do
|
11
|
+
is_set = @log_handler_set
|
12
|
+
@log_handler_set = 1
|
13
|
+
return is_set
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.set_log_handler(&block) # rubocop:disable Naming/AccessorMethodName
|
18
|
+
@log_handler_set = 1
|
19
|
+
@log_handler = lambda do |clog|
|
20
|
+
block.call LogRecord.new clog[:category], clog[:level], clog[:file], clog[:line], clog[:message]
|
21
|
+
end
|
22
|
+
CTanker.tanker_set_log_handler @log_handler
|
23
|
+
end
|
7
24
|
|
8
25
|
def initialize(options)
|
26
|
+
# tanker_init is not called globally to avoid potential logs at global scope
|
27
|
+
# some frameworks like to pre-execute statements at global scope and then fork, this fork can
|
28
|
+
# interact badly with the threads used in the log handler, so never call Tanker at global scope
|
29
|
+
CTanker.tanker_init
|
30
|
+
|
31
|
+
# Do not spam the console of our users.
|
32
|
+
self.class.set_log_handler { |_| } unless self.class.test_and_set_log_handler == 1
|
33
|
+
|
9
34
|
@revoke_event_handlers = Set.new
|
10
35
|
@ctanker = CTanker.tanker_create(options).get
|
11
36
|
@freed = false
|
@@ -34,16 +59,6 @@ module Tanker
|
|
34
59
|
end
|
35
60
|
end
|
36
61
|
|
37
|
-
def self.set_log_handler(&block) # rubocop:disable Naming/AccessorMethodName
|
38
|
-
@log_handler = lambda do |clog|
|
39
|
-
block.call LogRecord.new clog[:category], clog[:level], clog[:file], clog[:line], clog[:message]
|
40
|
-
end
|
41
|
-
CTanker.tanker_set_log_handler @log_handler
|
42
|
-
end
|
43
|
-
|
44
|
-
# Do not spam the console of our users
|
45
|
-
set_log_handler { |_| }
|
46
|
-
|
47
62
|
def connect_device_revoked_handler(&block)
|
48
63
|
@revoke_event_handlers.add block
|
49
64
|
end
|
data/lib/tanker/core/version.rb
CHANGED
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tanker-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.6.
|
4
|
+
version: 2.6.1.beta.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tanker team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|