libis-services 0.1.12 → 0.1.13

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
  SHA1:
3
- metadata.gz: ba5e29784d68584bf65c2e37772585e3cc629d35
4
- data.tar.gz: 8187615a4b52a6e2a89507e63e349cae6897a2a5
3
+ metadata.gz: dd75c079899e08571582664c3c087ef2ff54f0e1
4
+ data.tar.gz: 9ebb2a369af921f3bfc12ed9aa5581b9dbefd375
5
5
  SHA512:
6
- metadata.gz: d6dc1ce8c57b5d0aa76d08f52f9cf6fd3cbc63c4847e3c192c4fb24bcb430193bf1a722216650ba9bb08fc51501d34150d3034b892260b85d0da224413a9e6a6
7
- data.tar.gz: 5fa5195120bf68cc953dca82826b8ad3c4dd81efd80cf240d93ebb71c57a3d743f038639e02c270d8fae5f6189190c96516c0f2a6719a16d4f8bf5b1108bee5d
6
+ metadata.gz: 26cfe9bf38251f9bc4b2d0e734ee0d034d24123973be61e30151123b26e4dcd2babd3cd6fc6892ff56260d0353adf3e4b4f8751d593f278e92481cf4c5238a9c
7
+ data.tar.gz: b9074b9884c100fb78caaceb7ea8093228be2c15742298b039f75f4109a7a8f43fce76117a26323064e2e8cb68787b6df3c05deb14a3fd80f7cc11c3c0e7d341
@@ -31,7 +31,7 @@ module Libis
31
31
 
32
32
  def call(procedure, parameters = [])
33
33
  params = ''
34
- params = "'" + parameters.join("','") + "'" if parameters and parameters.size > 0
34
+ params = "'" + parameters.map(&:to_s).join("','") + "'" if parameters and parameters.size > 0
35
35
  oci.exec("call #{procedure}(#{params})")
36
36
  end
37
37
 
@@ -32,7 +32,7 @@ module Libis
32
32
  when 'REPCODE'
33
33
  @oracle.call('kul_packages.scope_xml_meta_file_ed', [term.upcase])
34
34
  when 'ID'
35
- @oracle.call('kul_packages.scope_xml_meta_file_by_id', term.to_i)
35
+ @oracle.call('kul_packages.scope_xml_meta_file_by_id', [term.to_i])
36
36
  else
37
37
  raise RuntimeError, "Invalid Scope search type '#{options[:type]}'"
38
38
  end
@@ -1,5 +1,5 @@
1
1
  module Libis
2
2
  module Services
3
- VERSION = '0.1.12'
3
+ VERSION = '0.1.13'
4
4
  end
5
5
  end
@@ -0,0 +1,42 @@
1
+ require_relative 'spec_helper'
2
+
3
+ require 'libis/services/scope/search'
4
+ require 'libis-tools'
5
+ require 'awesome_print'
6
+
7
+ describe 'Scope search service' do
8
+ let(:credentials) { Libis::Tools::ConfigFile.new File.join(File.dirname(__FILE__), 'credentials-test.yml') }
9
+ let(:subject) {
10
+ scope = Libis::Services::Scope::Search.new
11
+ # noinspection RubyResolve
12
+ scope.connect(credentials.scope_user, credentials.scope_passwd)
13
+ scope
14
+ }
15
+
16
+ context 'query' do
17
+
18
+ it 'by repcode' do
19
+ data = {
20
+ 'dc:title' => 'Archief Sint-Vincentius a Paulogenootschap, Conferentie Onze-Lieve-Vrouw van de Rozenkrans Antwerpen',
21
+ 'dc:identifier' => ['BE/942855/580(ref.code)'],
22
+ 'dc:source' => ['BE/942855/580']
23
+ }
24
+ result = subject.query 'BE-942855-580', type: 'REPCODE'
25
+ expect(result).to be_a(Libis::Tools::XmlDocument)
26
+ expect(result.to_hash['record']).to deep_include(data)
27
+ end
28
+
29
+ it 'by id' do
30
+ data = {
31
+ 'dc:title' => 'Archief Constant Guillaume Van Crombrugghe',
32
+ 'dc:identifier' => ['BE/942855/1569 (ref.code)'],
33
+ 'dc:source' => ['BE/942855/1569']
34
+ }
35
+ result = subject.query '332785', type: 'ID'
36
+ expect(result).to be_a(Libis::Tools::XmlDocument)
37
+ expect(result.to_hash['dc:record']).to deep_include(data)
38
+ end
39
+
40
+ end
41
+
42
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libis-services
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kris Dekeyser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-22 00:00:00.000000000 Z
11
+ date: 2018-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -310,6 +310,7 @@ files:
310
310
  - spec/rosetta_pds_spec.rb
311
311
  - spec/rosetta_producer_spec.rb
312
312
  - spec/rosetta_sip_spec.rb
313
+ - spec/scope_search_spec.rb
313
314
  - spec/spec_helper.rb
314
315
  homepage: https://github.com/Kris-LIBIS/LIBIS_Services
315
316
  licenses:
@@ -348,4 +349,5 @@ test_files:
348
349
  - spec/rosetta_pds_spec.rb
349
350
  - spec/rosetta_producer_spec.rb
350
351
  - spec/rosetta_sip_spec.rb
352
+ - spec/scope_search_spec.rb
351
353
  - spec/spec_helper.rb