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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d699c8f7630bd78527f5b6af45de122d212b2b0aeaf6bab74c419413177b68e2
4
- data.tar.gz: f2c1e08cc99f5fc8125bfe95c390e3ecf8e7db7a9231bcbd9570ace42bce7213
3
+ metadata.gz: 4a814c793e3b49cb28bde037781d8343d8d336ded06282a3103be503c5db54f1
4
+ data.tar.gz: 265ac2fdde0771e01c9730a9c3bdf3af7b272340fc7a2295098fcfea1bb92d9a
5
5
  SHA512:
6
- metadata.gz: 187e612af0116057862eb237a9e65dfa7f44479646d4851fc6957d14b560ecedf7db65ef878a91406ae82c8716d9bcd6b41fa238c428ae993c687ad2ea3f7aca
7
- data.tar.gz: f8e9ccdf0fc71f1cefde163d620db1c39a693d40737b336232f3388f2e69bbe8a4cbdea6a3adb4c703aded1f43eff9d0edb0b63b9701d01f625079a079ff773c
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 { |s| s.is_a?(Hash) ? TypedUri.new(s) : s }
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:, content:)
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(content.to_s, type: type)
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
- { "type" => type, "content" => content.to_s }
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
@@ -1,3 +1,3 @@
1
1
  module RelatonBib
2
- VERSION = "0.9.0".freeze
2
+ VERSION = "0.9.1".freeze
3
3
  end
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.0
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-30 00:00:00.000000000 Z
11
+ date: 2020-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debase