ruby_astm 1.4.6 → 1.4.7

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
- SHA1:
3
- metadata.gz: cd2c1d542ca88df2907a1ced3c504be478562cc1
4
- data.tar.gz: 9498ee9636238cf9320c2d7da27ac3dd117eca40
2
+ SHA256:
3
+ metadata.gz: 2e92b2e6071300c63a2c9cf237c68daf4e139a8806e451382eb3ad84b5ff7143
4
+ data.tar.gz: '08e321353b2f109d2994ab9f6e12720f564e4cff195b95fae4a6cc4b69145f1b'
5
5
  SHA512:
6
- metadata.gz: c33a3270c4e96663b714eef93522f282474f77ab220bc4dd53eccc625eac332c224944403237469c93f5cc2b95f7c0063102c2be2fa80a43408d6287665a34e7
7
- data.tar.gz: feca986fc7ade45225533c15671aa221e8285b30d5a1868a7ab46c92c385e584a738dae65ddb07c239d7e238f141b752242d1f2fcd86e4134544e2f0a96e568b
6
+ metadata.gz: 8a41a9637d497c4135adc2f846b45cfaefaa0b878259380c81440c7a32b6fcc098c7f2cfd99e0269d995cc6540f2d7760dcb66e4106af81a0690c58a5f1b382b
7
+ data.tar.gz: a743e98d90ed2a7c022ac75a8a64c42987f717e61e679a3ba5ed5cdaf4a70a16231544dcfdd34bb7e4a5920bfa6ab98250dabbab508577d2a34f8dc47bf1401f
@@ -21,6 +21,7 @@ class RealTimeDb
21
21
  attr_accessor :connection
22
22
  attr_accessor :work_allotment_hash
23
23
  attr_accessor :private_key_hash
24
+ attr_accessor :expires_at
24
25
 
25
26
  WORK_TYPES = {
26
27
  "IMMUNO" => "",
@@ -39,6 +40,7 @@ class RealTimeDb
39
40
  $service_account_email = self.private_key_hash["client_email"]
40
41
  $private_key = OpenSSL::PKey::RSA.new self.private_key_hash["private_key"]
41
42
  now_seconds = Time.now.to_i
43
+ self.expires_at = now_seconds + (60*30)
42
44
  payload = {:iss => $service_account_email,
43
45
  :sub => $service_account_email,
44
46
  :aud => self.private_key_hash["token_uri"],
@@ -100,14 +102,12 @@ class RealTimeDb
100
102
  ## if the barcode exists,
101
103
  ## otherwise create it.
102
104
  def barcode_exists?(barcode)
103
- begin
104
- self.connection.get(ENDPOINT, :orderBy => 'barcode', :equalTo => barcode)
105
- rescue
106
- ## reestablish the connection
105
+ current_time = Time.now.to_i
106
+ if current_time > self.expires_at
107
107
  self.connection = RestFirebase.new :site => SITE_URL,
108
108
  :secret => SECRET, :auth =>generate_access_token
109
- true
110
109
  end
110
+ self.connection.get(ENDPOINT, :orderBy => 'barcode', :equalTo => barcode)
111
111
  end
112
112
 
113
113
  ## idea is simple
@@ -12,7 +12,7 @@ class Result
12
12
  if line = args[:line]
13
13
 
14
14
  unless line.fields[2].blank?
15
- line.fields[2].scan(/\^+(?<name>[A-Za-z0-9\%\#\-\_\?\/]+)\^?(?<dilution>\d+)?/) { |name,dilution|
15
+ line.fields[2].scan(/^\^+(?<name>[A-Za-z0-9\%\#\-\_\?\/]+)\^?(?<dilution>\d+)?/) { |name,dilution|
16
16
 
17
17
  self.name = lookup_mapping(name)
18
18
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_astm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.6
4
+ version: 1.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bhargav Raut
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 5.2.3
47
+ version: 5.2.2
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.3
54
+ version: 5.2.2
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: json
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -150,6 +150,20 @@ dependencies:
150
150
  - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: rake
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
153
167
  description: This gem provides a server that can handle communication from medical
154
168
  instruments that send/receive information on the ASTM protocol.
155
169
  email: bhargav.r.raut@gmail.com
@@ -200,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
200
214
  version: '0'
201
215
  requirements: []
202
216
  rubyforge_project:
203
- rubygems_version: 2.6.14.4
217
+ rubygems_version: 2.7.8
204
218
  signing_key:
205
219
  specification_version: 4
206
220
  summary: A Ruby gem to interface with Medical instruments that work on the ASTM protocol