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: 9ce67a6d9d8ae5f85b59d20275b53bc5fd2c3daa
4
- data.tar.gz: 788b21aa7e8d522235c4d8a0bde001d69d84bd10
3
+ metadata.gz: 7af28a996d83058504db8b3886d97b4d5302225f
4
+ data.tar.gz: 4ff2c614654506bc23e0fa4ca9168828c289a46d
5
5
  SHA512:
6
- metadata.gz: 92e69302a90ddf5f1c098e0a4523b9c45929afd6d1c4d7ec53bf0f1e23a662710f3d283a7e877f0a1a1237f216be38f84be2b2ffd9eec2484f31107cdbebbe5a
7
- data.tar.gz: 687056444499489d0bf9ceb5ba7115ea569c76a016ce1b7a7c0e2fdd488ac6949f54af9f5ebe469a69bf44fe175d72545a46a739bcef904b66779e31c6422818
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(database, user, password)
11
- @database = database
12
- @user = user
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 #{@user}/#{@password}@#{@database} @#{script} #{params}`
64
+ process_result `sqlplus -S #{url} @#{script} #{params}`
67
65
  end
68
66
 
69
67
  private
@@ -14,7 +14,7 @@ module Libis
14
14
  end
15
15
 
16
16
  def connect
17
- @oracle = OracleClient.new(@url, @user, @password)
17
+ @oracle = OracleClient.new("#{@user}/#{@password}@#{@url}")
18
18
  end
19
19
 
20
20
  def set_schema(schema)
@@ -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(database, name, password)
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/SCOPEP/#{term}_err.XML"
39
- md_file = "/nas/vol03/oracle/SCOPEP/#{term}_md.XML"
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']
@@ -1,5 +1,5 @@
1
1
  module Libis
2
2
  module Services
3
- VERSION = '1.0.0'
3
+ VERSION = '1.0.1'
4
4
  end
5
5
  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: 1.0.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-01 00:00:00.000000000 Z
11
+ date: 2018-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler