dor-fetcher 1.0.4 → 1.0.5

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 +7 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDNjOTBjMGVjY2U0MWI0Y2RlYzk0MDZhZWYzOGI3OWMwOTJlYmZjMA==
4
+ NmVkZGI2MzEwMDY1YzBlMDUxNTZhOTRmMDhjOWFiMTg2YzVkNjUyYQ==
5
5
  data.tar.gz: !binary |-
6
- ZDQ5YTBiMGZiZGY1NDUyMDc5OWFlNDU3NGNiYzNmOTMxNDRhNTUyNw==
6
+ OTgyNDAxM2M1MWJkYmEyMmMyODlkYWJlYmRhMGIyYjYxYWFmNDJiMA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YzhmODI1ODIwY2FkZTBkMGQ0NDM0NjI2MmVjYWU3MTk0NTE1MGYwZTlkYWUz
10
- ZWIzZGNmZTU3NmQyMWUxNjY3Nzk5NGU0YWRlYTQyODk3MTRmM2M3NjRjMTc5
11
- ODQzYzE3OGFiYzExN2UwZWE4ODc0N2ZkOWY5ODM3MWM1OTAwYTI=
9
+ YjY3ZTM4MjUxNTBkNGIxMmE1NzM3NWIzNDcxNDk5ZTVjYzhmOTI3MTUxYTQ2
10
+ NDQ4NWMxNDQ0NzQyMDFmYmM2NzQzMWNmYmY3OGNiMjNmZGY0ZmVjZGFmNmJh
11
+ NWZmOTM4OGVlNWNiZThhZTU4ZWI5MmE0NzU2NDVmNjBjYzcwYTQ=
12
12
  data.tar.gz: !binary |-
13
- MDhiZTE4NThlNTIwZGQxMTQ4NzkwOTQwM2UyMTU2MzNkMmYzOGVjOWE4MzIz
14
- ZWQ1Njk0N2M5YzRlMmJhY2FjMGM5ZGZlZjY5YzUzNDM4YzhhMjAwMjUwYjcy
15
- N2QzMTJkY2EzYTMzY2Q0NDEwMWI1NDA1ZjViYTY0N2E5ZmQ4ZjQ=
13
+ YjIyMzAwNDkyYjM0Y2I2ZmUyYTM2Yzk5MTAwOTk2ZGYzMzVhMTZhZWFmYWJm
14
+ MzVhODAwMThhYTkyMTgwNjJhNzgzMzg5ODgxY2NhMTNlYjhkOTE4Y2RhY2I5
15
+ MmQzYmVhYWI5NWQ4NjM0MjgyOWFkYjFmMTAwOTcyYjI5MDc3MjU=
data/lib/dor-fetcher.rb CHANGED
@@ -100,14 +100,19 @@ module DorFetcher
100
100
  #Method to parse full Hash into an array containing only the druids
101
101
  #
102
102
  #@param response [Hash] Hash as returned by query_api
103
+ #@param no_prefix [boolean] if true (default), remove the druid: prefix on all druids, if false, leave alone
103
104
  #@return [Array] the array listing all druids in the supplied Hash
104
- def druid_array(response)
105
+ def druid_array(response,params={})
105
106
  return_list = []
106
107
  j = response
107
108
  j.keys.each do |key|
108
109
  if key != @@counts_key
109
110
  j[key].each do |item|
110
- return_list << item['druid'] if item['druid'] != nil
111
+ if item['druid'] != nil
112
+ druid=item['druid'].downcase
113
+ druid.gsub!('druid:','') if params[:no_prefix]
114
+ return_list << druid
115
+ end
111
116
  end
112
117
  end
113
118
  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.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carrick Rogers
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-11-07 00:00:00.000000000 Z
13
+ date: 2014-11-11 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec