annotations2triannon 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/annotations2triannon.gemspec +1 -1
- data/bin/dms.rb +17 -5
- 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: 54f2c2055aa2445af8a1f5693c49240c2e363502
|
4
|
+
data.tar.gz: 5d8c7509a83581b8cd07254b60158fd5febeda90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a5a3d420dd423bb37626d02448be680c917f7d01837e86f0ec23502ee1367f2f5096863dc86d4dbb6b27f80b298b9208ed84a8857df606c6e03f3c41e35eb86
|
7
|
+
data.tar.gz: bc43fe06a962a028f9dfdf5d4c151f68e3ea63f17073df45aedba769e1a8361d5fc9f3e69aa2aeb22db72f13778a575457d4dd214ba1db7ccb592b5e74d7cdb3
|
data/bin/dms.rb
CHANGED
@@ -64,18 +64,30 @@ ANNO_TRACKING_FILE = File.join(CONFIG.log_path, 'dms_annotation_tracking.json')
|
|
64
64
|
# persist the anno_tracking data to a file
|
65
65
|
# @param anno_data [Hash]
|
66
66
|
def anno_tracking_save(anno_data)
|
67
|
-
|
68
|
-
|
67
|
+
begin
|
68
|
+
dump_json(ANNO_TRACKING_FILE, anno_data)
|
69
|
+
puts "Annotation records updated in: #{ANNO_TRACKING_FILE}"
|
70
|
+
rescue
|
71
|
+
msg = "FAILURE to save annotation tracking file #{ANNO_TRACKING_FILE}"
|
72
|
+
CONFIG.logger.error(msg)
|
73
|
+
end
|
69
74
|
end
|
70
75
|
|
71
76
|
# retrieve the anno_tracking data from a file
|
72
77
|
# @returns anno_data [Hash]
|
73
78
|
def anno_tracking_load
|
74
|
-
|
75
|
-
|
76
|
-
|
79
|
+
data = {}
|
80
|
+
begin
|
81
|
+
if File.exists? ANNO_TRACKING_FILE
|
82
|
+
if File.size(ANNO_TRACKING_FILE).to_i > 0
|
83
|
+
data = JSON.parse( File.read(ANNO_TRACKING_FILE) )
|
84
|
+
end
|
77
85
|
end
|
86
|
+
rescue
|
87
|
+
msg = "FAILURE to load annotation tracking file #{ANNO_TRACKING_FILE}"
|
88
|
+
CONFIG.logger.error(msg)
|
78
89
|
end
|
90
|
+
return data
|
79
91
|
end
|
80
92
|
|
81
93
|
|