pubid-core 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pubid/core/identifier.rb +11 -1
- data/lib/pubid/core/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: 5961503e7e921ca44202798588badd95d5977fd62fbf98275777770439b5da17
|
4
|
+
data.tar.gz: 2840650728ca920a51a615d2ee81e2884607e485e7740fdd4fc4279cb34cb6fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a956ff7eb7a323b86e3c8656e4396d0c8af503a89f05c96dbd9ff3cc37ec1f6f43ae8a1111eb6c1437b98d3a846f62e0a72b658e2d89a207099351327953c2e
|
7
|
+
data.tar.gz: d55c54c9dc464c01af7bda543bf482d82472ab169101759b510793824e4ee963725e43fe5a486c05627f886f0111e7525fff05d1bd3beafe7612dbe93abe2b87
|
@@ -56,8 +56,18 @@ module Pubid::Core
|
|
56
56
|
Transformer
|
57
57
|
end
|
58
58
|
|
59
|
+
def update_old_code(code)
|
60
|
+
return code unless defined?(UPDATE_CODES)
|
61
|
+
|
62
|
+
UPDATE_CODES.each do |from, to|
|
63
|
+
code = code.gsub(from.match?(/^\/.*\/$/) ? Regexp.new(from[1..-2]) : /^#{Regexp.escape(from)}$/, to)
|
64
|
+
end
|
65
|
+
code
|
66
|
+
end
|
67
|
+
|
59
68
|
def parse(code_or_params)
|
60
|
-
params = code_or_params.is_a?(String) ?
|
69
|
+
params = code_or_params.is_a?(String) ?
|
70
|
+
get_parser_class.new.parse(update_old_code(code_or_params)) : code_or_params
|
61
71
|
# Parslet returns an array when match any copublisher
|
62
72
|
# otherwise it's hash
|
63
73
|
if params.is_a?(Array)
|
data/lib/pubid/core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pubid-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|