libis-services 1.0.0 → 1.0.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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7af28a996d83058504db8b3886d97b4d5302225f
|
4
|
+
data.tar.gz: 4ff2c614654506bc23e0fa4ca9168828c289a46d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 914bd614c3c46bba97873874d3b0f9545db6bcd04b10f90b889249d28ec5a410a0e5635dbed4edf70f3bdbb604d6101d914393fc087db9973665c4ffdc6f906f
|
7
|
+
data.tar.gz: c9f0161048b1f987647041adf1b756bfed83891c70d3698ed79d2b7e4fb3aefd48f0cc9fc421e1aacb748930fccaf90db9bb0b8b3545da4cb162f3aeee529f96
|
@@ -5,13 +5,11 @@ module Libis
|
|
5
5
|
|
6
6
|
class OracleClient
|
7
7
|
|
8
|
-
attr_reader :oci
|
8
|
+
attr_reader :url, :oci
|
9
9
|
|
10
|
-
def initialize(
|
11
|
-
@
|
12
|
-
@
|
13
|
-
@password = password
|
14
|
-
@oci = OCI8.new(user, password, database)
|
10
|
+
def initialize(url)
|
11
|
+
@url = url
|
12
|
+
@oci = OCI8.new(url)
|
15
13
|
ObjectSpace.define_finalizer(self, self.class.finalize(@oci))
|
16
14
|
end
|
17
15
|
|
@@ -63,7 +61,7 @@ module Libis
|
|
63
61
|
def run(script, parameters = [])
|
64
62
|
params = ''
|
65
63
|
params = "\"" + parameters.join("\" \"") + "\"" if parameters and parameters.size > 0
|
66
|
-
process_result `sqlplus -S #{
|
64
|
+
process_result `sqlplus -S #{url} @#{script} #{params}`
|
67
65
|
end
|
68
66
|
|
69
67
|
private
|
@@ -17,7 +17,11 @@ module Libis
|
|
17
17
|
|
18
18
|
def connect(name, password, database = nil)
|
19
19
|
database ||= 'libis-db-scope.cc.kuleuven.be:1556/SCOPEP.kuleuven.be'
|
20
|
-
@oracle = OracleClient.new(
|
20
|
+
@oracle = OracleClient.new("#{name}/#{password}/#{database}")
|
21
|
+
end
|
22
|
+
|
23
|
+
def connect_url(url)
|
24
|
+
@oracle = OracleClient.new(url)
|
21
25
|
end
|
22
26
|
|
23
27
|
def find(term, options = {})
|
@@ -35,8 +39,8 @@ module Libis
|
|
35
39
|
raise RuntimeError, "Invalid Scope search type '#{options[:type]}'"
|
36
40
|
end
|
37
41
|
term = term.gsub(/[-\/]/, '_')
|
38
|
-
err_file = "/nas/vol03/oracle
|
39
|
-
md_file = "/nas/vol03/oracle
|
42
|
+
err_file = "/nas/vol03/oracle/#{options[:dir] || 'SCOPEP'}/#{term}_err.XML"
|
43
|
+
md_file = "/nas/vol03/oracle/#{options[:dir] || 'SCOPEP'}/#{term}_md.XML"
|
40
44
|
if File.exist? err_file
|
41
45
|
doc = Libis::Tools::XmlDocument.open(err_file)
|
42
46
|
msg = doc['/error/error_msg']
|
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: 1.0.
|
4
|
+
version: 1.0.1
|
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-10-
|
11
|
+
date: 2018-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|