exlibris-aleph 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NmY2Y2UwNjVkZjE2NzA5ODE0ODgxNDM0MWQ4NDEwNzM5YWZiYzQ1OQ==
5
+ data.tar.gz: !binary |-
6
+ MmY3YzU3MjhiNjk5NGVmNzdkODU5NDhiZWRmNDk2YWMzMGRjMjdiNA==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ OWY1YTQ5NTEwYmYwMjVjOGVlOWYxODRmZWU2ZDg0OWRlZTY3ZGI4ZmNjYTdm
10
+ YmE5OTQxMmM5NGU2ODAwYjE3YTk0YjUzZjg2ZTBlYzYwODJmYTBhMDdmNWZk
11
+ Nzg2ODExN2FjNGVhOGQzMjgyZDVkNzA2YWRjZjI3YzEzYjIyNTA=
12
+ data.tar.gz: !binary |-
13
+ Y2Y5MzVlNGVmNmU5MjE1Mzk5NGY5MjM5ODM5YjgwNjhmOWM0MDJjZGNhZDc2
14
+ YzBjZjQwZjM1NTYzMTA3MjQyOGVhNWRjZGY2NmNkYmVlNmFkNDNmZjU4OTI3
15
+ MmZmNWUzN2U4OWVlOTgyZmRlZTdmZDA2NzQwZDc4ZGQ5MTRmOGQ=
@@ -204,23 +204,25 @@ module Exlibris
204
204
  # Available param keys are:
205
205
  # :adm_library_code, :sub_library_code, :item_status_code, :item_process_status_code
206
206
  def item_permissions(params)
207
- unless params[:item_process_status_code].nil?
207
+ item_permissions = {}
208
+ # Item process statuses take precedent in Aleph, same here.
209
+ if item_permissions.empty? and params[:item_process_status_code]
208
210
  adm_permissions =
209
211
  item_permissions_by_item_process_status[params[:adm_library_code]]
210
212
  sublibrary_permissions =
211
213
  adm_permissions[params[:sub_library_code]] unless adm_permissions.nil?
212
- item_process_status_permissions =
214
+ item_permissions =
213
215
  sublibrary_permissions[params[:item_process_status_code]] unless sublibrary_permissions.nil?
214
- return item_process_status_permissions unless item_process_status_permissions.nil?
215
216
  end
216
- unless params[:item_status_code].nil?
217
+ # If we didn't find anything with the item process status, try the item status
218
+ if item_permissions.empty? and params[:item_status_code]
217
219
  adm_permissions = item_permissions_by_item_status[params[:adm_library_code]]
218
220
  sublibrary_permissions =
219
221
  adm_permissions[params[:sub_library_code]] unless adm_permissions.nil?
220
- item_status_permissions =
222
+ item_permissions =
221
223
  sublibrary_permissions[params[:item_status_code]] unless sublibrary_permissions.nil?
222
- return item_status_permissions unless item_status_permissions.nil?
223
224
  end
225
+ rescue => e
224
226
  logger.warn(
225
227
  "Warning in #{self.class}. "+
226
228
  "Item permissions not found. "+
@@ -230,7 +232,11 @@ module Exlibris
230
232
  "\tItem status: #{params[:item_status_code]}\n"+
231
233
  "\tItem process status: #{params[:item_process_status_code]}"
232
234
  )
233
- return {}
235
+ logger.error("Error: \n\t#{e}")
236
+ logger.error("\titem_permissions_by_item_process_status is #{item_permissions_by_item_process_status.inspect}")
237
+ logger.error("\titem_permissions_by_item_status is #{item_permissions_by_item_process_status.inspect}")
238
+ ensure
239
+ return item_permissions
234
240
  end
235
241
 
236
242
  def refresh?
@@ -1,5 +1,5 @@
1
1
  module Exlibris
2
2
  module Aleph
3
- VERSION = "1.0.4"
3
+ VERSION = "1.0.5"
4
4
  end
5
5
  end
@@ -22,7 +22,7 @@ class TabHelperTest < ActiveSupport::TestCase
22
22
  assert_nothing_raised() { Exlibris::Aleph::TabHelper.send(:new) }
23
23
  assert_same(@helper, Exlibris::Aleph::TabHelper.instance)
24
24
  end
25
-
25
+
26
26
  test "refresh" do
27
27
  @helper.instance_variable_set(:@refresh_time, lambda{1.second.ago})
28
28
  @helper.sub_libraries
@@ -35,27 +35,27 @@ class TabHelperTest < ActiveSupport::TestCase
35
35
  assert_not_equal(updated_at_1, @helper.updated_at)
36
36
  @helper.instance_variable_set(:@refresh_time, @helper.class.refresh_time)
37
37
  end
38
-
38
+
39
39
  test "sub_library_text" do
40
40
  assert_equal("NYU Bobst", @helper.sub_library_text("BOBST"))
41
41
  end
42
-
42
+
43
43
  test "sub_library_adm" do
44
44
  assert_equal("NYU50", @helper.sub_library_adm("BOBST"))
45
45
  end
46
-
46
+
47
47
  test "item_pickup_locations" do
48
48
  assert_equal(
49
49
  ["BOBST", "NCOUR", "NIFA", "NISAW", "NREI", "NPOLY", "NYUAB", "NYUSE", "NYUSS"],
50
50
  @helper.item_pickup_locations({:adm_library_code => "nyu50", :sub_library_code => "BOBST", :bor_status => "51"}))
51
51
  end
52
-
52
+
53
53
  test "collection_text" do
54
54
  assert_equal(
55
55
  "Main Collection",
56
56
  @helper.collection_text({:adm_library_code => "nyu50", :sub_library_code => "BOBST", :collection_code => "MAIN"}))
57
57
  end
58
-
58
+
59
59
  test "item_web_text" do
60
60
  assert_equal(
61
61
  "Offsite Available",
@@ -64,18 +64,23 @@ class TabHelperTest < ActiveSupport::TestCase
64
64
  "Offsite Available",
65
65
  @helper.item_web_text({:adm_library_code => "nyu50", :sub_library_code => "BOBST", :item_process_status_code => "DP"}))
66
66
  end
67
-
67
+
68
+ test "item_permissions" do
69
+ assert_equal("C", @helper.item_permissions(:adm_library_code => "nyu50",
70
+ :sub_library_code => "BOBST", :item_status_code => "01", :item_process_status_code => "DP")[:hold_request])
71
+ end
72
+
68
73
  test "sub_libraries" do
69
74
  assert_equal("BOBST", @helper.sub_libraries["BOBST"][:code])
70
75
  assert_equal("NYU Bobst", @helper.sub_libraries["BOBST"][:text])
71
76
  assert_equal("NYU50", @helper.sub_libraries["BOBST"][:library])
72
77
  end
73
-
78
+
74
79
  test "patrons" do
75
80
  assert_equal("51", @helper.patrons["nyu50"]["51"][:code])
76
81
  assert_equal("NYU Administrator", @helper.patrons["nyu50"]["51"][:text])
77
82
  end
78
-
83
+
79
84
  test "patron_permissions" do
80
85
  assert_equal("BOBST", @helper.patron_permissions["nyu50"]["BOBST"]["51"][:sub_library])
81
86
  assert_equal("51", @helper.patron_permissions["nyu50"]["BOBST"]["51"][:patron_status])
@@ -93,13 +98,13 @@ class TabHelperTest < ActiveSupport::TestCase
93
98
  assert_equal("N", @helper.patron_permissions["nyu50"]["BOBST"]["51"][:booking_ignore_closing_hours])
94
99
  assert_equal("N", @helper.patron_permissions["nyu50"]["BOBST"]["51"][:automatically_create_aleph_record])
95
100
  end
96
-
101
+
97
102
  test "items" do
98
103
  assert_equal("ITEM-STATUS", @helper.items["nyu50"]["Billed as lost"][:code])
99
104
  assert_equal("Billed as lost", @helper.items["nyu50"]["Billed as lost"][:original_text])
100
105
  assert_equal("Request ILL", @helper.items["nyu50"]["Billed as lost"][:web_text])
101
106
  end
102
-
107
+
103
108
  test "item_permissions_by_item_status" do
104
109
  assert_equal("BOBST", @helper.item_permissions_by_item_status["nyu50"]["BOBST"]["01"][:sub_library])
105
110
  assert_equal("01", @helper.item_permissions_by_item_status["nyu50"]["BOBST"]["01"][:item_status])
@@ -117,7 +122,7 @@ class TabHelperTest < ActiveSupport::TestCase
117
122
  assert_equal("00", @helper.item_permissions_by_item_status["nyu50"]["BOBST"]["01"][:reloaning_limit])
118
123
  assert_equal("A", @helper.item_permissions_by_item_status["nyu50"]["BOBST"]["01"][:booking_hours])
119
124
  end
120
-
125
+
121
126
  test "item_permissions_by_item_process_status" do
122
127
  assert_equal("BOBST", @helper.item_permissions_by_item_process_status["nyu50"]["BOBST"]["AC"][:sub_library])
123
128
  assert_equal("AC", @helper.item_permissions_by_item_process_status["nyu50"]["BOBST"]["AC"][:item_process_status])
@@ -135,13 +140,13 @@ class TabHelperTest < ActiveSupport::TestCase
135
140
  assert_equal("00", @helper.item_permissions_by_item_process_status["nyu50"]["BOBST"]["AC"][:reloaning_limit])
136
141
  assert_equal("A", @helper.item_permissions_by_item_process_status["nyu50"]["BOBST"]["AC"][:booking_hours])
137
142
  end
138
-
143
+
139
144
  test "collections" do
140
145
  assert_equal("BOBST", @helper.collections["nyu50"]["BOBST"]["MAIN"][:sub_library])
141
146
  assert_equal("MAIN", @helper.collections["nyu50"]["BOBST"]["MAIN"][:collection_code])
142
147
  assert_equal("Main Collection", @helper.collections["nyu50"]["BOBST"]["MAIN"][:text])
143
148
  end
144
-
149
+
145
150
  test "pickup_locations" do
146
151
  assert_equal("BOBST", @helper.pickup_locations["nyu50"]["BOBST"]["##"]["DP"]["51"]["Y"][:sub_library])
147
152
  assert_equal("##", @helper.pickup_locations["nyu50"]["BOBST"]["##"]["DP"]["51"]["Y"][:item_status])
@@ -150,12 +155,12 @@ class TabHelperTest < ActiveSupport::TestCase
150
155
  assert_equal("Y", @helper.pickup_locations["nyu50"]["BOBST"]["##"]["DP"]["51"]["Y"][:availability_status])
151
156
  assert_equal(["BOBST", "NCOUR", "NIFA", "NISAW", "NREI", "NPOLY", "NYUAB", "NYUSE", "NYUSS"], @helper.pickup_locations["nyu50"]["BOBST"]["##"]["DP"]["51"]["Y"][:pickup_locations])
152
157
  end
153
-
158
+
154
159
  test "pickup_locations on multiple lines" do
155
160
  assert_equal(["BOBST", "NCOUR", "NIFA","NISAW","NREI","NPOLY","NYUAB","NBERL",
156
161
  "NFLOR","NLOND","NPRAG","NWADC"], @helper.pickup_locations["nyu50"]["BOBST"]["##"]["##"]["89"]["#"][:pickup_locations])
157
162
  end
158
-
163
+
159
164
  test "refresh_yml" do
160
165
  assert_nil(@helper.sub_libraries["NEW__"])
161
166
  sub_library_file = "#{File.dirname(__FILE__)}/mnt/aleph_tab/alephe/tab/tab_sub_library.eng"
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exlibris-aleph
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
5
- prerelease:
4
+ version: 1.0.5
6
5
  platform: ruby
7
6
  authors:
8
7
  - Scot Dalton
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-03-07 00:00:00.000000000 Z
11
+ date: 2013-04-03 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rake
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: require_all
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ~>
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ~>
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: nokogiri
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ~>
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ~>
60
53
  - !ruby/object:Gem::Version
@@ -62,7 +55,6 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: httparty
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ~>
68
60
  - !ruby/object:Gem::Version
@@ -70,7 +62,6 @@ dependencies:
70
62
  type: :runtime
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - ~>
76
67
  - !ruby/object:Gem::Version
@@ -78,7 +69,6 @@ dependencies:
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: activesupport
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
73
  - - ~>
84
74
  - !ruby/object:Gem::Version
@@ -86,7 +76,6 @@ dependencies:
86
76
  type: :runtime
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
80
  - - ~>
92
81
  - !ruby/object:Gem::Version
@@ -94,7 +83,6 @@ dependencies:
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: builder
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
87
  - - ~>
100
88
  - !ruby/object:Gem::Version
@@ -102,7 +90,6 @@ dependencies:
102
90
  type: :runtime
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
94
  - - ~>
108
95
  - !ruby/object:Gem::Version
@@ -110,7 +97,6 @@ dependencies:
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: marc
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
101
  - - ~>
116
102
  - !ruby/object:Gem::Version
@@ -118,7 +104,6 @@ dependencies:
118
104
  type: :runtime
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
108
  - - ~>
124
109
  - !ruby/object:Gem::Version
@@ -126,7 +111,6 @@ dependencies:
126
111
  - !ruby/object:Gem::Dependency
127
112
  name: vcr
128
113
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
114
  requirements:
131
115
  - - ~>
132
116
  - !ruby/object:Gem::Version
@@ -134,7 +118,6 @@ dependencies:
134
118
  type: :development
135
119
  prerelease: false
136
120
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
121
  requirements:
139
122
  - - ~>
140
123
  - !ruby/object:Gem::Version
@@ -142,7 +125,6 @@ dependencies:
142
125
  - !ruby/object:Gem::Dependency
143
126
  name: webmock
144
127
  requirement: !ruby/object:Gem::Requirement
145
- none: false
146
128
  requirements:
147
129
  - - ~>
148
130
  - !ruby/object:Gem::Version
@@ -150,7 +132,6 @@ dependencies:
150
132
  type: :development
151
133
  prerelease: false
152
134
  version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
135
  requirements:
155
136
  - - ~>
156
137
  - !ruby/object:Gem::Version
@@ -246,33 +227,26 @@ files:
246
227
  - test/xservice/bor_auth_test.rb
247
228
  homepage: https://github.com/scotdalton/exlibris-aleph
248
229
  licenses: []
230
+ metadata: {}
249
231
  post_install_message:
250
232
  rdoc_options: []
251
233
  require_paths:
252
234
  - lib
253
235
  required_ruby_version: !ruby/object:Gem::Requirement
254
- none: false
255
236
  requirements:
256
237
  - - ! '>='
257
238
  - !ruby/object:Gem::Version
258
239
  version: '0'
259
- segments:
260
- - 0
261
- hash: 3658300463796670489
262
240
  required_rubygems_version: !ruby/object:Gem::Requirement
263
- none: false
264
241
  requirements:
265
242
  - - ! '>='
266
243
  - !ruby/object:Gem::Version
267
244
  version: '0'
268
- segments:
269
- - 0
270
- hash: 3658300463796670489
271
245
  requirements: []
272
246
  rubyforge_project:
273
- rubygems_version: 1.8.24
247
+ rubygems_version: 2.0.3
274
248
  signing_key:
275
- specification_version: 3
249
+ specification_version: 4
276
250
  summary: Library to work with Exlibris' Aleph ILS.
277
251
  test_files:
278
252
  - test/config/aleph/alephe/sub_libraries.yml