selfsdk 0.0.152 → 0.0.153
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/messages/base.rb +2 -2
- data/lib/selfsdk.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0c8f286f380ceb7e9ac8e066789832d4b9f197751505b940fd8cf746bde8428
|
4
|
+
data.tar.gz: 49256177edb72bc4eb166ae7cd2d3310f60f9dab6b0a1c0380eb779adf05cf63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 814615b35b65af67cbde61330523aa3ec43122b52b0048078ebe6a6ac895e5518ecb8dde154017a15e0190cdb3c9ad32a74ed09627824d49208cdf98748c79f5
|
7
|
+
data.tar.gz: 3b37174d96dd2b6d4c050d496dd338a4ae0e1b9c36ef0b7d27b81c36f9cc1f74c58ce536e46e08a9e7c27a3449e1aab680b666f6e4ebbb1c8e2120df41ad4d55
|
data/lib/messages/base.rb
CHANGED
@@ -21,9 +21,9 @@ module SelfSDK
|
|
21
21
|
msgs = []
|
22
22
|
devices.each do |d|
|
23
23
|
msgs << proto(d)
|
24
|
+
SelfSDK.logger.info "synchronously messaging to #{@to}:#{d}"
|
24
25
|
end
|
25
26
|
res = @messaging.send_and_wait_for_response(msgs, self)
|
26
|
-
SelfSDK.logger.info "synchronously messaging to #{@to}:#{@d}"
|
27
27
|
res
|
28
28
|
end
|
29
29
|
|
@@ -32,7 +32,7 @@ module SelfSDK
|
|
32
32
|
res = []
|
33
33
|
devices.each do |d|
|
34
34
|
res << @messaging.send_message(proto(d))
|
35
|
-
SelfSDK.logger.info "asynchronously requested information to #{@to}:#{
|
35
|
+
SelfSDK.logger.info "asynchronously requested information to #{@to}:#{d}"
|
36
36
|
end
|
37
37
|
res.first
|
38
38
|
end
|
data/lib/selfsdk.rb
CHANGED
@@ -40,13 +40,13 @@ module SelfSDK
|
|
40
40
|
# @param app_id [string] the app id.
|
41
41
|
# @param app_key [string] the app api key provided by developer portal.
|
42
42
|
# @param storage_key [string] the key to be used to encrypt persisted data.
|
43
|
+
# @param storage_dir [String] The folder where encryption sessions and settings will be stored
|
43
44
|
# @param [Hash] opts the options to authenticate.
|
44
45
|
# @option opts [String] :base_url The self provider url.
|
45
46
|
# @option opts [String] :messaging_url The messaging self provider url.
|
46
47
|
# @option opts [Bool] :auto_reconnect Automatically reconnects to websocket if connection is lost (defaults to true).
|
47
48
|
# @option opts [Symbol] :env The environment to be used, defaults to ":production".
|
48
|
-
|
49
|
-
def initialize(app_id, app_key, storage_key, opts = {})
|
49
|
+
def initialize(app_id, app_key, storage_key, storage_dir, opts = {})
|
50
50
|
SelfSDK.logger.debug "syncing ntp times #{SelfSDK::Time.now}"
|
51
51
|
env = opts.fetch(:env, "")
|
52
52
|
|
@@ -56,7 +56,7 @@ module SelfSDK
|
|
56
56
|
@messaging_client = MessagingClient.new(messaging_url,
|
57
57
|
@client,
|
58
58
|
storage_key,
|
59
|
-
storage_dir:
|
59
|
+
storage_dir: storage_dir,
|
60
60
|
auto_reconnect: opts.fetch(:auto_reconnect, MessagingClient::DEFAULT_AUTO_RECONNECT),
|
61
61
|
device_id: opts.fetch(:device_id, MessagingClient::DEFAULT_DEVICE))
|
62
62
|
end
|