trophonius 1.2.4.1 → 1.2.4.9

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: 7c5fa0924dd1c64e76122e79ab2bf62626e71d5c185da9151df9a44d8581c536
4
- data.tar.gz: 15ff6326afcc5d50250f0ef94d91f555f8751dcf98469edb36c146989520efeb
3
+ metadata.gz: 00a7c14bd030e2f9556582beaf62ed25cb47ee8472493d92d11780e110c9c001
4
+ data.tar.gz: d0d288c28853421f8e224a834b476b3997872dbb9d7d606ece5cfa0e00864671
5
5
  SHA512:
6
- metadata.gz: e38494782549ad841d8fb6a76a9348ef2a5882b97dc8a06cabf42157e3958e7e13d6dbdb4d10f6ce3f07fe98dd59190fed409e068aa7ac536316df5deb331e46
7
- data.tar.gz: 0aca3057049e2c303958ddba479fe40dae7ca6032b7362b7b50e34d7cf39645cbc343eee541b0470731d5a89ddbddd6d2ad3ca58cbc04e83a3d2c7df780d3f46
6
+ metadata.gz: f18b0ceb2b54cd6bbacfd3edcc84f1c3897aaa8dfbcc8041c5ab7dc9c45290667704ee79d9086a3bc895356bba1a6dd9af26580e0ed633c059b74601023aad38
7
+ data.tar.gz: ba7160a9f94509edb74ca0ab267cdf76e670dbf76013c190ed636395573637099d6e12cc84a51a394c8982f28cd46eac9c495f4df79358044874f500d19b8388
@@ -70,18 +70,17 @@ module Trophonius
70
70
 
71
71
  begin
72
72
  parsed = JSON.parse(temp.response_body)
73
- Error.throw_error(response['messages'][0]['code']) if parsed['messages'][0]['code'] != '0'
74
- return parsed['response']['token']
75
73
  rescue Exception => e
76
74
  Error.throw_error('1631')
77
75
  end
76
+ Error.throw_error(parsed['messages'][0]['code']) if parsed['messages'][0]['code'] != '0'
77
+ return parsed['response']['token']
78
78
  end
79
79
 
80
80
  ##
81
81
  # Returns the last received token
82
82
  # @return [String] the last valid *token* used to connect with the FileMaker data api
83
83
  def self.token
84
- token = Trophonius::RedisManager.get_key(key: 'token')
85
84
  return Trophonius.config.redis_connection ? Trophonius::RedisManager.get_key(key: 'token') : @token
86
85
  end
87
86
 
@@ -89,7 +88,7 @@ module Trophonius
89
88
  # Returns the receive time of the last received token
90
89
  # @return [Time] Returns the receive time of the last received token
91
90
  def self.last_connection
92
- last = Trophonius::RedisManager.get_key(key: 'last_connection')
91
+ last = Trophonius.config.redis_connection ? Trophonius::RedisManager.get_key(key: 'last_connection') : nil
93
92
  last = last.nil? ? nil : Time.parse(last)
94
93
  Trophonius.config.redis_connection ? last : @last_connection
95
94
  end
@@ -136,8 +136,8 @@ module Trophonius
136
136
  response = Request.make_request(url, "Bearer #{Request.get_token}", 'post', body)
137
137
  if response['messages'][0]['code'] != '0'
138
138
  if response['messages'][0]['code'] == '101' || response['messages'][0]['code'] == '401'
139
- RecordSet.new(@trophonius_model.layout_name, @trophonius_model.non_modifiable_fields).send(method, *args, &block)
140
- return
139
+ resp = RecordSet.new(@trophonius_model.layout_name, @trophonius_model.non_modifiable_fields).send(method, *args, &block)
140
+ return resp
141
141
  else
142
142
  if response['messages'][0]['code'] == '102'
143
143
  results = Request.retrieve_first(@trophonius_model.layout_name)
@@ -2,10 +2,12 @@ module Trophonius
2
2
  # the RedisManager module is used to create a (single) connection to a redis store.
3
3
  module Trophonius::RedisManager
4
4
  def self.connect
5
- if ENV['REDIS_URL'] && ENV['REDIS_URL'] != ''
6
- @redis ||= Redis.new(url: ENV['REDIS_URL'])
7
- else
8
- @redis ||= Redis.new
5
+ if Trophonius.config.redis_connection
6
+ if ENV['REDIS_URL'] && ENV['REDIS_URL'] != ''
7
+ @redis ||= Redis.new(url: ENV['REDIS_URL'])
8
+ else
9
+ @redis ||= Redis.new
10
+ end
9
11
  end
10
12
  return nil
11
13
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trophonius
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4.1
4
+ version: 1.2.4.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kempen Automatisering
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '5.2'
47
+ version: 6.x
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '5.2'
54
+ version: 6.x
55
55
  description: An easy to use link between Ruby (on Rails) and FileMaker using the FileMaker
56
56
  Data-API.
57
57
  email: