relaton-index 0.2.4 → 0.2.5
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/relaton/index/file_io.rb +25 -1
- data/lib/relaton/index/version.rb +1 -1
- 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: 505b5d0118ee9844e1486dff3fbd57c1ceec35d609ca022dcb5ba4f121e3c7db
|
4
|
+
data.tar.gz: d9c7dd287a036fd2d939cf5d9a5ec6193408fc2c1de24aaa465aa38e2d8ed876
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb4cd48d2db8361dbcd8414ce8512e3dc1fe618d16e1d82ac1da53b05b3a505980d691a5a0f0f8cc09856ab38029256bd5e0ca413f7d26f7a8897ca89b9aba17
|
7
|
+
data.tar.gz: 9155e1925e674e35a7ee889bb8467c5cb21dcbf7394ba87650ed70f856725431784b6ad90e2433b8250cc61362c742acae9d5523b40d99865a7a3af5f771ed76
|
@@ -104,7 +104,20 @@ module Relaton
|
|
104
104
|
|
105
105
|
index = YAML.safe_load yaml, permitted_classes: [Symbol]
|
106
106
|
return index if check_format index
|
107
|
+
|
108
|
+
warn_local_index_error "Wrong structure of the"
|
107
109
|
rescue Psych::SyntaxError
|
110
|
+
warn_local_index_error "YAML parsing error when reading"
|
111
|
+
end
|
112
|
+
|
113
|
+
def warn_local_index_error(reason)
|
114
|
+
warn "[relaton] #{reason} file #{file}"
|
115
|
+
if url.is_a? String
|
116
|
+
warn "[relaton] Considering #{file} file corrupt, re-downloading from #{url}"
|
117
|
+
else
|
118
|
+
warn "[relaton] Considering #{file} file corrupt, removing it."
|
119
|
+
remove
|
120
|
+
end
|
108
121
|
end
|
109
122
|
|
110
123
|
#
|
@@ -118,7 +131,18 @@ module Relaton
|
|
118
131
|
entry = zip.get_next_entry
|
119
132
|
index = YAML.safe_load(entry.get_input_stream.read, permitted_classes: [Symbol])
|
120
133
|
save index
|
121
|
-
index
|
134
|
+
warn "[relaton] Downloaded index from #{url}"
|
135
|
+
return index if check_format index
|
136
|
+
|
137
|
+
warn_remote_index_error "Wrong structure of"
|
138
|
+
rescue Psych::SyntaxError
|
139
|
+
warn_remote_index_error "YAML parsing error when reading"
|
140
|
+
end
|
141
|
+
|
142
|
+
def warn_remote_index_error(reason)
|
143
|
+
warn "[relaton] #{reason} newly downloaded file " \
|
144
|
+
"at #{file} #{url}, the remote index seems to be invalid." \
|
145
|
+
"Please report this issue at https://github.com/relaton/relaton-cli."
|
122
146
|
end
|
123
147
|
|
124
148
|
#
|