trophonius 1.4.5.2 → 1.4.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/trophonius_connection.rb +8 -5
- data/lib/trophonius_request.rb +5 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eecfcdce6515f91456cd8e482da0eec5104f2e8fde6b3625baf0db732bc12969
|
4
|
+
data.tar.gz: 6b79cbc8b44fe728171a3123d12def4f4df2eaf8f43c66b8201564ed14e12cae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a048ab92bfc7971e9d0f80a33e45ba7dc689cbff9d711863cdc5aa0308b29bec48412d9bda6adacb38e267b552a0345a6eb3f8214fa383ecacaaabcf8410db20
|
7
|
+
data.tar.gz: 885bee6b19febf90d566c64b7e2fc714d9323efabe10bc0a47fab0a10ae823aec84b5935a3555834e83363e9378322314f2623c727bba1dde2c48d302971c8ad
|
@@ -14,7 +14,6 @@ module Trophonius
|
|
14
14
|
Trophonius::RedisManager.set_key(key: 'token', value: setup_connection)
|
15
15
|
Trophonius::RedisManager.set_key(key: 'last_connection', value: Time.now)
|
16
16
|
Trophonius::RedisManager.get_key(key: 'token')
|
17
|
-
|
18
17
|
else
|
19
18
|
@token = setup_connection
|
20
19
|
@last_connection = Time.now
|
@@ -157,11 +156,15 @@ module Trophonius
|
|
157
156
|
request =
|
158
157
|
Typhoeus::Request.new(
|
159
158
|
url,
|
160
|
-
method: :get, body: {}, params: {}, headers: { 'Content-Type' => 'application/json', Authorization: "Bearer #{
|
159
|
+
method: :get, body: {}, params: {}, headers: { 'Content-Type' => 'application/json', Authorization: "Bearer #{token}" }
|
161
160
|
)
|
162
161
|
temp = request.run
|
163
|
-
JSON.parse(temp.response_body)
|
164
|
-
|
162
|
+
json_parsed = JSON.parse(temp.response_body)
|
163
|
+
|
164
|
+
json_parsed['messages'][0]['code'] == '0'
|
165
|
+
rescue StandardError => e
|
166
|
+
puts e
|
167
|
+
puts e.backtrace
|
165
168
|
false
|
166
169
|
end
|
167
170
|
end
|
@@ -173,7 +176,7 @@ module Trophonius
|
|
173
176
|
if Trophonius.config.layout_name != '' && test_connection == false
|
174
177
|
false
|
175
178
|
else
|
176
|
-
last_connection.nil? ? false :
|
179
|
+
last_connection.nil? ? false : test_connection
|
177
180
|
end
|
178
181
|
end
|
179
182
|
end
|
data/lib/trophonius_request.rb
CHANGED
@@ -37,6 +37,8 @@ module Trophonius
|
|
37
37
|
begin
|
38
38
|
JSON.parse(temp.response_body)
|
39
39
|
rescue Exception => e
|
40
|
+
puts e
|
41
|
+
puts e.backtrace
|
40
42
|
Error.throw_error('1631')
|
41
43
|
end
|
42
44
|
end
|
@@ -111,7 +113,9 @@ module Trophonius
|
|
111
113
|
)
|
112
114
|
begin
|
113
115
|
make_request(url, "Bearer #{get_token}", 'get', '{}')['response']['fieldMetaData'].map { |field| field['name'] }
|
114
|
-
rescue
|
116
|
+
rescue StandardError => e
|
117
|
+
puts e
|
118
|
+
puts e.backtrace
|
115
119
|
Error.throw_error('1631')
|
116
120
|
end
|
117
121
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trophonius
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.5.
|
4
|
+
version: 1.4.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kempen Automatisering
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
requirements: []
|
98
|
-
rubygems_version: 3.
|
98
|
+
rubygems_version: 3.3.16
|
99
99
|
signing_key:
|
100
100
|
specification_version: 4
|
101
101
|
summary: Link between Ruby (on Rails) and FileMaker.
|