relaton 1.7.0 → 1.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +46 -0
- data/docs/README.adoc +228 -2
- data/globalcache/iec/iec_60050_102_2007.xml +58 -0
- data/globalcache/iec/version +1 -0
- data/lib/relaton.rb +8 -7
- data/lib/relaton/config.rb +3 -2
- data/lib/relaton/db.rb +237 -32
- data/lib/relaton/db_cache.rb +22 -6
- data/lib/relaton/processor.rb +11 -0
- data/lib/relaton/registry.rb +1 -1
- data/lib/relaton/version.rb +1 -1
- data/lib/relaton/workers_pool.rb +23 -0
- data/localcache/iec/iec_60050_102_2007.xml +58 -0
- data/localcache/iec/version +1 -0
- data/relaton.gemspec +8 -6
- data/spec/relaton/db_cache_spec.rb +1 -1
- data/spec/relaton/db_spec.rb +122 -0
- data/spec/relaton/processor_spec.rb +4 -0
- data/spec/relaton/regirtry_spec.rb +54 -44
- data/spec/relaton_spec.rb +120 -19
- data/spec/vcr_cassetes/19133_2005.yml +18 -18
- data/spec/vcr_cassetes/cc_dir_10005_2019.yml +7 -7
- data/spec/vcr_cassetes/cie_001_1980.yml +120 -0
- data/spec/vcr_cassetes/ecma_6.yml +94 -0
- data/spec/vcr_cassetes/fisp_140.yml +6 -6
- data/spec/vcr_cassetes/gb_t_20223_2006.yml +13 -9
- data/spec/vcr_cassetes/hist_cmbined_included.yml +105 -0
- data/spec/vcr_cassetes/iec_60050_102_2007.yml +283 -0
- data/spec/vcr_cassetes/iec_combined_included.yml +945 -0
- data/spec/vcr_cassetes/ieee_528_2019.yml +15 -15
- data/spec/vcr_cassetes/iho_b_11.yml +15 -15
- data/spec/vcr_cassetes/iso_111111119115_1.yml +4 -4
- data/spec/vcr_cassetes/iso_19115.yml +19 -19
- data/spec/vcr_cassetes/iso_19115_1.yml +17 -17
- data/spec/vcr_cassetes/iso_19115_1_2.yml +35 -35
- data/spec/vcr_cassetes/iso_awi_24229.yml +18 -18
- data/spec/vcr_cassetes/iso_combined_applied.yml +361 -0
- data/spec/vcr_cassetes/iso_combined_included.yml +361 -0
- data/spec/vcr_cassetes/itu_combined_included.yml +1296 -0
- data/spec/vcr_cassetes/ogc_19_025r1.yml +2484 -1901
- data/spec/vcr_cassetes/ogm_ami4ccm_1_0.yml +7 -7
- data/spec/vcr_cassetes/rfc_8341.yml +47 -15
- data/spec/vcr_cassetes/rfc_unsuccess.yml +70 -0
- data/spec/vcr_cassetes/sp_800_38b.yml +6 -6
- data/spec/vcr_cassetes/un_rtade_cefact_2004_32.yml +30 -30
- data/spec/vcr_cassetes/w3c_json_ld11.yml +12 -12
- metadata +62 -50
- data/.github/workflows/macos.yml +0 -34
- data/.github/workflows/ubuntu.yml +0 -32
- data/.github/workflows/windows.yml +0 -35
data/lib/relaton/db_cache.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "fileutils"
|
2
|
+
require "timeout"
|
2
3
|
|
3
4
|
module Relaton
|
4
5
|
class DbCache
|
@@ -14,6 +15,20 @@ module Relaton
|
|
14
15
|
# set_version # unless File.exist? file_version
|
15
16
|
end
|
16
17
|
|
18
|
+
# Move caches to anothe dir
|
19
|
+
# @param new_dir [String, nil]
|
20
|
+
def mv(new_dir)
|
21
|
+
return unless new_dir && @ext == "xml"
|
22
|
+
|
23
|
+
FileUtils.mv dir, new_dir
|
24
|
+
@dir = new_dir
|
25
|
+
end
|
26
|
+
|
27
|
+
# Clear database
|
28
|
+
def clear
|
29
|
+
FileUtils.rm_rf Dir.glob "#{dir}/*" if @ext == "xml" # unless it's static DB
|
30
|
+
end
|
31
|
+
|
17
32
|
# Save item
|
18
33
|
# @param key [String]
|
19
34
|
# @param value [String] Bibitem xml serialization
|
@@ -65,7 +80,7 @@ module Relaton
|
|
65
80
|
value = self[key]
|
66
81
|
return unless value
|
67
82
|
|
68
|
-
if value
|
83
|
+
if value.match? /^not_found/
|
69
84
|
value.match(/\d{4}-\d{2}-\d{2}/).to_s
|
70
85
|
else
|
71
86
|
doc = Nokogiri::XML value
|
@@ -76,8 +91,9 @@ module Relaton
|
|
76
91
|
# Returns all items
|
77
92
|
# @return [Array<String>]
|
78
93
|
def all
|
79
|
-
Dir.glob("#{@dir}/**/*.xml").sort.map do |f|
|
80
|
-
File.read(f, encoding: "utf-8")
|
94
|
+
Dir.glob("#{@dir}/**/*.{xml,yml,yaml}").sort.map do |f|
|
95
|
+
content = File.read(f, encoding: "utf-8")
|
96
|
+
block_given? ? yield(f, content) : content
|
81
97
|
end
|
82
98
|
end
|
83
99
|
|
@@ -159,7 +175,7 @@ module Relaton
|
|
159
175
|
def filename(key)
|
160
176
|
prefcode = key.downcase.match /^(?<prefix>[^\(]+)\((?<code>[^\)]+)/
|
161
177
|
fn = if prefcode
|
162
|
-
"#{prefcode[:prefix]}/#{prefcode[:code].gsub(/[-:\s\/\()]/, '_').squeeze(
|
178
|
+
"#{prefcode[:prefix]}/#{prefcode[:code].gsub(/[-:\s\/\()]/, '_').squeeze('_')}"
|
163
179
|
else
|
164
180
|
key.gsub(/[-:\s]/, "_")
|
165
181
|
end
|
@@ -193,7 +209,7 @@ module Relaton
|
|
193
209
|
# @content [String]
|
194
210
|
def file_safe_write(file, content)
|
195
211
|
File.open file, File::RDWR | File::CREAT, encoding: "UTF-8" do |f|
|
196
|
-
Timeout.timeout(
|
212
|
+
Timeout.timeout(10) { f.flock File::LOCK_EX }
|
197
213
|
f.write content
|
198
214
|
end
|
199
215
|
end
|
@@ -218,7 +234,7 @@ module Relaton
|
|
218
234
|
# local_cache: local cache name; none created if nil; "relaton" created
|
219
235
|
# if empty global_cache: boolean to create global_cache
|
220
236
|
# flush_caches: flush caches
|
221
|
-
def init_bib_caches(opts)
|
237
|
+
def init_bib_caches(opts) # rubocop:disable Metrics/CyclomaticComplexity
|
222
238
|
globalname = global_bibliocache_name if opts[:global_cache]
|
223
239
|
localname = local_bibliocache_name(opts[:local_cache])
|
224
240
|
localname = "relaton" if localname&.empty?
|
data/lib/relaton/processor.rb
CHANGED
@@ -20,5 +20,16 @@ module Relaton
|
|
20
20
|
def hash_to_bib(_hash)
|
21
21
|
raise "This is an abstract class!"
|
22
22
|
end
|
23
|
+
|
24
|
+
def grammar_hash
|
25
|
+
raise "This is an abstract class!"
|
26
|
+
end
|
27
|
+
|
28
|
+
# Retuns default number of workers. Should be overraded by childred classes if need.
|
29
|
+
#
|
30
|
+
# @return [Integer] nuber of wokrers
|
31
|
+
def threads
|
32
|
+
10
|
33
|
+
end
|
23
34
|
end
|
24
35
|
end
|
data/lib/relaton/registry.rb
CHANGED
@@ -8,7 +8,7 @@ module Relaton
|
|
8
8
|
SUPPORTED_GEMS = %w[
|
9
9
|
relaton_gb relaton_iec relaton_ietf relaton_iso relaton_itu relaton_nist
|
10
10
|
relaton_ogc relaton_calconnect relaton_omg relaton_un relaton_w3c
|
11
|
-
relaton_ieee relaton_iho relaton_bipm
|
11
|
+
relaton_ieee relaton_iho relaton_bipm relaton_ecma relaton_cie
|
12
12
|
].freeze
|
13
13
|
|
14
14
|
include Singleton
|
data/lib/relaton/version.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Relaton
|
4
|
+
# Workers poll.
|
5
|
+
class WorkersPool
|
6
|
+
def initialize(workers = 2, &_block)
|
7
|
+
num_workers = workers < 2 ? 2 : workers
|
8
|
+
@queue = SizedQueue.new(num_workers * 2)
|
9
|
+
@threads = Array.new num_workers do
|
10
|
+
Thread.new do
|
11
|
+
while item = @queue.pop
|
12
|
+
yield(item)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def <<(item)
|
19
|
+
@queue << item
|
20
|
+
self
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
<bibdata type="standard">
|
2
|
+
<fetched>2021-02-03</fetched>
|
3
|
+
<title type="title-main" format="text/plain" language="en" script="Latn">International Electrotechnical Vocabulary (IEV)</title>
|
4
|
+
<title type="title-part" format="text/plain" language="en" script="Latn">Part 102: Mathematics -- General concepts and linear algebra</title>
|
5
|
+
<title type="main" format="text/plain" language="en" script="Latn">International Electrotechnical Vocabulary (IEV) - Part 102: Mathematics -- General concepts and linear algebra</title>
|
6
|
+
<uri type="src">https://webstore.iec.ch/publication/160</uri>
|
7
|
+
<uri type="obp">/preview/info_iec60050-102%7Bed1.0%7Db.pdf</uri>
|
8
|
+
<docidentifier type="IEC">IEC 60050-102:2007</docidentifier>
|
9
|
+
<docidentifier type="URN">urn:iec:std:iec:60050-102:2007:::en</docidentifier>
|
10
|
+
<date type="published">
|
11
|
+
<on>2007-08-27</on>
|
12
|
+
</date>
|
13
|
+
<contributor>
|
14
|
+
<role type="publisher"/>
|
15
|
+
<organization>
|
16
|
+
<name>International Electrotechnical Commission</name>
|
17
|
+
<abbreviation>IEC</abbreviation>
|
18
|
+
<uri>www.iec.ch</uri>
|
19
|
+
</organization>
|
20
|
+
</contributor>
|
21
|
+
<edition>1.0</edition>
|
22
|
+
<language>en</language>
|
23
|
+
<script>Latn</script>
|
24
|
+
<abstract format="text/plain" language="en" script="Latn">This part of IEC 60050 gives the general mathematical terminology used in the fields of electricity, electronics and telecommunications, together with basic concepts in linear algebra. It maintains a clear distinction between mathematical concepts and physical concepts, even if some terms are used in both cases. Another part will deal with functions.
|
25
|
+
It has the status of a horizontal standard in accordance with IEC Guide 108.</abstract>
|
26
|
+
<status>
|
27
|
+
<stage>60</stage>
|
28
|
+
<substage>60</substage>
|
29
|
+
</status>
|
30
|
+
<copyright>
|
31
|
+
<from>2007</from>
|
32
|
+
<owner>
|
33
|
+
<organization>
|
34
|
+
<name>International Electrotechnical Commission</name>
|
35
|
+
<abbreviation>IEC</abbreviation>
|
36
|
+
<uri>www.iec.ch</uri>
|
37
|
+
</organization>
|
38
|
+
</owner>
|
39
|
+
</copyright>
|
40
|
+
<place>Geneva</place>
|
41
|
+
<ext>
|
42
|
+
<doctype>international-standard</doctype>
|
43
|
+
<editorialgroup>
|
44
|
+
<technical-committee number="1" type="technicalCommittee">TC 1 - Terminology</technical-committee>
|
45
|
+
</editorialgroup>
|
46
|
+
<ics>
|
47
|
+
<code>01.040.07</code>
|
48
|
+
<text>Natural and applied sciences (Vocabularies)</text>
|
49
|
+
</ics>
|
50
|
+
<ics>
|
51
|
+
<code>07.020</code>
|
52
|
+
<text>Mathematics</text>
|
53
|
+
</ics>
|
54
|
+
<structuredidentifier type="IEC">
|
55
|
+
<project-number>60050</project-number>
|
56
|
+
</structuredidentifier>
|
57
|
+
</ext>
|
58
|
+
</bibdata>
|
@@ -0,0 +1 @@
|
|
1
|
+
407d6f5afdc9ae9ea7abe6e84d27f40b
|
data/relaton.gemspec
CHANGED
@@ -32,21 +32,23 @@ Gem::Specification.new do |spec|
|
|
32
32
|
# spec.add_dependency "algoliasearch"
|
33
33
|
spec.add_dependency "relaton-bipm", "~> 1.7.0"
|
34
34
|
spec.add_dependency "relaton-calconnect", "~> 1.7.0"
|
35
|
+
spec.add_dependency "relaton-cie", "1.7.pre1"
|
36
|
+
spec.add_dependency "relaton-ecma", "1.7.pre1"
|
35
37
|
spec.add_dependency "relaton-gb", "~> 1.7.0"
|
36
|
-
spec.add_dependency "relaton-iec", "
|
38
|
+
spec.add_dependency "relaton-iec", ">= 1.7.6"
|
37
39
|
spec.add_dependency "relaton-ieee", "~> 1.7.0"
|
38
40
|
spec.add_dependency "relaton-ietf", "~> 1.7.0"
|
39
41
|
spec.add_dependency "relaton-iho", "~> 1.7.0"
|
40
|
-
spec.add_dependency "relaton-iso", "
|
41
|
-
spec.add_dependency "relaton-itu", "
|
42
|
-
spec.add_dependency "relaton-nist", "
|
42
|
+
spec.add_dependency "relaton-iso", ">= 1.7.1"
|
43
|
+
spec.add_dependency "relaton-itu", ">= 1.7.2"
|
44
|
+
spec.add_dependency "relaton-nist", ">= 1.7.1"
|
43
45
|
spec.add_dependency "relaton-ogc", "~> 1.7.0"
|
44
46
|
spec.add_dependency "relaton-omg", "~> 1.7.0"
|
45
47
|
spec.add_dependency "relaton-un", "~> 1.7.0"
|
46
48
|
spec.add_dependency "relaton-w3c", "~> 1.7.0"
|
47
49
|
|
48
50
|
spec.add_development_dependency "byebug", "~> 11.0"
|
49
|
-
spec.add_development_dependency "debase"
|
51
|
+
# spec.add_development_dependency "debase"
|
50
52
|
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
51
53
|
spec.add_development_dependency "guard", "~> 2.14"
|
52
54
|
spec.add_development_dependency "guard-rspec", "~> 4.7"
|
@@ -54,7 +56,7 @@ Gem::Specification.new do |spec|
|
|
54
56
|
spec.add_development_dependency "rake", "~> 10.0"
|
55
57
|
spec.add_development_dependency "rspec", "~> 3.6"
|
56
58
|
spec.add_development_dependency "rubocop", "= 0.54.0"
|
57
|
-
spec.add_development_dependency "ruby-debug-ide"
|
59
|
+
# spec.add_development_dependency "ruby-debug-ide"
|
58
60
|
spec.add_development_dependency "simplecov", "~> 0.15"
|
59
61
|
spec.add_development_dependency "timecop", "~> 0.9"
|
60
62
|
spec.add_development_dependency "vcr", "~> 5"
|
@@ -7,7 +7,7 @@ RSpec.describe Relaton::DbCache do
|
|
7
7
|
FileUtils.mv cache_path, "relaton1/cache", force: true
|
8
8
|
FileUtils.rm_rf %w(relaton)
|
9
9
|
Relaton::DbCache.init_bib_caches(
|
10
|
-
global_cache: true, local_cache: "", flush_caches: true
|
10
|
+
global_cache: true, local_cache: "", flush_caches: true
|
11
11
|
)
|
12
12
|
expect(File.exist?(cache_path)).to be true
|
13
13
|
expect(File.exist?("relaton")).to be true
|
data/spec/relaton/db_spec.rb
CHANGED
@@ -1,6 +1,98 @@
|
|
1
1
|
RSpec.describe Relaton::Db do
|
2
2
|
before(:each) { FileUtils.rm_rf %w[testcache testcache2] }
|
3
3
|
|
4
|
+
context "modifing database" do
|
5
|
+
it "move to new dir" do
|
6
|
+
db = Relaton::Db.new "global_cache", "local_cache"
|
7
|
+
db.save_entry "ISO(ISO 123)", "<bibitem id='ISO123></bibitem>"
|
8
|
+
expect(File.exist?("global_cache")).to be true
|
9
|
+
expect(File.exist?("local_cache")).to be true
|
10
|
+
db.mv "testcache", "testcache2"
|
11
|
+
expect(File.exist?("testcache")).to be true
|
12
|
+
expect(File.exist?("global_cache")).to be false
|
13
|
+
expect(File.exist?("testcache2")).to be true
|
14
|
+
expect(File.exist?("local_cache")).to be false
|
15
|
+
end
|
16
|
+
|
17
|
+
it "clear" do
|
18
|
+
db = Relaton::Db.new "testcache", "testcache2"
|
19
|
+
db.save_entry "ISO(ISO 123)", "<bibitem id='ISO123></bibitem>"
|
20
|
+
expect(File.exist?("testcache/iso")).to be true
|
21
|
+
expect(File.exist?("testcache2/iso")).to be true
|
22
|
+
db.clear
|
23
|
+
expect(File.exist?("testcache/iso")).to be false
|
24
|
+
expect(File.exist?("testcache2/iso")).to be false
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
context "query in local DB" do
|
29
|
+
let(:db) { Relaton::Db.new "testcache", "testcache2" }
|
30
|
+
|
31
|
+
before(:each) do
|
32
|
+
db.save_entry "ISO(ISO 123)", <<~DOC
|
33
|
+
<bibitem id='ISO123'>
|
34
|
+
<title>The first test</title><edition>2</edition><date type="published"><on>2011-10-12</on></date>
|
35
|
+
</bibitem>
|
36
|
+
DOC
|
37
|
+
db.save_entry "IEC(IEC 123)", <<~DOC
|
38
|
+
<bibitem id="IEC123">
|
39
|
+
<title>The second test</title><edition>1</edition><date type="published"><on>2015-12</on></date>
|
40
|
+
</bibitem>
|
41
|
+
DOC
|
42
|
+
end
|
43
|
+
|
44
|
+
after(:each) { db.clear }
|
45
|
+
|
46
|
+
it "one document" do
|
47
|
+
item = db.fetch_db "ISO((ISO 124)"
|
48
|
+
expect(item).to be_nil
|
49
|
+
item = db.fetch_db "ISO(ISO 123)"
|
50
|
+
expect(item).to be_instance_of RelatonIsoBib::IsoBibliographicItem
|
51
|
+
end
|
52
|
+
|
53
|
+
it "all documents" do
|
54
|
+
items = db.fetch_all
|
55
|
+
expect(items.size).to be 9
|
56
|
+
expect(items[7]).to be_instance_of RelatonIec::IecBibliographicItem
|
57
|
+
expect(items[8]).to be_instance_of RelatonIsoBib::IsoBibliographicItem
|
58
|
+
end
|
59
|
+
|
60
|
+
context "search for text" do
|
61
|
+
it do
|
62
|
+
items = db.fetch_all "test"
|
63
|
+
expect(items.size).to eq 2
|
64
|
+
items = db.fetch_all "first"
|
65
|
+
expect(items.size).to eq 1
|
66
|
+
expect(items[0].id).to eq "ISO123"
|
67
|
+
end
|
68
|
+
|
69
|
+
it "in attributes" do
|
70
|
+
items = db.fetch_all "123"
|
71
|
+
expect(items.size).to eq 2
|
72
|
+
items = db.fetch_all "ISO"
|
73
|
+
expect(items.size).to eq 8
|
74
|
+
expect(items[7].id).to eq "ISO123"
|
75
|
+
end
|
76
|
+
|
77
|
+
it "and fail" do
|
78
|
+
items = db.fetch_all "bibitem"
|
79
|
+
expect(items.size).to eq 0
|
80
|
+
end
|
81
|
+
|
82
|
+
it "and edition" do
|
83
|
+
items = db.fetch_all "123", edition: "2"
|
84
|
+
expect(items.size).to eq 1
|
85
|
+
expect(items[0].id).to eq "ISO123"
|
86
|
+
end
|
87
|
+
|
88
|
+
it "and year" do
|
89
|
+
items = db.fetch_all "123", year: 2015
|
90
|
+
expect(items.size).to eq 1
|
91
|
+
expect(items[0].id).to eq "IEC123"
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
4
96
|
it "returns docid type" do
|
5
97
|
db = Relaton::Db.new "testcache", "testcache2"
|
6
98
|
expect(db.docid_type("CN(GB/T 1.1)")).to eq ["Chinese Standard", "GB/T 1.1"]
|
@@ -30,6 +122,36 @@ RSpec.describe Relaton::Db do
|
|
30
122
|
end
|
31
123
|
end
|
32
124
|
|
125
|
+
it "fetch document with net retries" do
|
126
|
+
db = Relaton::Db.new nil, nil
|
127
|
+
expect(db.instance_variable_get(:@registry).processors[:relaton_ietf]).to receive(:get)
|
128
|
+
.and_raise(RelatonBib::RequestError).exactly(3).times
|
129
|
+
expect { db.fetch "RFC 8341", nil, retries: 3 }.to raise_error RelatonBib::RequestError
|
130
|
+
end
|
131
|
+
|
132
|
+
context "async fetch" do
|
133
|
+
let(:db) { Relaton::Db.new nil, nil }
|
134
|
+
let(:queue) { Queue.new }
|
135
|
+
|
136
|
+
it "success" do
|
137
|
+
result = nil
|
138
|
+
VCR.use_cassette "rfc_8341" do
|
139
|
+
db.fetch_async("RFC 8341") { |r| queue << r }
|
140
|
+
Timeout.timeout(5) { result = queue.pop }
|
141
|
+
end
|
142
|
+
expect(result).to be_instance_of RelatonIetf::IetfBibliographicItem
|
143
|
+
end
|
144
|
+
|
145
|
+
it "prefix not found" do
|
146
|
+
result = ""
|
147
|
+
VCR.use_cassette "rfc_unsuccess" do
|
148
|
+
db.fetch_async("ABC 123456") { |r| queue << r }
|
149
|
+
Timeout.timeout(5) { result = queue.pop }
|
150
|
+
end
|
151
|
+
expect(result).to be_nil
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
33
155
|
context "fetch documents form static cache" do
|
34
156
|
let(:db) { Relaton::Db.new nil, nil }
|
35
157
|
|
@@ -23,5 +23,9 @@ RSpec.describe Relaton::Processor do
|
|
23
23
|
it "hash_to_bib method should be implemented" do
|
24
24
|
expect { subject.hash_to_bib({}) }.to raise_error StandardError
|
25
25
|
end
|
26
|
+
|
27
|
+
it "grammar_hash method should be implemented" do
|
28
|
+
expect { subject.grammar_hash }.to raise_error StandardError
|
29
|
+
end
|
26
30
|
end
|
27
31
|
end
|
@@ -2,72 +2,82 @@ RSpec.describe Relaton::Registry do
|
|
2
2
|
it "outputs backend not present" do
|
3
3
|
stub_const "Relaton::Registry::SUPPORTED_GEMS", ["not_supported_gem"]
|
4
4
|
expect { Relaton::Registry.clone.instance }.to output(
|
5
|
-
/backend not_supported_gem not present
|
5
|
+
/backend not_supported_gem not present/
|
6
6
|
).to_stdout
|
7
7
|
end
|
8
8
|
|
9
9
|
it "finds ISO processor" do
|
10
|
-
expect(Relaton::Registry.instance.find_processor("relaton_iso"))
|
11
|
-
to be_instance_of RelatonIso::Processor
|
10
|
+
expect(Relaton::Registry.instance.find_processor("relaton_iso"))
|
11
|
+
.to be_instance_of RelatonIso::Processor
|
12
12
|
end
|
13
13
|
|
14
14
|
it "returns supported processors" do
|
15
15
|
expect(Relaton::Registry.instance.supported_processors).to include :relaton_iso
|
16
16
|
end
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
context "finds processor by type" do
|
19
|
+
it "CN" do
|
20
|
+
expect(Relaton::Registry.instance.by_type("CN")).to be_instance_of RelatonGb::Processor
|
21
|
+
end
|
21
22
|
|
22
|
-
|
23
|
-
|
24
|
-
|
23
|
+
it "IEC" do
|
24
|
+
expect(Relaton::Registry.instance.by_type("IEC")).to be_instance_of RelatonIec::Processor
|
25
|
+
end
|
25
26
|
|
26
|
-
|
27
|
-
|
28
|
-
|
27
|
+
it "IETF" do
|
28
|
+
expect(Relaton::Registry.instance.by_type("IETF")).to be_instance_of RelatonIetf::Processor
|
29
|
+
end
|
29
30
|
|
30
|
-
|
31
|
-
|
32
|
-
|
31
|
+
it "ISO" do
|
32
|
+
expect(Relaton::Registry.instance.by_type("ISO")).to be_instance_of RelatonIso::Processor
|
33
|
+
end
|
33
34
|
|
34
|
-
|
35
|
-
|
36
|
-
|
35
|
+
it "ITU" do
|
36
|
+
expect(Relaton::Registry.instance.by_type("ITU")).to be_instance_of RelatonItu::Processor
|
37
|
+
end
|
37
38
|
|
38
|
-
|
39
|
-
|
40
|
-
|
39
|
+
it "NIST" do
|
40
|
+
expect(Relaton::Registry.instance.by_type("NIST")).to be_instance_of RelatonNist::Processor
|
41
|
+
end
|
41
42
|
|
42
|
-
|
43
|
-
|
44
|
-
|
43
|
+
it "OGC" do
|
44
|
+
expect(Relaton::Registry.instance.by_type("OGC")).to be_instance_of RelatonOgc::Processor
|
45
|
+
end
|
45
46
|
|
46
|
-
|
47
|
-
|
48
|
-
|
47
|
+
it "CC" do
|
48
|
+
expect(Relaton::Registry.instance.by_type("CC")).to be_instance_of RelatonCalconnect::Processor
|
49
|
+
end
|
49
50
|
|
50
|
-
|
51
|
-
|
52
|
-
|
51
|
+
it "OMG" do
|
52
|
+
expect(Relaton::Registry.instance.by_type("OMG")).to be_instance_of RelatonOmg::Processor
|
53
|
+
end
|
53
54
|
|
54
|
-
|
55
|
-
|
56
|
-
|
55
|
+
it "UN" do
|
56
|
+
expect(Relaton::Registry.instance.by_type("UN")).to be_instance_of RelatonUn::Processor
|
57
|
+
end
|
57
58
|
|
58
|
-
|
59
|
-
|
60
|
-
|
59
|
+
it "W3C" do
|
60
|
+
expect(Relaton::Registry.instance.by_type("W3C")).to be_instance_of RelatonW3c::Processor
|
61
|
+
end
|
61
62
|
|
62
|
-
|
63
|
-
|
64
|
-
|
63
|
+
it "IEEE" do
|
64
|
+
expect(Relaton::Registry.instance.by_type("IEEE")).to be_instance_of RelatonIeee::Processor
|
65
|
+
end
|
65
66
|
|
66
|
-
|
67
|
-
|
68
|
-
|
67
|
+
it "IHO" do
|
68
|
+
expect(Relaton::Registry.instance.by_type("IHO")).to be_instance_of RelatonIho::Processor
|
69
|
+
end
|
70
|
+
|
71
|
+
it "BIPM" do
|
72
|
+
expect(Relaton::Registry.instance.by_type("BIPM")).to be_instance_of RelatonBipm::Processor
|
73
|
+
end
|
74
|
+
|
75
|
+
it "ECMA" do
|
76
|
+
expect(Relaton::Registry.instance.by_type("ECMA")).to be_instance_of RelatonEcma::Processor
|
77
|
+
end
|
69
78
|
|
70
|
-
|
71
|
-
|
79
|
+
it "CIE" do
|
80
|
+
expect(Relaton::Registry.instance.by_type("CIE")).to be_instance_of RelatonCie::Processor
|
81
|
+
end
|
72
82
|
end
|
73
83
|
end
|