relaton 1.19.0 → 1.19.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f0ddaf211c05222758cc04c4183f57c326c45d3a3edb2ae24e1abb6c394db5f
4
- data.tar.gz: 9757e439532532367945ce41b14f5b7941f8e141615c5a8f690422d9f8b77654
3
+ metadata.gz: 5a133026bf858511b0385b639ec7cc96ab0f855c31a5446d1d118d009eda235d
4
+ data.tar.gz: b9b89a70476bf01a6c9ca710047ccf13f4531174dafa12e5b37908bdf668d44c
5
5
  SHA512:
6
- metadata.gz: 3ad04fc9310b0d477df6243411f9aa2e5740a47e231eec23d45270d60aecf5633e600fd629d2e315b7b284bc7a3304c0df7370a7418c64181b7ac46565b65c5a
7
- data.tar.gz: 2bd8e7681cb05369277bfc3f84f9741d75fe79a44d311863e2b563010bb94b14c8414903e0941ced1b67448032a5a3d94172c1773f605f58b80b27be421b6d9a
6
+ metadata.gz: d35962b592b2eb4ed65261bed9638d304bd91ffc09baf1cb40c7e245692381b28d6d4985fe321d326d09770afa738ea3cce1e15ab499501d4221228559051140
7
+ data.tar.gz: 46d9116df1ae0f23d7aea5763908bb4b5ac3ec3073d2bbd8b67578c94b85ab5ab89f327747f420ca2226409955ff78de41a4eeabd7992cb32383491386a45b99
@@ -10,7 +10,7 @@ module Relaton
10
10
  relaton_ogc relaton_calconnect relaton_omg relaton_un relaton_w3c
11
11
  relaton_ieee relaton_iho relaton_bipm relaton_ecma relaton_cie relaton_bsi
12
12
  relaton_cen relaton_iana relaton_3gpp relaton_oasis relaton_doi relaton_jis
13
- relaton_xsf relaton_ccsds relaton_etsi relaton_isbn
13
+ relaton_xsf relaton_ccsds relaton_etsi relaton_isbn relaton/plateau
14
14
  ].freeze
15
15
 
16
16
  include Singleton
@@ -107,7 +107,9 @@ module Relaton
107
107
  private
108
108
 
109
109
  def camel_case(gem_name)
110
- gem_name.split("_").map(&:capitalize).join
110
+ gem_name.split("/").map do |part|
111
+ part.split("_").map(&:capitalize).join
112
+ end.join("::")
111
113
  end
112
114
  end
113
115
  end
@@ -1,3 +1,3 @@
1
1
  module Relaton
2
- VERSION = "1.19.0".freeze
2
+ VERSION = "1.19.1".freeze
3
3
  end
data/relaton.gemspec CHANGED
@@ -53,6 +53,7 @@ Gem::Specification.new do |spec|
53
53
  spec.add_dependency "relaton-oasis", "~> 1.19.0"
54
54
  spec.add_dependency "relaton-ogc", "~> 1.19.0"
55
55
  spec.add_dependency "relaton-omg", "~> 1.19.0"
56
+ spec.add_dependency "relaton-plateau", "~> 1.19.0"
56
57
  spec.add_dependency "relaton-un", "~> 1.19.0"
57
58
  spec.add_dependency "relaton-w3c", "~> 1.19.0"
58
59
  spec.add_dependency "relaton-xsf", "~> 1.19.0"
@@ -127,6 +127,42 @@ RSpec.describe Relaton::Registry do
127
127
  it "ISBN" do
128
128
  expect(Relaton::Registry.instance.by_type("ISBN")).to be_instance_of RelatonIsbn::Processor
129
129
  end
130
+
131
+ context "PLATEAU" do
132
+ let(:processor) { Relaton::Registry.instance.by_type("PLATEAU") }
133
+ before { processor }
134
+
135
+ it "finds processor" do
136
+ expect(processor).to be_instance_of Relaton::Plateau::Processor
137
+ end
138
+
139
+ it "fetch data" do
140
+ expect(Relaton::Plateau::Fetcher).to receive(:fetch).with("plateau-handbooks", output: "dir", format: "xml")
141
+ processor.fetch_data "plateau-handbooks", output: "dir", format: "xml"
142
+ end
143
+
144
+ it "from_xml" do
145
+ expect(Relaton::Plateau::XMLParser).to receive(:from_xml).with(:xml).and_return :bibitem
146
+ expect(processor.from_xml(:xml)).to eq :bibitem
147
+ end
148
+
149
+ it "hash_to_bib" do
150
+ expect(Relaton::Plateau::HashConverter).to receive(:hash_to_bib).with(:hash).and_return bib: :bib
151
+ expect(Relaton::Plateau::BibItem).to receive(:new).with(bib: :bib).and_return :bibitem
152
+ expect(processor.hash_to_bib(:hash)).to eq :bibitem
153
+ end
154
+
155
+ it "grammar_hash" do
156
+ expect(processor.grammar_hash).to be_instance_of String
157
+ end
158
+
159
+ it "remove_index_file" do
160
+ index = double "index"
161
+ expect(index).to receive(:remove_file)
162
+ expect(Relaton::Index).to receive(:find_or_create).and_return index
163
+ processor.remove_index_file
164
+ end
165
+ end
130
166
  end
131
167
 
132
168
  it "find processot by dataset" do
data/spec/relaton_spec.rb CHANGED
@@ -373,6 +373,15 @@ RSpec.describe Relaton::Db do
373
373
  expect(bib.docidentifier.first.id).to eq "ISBN 978-0-580-50101-4"
374
374
  end
375
375
 
376
+ it "get PLATEAU reference" do
377
+ docid = RelatonBib::DocumentIdentifier.new(id: "PLATEAU Hanbook #01", type: "PLATEAU")
378
+ item = Relaton::Plateau::BibItem.new docid: [docid]
379
+ expect(Relaton::Plateau::Bibliography).to receive(:get).with("PLATEAU Hanbook #01", nil, {}).and_return item
380
+ bib = @db.fetch "PLATEAU Hanbook #01"
381
+ expect(bib).to be_instance_of Relaton::Plateau::BibItem
382
+ expect(bib.docidentifier.first.id).to eq "PLATEAU Hanbook #01"
383
+ end
384
+
376
385
  context "get combined documents" do
377
386
  context "ISO" do
378
387
  it "included" do