relaton-omg 1.16.1 → 1.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.adoc +21 -7
- data/grammars/basicdoc.rng +18 -2
- data/grammars/biblio.rng +1 -0
- data/lib/relaton_omg/hash_converter.rb +3 -3
- data/lib/relaton_omg/omg_bibliography.rb +3 -3
- data/lib/relaton_omg/scrapper.rb +1 -1
- data/lib/relaton_omg/version.rb +1 -1
- data/relaton_omg.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fbe6994401edd1904af8cf3302400dff52a8dc43140797f327ff31a45ee0967
|
4
|
+
data.tar.gz: a0142d4f33106ea88f11072da9272ab2f898bccb202d29745863bb90feff24e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fd173bd8cf48cca7fe72be3cf0dde0d9da93e7b3ba5e48e2226b07742d4006d33b2a6656f5499d0a11401cfcac1c94c0f2365d9e89fd192dcfd15337704cba1
|
7
|
+
data.tar.gz: 668b7e8677e81e0a344b6c92270ff5eebd5e60a0df45e1ca8699b237b185a201f1421638f41b23efd5ac3da27ec3490b5dcaa9ba95bb141229029f3d607c5fa0
|
data/README.adoc
CHANGED
@@ -31,6 +31,20 @@ Or install it yourself as:
|
|
31
31
|
|
32
32
|
== Usage
|
33
33
|
|
34
|
+
=== Configuration
|
35
|
+
|
36
|
+
Configuration is optional. The available option is `logger` which is a `Logger` instance. By default, the logger is `Logger.new($stderr)` with `Logger::WARN` level. To change the logger level, use `RelatonOmg.configure` block.
|
37
|
+
|
38
|
+
[source,ruby]
|
39
|
+
----
|
40
|
+
require 'relaton_omg'
|
41
|
+
=> true
|
42
|
+
|
43
|
+
RelatonOmg.configure do |config|
|
44
|
+
config.logger.level = Logger::DEBUG
|
45
|
+
end
|
46
|
+
----
|
47
|
+
|
34
48
|
=== Search document
|
35
49
|
|
36
50
|
Reference format is `OMG + {ACRONYM} + {VERSION}`
|
@@ -40,16 +54,16 @@ Reference format is `OMG + {ACRONYM} + {VERSION}`
|
|
40
54
|
|
41
55
|
[source,ruby]
|
42
56
|
----
|
43
|
-
require 'relaton_omg'
|
44
|
-
=> true
|
45
|
-
|
46
57
|
item = RelatonOmg::OmgBibliography.get 'OMG AMI4CCM 1.0'
|
47
|
-
|
58
|
+
[relaton-omg] (OMG AMI4CCM 1.0) Fetching from www.omg.org ...
|
59
|
+
[relaton-omg] (OMG AMI4CCM 1.0) Found: `AMI4CCM 1.0`
|
60
|
+
=> #<RelatonOmg::OmgBibliographicItem:0x000000010435a520
|
48
61
|
...
|
49
62
|
|
50
63
|
# Return nil if the document doesn't exist.
|
51
64
|
RelatonOmg::OmgBibliography.get 'OMG 1111'
|
52
|
-
[relaton-omg]
|
65
|
+
[relaton-omg] (OMG 1111) Fetching from www.omg.org ...
|
66
|
+
[relaton-omg] (OMG 1111) Not found.
|
53
67
|
=> nil
|
54
68
|
----
|
55
69
|
|
@@ -58,7 +72,7 @@ RelatonOmg::OmgBibliography.get 'OMG 1111'
|
|
58
72
|
[source,ruby]
|
59
73
|
----
|
60
74
|
item.to_xml
|
61
|
-
=> "<bibitem id="AMI4CCM1.0" schema-version="v1.2.
|
75
|
+
=> "<bibitem id="AMI4CCM1.0" schema-version="v1.2.5">
|
62
76
|
<fetched>2022-12-05</fetched>
|
63
77
|
<title type="main" format="text/plain" language="en" script="Latn">Asynchronous Method Invocation for CCM</title>
|
64
78
|
<uri type="src">https://www.omg.org/spec/AMI4CCM/1.0/About-AMI4CCM</uri>
|
@@ -92,7 +106,7 @@ item = RelatonOmg::OmgBibliographicItem.from_xml 'spec/fixtures/omg_ami4ccm_1_0.
|
|
92
106
|
[source,ruby]
|
93
107
|
----
|
94
108
|
hash = YAML.load_file 'spec/fixtures/omg_ami4ccm_1_0.yaml'
|
95
|
-
=> {"schema-version"=>"v1.2.
|
109
|
+
=> {"schema-version"=>"v1.2.5",
|
96
110
|
"id"=>"AMI4CCM1.0",
|
97
111
|
...
|
98
112
|
|
data/grammars/basicdoc.rng
CHANGED
@@ -346,6 +346,8 @@
|
|
346
346
|
<ref name="keyword"/>
|
347
347
|
<ref name="xref"/>
|
348
348
|
<ref name="hyperlink"/>
|
349
|
+
<ref name="index"/>
|
350
|
+
<ref name="index-xref"/>
|
349
351
|
</choice>
|
350
352
|
</oneOrMore>
|
351
353
|
</element>
|
@@ -623,6 +625,8 @@
|
|
623
625
|
<ref name="eref"/>
|
624
626
|
<ref name="xref"/>
|
625
627
|
<ref name="hyperlink"/>
|
628
|
+
<ref name="index"/>
|
629
|
+
<ref name="index-xref"/>
|
626
630
|
</choice>
|
627
631
|
</zeroOrMore>
|
628
632
|
</element>
|
@@ -636,6 +640,8 @@
|
|
636
640
|
<ref name="eref"/>
|
637
641
|
<ref name="xref"/>
|
638
642
|
<ref name="hyperlink"/>
|
643
|
+
<ref name="index"/>
|
644
|
+
<ref name="index-xref"/>
|
639
645
|
</choice>
|
640
646
|
</zeroOrMore>
|
641
647
|
</element>
|
@@ -648,6 +654,8 @@
|
|
648
654
|
<ref name="eref"/>
|
649
655
|
<ref name="xref"/>
|
650
656
|
<ref name="hyperlink"/>
|
657
|
+
<ref name="index"/>
|
658
|
+
<ref name="index-xref"/>
|
651
659
|
</choice>
|
652
660
|
</zeroOrMore>
|
653
661
|
</element>
|
@@ -655,7 +663,11 @@
|
|
655
663
|
<define name="keyword">
|
656
664
|
<element name="keyword">
|
657
665
|
<zeroOrMore>
|
658
|
-
<
|
666
|
+
<choice>
|
667
|
+
<ref name="PureTextElement"/>
|
668
|
+
<ref name="index"/>
|
669
|
+
<ref name="index-xref"/>
|
670
|
+
</choice>
|
659
671
|
</zeroOrMore>
|
660
672
|
</element>
|
661
673
|
</define>
|
@@ -676,7 +688,11 @@
|
|
676
688
|
<define name="strike">
|
677
689
|
<element name="strike">
|
678
690
|
<zeroOrMore>
|
679
|
-
<
|
691
|
+
<choice>
|
692
|
+
<ref name="PureTextElement"/>
|
693
|
+
<ref name="index"/>
|
694
|
+
<ref name="index-xref"/>
|
695
|
+
</choice>
|
680
696
|
</zeroOrMore>
|
681
697
|
</element>
|
682
698
|
</define>
|
data/grammars/biblio.rng
CHANGED
@@ -15,12 +15,12 @@ module RelatonOmg
|
|
15
15
|
# @param opts [Hash] options
|
16
16
|
# @return [RelatonOmg::OmgBibliographicItem]
|
17
17
|
def get(code, _year = nil, _opts = {})
|
18
|
-
Util.warn "(#{code})
|
18
|
+
Util.warn "(#{code}) Fetching from www.omg.org ..."
|
19
19
|
result = search code
|
20
20
|
if result
|
21
|
-
Util.warn "(#{code})
|
21
|
+
Util.warn "(#{code}) Found: `#{result.docidentifier.first.id}`"
|
22
22
|
else
|
23
|
-
Util.warn "(#{code})
|
23
|
+
Util.warn "(#{code}) Not found."
|
24
24
|
end
|
25
25
|
result
|
26
26
|
end
|
data/lib/relaton_omg/scrapper.rb
CHANGED
@@ -16,7 +16,7 @@ module RelatonOmg
|
|
16
16
|
rescue OpenURI::HTTPError, URI::InvalidURIError, Net::OpenTimeout => e
|
17
17
|
return if e.is_a?(URI::InvalidURIError) || e.io.status[0] == "404"
|
18
18
|
|
19
|
-
raise RelatonBib::RequestError, "Unable acces #{url} (#{e.io.status.join(' ')}"
|
19
|
+
raise RelatonBib::RequestError, "Unable acces #{url} (#{e.io.status.join(' ')})"
|
20
20
|
end
|
21
21
|
|
22
22
|
private
|
data/lib/relaton_omg/version.rb
CHANGED
data/relaton_omg.gemspec
CHANGED
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.17.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: 2023-
|
11
|
+
date: 2023-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: relaton-bib
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.17.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 1.17.0
|
27
27
|
description: 'RelatonOmg: retrieve OMG Standards for bibliographic using the IsoBibliographicItem
|
28
28
|
model'
|
29
29
|
email:
|