relaton-ogc 1.4.0 → 1.6.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/macos.yml +2 -0
- data/grammars/isodoc.rng +7 -1
- data/grammars/ogc.rng +7 -0
- data/lib/relaton_ogc/hit_collection.rb +8 -3
- data/lib/relaton_ogc/ogc_bibliographic_item.rb +6 -3
- data/lib/relaton_ogc/ogc_bibliography.rb +2 -2
- data/lib/relaton_ogc/version.rb +1 -1
- data/relaton_ogc.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3487044fb3801af6c296c4a68993b4810da56d51c70aaae849e905f133995467
|
4
|
+
data.tar.gz: 9b2090662526e3af7bb5ceccd4c7439dabf78881a0bb83d8115d95cd677713d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 660c7b886d72f716a4c3f9b2797f1254615785b0d184fb030eeb348de802d0fc11889e21efa311052c9fbb4b275998d93d4faf65841b58d541ce14f5dbbc0e76
|
7
|
+
data.tar.gz: 852ad063d378e0d23b7de6301b00b5755dc2e8657028375662efd850b4d63acccaae5d78e8835cf0e845567e79a1d7c5816101a40f8063c240c790c1ec159486
|
data/.github/workflows/macos.yml
CHANGED
@@ -26,6 +26,8 @@ jobs:
|
|
26
26
|
- name: Update gems
|
27
27
|
run: |
|
28
28
|
sudo gem install bundler --force
|
29
|
+
ruby -v | grep 2.5 && bundle config set build.debase --with-cflags="-Wno-error=implicit-function-declaration"
|
30
|
+
ruby -v | grep 2.5 && bundle config set build.ruby-debug-ide --with-cflags="-Wno-error=implicit-function-declaration"
|
29
31
|
bundle install --jobs 4 --retry 3
|
30
32
|
- name: Run specs
|
31
33
|
run: |
|
data/grammars/isodoc.rng
CHANGED
@@ -42,7 +42,6 @@
|
|
42
42
|
</define>
|
43
43
|
<define name="xref">
|
44
44
|
<element name="xref">
|
45
|
-
<!-- attribute target { xsd:IDREF }, -->
|
46
45
|
<attribute name="target">
|
47
46
|
<data type="string">
|
48
47
|
<param name="pattern">\i\c*|\c+#\c+</param>
|
@@ -864,6 +863,13 @@
|
|
864
863
|
</define>
|
865
864
|
<define name="standard-document">
|
866
865
|
<element name="standard-document">
|
866
|
+
<attribute name="version"/>
|
867
|
+
<attribute name="type">
|
868
|
+
<choice>
|
869
|
+
<value>semantic</value>
|
870
|
+
<value>presentation</value>
|
871
|
+
</choice>
|
872
|
+
</attribute>
|
867
873
|
<ref name="bibdata"/>
|
868
874
|
<optional>
|
869
875
|
<ref name="boilerplate"/>
|
data/grammars/ogc.rng
CHANGED
@@ -104,6 +104,13 @@
|
|
104
104
|
</define>
|
105
105
|
<define name="ogc-standard">
|
106
106
|
<element name="ogc-standard">
|
107
|
+
<attribute name="version"/>
|
108
|
+
<attribute name="type">
|
109
|
+
<choice>
|
110
|
+
<value>semantic</value>
|
111
|
+
<value>presentation</value>
|
112
|
+
</choice>
|
113
|
+
</attribute>
|
107
114
|
<ref name="bibdata"/>
|
108
115
|
<zeroOrMore>
|
109
116
|
<ref name="termdocsource"/>
|
@@ -52,10 +52,15 @@ module RelatonOgc
|
|
52
52
|
#
|
53
53
|
# fetch data form server and save it to file.
|
54
54
|
#
|
55
|
-
def fetch_data
|
56
|
-
|
55
|
+
def fetch_data # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
|
56
|
+
h = {}
|
57
|
+
h["If-None-Match"] = etag if etag
|
58
|
+
resp = Faraday.new(ENDPOINT, headers: h).get
|
57
59
|
# return if there aren't any changes since last fetching
|
58
|
-
|
60
|
+
return if resp.status == 304
|
61
|
+
unless resp.status == 200
|
62
|
+
raise RelatonBib::RequestError, "Could not access #{ENDPOINT}"
|
63
|
+
end
|
59
64
|
|
60
65
|
FileUtils.mkdir_p DATADIR unless Dir.exist? DATADIR
|
61
66
|
self.etag = resp[:etag]
|
@@ -36,11 +36,14 @@ module RelatonOgc
|
|
36
36
|
hash
|
37
37
|
end
|
38
38
|
|
39
|
-
# @param builder [Nokogiri::XML::Builder]
|
40
39
|
# @param opts [Hash]
|
40
|
+
# @option opts [Nokogiri::XML::Builder] :builder XML builder
|
41
41
|
# @option opts [Boolean] :bibdata
|
42
|
-
|
43
|
-
|
42
|
+
# @option opts [Symbol, NilClass] :date_format (:short), :full
|
43
|
+
# @option opts [String, Symbol] :lang language
|
44
|
+
# @return [String] XML
|
45
|
+
def to_xml(**opts)
|
46
|
+
super **opts do |b|
|
44
47
|
b.ext do
|
45
48
|
b.doctype doctype if doctype
|
46
49
|
b.docsubtype docsubtype if docsubtype
|
@@ -54,9 +54,9 @@ module RelatonOgc
|
|
54
54
|
return { ret: item } if !year
|
55
55
|
|
56
56
|
item.date.select { |d| d.type == "published" }.each do |d|
|
57
|
-
return { ret: item } if year.to_i == d.on
|
57
|
+
return { ret: item } if year.to_i == d.on(:year)
|
58
58
|
|
59
|
-
missed_years << d.on
|
59
|
+
missed_years << d.on(:year)
|
60
60
|
end
|
61
61
|
end
|
62
62
|
{ years: missed_years }
|
data/lib/relaton_ogc/version.rb
CHANGED
data/relaton_ogc.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-ogc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.pre1
|
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-
|
11
|
+
date: 2020-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: debase
|
@@ -170,14 +170,14 @@ dependencies:
|
|
170
170
|
requirements:
|
171
171
|
- - "~>"
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: 1.
|
173
|
+
version: 1.6.pre
|
174
174
|
type: :runtime
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
178
|
- - "~>"
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version: 1.
|
180
|
+
version: 1.6.pre
|
181
181
|
description: 'RelatonOgc: retrieve OGC Standards for bibliographic use using the OgcBibliographicItem
|
182
182
|
model'
|
183
183
|
email:
|
@@ -230,9 +230,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
230
230
|
version: '0'
|
231
231
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
232
232
|
requirements:
|
233
|
-
- - "
|
233
|
+
- - ">"
|
234
234
|
- !ruby/object:Gem::Version
|
235
|
-
version:
|
235
|
+
version: 1.3.1
|
236
236
|
requirements: []
|
237
237
|
rubygems_version: 3.0.6
|
238
238
|
signing_key:
|