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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1d7de0653ac57178aae304281dcd8ec41c7b5688
4
- data.tar.gz: 6b408d6290cd17fdbe81e4327d37fd6aa7eea251
3
+ metadata.gz: dc9f3393f79186ade5f153deb2384a2dc90cb7c0
4
+ data.tar.gz: 0684f81f515ba8fe393cc463672ac73f79881416
5
5
  SHA512:
6
- metadata.gz: 823583dc1ffb9b66fa1909a47a4224d322b1c2b0d2638279ac9b8bf7208b1104bc00261c64e5ff76a9c1d6b1d4a8ea74c9276df8801896161335d6652d5a14af
7
- data.tar.gz: 4146bfe8c67f079767d962573a3eb4176aaaf30ee1fc48209b620f51ca5cd2ac71359035e17421a34b39dd89ba41f2c38d4499b95539e7d533f0bbf1367a9993
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
- env[:body] = JSON.parse(env[:body])
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
@@ -1,5 +1,5 @@
1
1
  module CMIS
2
- class Server < Connection
2
+ class Server
3
3
  def initialize(options = {})
4
4
  @options = options.symbolize_keys
5
5
  end
data/lib/cmis/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module CMIS
2
- VERSION = '0.4.8'
2
+ VERSION = '0.4.9'
3
3
  end
@@ -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.8
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-08 00:00:00.000000000 Z
12
+ date: 2014-04-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday