relaton 1.0.1 → 1.0.2
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/db.rb +1 -1
- data/lib/relaton/db_cache.rb +16 -14
- data/lib/relaton/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ef8be5b24a3eccd56e2682afb69d1e7e810bfd67068d9e3c6bd875603777650
|
4
|
+
data.tar.gz: ac234a78943683f1b7d18bb5df3139eefe214f4f842dd0567f1646200ca7ee36
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 493e4ed525d7c34e23aa20ab2271c69d3f41b7b3a007dd7981f7549810c1d13960a069c0bc46e195da5e97c38cc739cc3a36c56cbe10f74e0b25f5bc51f8c250
|
7
|
+
data.tar.gz: 2607311660b450c97b903f48621ef97e748c477083c772430753569fe4b4eb1366710ca2724b14a42f96148a1bb6cfa4962453f0ad1f14b3683a58f28e63c35a
|
data/lib/relaton/db.rb
CHANGED
@@ -123,7 +123,7 @@ module Relaton
|
|
123
123
|
# @return [Array]
|
124
124
|
def strip_id_wrapper(code, stdclass)
|
125
125
|
prefix = @registry.processors[stdclass].prefix
|
126
|
-
code = code.sub(/^#{prefix}\((.+)\)$/, "\\1")
|
126
|
+
code = code.sub(/\u2013/, "-").sub(/^#{prefix}\((.+)\)$/, "\\1")
|
127
127
|
[prefix, code]
|
128
128
|
end
|
129
129
|
|
data/lib/relaton/db_cache.rb
CHANGED
@@ -24,15 +24,19 @@ module Relaton
|
|
24
24
|
end
|
25
25
|
|
26
26
|
prefix_dir = "#{@dir}/#{prefix(key)}"
|
27
|
-
unless Dir.exist? prefix_dir
|
28
|
-
FileUtils::mkdir_p prefix_dir
|
29
|
-
end
|
27
|
+
FileUtils::mkdir_p prefix_dir unless Dir.exist? prefix_dir
|
30
28
|
set_version prefix_dir
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
29
|
+
File.write "#{filename(key)}.#{ext(value)}", value, encoding: "utf-8"
|
30
|
+
end
|
31
|
+
|
32
|
+
# @param value [String]
|
33
|
+
# @return [String]
|
34
|
+
def ext(value)
|
35
|
+
case value
|
36
|
+
when /^not_found/ then "notfound"
|
37
|
+
when /^redirection/ then "redirect"
|
38
|
+
else @ext
|
39
|
+
end
|
36
40
|
end
|
37
41
|
|
38
42
|
# Read item
|
@@ -163,7 +167,8 @@ module Relaton
|
|
163
167
|
end
|
164
168
|
|
165
169
|
#
|
166
|
-
# Checks if there is file with xml or txt extension and return filename with
|
170
|
+
# Checks if there is file with xml or txt extension and return filename with
|
171
|
+
# the extension.
|
167
172
|
#
|
168
173
|
# @param file [String]
|
169
174
|
# @return [String, NilClass]
|
@@ -181,9 +186,6 @@ module Relaton
|
|
181
186
|
# @param key [String]
|
182
187
|
# @return [String]
|
183
188
|
def prefix(key)
|
184
|
-
# @registry.processors.detect do |_n, p|
|
185
|
-
# /^#{p.prefix}/.match(key) || processor.defaultprefix.match(key)
|
186
|
-
# end[1].prefix.downcase
|
187
189
|
key.downcase.match(/^[^\(]+(?=\()/).to_s
|
188
190
|
end
|
189
191
|
|
@@ -204,8 +206,8 @@ module Relaton
|
|
204
206
|
public
|
205
207
|
|
206
208
|
# Initialse and return relaton instance, with local and global cache names
|
207
|
-
# local_cache: local cache name; none created if nil; "relaton" created
|
208
|
-
# global_cache: boolean to create global_cache
|
209
|
+
# local_cache: local cache name; none created if nil; "relaton" created
|
210
|
+
# if empty global_cache: boolean to create global_cache
|
209
211
|
# flush_caches: flush caches
|
210
212
|
def init_bib_caches(opts)
|
211
213
|
globalname = global_bibliocache_name if opts[:global_cache]
|
data/lib/relaton/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: relaton-calconnect
|