relaton-omg 1.7.2 → 1.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +1 -11
- data/.rubocop.yml +3 -1
- data/README.adoc +21 -5
- data/grammars/biblio.rng +7 -8
- data/lib/relaton_omg/scrapper.rb +2 -2
- data/lib/relaton_omg/version.rb +1 -1
- data/relaton_omg.gemspec +2 -4
- 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: 05ffe60d5d13aabbeaf36188da133a0bc1ef235aa47d79935cd787783cdcf3e5
|
4
|
+
data.tar.gz: 314cb574d9366c2e224d4701d6a84b601c8c07222c6fd8eb68b1050dc451daf7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b333cb4e949774c26b29e39bbcfd78c1999f20113037180e5d57b70b1d6fc196a4ac40d84428246eae429e221551ebcaf6fd88a4bcd0ffa42941e4517387912
|
7
|
+
data.tar.gz: 220a8897c4d5720ee9324eb4bc1dd7f22d100f6d3d9236cd573e6086bce8fe1a36bad5c47fdf0a2dbf563045b595cb23301a91c2c0dee04735dac78dd4a78214
|
data/.github/workflows/rake.yml
CHANGED
@@ -16,19 +16,9 @@ jobs:
|
|
16
16
|
strategy:
|
17
17
|
fail-fast: false
|
18
18
|
matrix:
|
19
|
-
ruby: [ '
|
19
|
+
ruby: [ '3.0', '2.7', '2.6', '2.5' ]
|
20
20
|
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
21
21
|
experimental: [ false ]
|
22
|
-
include:
|
23
|
-
- ruby: '3.0'
|
24
|
-
os: 'ubuntu-latest'
|
25
|
-
experimental: true
|
26
|
-
- ruby: '3.0'
|
27
|
-
os: 'windows-latest'
|
28
|
-
experimental: true
|
29
|
-
- ruby: '3.0'
|
30
|
-
os: 'macos-latest'
|
31
|
-
experimental: true
|
32
22
|
steps:
|
33
23
|
- uses: actions/checkout@v2
|
34
24
|
with:
|
data/.rubocop.yml
CHANGED
@@ -2,9 +2,11 @@
|
|
2
2
|
# https://github.com/riboseinc/oss-guides
|
3
3
|
# All project-specific additions and overrides should be specified in this file.
|
4
4
|
|
5
|
+
require: rubocop-rails
|
6
|
+
|
5
7
|
inherit_from:
|
6
8
|
- https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
|
7
9
|
AllCops:
|
8
|
-
TargetRubyVersion: 2.
|
10
|
+
TargetRubyVersion: 2.5
|
9
11
|
Rails:
|
10
12
|
Enabled: false
|
data/README.adoc
CHANGED
@@ -33,17 +33,22 @@ Or install it yourself as:
|
|
33
33
|
|
34
34
|
=== Search document
|
35
35
|
|
36
|
+
Reference format is `OMG + {ACRONYM} + {VERSION}`
|
37
|
+
|
38
|
+
- `ACRONYM` is an acronym from the list of specs https://www.omg.org/spec/#all
|
39
|
+
- `VERSION` (optional) if omitted then the lastes version is fetched
|
40
|
+
|
36
41
|
[source,ruby]
|
37
42
|
----
|
38
43
|
require 'relaton_omg'
|
39
44
|
=> true
|
40
45
|
|
41
|
-
item = RelatonOmg::OmgBibliography.
|
46
|
+
item = RelatonOmg::OmgBibliography.get 'OMG AMI4CCM 1.0'
|
42
47
|
=> #<RelatonOmg::OmgBibliographicItem:0x007fda17eab2f0
|
43
48
|
...
|
44
49
|
|
45
50
|
# Return nil if document doesn't exist.
|
46
|
-
RelatonOmg::OmgBibliography.
|
51
|
+
RelatonOmg::OmgBibliography.get 'OMG 1111'
|
47
52
|
[relaton-omg] no document found for "OMG 1111" reference.
|
48
53
|
=> nil
|
49
54
|
----
|
@@ -76,7 +81,18 @@ item.to_xml
|
|
76
81
|
</bibitem>"
|
77
82
|
----
|
78
83
|
|
79
|
-
===
|
84
|
+
=== Typed links
|
85
|
+
|
86
|
+
OMG documents may have `src` and `pdf` link types.
|
87
|
+
|
88
|
+
[source,ruby]
|
89
|
+
----
|
90
|
+
item.link
|
91
|
+
=> [#<RelatonBib::TypedUri:0x00007fa897a72208 @content=#<Addressable::URI:0x80c URI:https://www.omg.org/spec/AMI4CCM/1.0/About-AMI4CCM/>, @type="src">,
|
92
|
+
#<RelatonBib::TypedUri:0x00007fa897a71600 @content=#<Addressable::URI:0x820 URI:https://www.omg.org/spec/AMI4CCM/1.0/PDF>, @type="pdf">]
|
93
|
+
----
|
94
|
+
|
95
|
+
=== Create bibliographic item from XML
|
80
96
|
|
81
97
|
[source,ruby]
|
82
98
|
----
|
@@ -85,7 +101,7 @@ item = RelatonOmg::OmgBibliographicItem.from_xml 'spec/fixtures/omg_ami4ccm_1_0.
|
|
85
101
|
...
|
86
102
|
----
|
87
103
|
|
88
|
-
=== Create bibliographic item
|
104
|
+
=== Create bibliographic item from Hash
|
89
105
|
[source,ruby]
|
90
106
|
----
|
91
107
|
hash = YAML.load_file 'spec/fixtures/omg_ami4ccm_1_0.yaml'
|
@@ -97,7 +113,7 @@ item = RelatonOmg::OmgBibliographicItem.from_hash hash
|
|
97
113
|
...
|
98
114
|
----
|
99
115
|
|
100
|
-
=== Create bibliographic item
|
116
|
+
=== Create bibliographic item from YAML
|
101
117
|
[source,ruby]
|
102
118
|
----
|
103
119
|
item = RelatonOmg::OmgBibliographicItem.from_yaml 'spec/fixtures/omg_ami4ccm_1_0.yaml'
|
data/grammars/biblio.rng
CHANGED
@@ -124,7 +124,7 @@
|
|
124
124
|
<value>application/tei+xml</value>
|
125
125
|
<value>text/x-asciidoc</value>
|
126
126
|
<value>text/markdown</value>
|
127
|
-
<value>application/x-
|
127
|
+
<value>application/x-metanorma+xml</value>
|
128
128
|
<text/>
|
129
129
|
</choice>
|
130
130
|
</attribute>
|
@@ -401,9 +401,9 @@
|
|
401
401
|
<choice>
|
402
402
|
<!-- iso191606 TODO -->
|
403
403
|
<group>
|
404
|
-
<
|
404
|
+
<zeroOrMore>
|
405
405
|
<ref name="street"/>
|
406
|
-
</
|
406
|
+
</zeroOrMore>
|
407
407
|
<ref name="city"/>
|
408
408
|
<optional>
|
409
409
|
<ref name="state"/>
|
@@ -452,6 +452,7 @@
|
|
452
452
|
<attribute name="type">
|
453
453
|
<choice>
|
454
454
|
<value>isni</value>
|
455
|
+
<value>orcid</value>
|
455
456
|
<value>uri</value>
|
456
457
|
</choice>
|
457
458
|
</attribute>
|
@@ -461,10 +462,7 @@
|
|
461
462
|
<define name="org-identifier">
|
462
463
|
<element name="identifier">
|
463
464
|
<attribute name="type">
|
464
|
-
<
|
465
|
-
<value>orcid</value>
|
466
|
-
<value>uri</value>
|
467
|
-
</choice>
|
465
|
+
<data type="string" datatypeLibrary=""/>
|
468
466
|
</attribute>
|
469
467
|
<text/>
|
470
468
|
</element>
|
@@ -789,6 +787,7 @@
|
|
789
787
|
<value>adapted</value>
|
790
788
|
<value>vote-started</value>
|
791
789
|
<value>vote-ended</value>
|
790
|
+
<value>announced</value>
|
792
791
|
</choice>
|
793
792
|
</define>
|
794
793
|
<define name="bdate">
|
@@ -1106,7 +1105,7 @@
|
|
1106
1105
|
<value>complementOf</value>
|
1107
1106
|
<value>obsoletes</value>
|
1108
1107
|
<value>obsoletedBy</value>
|
1109
|
-
<value>
|
1108
|
+
<value>cites</value>
|
1110
1109
|
<value>isCitedIn</value>
|
1111
1110
|
</choice>
|
1112
1111
|
</define>
|
data/lib/relaton_omg/scrapper.rb
CHANGED
@@ -13,8 +13,8 @@ module RelatonOmg
|
|
13
13
|
url += "/" + version if version
|
14
14
|
doc = Nokogiri::HTML OpenURI.open_uri(URI(url))
|
15
15
|
OmgBibliographicItem.new **item(doc, acronym)
|
16
|
-
rescue OpenURI::HTTPError => e
|
17
|
-
if e.io.status[0] == "404"
|
16
|
+
rescue OpenURI::HTTPError, URI::InvalidURIError => e
|
17
|
+
if e.is_a?(URI::InvalidURIError) || e.io.status[0] == "404"
|
18
18
|
warn %{[relaton-omg] no document found for "#{ref}" reference.}
|
19
19
|
return
|
20
20
|
end
|
data/lib/relaton_omg/version.rb
CHANGED
data/relaton_omg.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
|
|
12
12
|
"using the IsoBibliographicItem model"
|
13
13
|
spec.homepage = "https://github.com/relaton/relaton-ogn"
|
14
14
|
spec.license = "BSD-2-Clause"
|
15
|
-
spec.required_ruby_version = Gem::Requirement.new(">= 2.
|
15
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
|
16
16
|
|
17
17
|
spec.metadata["homepage_uri"] = spec.homepage
|
18
18
|
spec.metadata["source_code_uri"] = "https://github.com/relaton/relaton-ogn"
|
@@ -27,14 +27,12 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.require_paths = ["lib"]
|
28
28
|
|
29
29
|
spec.add_development_dependency "byebug"
|
30
|
-
# spec.add_development_dependency "debase"
|
31
30
|
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
32
31
|
spec.add_development_dependency "pry-byebug"
|
33
|
-
# spec.add_development_dependency "ruby-debug-ide"
|
34
32
|
spec.add_development_dependency "ruby-jing"
|
35
33
|
spec.add_development_dependency "simplecov"
|
36
34
|
spec.add_development_dependency "vcr"
|
37
35
|
spec.add_development_dependency "webmock"
|
38
36
|
|
39
|
-
spec.add_dependency "relaton-bib", "~> 1.
|
37
|
+
spec.add_dependency "relaton-bib", "~> 1.10.0"
|
40
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-omg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.10.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:
|
11
|
+
date: 2022-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|
@@ -114,14 +114,14 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 1.
|
117
|
+
version: 1.10.0
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 1.
|
124
|
+
version: 1.10.0
|
125
125
|
description: 'RelatonOmg: retrieve OMG Standards for bibliographic using the IsoBibliographicItem
|
126
126
|
model'
|
127
127
|
email:
|
@@ -166,14 +166,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
166
166
|
requirements:
|
167
167
|
- - ">="
|
168
168
|
- !ruby/object:Gem::Version
|
169
|
-
version: 2.
|
169
|
+
version: 2.5.0
|
170
170
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
171
171
|
requirements:
|
172
172
|
- - ">="
|
173
173
|
- !ruby/object:Gem::Version
|
174
174
|
version: '0'
|
175
175
|
requirements: []
|
176
|
-
rubygems_version: 3.
|
176
|
+
rubygems_version: 3.2.3
|
177
177
|
signing_key:
|
178
178
|
specification_version: 4
|
179
179
|
summary: 'RelatonOmg: retrieve OMG Standards for bibliographic using the IsoBibliographicItem
|