relaton-ccsds 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 +15 -22
- data/grammars/basicdoc.rng +3 -0
- data/lib/relaton_ccsds/bibliography.rb +3 -3
- data/lib/relaton_ccsds/data_fetcher.rb +3 -3
- data/lib/relaton_ccsds/util.rb +1 -4
- data/lib/relaton_ccsds/version.rb +1 -1
- data/lib/relaton_ccsds/xml_parser.rb +4 -0
- data/lib/relaton_ccsds.rb +0 -1
- data/relaton_ccsds.gemspec +2 -2
- metadata +7 -8
- data/lib/relaton_ccsds/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: d13a1ff82cb418e8778c916807bb43c5e8a3fe31f48f8f572c32e6f1631a59b1
|
4
|
+
data.tar.gz: 499cafc2a2dcfd2aa2f8b1040a6d0f2a7af4ad14851df92b980e73697b95ace2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9cbac64eb97f0ca87f19c1274d9ff2864597fb62912a599ea8bd65c4ce722eb9c73e4c2466cdc915385425f9c08bab9f0392de64e62111c579c56df8ca6750c7
|
7
|
+
data.tar.gz: 37ccb6686d9b6cc55990561a205641d809d8ced600468f919588b7a56aa8c252e06076cee066bf3a97e17dbc76d12a05124d43069e5e1f8cab2d6376996fb91a
|
data/README.adoc
CHANGED
@@ -23,24 +23,13 @@ Or install it yourself as:
|
|
23
23
|
|
24
24
|
== Usage
|
25
25
|
|
26
|
-
===
|
27
|
-
|
28
|
-
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 `RelatonCcsds.configure` block.
|
26
|
+
=== Search for a standard using keywords
|
29
27
|
|
30
28
|
[source,ruby]
|
31
29
|
----
|
32
30
|
require 'relaton_ccsds'
|
33
31
|
=> true
|
34
32
|
|
35
|
-
RelatonCcsds.configure do |config|
|
36
|
-
config.logger.level = Logger::DEBUG
|
37
|
-
end
|
38
|
-
----
|
39
|
-
|
40
|
-
=== Search for a standard using keywords
|
41
|
-
|
42
|
-
[source,ruby]
|
43
|
-
----
|
44
33
|
hits = RelatonCcsds::Bibliography.search("CCSDS 230.2-G-1")
|
45
34
|
=> <RelatonCcsds::HitCollection:0x00000000001770 @ref=CCSDS 230.2-G-1 @fetched=false>
|
46
35
|
|
@@ -54,7 +43,7 @@ item = hits[0].doc
|
|
54
43
|
[source,ruby]
|
55
44
|
----
|
56
45
|
item.to_xml
|
57
|
-
=> "<bibitem id="CCSDS230.2-G-1" schema-version="v1.2.
|
46
|
+
=> "<bibitem id="CCSDS230.2-G-1" schema-version="v1.2.9">
|
58
47
|
<fetched>2023-08-25</fetched>
|
59
48
|
<title format="text/plain" language="en" script="Latn">Next Generation Uplink</title>
|
60
49
|
<uri type="pdf">https://public.ccsds.org/Pubs/230x2g1.pdf</uri>
|
@@ -66,7 +55,7 @@ With argument `bibdata: true` it outputs XML wrapped by `bibdata` element and ad
|
|
66
55
|
[source,ruby]
|
67
56
|
----
|
68
57
|
item.to_xml bibdata: true
|
69
|
-
=> "<bibdata schema-version="v1.2.
|
58
|
+
=> "<bibdata schema-version="v1.2.9">
|
70
59
|
<fetched>2023-08-25</fetched>
|
71
60
|
<title format="text/plain" language="en" script="Latn">Next Generation Uplink</title>
|
72
61
|
<uri type="pdf">https://public.ccsds.org/Pubs/230x2g1.pdf</uri>
|
@@ -95,8 +84,8 @@ item.link
|
|
95
84
|
@type="pdf">]
|
96
85
|
|
97
86
|
RelatonCcsds::Bibliography.get("CCSDS 720.6-Y-1").link
|
98
|
-
[relaton-
|
99
|
-
[relaton-
|
87
|
+
[relaton-ccsds] (CCSDS 720.6-Y-1) Fetching from Relaton repository ...
|
88
|
+
[relaton-ccsds] (CCSDS 720.6-Y-1) Found: `CCSDS 720.6-Y-1`.
|
100
89
|
=> [#<RelatonBib::TypedUri:0x0000000114183bb0
|
101
90
|
@content=#<Addressable::URI:0xca8 URI:https://public.ccsds.org/Pubs/720x6y1.pdf>,
|
102
91
|
@language=nil,
|
@@ -113,8 +102,8 @@ RelatonCcsds::Bibliography.get("CCSDS 720.6-Y-1").link
|
|
113
102
|
[source,ruby]
|
114
103
|
----
|
115
104
|
RelatonCcsds::Bibliography.get("CCSDS 230.2-G-1")
|
116
|
-
[relaton-
|
117
|
-
[relaton-
|
105
|
+
[relaton-ccsds] (CCSDS 230.2-G-1) Fetching from Relaton repository ...
|
106
|
+
[relaton-ccsds] (CCSDS 230.2-G-1) Found: `CCSDS 230.2-G-1`.
|
118
107
|
=> #<RelatonCcsds::BibliographicItem:0x00000001135dade0
|
119
108
|
...
|
120
109
|
----
|
@@ -124,8 +113,8 @@ RelatonCcsds::Bibliography.get("CCSDS 230.2-G-1")
|
|
124
113
|
[source,ruby]
|
125
114
|
----
|
126
115
|
item = RelatonCcsds::Bibliography.get("CCSDS 720.4-Y-1 (DOC)")
|
127
|
-
[relaton-
|
128
|
-
[relaton-
|
116
|
+
[relaton-ccsds] (CCSDS 720.4-Y-1 (DOC)) Fetching from Relaton repository ...
|
117
|
+
[relaton-ccsds] (CCSDS 720.4-Y-1 (DOC)) Found: `CCSDS 720.4-Y-1`.
|
129
118
|
=> #<RelatonCcsds::BibliographicItem:0x000000011100dfe0
|
130
119
|
...
|
131
120
|
|
@@ -139,8 +128,8 @@ pry(main)> item.link[0].content.to_s
|
|
139
128
|
=> "https://public.ccsds.org/Pubs/720x4y1.doc"
|
140
129
|
|
141
130
|
item = RelatonCcsds::Bibliography.get("CCSDS 720.4-Y-1 (PDF)")
|
142
|
-
[relaton-
|
143
|
-
[relaton-
|
131
|
+
[relaton-ccsds] (CCSDS 720.4-Y-1 (PDF)) Fetching from Relaton repository ...
|
132
|
+
[relaton-ccsds] (CCSDS 720.4-Y-1 (PDF)) Found: `CCSDS 720.4-Y-1`.
|
144
133
|
=> #<RelatonCcsds::BibliographicItem:0x0000000111004620
|
145
134
|
...
|
146
135
|
|
@@ -195,6 +184,10 @@ Done in: 20 sec.
|
|
195
184
|
=> nil
|
196
185
|
----
|
197
186
|
|
187
|
+
=== Logging
|
188
|
+
|
189
|
+
RelatonCcsds 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.
|
190
|
+
|
198
191
|
== Development
|
199
192
|
|
200
193
|
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.
|
data/grammars/basicdoc.rng
CHANGED
@@ -27,14 +27,14 @@ module RelatonCcsds
|
|
27
27
|
def get(reference, _year = nil, opts = {}) # rubocop:disable Metrics/MethodLength
|
28
28
|
ref = reference.sub(/\s\((DOC|PDF)\)$/, "")
|
29
29
|
opts[:format] ||= Regexp.last_match(1)
|
30
|
-
Util.
|
30
|
+
Util.info "Fetching from Relaton repository ...", key: reference
|
31
31
|
hits = search ref
|
32
32
|
doc = hits.first&.doc&.to_format(opts[:format])
|
33
33
|
unless doc
|
34
|
-
Util.
|
34
|
+
Util.info "Not found.", key: reference
|
35
35
|
return nil
|
36
36
|
end
|
37
|
-
Util.
|
37
|
+
Util.info "Found: `#{hits.first.code}`.", key: reference
|
38
38
|
doc
|
39
39
|
end
|
40
40
|
end
|
@@ -112,7 +112,7 @@ module RelatonCcsds
|
|
112
112
|
id = bib.docidentifier.first.id
|
113
113
|
file = File.join @output, "#{id.gsub(/[.\s-]+/, '-')}.#{@ext}"
|
114
114
|
if @files.include?(file)
|
115
|
-
|
115
|
+
Util.info "(#{file}) file already exists. Trying to merge links ..."
|
116
116
|
merge_links bib, file
|
117
117
|
else @files << file
|
118
118
|
end
|
@@ -235,10 +235,10 @@ module RelatonCcsds
|
|
235
235
|
hash = YAML.load_file file
|
236
236
|
bib2 = BibliographicItem.from_hash hash
|
237
237
|
if bib.link[0].type == bib2.link[0].type
|
238
|
-
|
238
|
+
Util.info "links are the same.", key: file
|
239
239
|
return
|
240
240
|
end
|
241
|
-
|
241
|
+
Util.info "links are merged.", key: file
|
242
242
|
bib.link << bib2.link[0]
|
243
243
|
end
|
244
244
|
|
data/lib/relaton_ccsds/util.rb
CHANGED
data/lib/relaton_ccsds.rb
CHANGED
@@ -5,7 +5,6 @@ require "relaton_bib"
|
|
5
5
|
require "relaton/index"
|
6
6
|
require_relative "relaton_ccsds/version"
|
7
7
|
require_relative "relaton_ccsds/bibliographic_item"
|
8
|
-
require_relative "relaton_ccsds/config"
|
9
8
|
require_relative "relaton_ccsds/util"
|
10
9
|
require_relative "relaton_ccsds/document_type"
|
11
10
|
require_relative "relaton_ccsds/bibliography"
|
data/relaton_ccsds.gemspec
CHANGED
@@ -24,8 +24,8 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.required_ruby_version = ">= 2.7.0"
|
25
25
|
|
26
26
|
# Uncomment to register a new dependency of your gem
|
27
|
-
spec.add_dependency "mechanize", "~> 2.
|
28
|
-
spec.add_dependency "relaton-bib", "~> 1.
|
27
|
+
spec.add_dependency "mechanize", "~> 2.10"
|
28
|
+
spec.add_dependency "relaton-bib", "~> 1.19.0"
|
29
29
|
spec.add_dependency "relaton-index", "~> 0.2.0"
|
30
30
|
|
31
31
|
# For more information and examples about making a new gem, check out our
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-ccsds
|
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-03 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
|
@@ -76,7 +76,6 @@ files:
|
|
76
76
|
- lib/relaton_ccsds.rb
|
77
77
|
- lib/relaton_ccsds/bibliographic_item.rb
|
78
78
|
- lib/relaton_ccsds/bibliography.rb
|
79
|
-
- lib/relaton_ccsds/config.rb
|
80
79
|
- lib/relaton_ccsds/data_fetcher.rb
|
81
80
|
- lib/relaton_ccsds/data_parser.rb
|
82
81
|
- lib/relaton_ccsds/document_type.rb
|
@@ -107,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
106
|
- !ruby/object:Gem::Version
|
108
107
|
version: '0'
|
109
108
|
requirements: []
|
110
|
-
rubygems_version: 3.3.
|
109
|
+
rubygems_version: 3.3.27
|
111
110
|
signing_key:
|
112
111
|
specification_version: 4
|
113
112
|
summary: 'RelatonCcsds: retrive www.ccsds.org Standards'
|