relaton-bib 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/relaton_bib/bibliographic_item.rb +6 -1
- data/lib/relaton_bib/typed_uri.rb +7 -4
- data/lib/relaton_bib/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: 4a814c793e3b49cb28bde037781d8343d8d336ded06282a3103be503c5db54f1
|
4
|
+
data.tar.gz: 265ac2fdde0771e01c9730a9c3bdf3af7b272340fc7a2295098fcfea1bb92d9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 655c27d5d4f8977d2d0a50a2c7b09ea20e6d8f97089fbbb1b89b9f882e2a28b08d308622c080888e2b8ab2e7650516b1cf2d8dc26ed607bb777a114f288e20af
|
7
|
+
data.tar.gz: e23563ef7106393b9dd38e8980914c7b72e611257d9887d3ca42fe0e00bcfef74ca593e5ab5c67ad41b743deebbb715766ac950aad12e5815f44beb2386a3d2c
|
@@ -217,7 +217,12 @@ module RelatonBib
|
|
217
217
|
@script = args.fetch :script, []
|
218
218
|
@status = args[:docstatus]
|
219
219
|
@relation = DocRelationCollection.new(args[:relation] || [])
|
220
|
-
@link = args.fetch(:link, []).map
|
220
|
+
@link = args.fetch(:link, []).map do |s|
|
221
|
+
if s.is_a?(Hash) then TypedUri.new(s)
|
222
|
+
elsif s.is_a?(String) then TypedUri.new(content: s)
|
223
|
+
else s
|
224
|
+
end
|
225
|
+
end
|
221
226
|
@series = args.fetch :series, []
|
222
227
|
@medium = args[:medium]
|
223
228
|
@place = args.fetch(:place, []).map { |pl| pl.is_a?(String) ? Place.new(name: pl) : pl }
|
@@ -8,9 +8,9 @@ module RelatonBib
|
|
8
8
|
# @retutn [URI]
|
9
9
|
attr_reader :content
|
10
10
|
|
11
|
-
# @param type [String] src/obp/rss
|
11
|
+
# @param type [String, NilClass] src/obp/rss
|
12
12
|
# @param content [String]
|
13
|
-
def initialize(type
|
13
|
+
def initialize(type: nil, content:)
|
14
14
|
@type = type
|
15
15
|
@content = Addressable::URI.parse content if content
|
16
16
|
end
|
@@ -22,12 +22,15 @@ module RelatonBib
|
|
22
22
|
|
23
23
|
# @param builder [Nokogiri::XML::Builder]
|
24
24
|
def to_xml(builder)
|
25
|
-
builder.uri
|
25
|
+
doc = builder.uri content.to_s
|
26
|
+
doc[:type] = type if type
|
26
27
|
end
|
27
28
|
|
28
29
|
# @return [Hash]
|
29
30
|
def to_hash
|
30
|
-
|
31
|
+
hash = { "content" => content.to_s }
|
32
|
+
hash["type"] = type.to_s if type
|
33
|
+
hash
|
31
34
|
end
|
32
35
|
end
|
33
36
|
end
|
data/lib/relaton_bib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-bib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: debase
|