pmp 0.5.1 → 0.5.2
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 +4 -4
- data/lib/pmp/collection_document.rb +1 -1
- data/lib/pmp/version.rb +1 -1
- data/spec/collection_document_spec.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ca69f3e539643b77523e7f339825dade3705136
|
4
|
+
data.tar.gz: 6562b98d05e8f039ee79fa04d9cc06cd590ffb77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ce6b0dd6ab4f56c0e587e6f736126b40b8c04d349f4be5f518275ce23d0f3c3f289cccda68998270a9fd817a084ee0c798b004013fde9e2757d45a7bf9bbcfb
|
7
|
+
data.tar.gz: 91bf97ba769d222e67643d232fe686e1b8d7a235a853bed842921753af91dee3d22284189102e709e4bf18d5b78e8d7809ac5d914e1b027632fd98e286d5579a
|
@@ -198,7 +198,7 @@ module PMP
|
|
198
198
|
def self.to_persist_json(body)
|
199
199
|
return body.to_s if body.is_a?(String) || !body.respond_to?(:as_json)
|
200
200
|
|
201
|
-
result = body.as_json.select
|
201
|
+
result = body.as_json.select { |k,v| %w(version attributes links).include?(k) }
|
202
202
|
result['attributes'].reject! { |k,v| %w(created modified).include?(k) }
|
203
203
|
result['links'].reject! { |k,v| %w(creator query edit auth).include?(k) }
|
204
204
|
|
data/lib/pmp/version.rb
CHANGED
@@ -206,7 +206,7 @@ describe PMP::CollectionDocument do
|
|
206
206
|
doc = PMP::CollectionDocument.new(oauth_token: 'thisisatestvalueonly')
|
207
207
|
|
208
208
|
stub_request(:put, "https://publish.pmp.io/docs/c144e4df-021b-41e6-9cf3-42ac49bcbd42").
|
209
|
-
with(:body => "{\"links\":{},\"attributes\":{\"guid\":\"c144e4df-021b-41e6-9cf3-42ac49bcbd42\",\"title\":\"testing\"}}",
|
209
|
+
with(:body => "{\"version\":\"1.0\",\"links\":{},\"attributes\":{\"guid\":\"c144e4df-021b-41e6-9cf3-42ac49bcbd42\",\"title\":\"testing\"}}",
|
210
210
|
:headers => {'Accept'=>'application/vnd.collection.doc+json', 'Authorization'=>'Bearer thisisatestvalueonly', 'Content-Type'=>'application/vnd.collection.doc+json'}).
|
211
211
|
to_return(:status => 200, :body => '{"url":"https://api.pmp.io/docs/c144e4df-021b-41e6-9cf3-42ac49bcbd42"}')
|
212
212
|
|
@@ -219,7 +219,7 @@ describe PMP::CollectionDocument do
|
|
219
219
|
doc.href.must_equal "https://api.pmp.io/docs/c144e4df-021b-41e6-9cf3-42ac49bcbd42"
|
220
220
|
|
221
221
|
stub_request(:put, "https://publish.pmp.io/docs/c144e4df-021b-41e6-9cf3-42ac49bcbd42").
|
222
|
-
with(:body => "{\"links\":{},\"attributes\":{\"guid\":\"c144e4df-021b-41e6-9cf3-42ac49bcbd42\",\"title\":\"testing an update\"}}",
|
222
|
+
with(:body => "{\"version\":\"1.0\",\"links\":{},\"attributes\":{\"guid\":\"c144e4df-021b-41e6-9cf3-42ac49bcbd42\",\"title\":\"testing an update\"}}",
|
223
223
|
:headers => {'Accept'=>'application/vnd.collection.doc+json', 'Authorization'=>'Bearer thisisatestvalueonly', 'Content-Type'=>'application/vnd.collection.doc+json'}).
|
224
224
|
to_return(:status => 200, :body => '{"url":"https://api.pmp.io/docs/c144e4df-021b-41e6-9cf3-42ac49bcbd42"}')
|
225
225
|
|