cmis-ruby 0.4.8 → 0.4.9
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/cmis/connection/response_parser.rb +7 -1
- data/lib/cmis/server.rb +1 -1
- data/lib/cmis/version.rb +1 -1
- data/spec/cmis-ruby/document_spec.rb +17 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc9f3393f79186ade5f153deb2384a2dc90cb7c0
|
4
|
+
data.tar.gz: 0684f81f515ba8fe393cc463672ac73f79881416
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1968cc53fa44ad8007975d6b2bba0c50d4980bd6c31c874b48e215a73e54d237b645a424698c69e376a646c8e6838fc4919ba997fe2a32ea2acc41f4000e15a4
|
7
|
+
data.tar.gz: 1a13f30564ad323bbaea4dfb22850d07e56eaa1f28ad1cfe354dddc78aa7101e3d8d9b384b90d5a8c3835c4710a145c818e271d2a3f0ae08dc1a7e5b189e1c40
|
@@ -13,7 +13,7 @@ module CMIS
|
|
13
13
|
raise Exceptions::Unauthorized
|
14
14
|
else
|
15
15
|
if env[:response_headers][:content_type] =~ JSON_CONTENT_TYPE
|
16
|
-
|
16
|
+
parse_body(env)
|
17
17
|
check_for_cmis_exception!(env[:body])
|
18
18
|
end
|
19
19
|
end
|
@@ -22,6 +22,12 @@ module CMIS
|
|
22
22
|
|
23
23
|
private
|
24
24
|
|
25
|
+
def parse_body(env)
|
26
|
+
unless env[:response_headers][:content_disposition]
|
27
|
+
env[:body] = JSON.parse(env[:body])
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
25
31
|
def check_for_cmis_exception!(body)
|
26
32
|
return unless body.is_a?(Hash)
|
27
33
|
|
data/lib/cmis/server.rb
CHANGED
data/lib/cmis/version.rb
CHANGED
@@ -54,5 +54,22 @@ module CMIS
|
|
54
54
|
document.delete
|
55
55
|
end
|
56
56
|
end
|
57
|
+
|
58
|
+
context 'when creating a document with json content' do
|
59
|
+
it 'has the json content' do
|
60
|
+
document = repository.new_document
|
61
|
+
document.name = 'json_document'
|
62
|
+
document.object_type_id = 'cmis:document'
|
63
|
+
document.content = { stream: '{ "foo" : "bar" }',
|
64
|
+
mime_type: 'application/json',
|
65
|
+
filename: 'foo.json' }
|
66
|
+
document = document.create_in_folder(repository.root)
|
67
|
+
|
68
|
+
expect(document.content_stream_mime_type).to eq('application/json')
|
69
|
+
expect(document.content).to eq '{ "foo" : "bar" }'
|
70
|
+
|
71
|
+
document.delete
|
72
|
+
end
|
73
|
+
end
|
57
74
|
end
|
58
75
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cmis-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kenneth Geerts
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-04-
|
12
|
+
date: 2014-04-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|