exlibris-primo 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +7 -7
- data/lib/exlibris/primo/config.rb +5 -1
- data/lib/exlibris/primo/holding.rb +3 -2
- data/lib/exlibris/primo/version.rb +1 -1
- data/lib/exlibris/primo/web_service/client/base/savon_client.rb +12 -1
- data/test/config_test.rb +5 -2
- data/test/support/config.yml +1 -0
- data/test/test_helper.rb +3 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31a29c3edd10e13805c5345c07630a58ac74e67a
|
4
|
+
data.tar.gz: 3857506c59bcc838bdc931f716dc651f87afb66e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ebea32dd20698b07deca95642526b89b6b3faf0686c0daeda596cfe91bf4f60e6f03cad545d929ef51b99b25fb790964a086757ed7c3fa9fca9eac5e4271cbe
|
7
|
+
data.tar.gz: 1a56c4b8b19f7bece6f546221b697b6be782cacbfd6944d972891b1601b25dc38d34c600c5137859f05a2798744f6ae8fa19c624df35930398f06c6e38338705
|
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# Exlibris::Primo
|
2
2
|
[](http://badge.fury.io/rb/exlibris-primo)
|
3
|
-
[](https://travis-ci.org/NYULibraries/exlibris-primo)
|
4
|
+
[](https://gemnasium.com/NYULibraries/exlibris-primo)
|
5
|
+
[](https://codeclimate.com/github/NYULibraries/exlibris-primo)
|
6
|
+
[](https://coveralls.io/github/NYULibraries/exlibris-primo?branch=master)
|
7
7
|
|
8
8
|
Exlibris::Primo offers a set of classes for interacting with the ExLibris Primo APIs.
|
9
9
|
|
@@ -83,7 +83,7 @@ Exlibris::Primo::Config can also read in from a YAML file that specifies the var
|
|
83
83
|
end
|
84
84
|
|
85
85
|
## Exlibris::Primo::EShelf
|
86
|
-
The Exlibris::Primo::EShelf class provides methods for reading a given user's Primo eshelf
|
86
|
+
The Exlibris::Primo::EShelf class provides methods for reading a given user's Primo eshelf
|
87
87
|
and eshelf structure as well as adding and removing records.
|
88
88
|
|
89
89
|
## Example of Exlibris::Primo::EShelf in action
|
@@ -95,7 +95,7 @@ and eshelf structure as well as adding and removing records.
|
|
95
95
|
eshelf.add_records(["PrimoRecordId","PrimoRecordId2"], basket_id)
|
96
96
|
|
97
97
|
## Exlibris::Primo::Reviews
|
98
|
-
The Exlibris::Primo::Reviews class provides methods for reading a given user's Primo reviews
|
98
|
+
The Exlibris::Primo::Reviews class provides methods for reading a given user's Primo reviews
|
99
99
|
features.
|
100
100
|
|
101
101
|
## Example of Exlibris::Primo::Reviews in action
|
@@ -104,7 +104,7 @@ features.
|
|
104
104
|
user_record_reviews = reviews.reviews #=> Array of Primo reviews
|
105
105
|
|
106
106
|
## Exlibris::Primo::Tags
|
107
|
-
The Exlibris::Primo::Tags class provides methods for reading a given user's Primo tags
|
107
|
+
The Exlibris::Primo::Tags class provides methods for reading a given user's Primo tags
|
108
108
|
features.
|
109
109
|
|
110
110
|
## Example of Exlibris::Primo::Tags in action
|
@@ -7,7 +7,7 @@ module Exlibris
|
|
7
7
|
module Config
|
8
8
|
class << self
|
9
9
|
include WriteAttributes
|
10
|
-
attr_accessor :base_url, :institution, :institutions, :libraries, :availability_statuses, :sources,
|
10
|
+
attr_accessor :base_url, :proxy_url, :institution, :institutions, :libraries, :availability_statuses, :sources,
|
11
11
|
:facet_labels, :facet_top_level, :facet_collections, :facet_resource_types, :load_time
|
12
12
|
|
13
13
|
def load_yaml file
|
@@ -29,6 +29,10 @@ module Exlibris
|
|
29
29
|
@base_url ||= String.new config.base_url.to_s
|
30
30
|
end
|
31
31
|
|
32
|
+
def proxy_url
|
33
|
+
@proxy_url ||= config.proxy_url
|
34
|
+
end
|
35
|
+
|
32
36
|
def institution
|
33
37
|
@institution ||= String.new config.institution.to_s
|
34
38
|
end
|
@@ -100,13 +100,14 @@ module Exlibris
|
|
100
100
|
|
101
101
|
# Return the attribute accessible instance variables as a hash.
|
102
102
|
def to_h
|
103
|
-
{
|
103
|
+
{
|
104
|
+
:availlibrary => availlibrary, :record_id => record_id, :original_id => original_id,
|
104
105
|
:title => title, :author => author, :display_type => display_type, :source_id => source_id,
|
105
106
|
:original_source_id => original_source_id, :source_record_id => source_record_id,
|
106
107
|
:ils_api_id => ils_api_id, :institution_code => institution_code, :library_code => library_code,
|
107
108
|
:availability_status_code => availability_status_code, :collection => collection,
|
108
109
|
:call_number => call_number, :coverage => coverage, :notes => notes, :subfields => subfields,
|
109
|
-
:
|
110
|
+
:source_class => source_class, :source_data => source_data }
|
110
111
|
end
|
111
112
|
end
|
112
113
|
end
|
@@ -11,9 +11,20 @@ module Exlibris
|
|
11
11
|
# we don't want to make an extra HTTP call.
|
12
12
|
#
|
13
13
|
# @client ||= Savon.client(wsdl: wsdl)
|
14
|
-
@client ||= Savon.client(
|
14
|
+
@client ||= Savon.client(client_options)
|
15
15
|
end
|
16
16
|
protected :client
|
17
|
+
|
18
|
+
def client_options
|
19
|
+
{
|
20
|
+
proxy: proxy_url,
|
21
|
+
endpoint: endpoint,
|
22
|
+
namespace: endpoint,
|
23
|
+
log: false,
|
24
|
+
log_level: :warn
|
25
|
+
}.delete_if { |k, v| v.blank? }
|
26
|
+
end
|
27
|
+
private :client_options
|
17
28
|
end
|
18
29
|
end
|
19
30
|
end
|
data/test/config_test.rb
CHANGED
@@ -17,9 +17,10 @@ class ConfigTest < Test::Unit::TestCase
|
|
17
17
|
|
18
18
|
def test_config_from_yaml
|
19
19
|
reset_primo_configuration
|
20
|
-
yaml_primo_configuration
|
20
|
+
yaml_primo_configuration(false)
|
21
21
|
assert_equal "yaml_url", Exlibris::Primo::Config.base_url
|
22
22
|
assert_equal "YAML_INSTITUTION", Exlibris::Primo::Config.institution
|
23
|
+
assert_equal "yaml_proxy_url", Exlibris::Primo::Config.proxy_url
|
23
24
|
assert_nil(Exlibris::Primo::Config.institutions)
|
24
25
|
assert_equal({ "LIB_CODE1" => "Library Decoded 1", "LIB_CODE2" => "Library Decoded 2",
|
25
26
|
"LIB_CODE3" => "Library Decoded 3" }, Exlibris::Primo::Config.libraries)
|
@@ -44,10 +45,12 @@ class ConfigTest < Test::Unit::TestCase
|
|
44
45
|
|
45
46
|
def test_config_attributes
|
46
47
|
reset_primo_configuration
|
47
|
-
yaml_primo_configuration
|
48
|
+
yaml_primo_configuration(false)
|
48
49
|
search = Exlibris::Primo::Search.new
|
49
50
|
assert_equal "yaml_url", search.base_url
|
50
51
|
assert_equal "YAML_INSTITUTION", search.institution
|
52
|
+
assert_equal "yaml_proxy_url", search
|
53
|
+
.proxy_url
|
51
54
|
assert_equal({}, search.institutions)
|
52
55
|
assert_equal({ "LIB_CODE1" => "Library Decoded 1", "LIB_CODE2" => "Library Decoded 2",
|
53
56
|
"LIB_CODE3" => "Library Decoded 3" }, search.libraries)
|
data/test/support/config.yml
CHANGED
data/test/test_helper.rb
CHANGED
@@ -66,15 +66,17 @@ class Test::Unit::TestCase
|
|
66
66
|
end
|
67
67
|
protected :assert_request
|
68
68
|
|
69
|
-
def yaml_primo_configuration
|
69
|
+
def yaml_primo_configuration(overide_proxy_url = true)
|
70
70
|
Exlibris::Primo.configure do |config|
|
71
71
|
config.load_yaml File.expand_path("../support/config.yml", __FILE__)
|
72
|
+
config.proxy_url = nil if overide_proxy_url
|
72
73
|
end
|
73
74
|
end
|
74
75
|
|
75
76
|
def reset_primo_configuration
|
76
77
|
Exlibris::Primo.configure do |config|
|
77
78
|
config.base_url = nil
|
79
|
+
config.proxy_url = nil
|
78
80
|
config.institution = nil
|
79
81
|
config.institutions = nil
|
80
82
|
config.libraries = nil
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: exlibris-primo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scot Dalton
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 2.
|
75
|
+
version: 2.11.1
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 2.
|
82
|
+
version: 2.11.1
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: iso-639
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|