relaton-xsf 1.18.0 → 1.19.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 +7 -14
- data/lib/relaton_xsf/bibliography.rb +3 -3
- data/lib/relaton_xsf/data_fetcher.rb +1 -1
- data/lib/relaton_xsf/util.rb +1 -4
- data/lib/relaton_xsf/version.rb +1 -1
- data/lib/relaton_xsf.rb +0 -1
- metadata +7 -8
- data/lib/relaton_xsf/config.rb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fbdec6f6009810867d7be4cb3bd34bfdf581531f94b0e273ff550866ffceeb8b
|
4
|
+
data.tar.gz: 41e7652ccf48683a019527ed77d69f7535cc51f4d72d96b8d07013bf6b64971b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3aea8710f9b28e58260f69d31e057e0405bfefe6885b17c6d70be27091ddc05d5f5d0dec0c7404a4de77702145aae517486ff59b56bf8433c746ee237dc09e1
|
7
|
+
data.tar.gz: c9e602abefc78ed7a79ea1d58eedd7b672391df9e50f4cf655692015305e12cdba0971f28d72d928d2e9b3c7edbd6416b191a071754c69aa67026ce2e6aaf32c
|
data/README.adoc
CHANGED
@@ -38,24 +38,13 @@ Or install it yourself as:
|
|
38
38
|
|
39
39
|
== Usage
|
40
40
|
|
41
|
-
===
|
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.
|
41
|
+
=== Search for a standard using keywords
|
44
42
|
|
45
43
|
[source,ruby]
|
46
44
|
----
|
47
45
|
require 'relaton_xsf'
|
48
46
|
=> true
|
49
47
|
|
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
|
-
----
|
59
48
|
hit_collection = RelatonXsf::Bibliography.search("XEP 0001")
|
60
49
|
=> <RelatonXsf::HitCollection:0x00000000019780 @ref=XEP 0001 @fetched=false>
|
61
50
|
|
@@ -68,7 +57,7 @@ item = hit_collection[0].fetch
|
|
68
57
|
[source,ruby]
|
69
58
|
----
|
70
59
|
item.to_xml
|
71
|
-
=> "<bibitem id="XEP0001" type="standard" schema-version="v1.2.
|
60
|
+
=> "<bibitem id="XEP0001" type="standard" schema-version="v1.2.9">
|
72
61
|
<fetched>2023-07-18</fetched>
|
73
62
|
<title format="text/plain" language="en" script="Latn">XMPP Extension Protocols</title>
|
74
63
|
...
|
@@ -78,7 +67,7 @@ With argument `bibdata: true` it outputs XML wrapped by `bibdata` element and ad
|
|
78
67
|
[source,ruby]
|
79
68
|
----
|
80
69
|
item.to_xml bibdata: true
|
81
|
-
=> "<bibdata type="standard" schema-version="v1.2.
|
70
|
+
=> "<bibdata type="standard" schema-version="v1.2.9">
|
82
71
|
<fetched>2023-07-18</fetched>
|
83
72
|
<title format="text/plain" language="en" script="Latn">XMPP Extension Protocols</title>
|
84
73
|
...
|
@@ -134,6 +123,10 @@ Done in: 42 sec.
|
|
134
123
|
=> nil
|
135
124
|
----
|
136
125
|
|
126
|
+
=== Logging
|
127
|
+
|
128
|
+
RelatonXsf uses the relaton-logger gem for logging. By default, it logs to STDOUT. To change the log levels and add other loggers, read the https://github.com/relaton/relaton-logger#usage[relaton-logger] documentation.
|
129
|
+
|
137
130
|
== Development
|
138
131
|
|
139
132
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
@@ -7,15 +7,15 @@ module RelatonXsf
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def get(code, _year = nil, _opts = {})
|
10
|
-
Util.
|
10
|
+
Util.info "Fetching from Relaton repository ...", key: code
|
11
11
|
result = search(code)
|
12
12
|
if result.empty?
|
13
|
-
Util.
|
13
|
+
Util.info "Not found.", key: code
|
14
14
|
return
|
15
15
|
end
|
16
16
|
|
17
17
|
bib = result.first.fetch
|
18
|
-
Util.
|
18
|
+
Util.info "Found: `#{bib.docidentifier.first.id}`", key: code
|
19
19
|
bib
|
20
20
|
end
|
21
21
|
end
|
@@ -39,7 +39,7 @@ module RelatonXsf
|
|
39
39
|
id = bib.docidentifier.find(&:primary).id
|
40
40
|
file = File.join @output, "#{id.gsub(' ', '-').downcase}.#{@ext}"
|
41
41
|
if @files.include? file
|
42
|
-
warn "
|
42
|
+
Util.warn "#{file} already exists"
|
43
43
|
end
|
44
44
|
File.write file, serialize(bib), encoding: "UTF-8"
|
45
45
|
@files << file
|
data/lib/relaton_xsf/util.rb
CHANGED
data/lib/relaton_xsf/version.rb
CHANGED
data/lib/relaton_xsf.rb
CHANGED
@@ -4,7 +4,6 @@ require "mechanize"
|
|
4
4
|
require "relaton/index"
|
5
5
|
require "relaton_bib"
|
6
6
|
require_relative "relaton_xsf/version"
|
7
|
-
require_relative "relaton_xsf/config"
|
8
7
|
require_relative "relaton_xsf/util"
|
9
8
|
require_relative "relaton_xsf/bibliographic_item"
|
10
9
|
require_relative "relaton_xsf/bibliography"
|
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.19.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: 2024-
|
11
|
+
date: 2024-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mechanize
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.
|
19
|
+
version: '2.10'
|
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: 2.
|
26
|
+
version: '2.10'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: relaton-bib
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.19.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.19.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: relaton-index
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -70,7 +70,6 @@ files:
|
|
70
70
|
- lib/relaton_xsf/bibliographic_item.rb
|
71
71
|
- lib/relaton_xsf/bibliography.rb
|
72
72
|
- lib/relaton_xsf/bibxml_parser.rb
|
73
|
-
- lib/relaton_xsf/config.rb
|
74
73
|
- lib/relaton_xsf/data_fetcher.rb
|
75
74
|
- lib/relaton_xsf/hash_converter.rb
|
76
75
|
- lib/relaton_xsf/hit.rb
|
@@ -100,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
99
|
- !ruby/object:Gem::Version
|
101
100
|
version: '0'
|
102
101
|
requirements: []
|
103
|
-
rubygems_version: 3.3.
|
102
|
+
rubygems_version: 3.3.27
|
104
103
|
signing_key:
|
105
104
|
specification_version: 4
|
106
105
|
summary: 'RelatonIso: retrieve ISO Standards for bibliographic use using the IsoBibliographicItem
|