relaton-itu 1.2.0 → 1.3.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/ubuntu.yml +1 -0
- data/.rubocop.yml +2 -2
- data/lib/relaton_itu/editorial_group.rb +13 -1
- data/lib/relaton_itu/hash_converter.rb +1 -1
- data/lib/relaton_itu/itu_bibliographic_item.rb +0 -2
- data/lib/relaton_itu/itu_bibliography.rb +0 -8
- data/lib/relaton_itu/itu_group.rb +21 -0
- data/lib/relaton_itu/structured_identifier.rb +10 -0
- data/lib/relaton_itu/version.rb +1 -1
- data/relaton-itu.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: b7ea346c3346b49aa11d8537809895a14ade4b648f9953371988c705e64c6081
|
4
|
+
data.tar.gz: 59d9fe418c8e54dd1bc678c42efe35650d1c99ffee0c05211ca4b29931f01c25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 258db28aa9f3b4caf297881d47a3fca89e64b82d603712cfeefb450123219337ac59530b251356b87a7c5561fc0df0769ea59bb7e7b2ab894e845df01073bf3a
|
7
|
+
data.tar.gz: 6d5155965ed3aa9fc63e1feabde2557b171c5826c5078dcd5eee83602f2f5591a82542bf38f88f1418373f8f58691eeb6e9ab1881b1c7c18bebe9a2035ba6c4c
|
data/.rubocop.yml
CHANGED
@@ -26,7 +26,7 @@ module RelatonItu
|
|
26
26
|
end
|
27
27
|
|
28
28
|
# @param builder [Nokogiri::XML::Builder]
|
29
|
-
def to_xml(builder)
|
29
|
+
def to_xml(builder) # rubocop:disable Metrics/AbcSize
|
30
30
|
builder.editorialgroup do
|
31
31
|
builder.bureau bureau
|
32
32
|
builder.group { |b| group.to_xml b } if group
|
@@ -43,5 +43,17 @@ module RelatonItu
|
|
43
43
|
hash["workgroup"] = workgroup.to_hash if workgroup
|
44
44
|
hash
|
45
45
|
end
|
46
|
+
|
47
|
+
# @param prefix [String]
|
48
|
+
# @return [String]
|
49
|
+
def to_asciibib(prefix) # rubocop:disable Metrics/AbcSize
|
50
|
+
pref = prefix.empty? ? prefix : prefix + "."
|
51
|
+
pref += "editorialgroup"
|
52
|
+
out = "#{pref}.bureau:: #{bureau}\n"
|
53
|
+
out += group.to_asciibib "#{pref}.group" if group
|
54
|
+
out += subgroup.to_asciibib "#{pref}.subgroup" if subgroup
|
55
|
+
out += workgroup.to_asciibib "#{pref}.workgroup" if workgroup
|
56
|
+
out
|
57
|
+
end
|
46
58
|
end
|
47
59
|
end
|
@@ -9,12 +9,10 @@ module RelatonItu
|
|
9
9
|
|
10
10
|
# @params structuredidentifier [RelatonItu::StructuredIdentifier]
|
11
11
|
def initialize(**args)
|
12
|
-
# @doctype = args.delete :doctype
|
13
12
|
if args[:doctype] && !TYPES.include?(args[:doctype])
|
14
13
|
warn "[relaton-itu] WARNING: invalid doctype: #{args[:doctype]}"
|
15
14
|
end
|
16
15
|
super
|
17
|
-
# @doctype = args[:doctype]
|
18
16
|
end
|
19
17
|
end
|
20
18
|
end
|
@@ -67,14 +67,6 @@ module RelatonItu
|
|
67
67
|
nil
|
68
68
|
end
|
69
69
|
|
70
|
-
# def fetch_pages(hits, threads)
|
71
|
-
# workers = RelatonBib::WorkersPool.new threads
|
72
|
-
# workers.worker { |w| { i: w[:i], hit: w[:hit].fetch } }
|
73
|
-
# hits.each_with_index { |hit, i| workers << { i: i, hit: hit } }
|
74
|
-
# workers.end
|
75
|
-
# workers.result.sort_by { |a| a[:i] }.map { |x| x[:hit] }
|
76
|
-
# end
|
77
|
-
|
78
70
|
def search_filter(code)
|
79
71
|
docidrx = %r{\w+\.\d+|\w\sSuppl\.\s\d+} # %r{^ITU-T\s[^\s]+}
|
80
72
|
c = code.sub(/Imp\s?/, "").match(docidrx).to_s
|
@@ -28,6 +28,16 @@ module RelatonItu
|
|
28
28
|
hash["finish"] = finish if finish
|
29
29
|
hash
|
30
30
|
end
|
31
|
+
|
32
|
+
# @param prefix [String]
|
33
|
+
# @return [String]
|
34
|
+
def to_asciibib(prefix)
|
35
|
+
pref = prefix.empty? ? prefix : prefix + "."
|
36
|
+
pref += "period"
|
37
|
+
out = "#{pref}.start:: #{start}\n"
|
38
|
+
out += "#{pref}.finish:: #{finish}\n" if finish
|
39
|
+
out
|
40
|
+
end
|
31
41
|
end
|
32
42
|
|
33
43
|
TYPES = %w[tsag study-group work-group].freeze
|
@@ -72,5 +82,16 @@ module RelatonItu
|
|
72
82
|
hash["period"] = period.to_hash if period
|
73
83
|
hash
|
74
84
|
end
|
85
|
+
|
86
|
+
# @param prefix [String]
|
87
|
+
# @return [String]
|
88
|
+
def to_asciibib(prefix)
|
89
|
+
pref = prefix.empty? ? prefix : prefix + "."
|
90
|
+
out = "#{pref}name:: #{name}\n"
|
91
|
+
out += "#{pref}type:: #{type}\n" if type
|
92
|
+
out += "#{pref}acronym:: #{acronym}\n" if acronym
|
93
|
+
out += period.to_asciibib prefix if period
|
94
|
+
out
|
95
|
+
end
|
75
96
|
end
|
76
97
|
end
|
@@ -34,6 +34,16 @@ module RelatonItu
|
|
34
34
|
hash
|
35
35
|
end
|
36
36
|
|
37
|
+
# @param prefix [String]
|
38
|
+
# @return [String]
|
39
|
+
def to_asciibib(prefix)
|
40
|
+
pref = prefix.empty? ? prefix : prefix + "."
|
41
|
+
pref += "structuredidentifier"
|
42
|
+
out = "#{pref}.bureau:: #{bureau}\n#{pref}.docnumber:: #{docnumber}\n"
|
43
|
+
out += "#{pref}.annexid:: #{annexid}\n" if annexid
|
44
|
+
out
|
45
|
+
end
|
46
|
+
|
37
47
|
def presence?
|
38
48
|
true
|
39
49
|
end
|
data/lib/relaton_itu/version.rb
CHANGED
data/relaton-itu.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-itu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.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: 2020-
|
11
|
+
date: 2020-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: debase
|
@@ -156,14 +156,14 @@ dependencies:
|
|
156
156
|
requirements:
|
157
157
|
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 1.
|
159
|
+
version: 1.3.0
|
160
160
|
type: :runtime
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: 1.
|
166
|
+
version: 1.3.0
|
167
167
|
description: 'RelatonItu: retrieve ITU Standards for bibliographic use using the BibliographicItem
|
168
168
|
model'
|
169
169
|
email:
|