aac-metrics 0.0.7 → 0.0.8
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 +4 -4
- data/lib/aac-metrics/loader.rb +6 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 232fdb645ff973e962d8d09436a62df3e27e3071485e1172e8becbbacff541f3
|
4
|
+
data.tar.gz: a6d1e087067944672607bb05db23a5168c0e5886323bff893f3643f62dcee384
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7562db43f8f571898386244f7332b5ba85450645aae967e64501df4b123af8ccccacbc3e00e4a028bbe8b4d50f580362e3af7d0c9617fccd6084fbbc15d861d
|
7
|
+
data.tar.gz: 28da1194d1f57261f54e8438905dea89d4b9607acd2bc23ebcd8ec3be38257130cb0a8849d7f76c761ace088022d1be5fa6a2700751bc0c405a49faaaba9b20c
|
data/lib/aac-metrics/loader.rb
CHANGED
@@ -69,7 +69,7 @@ module AACMetrics::Loader
|
|
69
69
|
json
|
70
70
|
end
|
71
71
|
|
72
|
-
def self.process(fn, token=nil)
|
72
|
+
def self.process(fn, token=nil, add_words=false)
|
73
73
|
paths = [fn]
|
74
74
|
boards = []
|
75
75
|
visited_paths = {}
|
@@ -135,8 +135,10 @@ module AACMetrics::Loader
|
|
135
135
|
if str.scan(/\s+/).length < 2
|
136
136
|
word_hash = Digest::MD5.hexdigest(str)[0, 10]
|
137
137
|
raise "collision!" if words[word_hash] && words[word_hash] != str
|
138
|
-
words[word_hash]
|
139
|
-
|
138
|
+
if add_words || words[word_hash]
|
139
|
+
words[word_hash] = str
|
140
|
+
new_btn['label'] = "$#{word_hash}"
|
141
|
+
end
|
140
142
|
end
|
141
143
|
end
|
142
144
|
btn_idx += 1
|
@@ -192,7 +194,7 @@ module AACMetrics::Loader
|
|
192
194
|
boards = retrieve(fn, false)
|
193
195
|
output = fn
|
194
196
|
else
|
195
|
-
content = process(fn, token)
|
197
|
+
content = process(fn, token, true)
|
196
198
|
boards = content[:boards]
|
197
199
|
words = content[:words]
|
198
200
|
words_path = content[:words_path]
|