ruby_astm 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/publisher/poller.rb +2 -2
- data/lib/ruby_astm/astm_server.rb +9 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 842286467b059daf0900a6fcf8e4eb268c312d30
|
4
|
+
data.tar.gz: f8c9fe3d6f956160469ab440a05dde9668186908
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2127234e9e8bfd786a4e00bba25b0eb67f5e2d60acc709fe5868c5137edae77b60e8ea458f43767fda88467241166cf9e33da8a3d82eaade538b56f730414089
|
7
|
+
data.tar.gz: 4bc8ae6b1a863234dd750fd02d11d5656a4686eb6f254d831cedd2533ea225d1804e82a6ced3c243ff528d8337a0095a7536163ee88218d78d1fbe55a311c35d
|
data/lib/publisher/poller.rb
CHANGED
@@ -27,7 +27,7 @@ class Poller
|
|
27
27
|
def initialize(mpg=nil)
|
28
28
|
$redis = Redis.new
|
29
29
|
## this mapping is from MACHINE CODE AS THE KEY
|
30
|
-
$mappings = JSON.parse(IO.read(mpg ||
|
30
|
+
$mappings = JSON.parse(IO.read(mpg || AstmServer.default_mappings))
|
31
31
|
## INVERTING THE MAPPINGS, GIVES US THE LIS CODE AS THE KEY.
|
32
32
|
$inverted_mappings = Hash[$mappings.values.map{|c| c = c["LIS_CODE"]}.zip($mappings.keys)]
|
33
33
|
end
|
@@ -207,7 +207,7 @@ class Poller
|
|
207
207
|
|
208
208
|
## override to define how the data is updated.
|
209
209
|
def update(data)
|
210
|
-
|
210
|
+
|
211
211
|
end
|
212
212
|
|
213
213
|
##@param[Array] data : array of objects.
|
@@ -14,6 +14,14 @@ class AstmServer
|
|
14
14
|
$redis.zadd("ruby_astm_log",Time.now.to_i,message)
|
15
15
|
end
|
16
16
|
|
17
|
+
def self.root_path
|
18
|
+
File.dirname __dir__
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.default_mappings
|
22
|
+
File.join AstmServer.root_path, "../","mappings.json"
|
23
|
+
end
|
24
|
+
|
17
25
|
$ENQ = "[5]"
|
18
26
|
$start_text = "[2]"
|
19
27
|
$end_text = "[3]"
|
@@ -26,7 +34,7 @@ class AstmServer
|
|
26
34
|
self.server_ip = server_ip || "127.0.0.1"
|
27
35
|
self.server_port = server_port || 3000
|
28
36
|
self.respond_to_queries = respond_to_queries
|
29
|
-
$mappings = JSON.parse(IO.read(mpg ||
|
37
|
+
$mappings = JSON.parse(IO.read(mpg || AstmServer.default_mappings))
|
30
38
|
end
|
31
39
|
|
32
40
|
def start_server
|