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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a82bc9dc99c48271e4b298fb3e17f85fba6a82d4
4
- data.tar.gz: c0df376d0087a548c857f715531e3c78298b7b7f
3
+ metadata.gz: 31a29c3edd10e13805c5345c07630a58ac74e67a
4
+ data.tar.gz: 3857506c59bcc838bdc931f716dc651f87afb66e
5
5
  SHA512:
6
- metadata.gz: a23d848ebdfefc254a0d12364584183130d0a2375afdcfe8b2007345ad9430a481a4f5cca78eaeccaac68524bdb897046b3a19b9c60db728c76d21e4572f35e2
7
- data.tar.gz: 2c253dfc14fc47f65e9e628ad7161229a2f9011fa643a0ce7284a20af9239ea10c8567ed6284c1a871dab05072b8e73f1f1bb09070f0bc3e863d913641f40a95
6
+ metadata.gz: 0ebea32dd20698b07deca95642526b89b6b3faf0686c0daeda596cfe91bf4f60e6f03cad545d929ef51b99b25fb790964a086757ed7c3fa9fca9eac5e4271cbe
7
+ data.tar.gz: 1a56c4b8b19f7bece6f546221b697b6be782cacbfd6944d972891b1601b25dc38d34c600c5137859f05a2798744f6ae8fa19c624df35930398f06c6e38338705
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # Exlibris::Primo
2
2
  [![Gem Version](https://badge.fury.io/rb/exlibris-primo.png)](http://badge.fury.io/rb/exlibris-primo)
3
- [![Build Status](https://api.travis-ci.org/scotdalton/exlibris-primo.png?branch=master)](https://travis-ci.org/scotdalton/exlibris-primo)
4
- [![Dependency Status](https://gemnasium.com/scotdalton/exlibris-primo.png)](https://gemnasium.com/scotdalton/exlibris-primo)
5
- [![Code Climate](https://codeclimate.com/github/scotdalton/exlibris-primo.png)](https://codeclimate.com/github/scotdalton/exlibris-primo)
6
- [![Coverage Status](https://coveralls.io/repos/scotdalton/exlibris-primo/badge.png?branch=master)](https://coveralls.io/r/scotdalton/exlibris-primo)
3
+ [![Build Status](https://api.travis-ci.org/NYULibraries/exlibris-primo.png?branch=master)](https://travis-ci.org/NYULibraries/exlibris-primo)
4
+ [![Dependency Status](https://gemnasium.com/NYULibraries/exlibris-primo.png)](https://gemnasium.com/NYULibraries/exlibris-primo)
5
+ [![Code Climate](https://codeclimate.com/github/NYULibraries/exlibris-primo.png)](https://codeclimate.com/github/NYULibraries/exlibris-primo)
6
+ [![Coverage Status](https://coveralls.io/repos/github/NYULibraries/exlibris-primo/badge.svg?branch=master)](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
- { :availlibrary => availlibrary, :record_id => record_id, :original_id => original_id,
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
- :source_id => source_id, :source_class => source_class, :source_data => source_data }
110
+ :source_class => source_class, :source_data => source_data }
110
111
  end
111
112
  end
112
113
  end
@@ -1,5 +1,5 @@
1
1
  module Exlibris
2
2
  module Primo
3
- VERSION = '2.0.0'
3
+ VERSION = '2.1.0'
4
4
  end
5
5
  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(endpoint: endpoint, namespace: endpoint, log: false, log_level: :warn)
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)
@@ -1,5 +1,6 @@
1
1
  base_url: "yaml_url"
2
2
  institution: "YAML_INSTITUTION"
3
+ proxy_url: "yaml_proxy_url"
3
4
  libraries:
4
5
  "LIB_CODE1": "Library Decoded 1"
5
6
  "LIB_CODE2": "Library Decoded 2"
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.0.0
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.8.0
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.8.0
82
+ version: 2.11.1
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: iso-639
85
85
  requirement: !ruby/object:Gem::Requirement