voyager_oracle_api 0.3.0 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/oracle_connection.rb +11 -7
- data/lib/request.rb +5 -3
- data/voyager_oracle_api.gemspec +2 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.2
|
data/lib/oracle_connection.rb
CHANGED
@@ -5,19 +5,21 @@ module Voyager
|
|
5
5
|
attr_accessor :results
|
6
6
|
|
7
7
|
def initialize(args = {})
|
8
|
-
|
9
|
-
|
8
|
+
args.symbolize_keys!
|
9
|
+
@connection = args[:connection]
|
10
|
+
|
10
11
|
|
11
|
-
unless args.has_key?(
|
12
|
+
unless args.has_key?(:connection)
|
12
13
|
app_config_filename = File.join(File.dirname(__FILE__), "..", "config" ,"app_config.yml")
|
13
14
|
|
14
15
|
args = YAML.load_file(app_config_filename)['oracle_connection_details'] if args == {} and File.exists?(app_config_filename)
|
16
|
+
args.symbolize_keys!
|
15
17
|
|
16
|
-
raise "Need argument 'user'" unless args.has_key?(
|
17
|
-
raise "Need argument 'password'" unless args.has_key?(
|
18
|
-
raise "Need argument 'service'" unless args.has_key?(
|
18
|
+
raise "Need argument 'user'" unless args.has_key?(:user)
|
19
|
+
raise "Need argument 'password'" unless args.has_key?(:password)
|
20
|
+
raise "Need argument 'service'" unless args.has_key?(:service)
|
19
21
|
|
20
|
-
@connection = OCI8.new(args[
|
22
|
+
@connection = OCI8.new(args[:user], args[:password], args[:service])
|
21
23
|
@connection.prefetch_rows = 1000
|
22
24
|
end
|
23
25
|
|
@@ -27,6 +29,8 @@ module Voyager
|
|
27
29
|
|
28
30
|
|
29
31
|
def retrieve_holdings(*bibids)
|
32
|
+
bibids = Array.wrap(bibids).flatten
|
33
|
+
|
30
34
|
query = <<-HERE
|
31
35
|
select a.bib_id, a.mfhd_id, c.item_id, item_status
|
32
36
|
from bib_mfhd a, mfhd_master b, mfhd_item c, item_status d
|
data/lib/request.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
module Voyager
|
2
2
|
module Request
|
3
|
-
def self.simple_holdings_check(
|
3
|
+
def self.simple_holdings_check(args = {})
|
4
4
|
|
5
|
-
con =
|
6
|
-
con.
|
5
|
+
con = args.delete(:connection)
|
6
|
+
con ||= OracleConnection.new(args.delete(:connection_details))
|
7
|
+
bibids = Array.wrap(args.delete(:bibids))
|
8
|
+
con.retrieve_holdings(bibids)
|
7
9
|
|
8
10
|
results = {}
|
9
11
|
|
data/voyager_oracle_api.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "voyager_oracle_api"
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["James Stuart", "Gary Bertchume"]
|
12
|
-
s.date = "2012-10-
|
12
|
+
s.date = "2012-10-04"
|
13
13
|
s.description = "Middleware gem for Voyager Oracle API calls, specificially holdings information "
|
14
14
|
s.email = "github@jamesstuart.org"
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: voyager_oracle_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.3.
|
5
|
+
version: 0.3.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- James Stuart
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2012-10-
|
14
|
+
date: 2012-10-04 00:00:00 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activesupport
|
@@ -214,7 +214,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
214
214
|
requirements:
|
215
215
|
- - ">="
|
216
216
|
- !ruby/object:Gem::Version
|
217
|
-
hash:
|
217
|
+
hash: 551596431
|
218
218
|
segments:
|
219
219
|
- 0
|
220
220
|
version: "0"
|