dor-fetcher 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +8 -8
  2. data/lib/dor-fetcher.rb +8 -5
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- Y2JjMjRhMDM4MWQ0YWYyMzNmMTgzOWY3OTU5ODdjN2YxMzQ3ZGZiNQ==
4
+ ZDIzMmIyMTY5NzNjZGQzYWExMzhmYWFhNDY0ZmVkZjE3ZGFkNGIwMw==
5
5
  data.tar.gz: !binary |-
6
- NDlmNTY5YWVhMjg5MjdhYjFjM2RiZTNlMDdhZjUyMWEzZGFlNGQwYw==
6
+ YzU5NDYyYTA2ZTVjOTMwNDBhYjBiNjg5YzNiYzM4MzIyZDdmOGUwNA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NjcyZjkwNjEwNWNhMGJjYzNhYzBmZjYwZWQ1YzZhOWViYjJlZDdmZjg2NzI1
10
- MTcwZjllZGJmMTVmOTcyMDQ1NjUxOTRiNGIyMmUyNWQyNWM4OTlkOWQ4NTU2
11
- MzVhZDg1YzBiZmMwNjUzZGM3ZDAxYThmYWU5NzBmNzY0NThmZTM=
9
+ MDYzZGFmOWYzZGY5Mjk2ZTM5ZjU5ZDNhNGI1YTBjNGEzZWEzZDdjOTBiODgx
10
+ MzBkOTdiYmE2N2ZlNDQxOWMyODg0MTI5OWUzZjc5MjEzYTE0NjliNGZhYzg1
11
+ ZGM3MGRiY2Q5Mzg3YmUyOTIzNDEyNDRlM2E1ZDkxZTViZTc1M2M=
12
12
  data.tar.gz: !binary |-
13
- NmI2MzU1OWIyNTc2ZGJmNTY3MGMxODkzZmFiOWRmMTg3YWU4MzY0Mzg5Yzk5
14
- ZDA4OTUyMDk0MzI5NWE3ZjI3MTkzNDFhZjA5MDRjYjU3NmVhMTUyMDM3YmMy
15
- ZGZhZmUzNTQxNjUxMGIzOTVkNTY0N2U3ZmY1MzgyNjdmZTY2Y2I=
13
+ MmY0NzBlOTcyMWZjM2Y4NzJiZGExNmI0NWFkOTkzM2Y2OGI2OTZjMmYzOTE0
14
+ MWJmYWY2M2VmNDNmNjI4MGE1Njk2NmYxNzdiNGY2NWViNWZlM2NmZDEwZjc5
15
+ YjZmNjZlNDk4MWQwOGRlYzk2NjhhYmEzN2MzMjUzMDUwOTVmMjE=
@@ -104,14 +104,19 @@ module DorFetcher
104
104
  #Method to parse full Hash into an array containing only the druids
105
105
  #
106
106
  #@param response [Hash] Hash as returned by query_api
107
+ #@param no_prefix [boolean] if true (default), remove the druid: prefix on all druids, if false, leave alone
107
108
  #@return [Array] the array listing all druids in the supplied Hash
108
- def druid_array(response)
109
+ def druid_array(response,params={})
109
110
  return_list = []
110
111
  j = response
111
112
  j.keys.each do |key|
112
113
  if key != @@counts_key
113
114
  j[key].each do |item|
114
- return_list << item['druid'] if item['druid'] != nil
115
+ if item['druid'] != nil
116
+ druid=item['druid'].downcase
117
+ druid.gsub!('druid:','') if params[:no_prefix]
118
+ return_list << druid
119
+ end
115
120
  end
116
121
  end
117
122
  end
@@ -181,6 +186,4 @@ module DorFetcher
181
186
 
182
187
  end
183
188
 
184
- end
185
-
186
-
189
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dor-fetcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carrick Rogers