zimbra-soap-api 0.0.7.9 → 0.7.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zimbra/base.rb +18 -7
- data/lib/zimbra/directory.rb +1 -1
- data/lib/zimbra/version.rb +1 -1
- data/{zimbra.gemspec → zimbra-soap-api.gemspec} +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34a63b4e71d7208fbe61314d2a96129982769fb1
|
4
|
+
data.tar.gz: e76e1ddb77e34ad2df7cc1b99c74eb12b1d89120
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bc40186ea0dab47bd0cc22466f85336eb60ac6302aa8cda6d60bfbefd4df14f8dafcca5ec341c0982235e9bd95164ef2984d501ea71ffdb1c25ed1ac47b3431
|
7
|
+
data.tar.gz: 820e7d639ad1bb46e650d812b5e739f3be9eeae08a066a627c1c5ffc1dd8f5f11b5856359de1715d5692a0ec12c760d723873803c3e444fb8e8b966bb8b336e8
|
data/lib/zimbra/base.rb
CHANGED
@@ -29,6 +29,16 @@ module Zimbra
|
|
29
29
|
BaseService.create(name, attrs, class_name)
|
30
30
|
end
|
31
31
|
|
32
|
+
def zimbra_attrs_to_load=(array)
|
33
|
+
fail(ArgumentError, 'Must be an array') unless array.is_a?Array
|
34
|
+
@zimbra_attrs_to_load = array
|
35
|
+
end
|
36
|
+
|
37
|
+
def zimbra_attrs_to_load
|
38
|
+
return [] if @zimbra_attrs_to_load.nil?
|
39
|
+
@zimbra_attrs_to_load
|
40
|
+
end
|
41
|
+
|
32
42
|
end
|
33
43
|
|
34
44
|
attr_accessor :id, :name, :zimbra_attrs
|
@@ -186,11 +196,12 @@ module Zimbra
|
|
186
196
|
end
|
187
197
|
|
188
198
|
def response(class_name, node, full = true)
|
189
|
-
|
199
|
+
object = Object.const_get "Zimbra::#{class_name}"
|
200
|
+
names = full ? attributes_names(node) : object.zimbra_attrs_to_load
|
201
|
+
attrs = get_attributes(node, names)
|
202
|
+
|
190
203
|
id = (node/'@id').to_s
|
191
204
|
name = (node/'@name').to_s
|
192
|
-
|
193
|
-
object = Object.const_get "Zimbra::#{class_name}"
|
194
205
|
object.new(id, name, attrs, node)
|
195
206
|
end
|
196
207
|
|
@@ -198,14 +209,14 @@ module Zimbra
|
|
198
209
|
# and for each one gets the value of the n attribute
|
199
210
|
# "<a n=\"zimbraMailAlias\">restringida@zbox.cl</a>"
|
200
211
|
# would be zimbraMailAlias
|
201
|
-
def
|
212
|
+
def attributes_names(node)
|
202
213
|
(node/'n2:a').map { |e| (e/'@n').to_s }.uniq
|
203
214
|
end
|
204
215
|
|
205
|
-
def get_attributes(node)
|
216
|
+
def get_attributes(node, names = [])
|
206
217
|
attr_hash = {}
|
207
|
-
|
208
|
-
|
218
|
+
return attr_hash if names.empty?
|
219
|
+
names.each do |attr|
|
209
220
|
attr_hash[attr] = Zimbra::A.read node, attr
|
210
221
|
end
|
211
222
|
attr_hash
|
data/lib/zimbra/directory.rb
CHANGED
@@ -155,7 +155,7 @@ module Zimbra
|
|
155
155
|
def object_list_response(node, type)
|
156
156
|
node = clean_node node
|
157
157
|
class_name = ZIMBRA_TYPES_HASH[type][:class].name.gsub(/Zimbra::/, '')
|
158
|
-
Zimbra::BaseService::Parser.response(class_name, node,
|
158
|
+
Zimbra::BaseService::Parser.response(class_name, node, false)
|
159
159
|
end
|
160
160
|
|
161
161
|
# This method is to erase all others nodes from document
|
data/lib/zimbra/version.rb
CHANGED
@@ -22,6 +22,7 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.required_ruby_version = '>= 1.9.2'
|
23
23
|
|
24
24
|
s.add_development_dependency "rspec"
|
25
|
+
s.add_development_dependency "pry"
|
25
26
|
s.add_runtime_dependency 'curb'
|
26
27
|
s.add_runtime_dependency 'nokogiri'
|
27
28
|
s.add_runtime_dependency 'handsoap'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zimbra-soap-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Derek Kastner
|
@@ -28,6 +28,20 @@ dependencies:
|
|
28
28
|
- - '>='
|
29
29
|
- !ruby/object:Gem::Version
|
30
30
|
version: '0'
|
31
|
+
- !ruby/object:Gem::Dependency
|
32
|
+
name: pry
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - '>='
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0'
|
31
45
|
- !ruby/object:Gem::Dependency
|
32
46
|
name: curb
|
33
47
|
requirement: !ruby/object:Gem::Requirement
|
@@ -139,7 +153,7 @@ files:
|
|
139
153
|
- spec/zimbra/appointment_spec.rb
|
140
154
|
- spec/zimbra/common_elements_spec.rb
|
141
155
|
- spec/zimbra/distribution_list_spec.rb
|
142
|
-
- zimbra.gemspec
|
156
|
+
- zimbra-soap-api.gemspec
|
143
157
|
homepage: https://github.com/pbruna/ruby-zimbra
|
144
158
|
licenses: []
|
145
159
|
metadata: {}
|