relaton-bib 0.3.12 → 0.4.0

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: d9629f3a155e7b1e9ffd45fb5e4ecd369a7fa3068f7c635290b9757e52f437ad
4
- data.tar.gz: 2e7592910a8563d3f4a231a9856a779a3c3d9ffc3a719030e3f1687413f82d85
3
+ metadata.gz: 1895db87e6e6d010858802f4ff11b7b948b0b0474bfc3eefbbce32e5f3dcd105
4
+ data.tar.gz: 20320ba0d5ccf314fe1d92225efde5e3162b9b0325878bfd1e3305a2c0a66416
5
5
  SHA512:
6
- metadata.gz: b230bc556b2b9fcdffa2db61c3c2b715b7e4a1c8d368d584682bdcbc8e5208fedbe3727130238fd875970d1663b4bbd1a4b6e372797ce4fcacc5ec1f890f1edc
7
- data.tar.gz: 5f54f308c4040424e26c8a96f44f8299394cd82fa37d145832828eb4eb7c5db05472a458504f584885ddb3c642a86a9563e537be990842dd08eede85a8c24d46
6
+ metadata.gz: fe2a6ec289e51ed504e3fd206b623ce81c57a942276070a505de3642b45705f3aea5dfb8f6aa6feaf2e7f3d460db1498c6871498c208043213a6154f7f375eb1
7
+ data.tar.gz: 1fc4a93c85b30c432750df1e6611a88eb2f3e9ecb701af1d7a149abb59c6d7ce999b89fbbb2374ea95f5ac47c93022d48bba3d9f65f7c6e860ef3be2062b48e1
@@ -12,7 +12,9 @@ jobs:
12
12
  matrix:
13
13
  ruby: [ '2.6', '2.5', '2.4' ]
14
14
  steps:
15
- - uses: actions/checkout@master
15
+ - uses: actions/checkout@v1
16
+ with:
17
+ submodules: recursive
16
18
  - name: Use Ruby
17
19
  uses: actions/setup-ruby@v1
18
20
  with:
@@ -12,7 +12,9 @@ jobs:
12
12
  matrix:
13
13
  ruby: [ '2.6', '2.5', '2.4' ]
14
14
  steps:
15
- - uses: actions/checkout@master
15
+ - uses: actions/checkout@v1
16
+ with:
17
+ submodules: recursive
16
18
  - name: Use Ruby
17
19
  uses: actions/setup-ruby@v1
18
20
  with:
@@ -12,7 +12,9 @@ jobs:
12
12
  matrix:
13
13
  ruby: [ '2.6', '2.5', '2.4' ]
14
14
  steps:
15
- - uses: actions/checkout@master
15
+ - uses: actions/checkout@v1
16
+ with:
17
+ submodules: recursive
16
18
  - name: Use Ruby
17
19
  uses: actions/setup-ruby@v1
18
20
  with:
data/.gitmodules ADDED
@@ -0,0 +1,6 @@
1
+ [submodule "metanorma-model-iso"]
2
+ path = metanorma-model-iso
3
+ url = https://github.com/metanorma/metanorma-model-iso
4
+ [submodule "relaton-models"]
5
+ path = relaton-models
6
+ url = https://github.com/relaton/relaton-models
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- relaton-bib (0.3.12)
4
+ relaton-bib (0.4.0)
5
5
  addressable
6
6
  nokogiri
7
7
 
@@ -22,6 +22,7 @@ GEM
22
22
  mini_portile2 (2.4.0)
23
23
  nokogiri (1.10.3)
24
24
  mini_portile2 (~> 2.4.0)
25
+ optout (0.0.2)
25
26
  public_suffix (4.0.1)
26
27
  rake (10.5.0)
27
28
  rspec (3.8.0)
@@ -39,6 +40,8 @@ GEM
39
40
  rspec-support (3.8.2)
40
41
  ruby-debug-ide (0.7.0)
41
42
  rake (>= 0.8.1)
43
+ ruby-jing (0.0.1)
44
+ optout (>= 0.0.2)
42
45
  simplecov (0.17.0)
43
46
  docile (~> 1.1)
44
47
  json (>= 1.8, < 3)
@@ -57,7 +60,8 @@ DEPENDENCIES
57
60
  relaton-bib!
58
61
  rspec (~> 3.0)
59
62
  ruby-debug-ide
63
+ ruby-jing
60
64
  simplecov
61
65
 
62
66
  BUNDLED WITH
63
- 2.0.1
67
+ 2.0.2
@@ -37,10 +37,9 @@ module RelatonBib
37
37
 
38
38
  # @param builder [Nokogiri::XML::Builder]
39
39
  def to_xml(builder)
40
- builder.locality(type: type) do
41
- builder.referenceFrom reference_from # { reference_from.to_xml(builder) }
42
- builder.referenceTo reference_to if reference_to
43
- end
40
+ builder.parent[:type] = type
41
+ builder.referenceFrom reference_from # { reference_from.to_xml(builder) }
42
+ builder.referenceTo reference_to if reference_to
44
43
  end
45
44
 
46
45
  # @return [Hash]
@@ -350,7 +350,7 @@ module RelatonBib
350
350
  series.each { |s| s.to_xml builder }
351
351
  medium&.to_xml builder
352
352
  place.each { |pl| builder.place pl }
353
- extent.each { |e| e.to_xml builder }
353
+ extent.each { |e| builder.extent { e.to_xml builder } }
354
354
  accesslocation.each { |al| builder.accesslocation al }
355
355
  classification&.to_xml builder
356
356
  validity&.to_xml builder
@@ -64,7 +64,8 @@ module RelatonBib
64
64
  # @return [String]
65
65
  attr_reader :value
66
66
 
67
- # @param phone [String]
67
+ # @param type [String] allowed "phone", "email" or "uri"
68
+ # @param value [String]
68
69
  def initialize(type:, value:)
69
70
  @type = type
70
71
  @value = value
@@ -45,7 +45,7 @@ module RelatonBib
45
45
  builder.relation(type: type) do
46
46
  bibitem.to_xml(builder, **opts.merge(embedded: true))
47
47
  bib_locality.each do |l|
48
- l.to_xml builder
48
+ builder.locality { l.to_xml builder }
49
49
  end
50
50
  end
51
51
  end
@@ -51,10 +51,10 @@ module RelatonBib
51
51
  builder.completename { completename.to_xml builder }
52
52
  else
53
53
  prefix.each { |p| builder.prefix { p.to_xml builder } }
54
+ forename.each { |f| builder.forename { f.to_xml builder } }
54
55
  initial.each { |i| builder.initial { i.to_xml builder } }
55
- addition.each { |a| builder.addition { a.to_xml builder } }
56
56
  builder.surname { surname.to_xml builder }
57
- forename.each { |f| builder.forename { f.to_xml builder } }
57
+ addition.each { |a| builder.addition { a.to_xml builder } }
58
58
  end
59
59
  end
60
60
  end
@@ -25,7 +25,7 @@ module RelatonBib
25
25
  builder.validity do
26
26
  builder.validityBegins begins.strftime(FORMAT) if begins
27
27
  builder.validityEnds ends.strftime(FORMAT) if ends
28
- builder.validityRevision revision.strftime(FORMAT) if revision
28
+ builder.revision revision.strftime(FORMAT) if revision
29
29
  end
30
30
  end
31
31
 
@@ -1,3 +1,3 @@
1
1
  module RelatonBib
2
- VERSION = "0.3.12".freeze
2
+ VERSION = "0.4.0".freeze
3
3
  end
@@ -105,7 +105,7 @@ module RelatonBib
105
105
  end
106
106
 
107
107
  def fetch_extent(item)
108
- item.xpath("./locality").map do |ex|
108
+ item.xpath("./extent").map do |ex|
109
109
  BibItemLocality.new(
110
110
  ex[:type], ex.at("referenceFrom")&.text, ex.at("referenceTo")&.text
111
111
  )
@@ -125,7 +125,7 @@ module RelatonBib
125
125
 
126
126
  begins = (b = vl.at("validityBegins")) ? Time.strptime(b.text, "%Y-%m-%d %H:%M") : nil
127
127
  ends = (e = vl.at("validityEnds")) ? Time.strptime(e.text, "%Y-%m-%d %H:%M") : nil
128
- revision = (r = vl.at("validityRevision")) ? Time.strptime(r.text, "%Y-%m-%d %H:%M") : nil
128
+ revision = (r = vl.at("revision")) ? Time.strptime(r.text, "%Y-%m-%d %H:%M") : nil
129
129
  Validity.new begins: begins, ends: ends, revision: revision
130
130
  end
131
131
 
data/relaton-bib.gemspec CHANGED
@@ -29,6 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.add_development_dependency "rake", "~> 10.0"
30
30
  spec.add_development_dependency "rspec", "~> 3.0"
31
31
  spec.add_development_dependency "ruby-debug-ide"
32
+ spec.add_development_dependency "ruby-jing"
32
33
  spec.add_development_dependency "simplecov"
33
34
  spec.add_development_dependency "byebug"
34
35
 
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.3.12
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-31 00:00:00.000000000 Z
11
+ date: 2019-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: ruby-jing
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: simplecov
99
113
  requirement: !ruby/object:Gem::Requirement
@@ -161,6 +175,7 @@ files:
161
175
  - ".github/workflows/ubuntu.yml"
162
176
  - ".github/workflows/windows.yml"
163
177
  - ".gitignore"
178
+ - ".gitmodules"
164
179
  - ".rspec"
165
180
  - ".rubocop.yml"
166
181
  - Gemfile