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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 129e5b8dae43ccfec1c2ad27e1387f98359d2159
4
- data.tar.gz: 449bfcc75179a735d13e12f1a51a4ccbb9f59e62
3
+ metadata.gz: 842286467b059daf0900a6fcf8e4eb268c312d30
4
+ data.tar.gz: f8c9fe3d6f956160469ab440a05dde9668186908
5
5
  SHA512:
6
- metadata.gz: 28ce7bd7ee9db13a484623e40209bff9a390b94cb4d4b1f363945377e98dfef0453bd258fd0a13f64e8015632d342c75b5fde0ebe0102a8626baa9c4d60d9042
7
- data.tar.gz: 55c3f8d4532f88b82d90597eebda5f30e1564a1a13524e40f7c94ed9029c9b0064fceeee62a8922889f2c39cf7ff599f33c08a4bbe06484a250ff8f8d9173364
6
+ metadata.gz: 2127234e9e8bfd786a4e00bba25b0eb67f5e2d60acc709fe5868c5137edae77b60e8ea458f43767fda88467241166cf9e33da8a3d82eaade538b56f730414089
7
+ data.tar.gz: 4bc8ae6b1a863234dd750fd02d11d5656a4686eb6f254d831cedd2533ea225d1804e82a6ced3c243ff528d8337a0095a7536163ee88218d78d1fbe55a311c35d
@@ -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 || ("mappings.json")))
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 || ("mappings.json")))
37
+ $mappings = JSON.parse(IO.read(mpg || AstmServer.default_mappings))
30
38
  end
31
39
 
32
40
  def start_server
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: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bhargav Raut