openaccess-apc 0.1.0 → 0.2.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: c1c1f1d067a196318d056eaae505d6ecc50fdffb
4
- data.tar.gz: 729dab62bef1fcfc3a9b03231b120385e3b6d556
3
+ metadata.gz: c7586d3504dbc05753219a917ddfb3a5bb291cee
4
+ data.tar.gz: acfdfc03743136f6abdbedd5a16d106fd835e325
5
5
  SHA512:
6
- metadata.gz: '08b4d2233a9165d57b30e2a91ca16a6d93bb46d7bcadd61ad3c4e302f5b3073b1cce4f60d46b980de3dc49b078bce985d8079bc8342e493cc54f953495eefe21'
7
- data.tar.gz: 2d97a3ca77a39bab5e5efb6bc2820e425d915d4b8dcea96224dd35e846bc569b39015e8ca173ff6e32382077ede18f40b57e988856f5c908a3cfe66b408c0280
6
+ metadata.gz: f72b1e5f906952088bcae00e6e51df2b1bc0a250e2ad75bbf5a6d8ff89afc34734c0c39a81bfa1a79cec9c980eb4e859558cee6a8c043a8d3e761fb74952dd9d
7
+ data.tar.gz: 20f41df5cce18bc86912289f35bf5841943de3324b28883cfa4509d98afb1740af07d33294d594b5a809b31bf2a05c929fc17471a809a2c8d4672b5a1f86e774
@@ -1,5 +1,5 @@
1
1
  module OpenAccess
2
2
  module APC
3
- VERSION = '0.1.0'.freeze
3
+ VERSION = '0.2.0'.freeze
4
4
  end
5
5
  end
@@ -172,8 +172,8 @@ module OpenAccess
172
172
  # Returns the Pure person UUID given a network username
173
173
  # @param username [String] the network username
174
174
  # @return [String] the Pure UUID of the corresponding person
175
- def self.person(username = nil)
176
- employee_id = person_employee_id(username)
175
+ def self.person(username = nil, employee_id: nil)
176
+ employee_id ||= person_employee_id(username)
177
177
  person = @person_extractor.find_by_id(employee_id: employee_id)
178
178
  return person.uuid unless person.nil?
179
179
  raise UserNotFound, 'No user for employee ID: ' \
@@ -203,6 +203,7 @@ module OpenAccess
203
203
  # @return [Net::LDAP] the LDAP instance
204
204
  def self.configure_ldap
205
205
  conf = @config[:ldap]
206
+ return nil unless conf
206
207
  Net::LDAP.new(host: conf[:host], port: conf[:port], auth: conf[:auth])
207
208
  end
208
209
  private_class_method :configure_ldap
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openaccess-apc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Digital Innovation, Lancaster University Library