contentdm_api 0.4.1 → 0.5.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
  SHA256:
3
- metadata.gz: '09e9d240768cafbc4e4ea26c4ae4f044d27b50760cf68b9ca95037ab634a763f'
4
- data.tar.gz: 5d6dc41cd3b9a2ddebc049c43ef8dfc64d455cebeef870683d4797161ef5da0d
3
+ metadata.gz: 24c59f2f7942f61ea5480a1b3bf726597f77da2bce1c1b4b6a1c80f056bd59ea
4
+ data.tar.gz: 94c7be93dce8be2ba5cf58df8cfbc4cdd5bb54ddaf4d786a9d62c011dc39ffe4
5
5
  SHA512:
6
- metadata.gz: d88357e27ad803be09e1390de563bf351f2f52b327fc81dea85f608899887b1fdf89a23c2846ffa02a9f3062a7c2c03776907b1152792e4ea99cc655d87c869b
7
- data.tar.gz: d4e7d566a2bc8fe3b94c8acf4730cbb42ff461cd67360fa02bd016f6c5ab3ac16fa57faa6f6f57934cf45888fddee0f5fa576464a3c6553c95503fefeb05d1a8
6
+ metadata.gz: 0b2e05d1138f8abfb375713d5a458a14749af227d724485557c8fad8ab87b3fd8920d4acdb1b479836f4a235773fd00a1656c15984ebf5d3ca2613e4ca18df78
7
+ data.tar.gz: 6403f5df1d27b714e3c51ce00deaa196f986ec0bd8faf2efebaf20d06f43bec0285451a22855b02bdd65fea2c546f6f45de5a097fbbfad740b5c6ad507dd6df9
@@ -1,6 +1,7 @@
1
1
  language: ruby
2
2
  cache: bundler
3
3
  rvm:
4
- - 2.2.3
5
- - 2.3.1
4
+ - 2.3.7
5
+ - 2.5.3
6
+ - 2.6.1
6
7
  before_install: gem install bundler -v 1.11.2
@@ -15,7 +15,10 @@ module CONTENTdmAPI
15
15
  # @param [String] collection The CONTENTdm API calls this an "alias"
16
16
  # @param [Integer] id The CONTENTdm API calls this a "pointer". It is the
17
17
  # identifier for a a given CONTENTdm item.
18
- # @param [Boolean] with_compound Include compound object info?
18
+ # @param [Boolean] with_compound Recursively request and in clude full
19
+ # compound item data? If false, basic compound data will STILL be
20
+ # included in the array value of the item hash key 'page'. 'page' is the
21
+ # term CONTENTdm uses to signify a list of child pages for an item.
19
22
  # @param [Boolean] enrich_compount Fetch and merge full item info for each
20
23
  # compound?
21
24
  # @param [Object] requester A class to make requests of the API.
@@ -44,12 +47,12 @@ module CONTENTdmAPI
44
47
  if with_compound
45
48
  result_with_id.merge('page' => compounds_to_h)
46
49
  else
47
- result_with_id.merge('page' => [])
50
+ result_with_id.merge('page' => page)
48
51
  end
49
52
  end
50
53
 
51
54
  def compounds_to_h
52
- [page].flatten.map do |compound|
55
+ page.map do |compound|
53
56
  block_given? ? yield(compound(compound)) : compound(compound)
54
57
  end
55
58
  end
@@ -66,7 +69,9 @@ module CONTENTdmAPI
66
69
  end
67
70
 
68
71
  def page
69
- result.fetch('page', [])
72
+ # Single result pages come back as a hash. Cast them into and array to
73
+ # make our api more consistent
74
+ [result.fetch('page', [])].flatten
70
75
  end
71
76
 
72
77
  def result_with_id
@@ -94,7 +99,7 @@ module CONTENTdmAPI
94
99
  end
95
100
 
96
101
  def service_configs
97
- with_compound ? item_config.concat(compound_config) : item_config
102
+ item_config.concat(compound_config)
98
103
  end
99
104
 
100
105
  def item_config
@@ -1,3 +1,3 @@
1
1
  module CONTENTdmAPI
2
- VERSION = '0.4.1'.freeze
2
+ VERSION = '0.5.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contentdm_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chad Fennell
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-23 00:00:00.000000000 Z
11
+ date: 2019-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http
@@ -124,8 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
126
  requirements: []
127
- rubyforge_project:
128
- rubygems_version: 2.7.8
127
+ rubygems_version: 3.0.1
129
128
  signing_key:
130
129
  specification_version: 4
131
130
  summary: Ruby bindings for the CONTENTdm API