cmis-ruby 0.3.6 → 0.3.7

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: 02a90b75f0be84cc302c4a1009af31ba8c5bda9b
4
- data.tar.gz: 4c4fbdf04f4c5dee685f77a1ecfe43af08616431
3
+ metadata.gz: 97132317b4609f109b961b1069bd5423e6bb1b89
4
+ data.tar.gz: a43ebf5d4525804e207d040c0c58feda45e48fd8
5
5
  SHA512:
6
- metadata.gz: d21dacc515544df7721021adc675a1a7492ec56d3067e0a9a7220b205274dbdbb06212cb2028b926867deef899aa8373c3112be0071ab2e1e46973633070aa21
7
- data.tar.gz: 5b2ed9b877541bf0fb23f97ca15fa8f7bafa776eb803dab54c2d025fc30984023479f0c0a3b47c2b49c6cf51f452d35b56ed17cc3d3ed0170e4f95c2c86b50f2
6
+ metadata.gz: 4ea0dff54def6be22aa39c6ac2738993b6b6dfbb21bc34e0c001bdf2ba6012ac125a5c0cc6382633cefdcc064d53c0a95fd3c8710dcc59b98b971a622b2792b0
7
+ data.tar.gz: 29ee254a5eda2bca3b4220d64b219ed97b0815a42ed4330aa185ebc77c87cdfa94b32e98e9df20696279193f541a0434df520fee8be0d311ee93f086642e4530
data/cmis-ruby.gemspec CHANGED
@@ -1,25 +1,26 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
1
+ $LOAD_PATH.unshift 'lib'
4
2
  require 'cmis/version'
5
3
 
6
4
  Gem::Specification.new do |s|
7
- s.name = 'cmis-ruby'
8
- s.version = CMIS::VERSION
9
- s.authors = ['Kenneth Geerts', 'Michael Brackx']
10
- s.email = ['gem@up-nxt.com']
11
- s.homepage = 'https://github.com/UP-nxt'
12
- s.summary = 'Ruby client for CMIS'
5
+ s.name = 'cmis-ruby'
6
+ s.version = CMIS::VERSION
7
+ s.date = Time.now.strftime('%Y-%m-%d')
8
+ s.authors = ['Kenneth Geerts', 'Michael Brackx']
9
+ s.email = ['kenneth@up-nxt.com']
10
+ s.homepage = 'https://github.com/UP-nxt'
11
+ s.summary = 'Ruby client for CMIS'
12
+ s.license = 'Apache-2.0'
13
+ s.has_rdoc = false
13
14
 
14
- s.files = `git ls-files`.split($/)
15
- s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
16
- s.test_files = s.files.grep(%r{^(test|spec|features)/})
17
- s.require_paths = ['lib']
15
+ s.files = `git ls-files`.split($/)
16
+ s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ s.test_files = s.files.grep(%r{^(test|spec|features)/})
18
+ s.require_paths = [ 'lib' ]
18
19
 
19
- s.add_dependency 'faraday', '~> 0.9.0'
20
- s.add_dependency 'activesupport', '>= 3.2', '< 5.0'
20
+ s.add_dependency 'faraday', '~> 0.9'
21
+ s.add_dependency 'activesupport', '>= 3.2', '< 5.0'
21
22
 
22
- s.description = <<-DESC.gsub(/^ /, '')
23
- CMIS browser binding client library in ruby.
24
- DESC
23
+ s.description = <<-DESCRIPTION
24
+ CMIS browser binding client library in ruby.
25
+ DESCRIPTION
25
26
  end
data/lib/cmis-ruby.rb CHANGED
@@ -1,11 +1,11 @@
1
1
  require 'bigdecimal'
2
2
  require 'json'
3
3
 
4
+ require 'faraday'
5
+
4
6
  require 'active_support/core_ext'
5
7
  require 'core_ext'
6
8
 
7
- require 'faraday'
8
-
9
9
  require 'cmis/connection'
10
10
  require 'cmis/exceptions'
11
11
  require 'cmis/server'
data/lib/cmis/children.rb CHANGED
@@ -80,15 +80,15 @@ module CMIS
80
80
  end
81
81
 
82
82
  def do_get_children
83
- repository = @folder.repository
84
- result = repository.connection.execute!({ cmisselector: 'children',
85
- repositoryId: @folder.repository.id,
86
- objectId: @folder.cmis_object_id,
87
- maxItems: @max_items,
88
- skipCount: @skip_count,
89
- orderBy: @order_by,
90
- includeRelationships: @include_relationships,
91
- filter: @filter}, @opts)
83
+ server = @folder.repository.server
84
+ result = server.execute!({ cmisselector: 'children',
85
+ repositoryId: @folder.repository.id,
86
+ objectId: @folder.cmis_object_id,
87
+ maxItems: @max_items,
88
+ skipCount: @skip_count,
89
+ orderBy: @order_by,
90
+ includeRelationships: @include_relationships,
91
+ filter: @filter}, @opts)
92
92
 
93
93
  results = result['objects'].map { |o| build_object_with_relationships(o) }
94
94
  QueryResult.new(results, result['numItems'], result['hasMoreItems'])
@@ -3,9 +3,8 @@ module CMIS
3
3
  def initialize(options)
4
4
  options.symbolize_keys!
5
5
 
6
- service_url = options[:service_url] || ENV['CMIS_BROWSER_URL']
7
- @service_url = service_url or raise "\
8
- option `:service_url` or ENV['CMIS_BROWSER_URL'] must be set"
6
+ @service_url = options[:service_url] || ENV['CMIS_BROWSER_URL'] or raise \
7
+ "option `:service_url` or ENV['CMIS_BROWSER_URL'] must be set"
9
8
 
10
9
  adapter = (options[:adapter] || :net_http).to_sym
11
10
 
@@ -69,8 +68,8 @@ module CMIS
69
68
 
70
69
  repository_info = repository_infos[repository_id]
71
70
  @url_cache[repository_id] = {
72
- repository_url: repository_info['repositoryUrl'],
73
- root_folder_url: repository_info['rootFolderUrl']
71
+ repository_url: repository_info[:repositoryUrl],
72
+ root_folder_url: repository_info[:rootFolderUrl]
74
73
  }
75
74
  end
76
75
  @url_cache[repository_id]
@@ -137,7 +136,8 @@ module CMIS
137
136
  env[:body] = JSON.parse(env[:body]).with_indifferent_access
138
137
  if env[:body].is_a?(Hash) && ex = env[:body][:exception]
139
138
  ruby_exception = "CMIS::Exceptions::#{ex.camelize}".constantize
140
- raise ruby_exception, env[:body]['message']
139
+ message = "#{ex.underscore.humanize}: #{env[:body][:message]}"
140
+ raise ruby_exception, message
141
141
  end
142
142
  end
143
143
  end
data/lib/cmis/document.rb CHANGED
@@ -13,29 +13,29 @@ module CMIS
13
13
  end
14
14
 
15
15
  def create_in_folder(folder, opts = {})
16
- r = connection.execute!({ cmisaction: 'createDocument',
17
- repositoryId: repository.id,
18
- properties: properties,
19
- objectId: folder.cmis_object_id,
20
- folderId: folder.cmis_object_id,
21
- content: @local_content }, opts)
16
+ r = server.execute!({ cmisaction: 'createDocument',
17
+ repositoryId: repository.id,
18
+ properties: properties,
19
+ objectId: folder.cmis_object_id,
20
+ folderId: folder.cmis_object_id,
21
+ content: @local_content }, opts)
22
22
 
23
23
  ObjectFactory.create(r, repository)
24
24
  end
25
25
 
26
26
  def copy_in_folder(folder, opts = {})
27
- id = connection.execute!({ cmisaction: 'createDocument',
28
- repositoryId: repository.id,
29
- sourceId: cmis_object_id,
30
- objectId: folder.cmis_object_id }, opts)
27
+ id = server.execute!({ cmisaction: 'createDocument',
28
+ repositoryId: repository.id,
29
+ sourceId: cmis_object_id,
30
+ objectId: folder.cmis_object_id }, opts)
31
31
 
32
32
  repository.object(id)
33
33
  end
34
34
 
35
35
  def content(opts = {})
36
- connection.execute!({ cmisselector: 'content',
37
- repositoryId: repository.id,
38
- objectId: cmis_object_id }, opts)
36
+ server.execute!({ cmisselector: 'content',
37
+ repositoryId: repository.id,
38
+ objectId: cmis_object_id }, opts)
39
39
 
40
40
  rescue Exceptions::Constraint
41
41
  # Check for specific constraint?
@@ -55,11 +55,11 @@ module CMIS
55
55
  if detached?
56
56
  @local_content = content
57
57
  else
58
- update_change_token connection.execute!({ cmisaction: 'setContent',
59
- repositoryId: repository.id,
60
- objectId: cmis_object_id,
61
- content: content,
62
- changeToken: change_token }, opts)
58
+ update_change_token server.execute!({ cmisaction: 'setContent',
59
+ repositoryId: repository.id,
60
+ objectId: cmis_object_id,
61
+ content: content,
62
+ changeToken: change_token }, opts)
63
63
  end
64
64
  end
65
65
  end
data/lib/cmis/folder.rb CHANGED
@@ -28,21 +28,21 @@ module CMIS
28
28
  return object.create_in_folder(self, opts)
29
29
 
30
30
  when Folder
31
- o = connection.execute!({ cmisaction: 'createFolder',
32
- repositoryId: repository.id,
33
- properties: object.properties,
34
- objectId: cmis_object_id }, opts)
31
+ o = server.execute!({ cmisaction: 'createFolder',
32
+ repositoryId: repository.id,
33
+ properties: object.properties,
34
+ objectId: cmis_object_id }, opts)
35
35
 
36
36
  when Policy
37
- o = connection.execute!({ cmisaction: 'createPolicy',
38
- repositoryId: repository.id,
39
- properties: object.properties,
40
- objectId: cmis_object_id }, opts)
37
+ o = server.execute!({ cmisaction: 'createPolicy',
38
+ repositoryId: repository.id,
39
+ properties: object.properties,
40
+ objectId: cmis_object_id }, opts)
41
41
  when Item
42
- o = connection.execute!({ cmisaction: 'createItem',
43
- repositoryId: repository.id,
44
- properties: object.properties,
45
- objectId: cmis_object_id }, opts)
42
+ o = server.execute!({ cmisaction: 'createItem',
43
+ repositoryId: repository.id,
44
+ properties: object.properties,
45
+ objectId: cmis_object_id }, opts)
46
46
 
47
47
  else
48
48
  raise "Unexpected base_type_id: #{object.base_type_id}"
@@ -52,23 +52,23 @@ module CMIS
52
52
  end
53
53
 
54
54
  def delete_tree(opts = {})
55
- connection.execute!({ cmisaction: 'deleteTree',
56
- repositoryId: repository.id,
57
- objectId: cmis_object_id }, opts)
55
+ server.execute!({ cmisaction: 'deleteTree',
56
+ repositoryId: repository.id,
57
+ objectId: cmis_object_id }, opts)
58
58
  end
59
59
 
60
60
  def add(object, opts = {})
61
- connection.execute!({ cmisaction: 'addObjectToFolder',
62
- repositoryId: repository.id,
63
- objectId: object.cmis_object_id,
64
- folderId: cmis_object_id }, opts)
61
+ server.execute!({ cmisaction: 'addObjectToFolder',
62
+ repositoryId: repository.id,
63
+ objectId: object.cmis_object_id,
64
+ folderId: cmis_object_id }, opts)
65
65
  end
66
66
 
67
67
  def remove(object, opts = {})
68
- connection.execute!({ cmisaction: 'removeObjectFromFolder',
69
- repositoryId: repository.id,
70
- objectId: object.cmis_object_id,
71
- folderId: cmis_object_id }, opts)
68
+ server.execute!({ cmisaction: 'removeObjectFromFolder',
69
+ repositoryId: repository.id,
70
+ objectId: object.cmis_object_id,
71
+ folderId: cmis_object_id }, opts)
72
72
  end
73
73
  end
74
74
  end
data/lib/cmis/object.rb CHANGED
@@ -20,32 +20,32 @@ module CMIS
20
20
  end
21
21
 
22
22
  def delete(opts = {})
23
- connection.execute!({ cmisaction: 'delete',
24
- repositoryId: repository.id,
25
- objectId: cmis_object_id,
26
- allVersions: true }, opts)
23
+ server.execute!({ cmisaction: 'delete',
24
+ repositoryId: repository.id,
25
+ objectId: cmis_object_id,
26
+ allVersions: true }, opts)
27
27
  end
28
28
 
29
29
  def update_properties(properties, opts = {})
30
- update_change_token connection.execute!({ cmisaction: 'update',
31
- repositoryId: repository.id,
32
- objectId: cmis_object_id,
33
- properties: properties,
34
- changeToken: change_token }, opts)
30
+ update_change_token server.execute!({ cmisaction: 'update',
31
+ repositoryId: repository.id,
32
+ objectId: cmis_object_id,
33
+ properties: properties,
34
+ changeToken: change_token }, opts)
35
35
  end
36
36
 
37
37
  def parents(opts = {})
38
- result = connection.execute!({ cmisselector: 'parents',
39
- repositoryId: repository.id,
40
- objectId: cmis_object_id }, opts)
38
+ result = server.execute!({ cmisselector: 'parents',
39
+ repositoryId: repository.id,
40
+ objectId: cmis_object_id }, opts)
41
41
 
42
42
  result.map { |o| ObjectFactory.create(o['object'], repository) }
43
43
  end
44
44
 
45
45
  def allowable_actions(opts = {})
46
- connection.execute!({ cmisselector: 'allowableActions',
47
- repositoryId: repository.id,
48
- objectId: cmis_object_id }, opts)
46
+ server.execute!({ cmisselector: 'allowableActions',
47
+ repositoryId: repository.id,
48
+ objectId: cmis_object_id }, opts)
49
49
  end
50
50
 
51
51
  def relationships(opts = {})
@@ -53,9 +53,9 @@ module CMIS
53
53
  end
54
54
 
55
55
  def policies(opts = {})
56
- result = connection.execute!({ cmisselector: 'policies',
57
- repositoryId: repository.id,
58
- objectId: cmis_object_id }, opts)
56
+ result = server.execute!({ cmisselector: 'policies',
57
+ repositoryId: repository.id,
58
+ objectId: cmis_object_id }, opts)
59
59
 
60
60
  result.map { |r| Policy.new(r, repository) }
61
61
  end
@@ -67,7 +67,7 @@ module CMIS
67
67
  objectId: cmis_object_id }
68
68
  params.update!(folderId: folder.cmis_object_id) if folder
69
69
 
70
- connection.execute!(params, opts)
70
+ server.execute!(params, opts)
71
71
  end
72
72
 
73
73
  def move(target_folder, opts = {})
@@ -77,31 +77,31 @@ module CMIS
77
77
  raise 'Cannot move object because it is not in exactly one folder'
78
78
  end
79
79
 
80
- connection.execute!({ cmisaction: 'move',
81
- repositoryId: repository.id,
82
- objectId: cmis_object_id,
83
- targetFolderId: target_folder.cmis_object_id,
84
- sourceFolderId: object_parents.first.cmis_object_id }, opts)
80
+ server.execute!({ cmisaction: 'move',
81
+ repositoryId: repository.id,
82
+ objectId: cmis_object_id,
83
+ targetFolderId: target_folder.cmis_object_id,
84
+ sourceFolderId: object_parents.first.cmis_object_id }, opts)
85
85
  end
86
86
 
87
87
  def acls(opts = {})
88
- connection.execute!({ cmisselector: 'acl',
89
- repositoryId: repository.id,
90
- objectId: cmis_object_id }, opts)
88
+ server.execute!({ cmisselector: 'acl',
89
+ repositoryId: repository.id,
90
+ objectId: cmis_object_id }, opts)
91
91
  end
92
92
 
93
93
  def add_aces(aces, opts = {})
94
- connection.execute!({ cmisaction: 'applyACL',
95
- repositoryId: repository.id,
96
- objectId: cmis_object_id,
97
- addACEs: aces }, opts)
94
+ server.execute!({ cmisaction: 'applyACL',
95
+ repositoryId: repository.id,
96
+ objectId: cmis_object_id,
97
+ addACEs: aces }, opts)
98
98
  end
99
99
 
100
100
  def remove_aces(aces, opts = {})
101
- connection.execute!({ cmisaction: 'applyACL',
102
- repositoryId: repository.id,
103
- objectId: cmis_object_id,
104
- removeACEs: aces }, opts)
101
+ server.execute!({ cmisaction: 'applyACL',
102
+ repositoryId: repository.id,
103
+ objectId: cmis_object_id,
104
+ removeACEs: aces }, opts)
105
105
  end
106
106
 
107
107
  def detached?
@@ -110,8 +110,8 @@ module CMIS
110
110
 
111
111
  private
112
112
 
113
- def connection
114
- repository.connection if repository
113
+ def server
114
+ repository.server if repository
115
115
  end
116
116
  end
117
117
  end
data/lib/cmis/policy.rb CHANGED
@@ -8,17 +8,17 @@ module CMIS
8
8
  end
9
9
 
10
10
  def apply_to(object, opts = {})
11
- connection.execute!({ cmisaction: 'applyPolicy',
12
- repositoryId: repository_id,
13
- policyId: cmis_object_id,
14
- objectId: object.cmis_object_id }, opts)
11
+ server.execute!({ cmisaction: 'applyPolicy',
12
+ repositoryId: repository_id,
13
+ policyId: cmis_object_id,
14
+ objectId: object.cmis_object_id }, opts)
15
15
  end
16
16
 
17
17
  def remove_from(object, opts = {})
18
- connection.execute!({ cmisaction: 'removePolicy',
19
- repositoryId: repository_id,
20
- policyId: cmis_object_id,
21
- objectId: object.cmis_object_id }, opts)
18
+ server.execute!({ cmisaction: 'removePolicy',
19
+ repositoryId: repository_id,
20
+ policyId: cmis_object_id,
21
+ objectId: object.cmis_object_id }, opts)
22
22
  end
23
23
  end
24
24
  end
data/lib/cmis/query.rb CHANGED
@@ -88,7 +88,7 @@ module CMIS
88
88
  params.merge!(cmisaction: 'query', statement: @statement)
89
89
  end
90
90
 
91
- result = @repository.connection.execute!(params, @opts)
91
+ result = @repository.server.execute!(params, @opts)
92
92
 
93
93
  results = result['results'].map do |r|
94
94
  ObjectFactory.create(r, @repository)
@@ -80,15 +80,15 @@ module CMIS
80
80
  end
81
81
 
82
82
  def do_get_relationships
83
- connection = @object.repository.connection
84
- result = connection.execute!({ cmisselector: 'relationships',
85
- repositoryId: @object.repository.id,
86
- objectId: @object.cmis_object_id,
87
- maxItems: @max_items,
88
- skipCount: @skip_count,
89
- relationshipDirection: @direction,
90
- includeSubRelationshipTypes: @include_subtypes,
91
- typeId: @type_id }, @opts)
83
+ server = @object.repository.server
84
+ result = server.execute!({ cmisselector: 'relationships',
85
+ repositoryId: @object.repository.id,
86
+ objectId: @object.cmis_object_id,
87
+ maxItems: @max_items,
88
+ skipCount: @skip_count,
89
+ relationshipDirection: @direction,
90
+ includeSubRelationshipTypes: @include_subtypes,
91
+ typeId: @type_id }, @opts)
92
92
 
93
93
  results = result['objects'].map do |r|
94
94
  ObjectFactory.create(r, @object.repository)
@@ -1,15 +1,15 @@
1
1
  module CMIS
2
2
  class Repository
3
- attr_reader :connection
3
+ attr_reader :server
4
4
 
5
- def initialize(raw, connection)
5
+ def initialize(raw, server)
6
6
  @hash = raw
7
7
  @hash.each_key do |key|
8
8
  class_eval "def #{key.underscore};@hash['#{key}'];end"
9
9
  class_eval "def #{key.gsub('repository', '').underscore};@hash['#{key}'];end" if key =~ /^repository/
10
10
  end
11
11
 
12
- @connection = connection
12
+ @server = server
13
13
  end
14
14
 
15
15
  def new_document
@@ -37,33 +37,33 @@ module CMIS
37
37
  end
38
38
 
39
39
  def root(opts = {})
40
- result = connection.execute!({ cmisselector: 'object',
41
- repositoryId: id,
42
- objectId: root_folder_id }, opts)
40
+ result = server.execute!({ cmisselector: 'object',
41
+ repositoryId: id,
42
+ objectId: root_folder_id }, opts)
43
43
 
44
44
  ObjectFactory.create(result, self)
45
45
  end
46
46
 
47
47
  def object(cmis_object_id, opts = {})
48
- result = connection.execute!({ cmisselector: 'object',
49
- repositoryId: id,
50
- objectId: cmis_object_id }, opts)
48
+ result = server.execute!({ cmisselector: 'object',
49
+ repositoryId: id,
50
+ objectId: cmis_object_id }, opts)
51
51
 
52
52
  ObjectFactory.create(result, self)
53
53
  end
54
54
 
55
55
  def types(opts = {})
56
- result = connection.execute!({ cmisselector: 'typeDescendants',
57
- repositoryId: id,
58
- includePropertyDefinitions: true }, opts)
56
+ result = server.execute!({ cmisselector: 'typeDescendants',
57
+ repositoryId: id,
58
+ includePropertyDefinitions: true }, opts)
59
59
 
60
60
  construct_types(result)
61
61
  end
62
62
 
63
63
  def type(type_id, opts = {})
64
- result = connection.execute!({ cmisselector: 'typeDefinition',
65
- repositoryId: id,
66
- typeId: type_id }, opts)
64
+ result = server.execute!({ cmisselector: 'typeDefinition',
65
+ repositoryId: id,
66
+ typeId: type_id }, opts)
67
67
 
68
68
  Type.new(result, self)
69
69
  end
@@ -76,9 +76,9 @@ module CMIS
76
76
  end
77
77
 
78
78
  def create_type(type, opts = {})
79
- result = connection.execute!({ cmisaction: 'createType',
80
- repositoryId: id,
81
- type: JSON.generate(type.to_hash) }, opts)
79
+ result = server.execute!({ cmisaction: 'createType',
80
+ repositoryId: id,
81
+ type: JSON.generate(type.to_hash) }, opts)
82
82
 
83
83
  Type.new(result, self)
84
84
  end
@@ -86,17 +86,17 @@ module CMIS
86
86
  def create_relationship(object, opts = {})
87
87
  raise 'Object is not a Relationship' unless object.is_a?(Relationship)
88
88
 
89
- result = connection.execute!({ cmisaction: 'createRelationship',
90
- repositoryId: id,
91
- properties: object.properties }, opts)
89
+ result = server.execute!({ cmisaction: 'createRelationship',
90
+ repositoryId: id,
91
+ properties: object.properties }, opts)
92
92
 
93
93
  ObjectFactory.create(result, self)
94
94
  end
95
95
 
96
96
  def content_changes(change_log_token, opts = {})
97
- connection.execute!({ cmisselector: 'contentChanges',
98
- repositoryId: id,
99
- changeLogToken: change_log_token }, opts)
97
+ server.execute!({ cmisselector: 'contentChanges',
98
+ repositoryId: id,
99
+ changeLogToken: change_log_token }, opts)
100
100
  end
101
101
 
102
102
  def query(statement, opts = {})
data/lib/cmis/server.rb CHANGED
@@ -1,24 +1,23 @@
1
1
  module CMIS
2
- class Server
3
- attr_reader :connection
2
+ class Server < Connection
4
3
 
5
4
  def initialize(options = {})
6
- @connection = Connection.new(options)
5
+ super
7
6
  end
8
7
 
9
8
  def repositories(opts = {})
10
- result = connection.execute!({}, opts)
9
+ result = execute!({}, opts)
11
10
 
12
11
  result.values.map do |r|
13
- Repository.new(r, connection)
12
+ Repository.new(r, self)
14
13
  end
15
14
  end
16
15
 
17
16
  def repository(repository_id, opts = {})
18
- result = connection.execute!({ cmisselector: 'repositoryInfo',
19
- repositoryId: repository_id }, opts)
17
+ result = execute!({ cmisselector: 'repositoryInfo',
18
+ repositoryId: repository_id }, opts)
20
19
 
21
- Repository.new(result[repository_id], connection)
20
+ Repository.new(result[repository_id], self)
22
21
  end
23
22
 
24
23
  def has_repository?(repository_id)
data/lib/cmis/type.rb CHANGED
@@ -40,17 +40,17 @@ module CMIS
40
40
  hash = to_hash
41
41
  hash['propertyDefinitions'] = new_defs
42
42
 
43
- result = connection.execute!({ cmisaction: 'updateType',
44
- repositoryId: repository.id,
45
- type: JSON.generate(hash) }, opts)
43
+ result = server.execute!({ cmisaction: 'updateType',
44
+ repositoryId: repository.id,
45
+ type: JSON.generate(hash) }, opts)
46
46
 
47
47
  Type.new(result, repository)
48
48
  end
49
49
 
50
50
  def delete(opts = {})
51
- connection.execute!({ cmisaction: 'deleteType',
52
- repositoryId: repository.id,
53
- typeId: id }, opts)
51
+ server.execute!({ cmisaction: 'deleteType',
52
+ repositoryId: repository.id,
53
+ typeId: id }, opts)
54
54
  end
55
55
 
56
56
  def document_type?
@@ -98,8 +98,8 @@ module CMIS
98
98
 
99
99
  private
100
100
 
101
- def connection
102
- repository.connection if repository
101
+ def server
102
+ repository.server if repository
103
103
  end
104
104
  end
105
105
  end
data/lib/cmis/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module CMIS
2
- VERSION = '0.3.6'
2
+ VERSION = '0.3.7'
3
3
  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.3.6
4
+ version: 0.3.7
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-03-06 00:00:00.000000000 Z
12
+ date: 2014-03-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: 0.9.0
20
+ version: '0.9'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: 0.9.0
27
+ version: '0.9'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: activesupport
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -48,7 +48,7 @@ dependencies:
48
48
  description: |
49
49
  CMIS browser binding client library in ruby.
50
50
  email:
51
- - gem@up-nxt.com
51
+ - kenneth@up-nxt.com
52
52
  executables: []
53
53
  extensions: []
54
54
  extra_rdoc_files: []
@@ -93,7 +93,8 @@ files:
93
93
  - spec/server_spec.rb
94
94
  - spec/type_spec.rb
95
95
  homepage: https://github.com/UP-nxt
96
- licenses: []
96
+ licenses:
97
+ - Apache-2.0
97
98
  metadata: {}
98
99
  post_install_message:
99
100
  rdoc_options: []
@@ -124,4 +125,4 @@ test_files:
124
125
  - spec/repository_spec.rb
125
126
  - spec/server_spec.rb
126
127
  - spec/type_spec.rb
127
- has_rdoc:
128
+ has_rdoc: false