relaton-index 0.2.5 → 0.2.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 505b5d0118ee9844e1486dff3fbd57c1ceec35d609ca022dcb5ba4f121e3c7db
4
- data.tar.gz: d9c7dd287a036fd2d939cf5d9a5ec6193408fc2c1de24aaa465aa38e2d8ed876
3
+ metadata.gz: bf7b77a3f6cba821dfa2cff1ebed3ac0462c13620387f6498f6bf85603cc8224
4
+ data.tar.gz: dd0ff5e5da00c7797f71323b65728b80c7d70ed7f348c59ba7d06d59d89e57eb
5
5
  SHA512:
6
- metadata.gz: fb4cd48d2db8361dbcd8414ce8512e3dc1fe618d16e1d82ac1da53b05b3a505980d691a5a0f0f8cc09856ab38029256bd5e0ca413f7d26f7a8897ca89b9aba17
7
- data.tar.gz: 9155e1925e674e35a7ee889bb8467c5cb21dcbf7394ba87650ed70f856725431784b6ad90e2433b8250cc61362c742acae9d5523b40d99865a7a3af5f771ed76
6
+ metadata.gz: a6aeaa0052cd0c80ccef916c6c56aa09d6aea73f814630a7b0f57a3f267538a636a05e572cff8130571ee34b37f59b0851d07f3940ea0496aa13d823c978aa02
7
+ data.tar.gz: e5e91870084bd6062faac4a8f705fbd74379353e759cf00eeebd93b0200ff0bf92124c2ef0c5144da00323b62eed30f086e42019a83782d4bc2cecab7a41a581
@@ -76,10 +76,12 @@ module Relaton
76
76
  # @return [Boolean] <description>
77
77
  #
78
78
  def check_format(index)
79
- cehck_basic_format(index) && check_id_format(index)
79
+ check_basic_format(index) && check_id_format(index)
80
80
  end
81
81
 
82
- def cehck_basic_format(index)
82
+ def check_basic_format(index)
83
+ return false unless index.is_a? Array
84
+
83
85
  keys = %i[file id]
84
86
  index.all? { |item| item.respond_to?(:keys) && item.keys.sort == keys }
85
87
  end
@@ -111,11 +113,11 @@ module Relaton
111
113
  end
112
114
 
113
115
  def warn_local_index_error(reason)
114
- warn "[relaton] #{reason} file #{file}"
116
+ warn "[relaton-#{@dir}] #{reason} file #{file}"
115
117
  if url.is_a? String
116
- warn "[relaton] Considering #{file} file corrupt, re-downloading from #{url}"
118
+ warn "[relaton-#{@dir}] Considering #{file} file corrupt, re-downloading from #{url}"
117
119
  else
118
- warn "[relaton] Considering #{file} file corrupt, removing it."
120
+ warn "[relaton-#{@dir}] Considering #{file} file corrupt, removing it."
119
121
  remove
120
122
  end
121
123
  end
@@ -131,7 +133,7 @@ module Relaton
131
133
  entry = zip.get_next_entry
132
134
  index = YAML.safe_load(entry.get_input_stream.read, permitted_classes: [Symbol])
133
135
  save index
134
- warn "[relaton] Downloaded index from #{url}"
136
+ warn "[relaton-#{@dir}] Downloaded index from #{url}"
135
137
  return index if check_format index
136
138
 
137
139
  warn_remote_index_error "Wrong structure of"
@@ -140,7 +142,7 @@ module Relaton
140
142
  end
141
143
 
142
144
  def warn_remote_index_error(reason)
143
- warn "[relaton] #{reason} newly downloaded file " \
145
+ warn "[relaton-#{@dir}] #{reason} newly downloaded file " \
144
146
  "at #{file} #{url}, the remote index seems to be invalid." \
145
147
  "Please report this issue at https://github.com/relaton/relaton-cli."
146
148
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Relaton
4
4
  module Index
5
- VERSION = "0.2.5"
5
+ VERSION = "0.2.7"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-index
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-06-14 00:00:00.000000000 Z
11
+ date: 2023-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip