dor-fetcher 0.0.1 → 0.0.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 +11 -0
  3. metadata +16 -2
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- M2FhZDJlMzQwNTBhNTcwYmQxNGI4NGUzNmU4ZTBlMDg4N2RmNTQwZg==
4
+ ZjM1ZThlZWJiOGM0MzVmZTAwZTRkYjU5MzIxMDZkNzhhMTQ0YjNkMA==
5
5
  data.tar.gz: !binary |-
6
- NzQ2ZjdjZDQ0ZTY2YWEyOTA1OWQxMzRjZGI0NGNiYzFkMTVkMGI0Yg==
6
+ ZDAyYWRlOTUzZDYwNjQxNDI1MjgwMGIyMzhlYTRmNGU2YTEwMTk3Ng==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YjE1ZTEyZWUxZDE1M2UwMjM1MWQ4MWZkMzBhNGJmYmFjYzE2YTdkNTM3ZDM0
10
- NGM4NzBlZWZhNGM4ZTJkMGMwNDVjNmQ1NTE3ODk3ODBhZjczNmRkYmE4ODMz
11
- OGQ4NTk1ZmFmNTE5YWI1M2E0MjZhMmJiZDY2OWZhODVhNzY1MDg=
9
+ MGE2NmNjZjIxMzk2YmUwODA3NWYwZWM2NzMyNzQ5MWY1YmFiYzY2OTExNzhj
10
+ YWJkNzRiYTQwODQ0ZDgyNWFhN2EzMTRkZmE3YmFkZWI4ZTY5OGRjZTFkMmUy
11
+ OTQ2NGJkOGM2ODQ1M2NjNzBiM2MyMzEwOGYzZjM2ZTJkODhkYTE=
12
12
  data.tar.gz: !binary |-
13
- M2M1MWU1Mjc0ZjQyNmI1NGQ2NGZiODYxYzJjOTgyZTUzZWE1OWY2Mjc4YWRj
14
- ZWMwM2JlN2QwNzgzNTk4YTlkOTM4OThlNjcxNDkxMDZkMzY2NTEyM2M0Zjc4
15
- ZTAyZDc0NDU2NGJjNTQ1YjIzZTA0ZTI3NmNkMGVlNDk3YzdkMGI=
13
+ MTUxOThlMTUzMjlmNzg1MDdmODAwZmY5ZjEwYmNmODc3ZTA2MmM0MjQwMmMy
14
+ NDRiODQwY2I1NjRhYTUyMzg2YWU1M2ZmYzc2ZTA5NWYzZTU3ZmU4MTk2ZGE4
15
+ NjAyOGU4NjBlYzYyMDYyYWUyZjliMjYzYjUyYjJjNjA2ZTRjMWY=
data/lib/dor-fetcher.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'net/http'
2
+ require 'json'
2
3
 
3
4
  module DorFetcher
4
5
 
@@ -47,6 +48,16 @@ module DorFetcher
47
48
  return query_api('apo', '', {:count_only=>true})
48
49
  end
49
50
 
51
+ def druid_array(response)
52
+ return_list = []
53
+ j = JSON.parse(response)
54
+ j.keys.each do |key|
55
+ j[key].each do |item|
56
+ return_list << item['druid'] if item['druid'] != nil
57
+ end
58
+ end
59
+ return return_list
60
+ end
50
61
 
51
62
  def query_api(base, druid, params)
52
63
  url = "#{@service_url}/#{base}/#{druid}#{add_params(params)}"
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: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carrick Rogers
@@ -9,7 +9,21 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2014-10-10 00:00:00.000000000 Z
12
- dependencies: []
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rspec
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ! '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ! '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  description: Wrapped for the Dor Fetcher Services restful api.
14
28
  email: carrickr@stanford.edu
15
29
  executables: []