libis-services 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/libis/services/oracle_client.rb +23 -3
- data/lib/libis/services/scope/search.rb +2 -0
- data/lib/libis/services/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f9fe9b744e913618010de91f2b9a5fc7ef83e4b
|
4
|
+
data.tar.gz: eb5635155cef852bf7e4a83f313efe1779685d2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b747e3961f4e7ff3e090c3a3b3fd88dee467f984ac0757a936e140f9f043e940aee966d717e0d63bd0d39d56e3eb0e71f593bbacefae1fc7690dbd6503f727f4
|
7
|
+
data.tar.gz: b601be79d65cd639a98dd172798096e7253a0e98beba1271a74bea7fe51ffaa107375cd1efc7f3bc7eb11ccfb9a972b4de3499fd372fa8dcf4edbd31a5c6b252
|
@@ -1,22 +1,42 @@
|
|
1
|
+
require 'oci8'
|
2
|
+
|
1
3
|
module Libis
|
2
4
|
module Services
|
3
5
|
|
4
6
|
class OracleClient
|
5
7
|
|
8
|
+
attr_reader :oci
|
9
|
+
|
6
10
|
def initialize(database, user, password)
|
7
11
|
@database = database
|
8
12
|
@user = user
|
9
13
|
@password = password
|
14
|
+
@oci = OCI8.new(user, password, database)
|
15
|
+
ObjectSpace.define_finalizer( self, self.class.finalize(@oci) )
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.finalize(oci)
|
19
|
+
proc { oci.logoff }
|
20
|
+
end
|
21
|
+
|
22
|
+
# @param [Boolean] value
|
23
|
+
def blocking=(value)
|
24
|
+
oci.non_blocking = !value
|
25
|
+
blocking?
|
26
|
+
end
|
27
|
+
|
28
|
+
def blocking?
|
29
|
+
!oci.non_blocking?
|
10
30
|
end
|
11
31
|
|
12
32
|
def call(procedure, parameters = [])
|
13
33
|
params = ''
|
14
34
|
params = "'" + parameters.join("','") + "'" if parameters and parameters.size > 0
|
15
|
-
|
35
|
+
oci.exec("call #{procedure}(#{params})")
|
16
36
|
end
|
17
37
|
|
18
|
-
def execute(
|
19
|
-
|
38
|
+
def execute(statement, *bindvars, &block)
|
39
|
+
oci.exec(statement, *bindvars, &block)
|
20
40
|
end
|
21
41
|
|
22
42
|
def run(script, parameters = [])
|
@@ -40,6 +40,8 @@ module Libis
|
|
40
40
|
raise RuntimeError, "Scope search failed: '#{msg}'. Details: '#{detail}'"
|
41
41
|
elsif File.exist? md_file
|
42
42
|
@doc = Libis::Tools::XmlDocument.open(md_file)
|
43
|
+
File.delete(md_file) rescue nil
|
44
|
+
@doc
|
43
45
|
else
|
44
46
|
raise RuntimeError, 'Scope search did not generate expected result file.'
|
45
47
|
end
|