relaton-xsf 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 +16 -5
- data/lib/relaton_xsf/bibliography.rb +3 -3
- data/lib/relaton_xsf/hash_converter.rb +7 -7
- data/lib/relaton_xsf/version.rb +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: 141b6d42d27c2d188d685ffa7e0988eb09333f6e5d04d95d7bf7dcdd020ef73e
|
4
|
+
data.tar.gz: ce5925720e931e312e13d5a63e576f3c1bf50601f9c0b20a93ec6e31642349be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b203308289f35bdc3e64cfcabec6cd0c8a2328c0abd187089a5e5dfa7aa8abd9abcc15fa17e86d51bea9aa177775ca460e823f2206aa45d5a0b9811f9808484
|
7
|
+
data.tar.gz: 6452c03e18eeb325cc416c01f5e061640aa24fdd108df9fa21ad1f46f727009b355a28a3ddee79e46f6b031ce36ec8fd24e9730a39d66df1c891f4ce1c04757e
|
data/README.adoc
CHANGED
@@ -38,13 +38,24 @@ Or install it yourself as:
|
|
38
38
|
|
39
39
|
== Usage
|
40
40
|
|
41
|
-
===
|
41
|
+
=== Configuration
|
42
|
+
|
43
|
+
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 `RelatonXsf.configure` block.
|
42
44
|
|
43
45
|
[source,ruby]
|
44
46
|
----
|
45
47
|
require 'relaton_xsf'
|
46
48
|
=> true
|
47
49
|
|
50
|
+
RelatonXsf.configure do |config|
|
51
|
+
config.logger.level = Logger::DEBUG
|
52
|
+
end
|
53
|
+
----
|
54
|
+
|
55
|
+
=== Search for a standard using keywords
|
56
|
+
|
57
|
+
[source,ruby]
|
58
|
+
----
|
48
59
|
hit_collection = RelatonXsf::Bibliography.search("XEP 0001")
|
49
60
|
=> <RelatonXsf::HitCollection:0x00000000019780 @ref=XEP 0001 @fetched=false>
|
50
61
|
|
@@ -57,7 +68,7 @@ item = hit_collection[0].fetch
|
|
57
68
|
[source,ruby]
|
58
69
|
----
|
59
70
|
item.to_xml
|
60
|
-
=> "<bibitem id="XEP0001" type="standard" schema-version="v1.2.
|
71
|
+
=> "<bibitem id="XEP0001" type="standard" schema-version="v1.2.5">
|
61
72
|
<fetched>2023-07-18</fetched>
|
62
73
|
<title format="text/plain" language="en" script="Latn">XMPP Extension Protocols</title>
|
63
74
|
...
|
@@ -67,7 +78,7 @@ With argument `bibdata: true` it outputs XML wrapped by `bibdata` element and ad
|
|
67
78
|
[source,ruby]
|
68
79
|
----
|
69
80
|
item.to_xml bibdata: true
|
70
|
-
=> "<bibdata type="standard" schema-version="v1.2.
|
81
|
+
=> "<bibdata type="standard" schema-version="v1.2.5">
|
71
82
|
<fetched>2023-07-18</fetched>
|
72
83
|
<title format="text/plain" language="en" script="Latn">XMPP Extension Protocols</title>
|
73
84
|
...
|
@@ -81,8 +92,8 @@ item.to_xml bibdata: true
|
|
81
92
|
[source,ruby]
|
82
93
|
----
|
83
94
|
item = RelatonXsf::Bibliography.get "XEP 0001"
|
84
|
-
[relaton-xsf] (XEP 0001)
|
85
|
-
[relaton-xsf] (XEP 0001)
|
95
|
+
[relaton-xsf] (XEP 0001) Fetching from Relaton repository ...
|
96
|
+
[relaton-xsf] (XEP 0001) Found `XEP 0001`
|
86
97
|
=> #<RelatonXsf::BibliographicItem:0x000000011275cd18
|
87
98
|
...
|
88
99
|
|
@@ -7,15 +7,15 @@ module RelatonXsf
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def get(code, _year = nil, _opts = {})
|
10
|
-
Util.warn "(#{code})
|
10
|
+
Util.warn "(#{code}) Fetching from Relaton repository ..."
|
11
11
|
result = search(code)
|
12
12
|
if result.empty?
|
13
|
-
Util.warn "(#{code})
|
13
|
+
Util.warn "(#{code}) Not found."
|
14
14
|
return
|
15
15
|
end
|
16
16
|
|
17
17
|
bib = result.first.fetch
|
18
|
-
Util.warn "(#{code})
|
18
|
+
Util.warn "(#{code}) Found: `#{bib.docidentifier.first.id}`"
|
19
19
|
bib
|
20
20
|
end
|
21
21
|
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
module RelatonXsf
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
2
|
+
module HashConverter
|
3
|
+
include RelatonBib::HashConverter
|
4
|
+
extend self
|
5
|
+
# @param item_hash [Hash]
|
6
|
+
# @return [RelatonBib::BibliographicItem]
|
7
|
+
def bib_item(item_hash)
|
8
|
+
BibliographicItem.new(**item_hash)
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
data/lib/relaton_xsf/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-xsf
|
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: mechanize
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.17.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
40
|
+
version: 1.17.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: relaton-index
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|