yaccl 0.0.17 → 0.0.18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODRiNTVhMzQzYzNkMDEzMmUyYWUzN2UzODI2ODMxZDI4ZDNlYjc2Mw==
4
+ OTIzNjljOTQ0YTA0YjI4NjNiNGQzNmI0NmRiMDY0NDNlYTgzNzhlOQ==
5
5
  data.tar.gz: !binary |-
6
- NDY3ZGUwNmI5ZGExNTJjNjZhNzA1MDY0YzAyNWNjYjc3MDY3M2Y1OA==
6
+ YzFlMzQ0ZTdmOTljY2YxYmNkZjc1ZjZmNzM1ZTdlMzhhMzhiNzNlZA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZWFhNDIwMjRhYWQzNDMzZjE1MjRjMTQzNmEyOWVmYjY0NDNlZTdhNGJmZjUy
10
- MmEyZTNlYjRlNGMzNzlmM2ZmOTI1ZDNlNjNjNDU0NjA5MWFmNzU5OWI4NGQy
11
- YzMxY2YxOGZiODFmYzU0ZWVlNGQ2M2YxMTI5MGEwN2Q3YTYxMGE=
9
+ MmUxYjFiNTlhYWEyOTc5MTY1YmZlMDZiOTliYmMzMWE4NTk0NTNmNmIyZmMz
10
+ ODRiMzM1Y2I5ZjdjZTgyN2YxMzRiYjIyMDYzZmUwMmExYmE4OGY0Y2RiNDJi
11
+ MWQ4OTBhNDNiZGRiZjQ1YTFlYjFmMTlhZWRlYTFiZjlhYzVlZDU=
12
12
  data.tar.gz: !binary |-
13
- Zjk0NGUwYjYxNTI0MjU5OTEyMWQzYmZmNzkyYjE1YjE5MThiYTA2YTViYzFi
14
- NjM3NjJkZTUwYTA3Mjg5ZDhjMmQzZWNmOWVjZmQ5NmQ0ODRmMTRjODI4YzAx
15
- NDQzOWRhN2FiMzAxMTM0ODE5OWEwNmYyYzMzZDRlNGE3NWNjNGU=
13
+ Y2NhNTA1NDEyNGMyNTk2ZWYyMmRjOWQ2MmE1YWI2ZDcyNDZmN2E5MmFlYmRh
14
+ ODBiNGEzNzg0ZmVmYzkzMDhhNDczOGY0NTRlZGFmNTk2M2IwNWE5MjJkOWEy
15
+ MTA0MzQwYWVmMzY0YzEwNzJmYWFhM2U0MGUyYzlmMDRhNGQ2NjM=
@@ -25,8 +25,12 @@ module YACCL
25
25
 
26
26
  def children(max_items=nil, skip_count=nil)
27
27
  children = Services.get_children(repository_id, object_id, nil, nil, nil, nil, nil, nil, max_items, skip_count)
28
- children[:objects].map! { |o| ObjectFactory.create(repository_id, o[:object]) }
29
- children[:num_items] = children.delete(:numItems)
28
+ if children[:objects]
29
+ children[:objects].map! { |o| ObjectFactory.create(repository_id, o[:object]) }
30
+ else
31
+ children[:objects] = []
32
+ end
33
+ children[:num_items] = children.delete(:numItems).to_i
30
34
  children[:has_more_items] = children.delete(:hasMoreItems)
31
35
 
32
36
  yield(children) if block_given?
@@ -19,9 +19,6 @@ module YACCL
19
19
  @repository_id = repository_id
20
20
  @properties = get_properties_map(raw)
21
21
 
22
- @properties[:'cmis:creationDate'] = Time.at(@properties[:'cmis:creationDate'] / 1000) unless @properties[:'cmis:creationDate'].nil?
23
- @properties[:'cmis:lastModificationDate'] = Time.at(@properties[:'cmis:lastModificationDate'] / 1000) unless @properties[:'cmis:lastModificationDate'].nil?
24
-
25
22
  @object_id = @properties[:'cmis:objectId']
26
23
  @base_type_id = @properties[:'cmis:baseTypeId']
27
24
  @object_type_id = @properties[:'cmis:objectTypeId']
@@ -128,12 +125,16 @@ module YACCL
128
125
 
129
126
  def get_properties_map(raw)
130
127
  if raw[:succinctProperties]
131
- raw[:succinctProperties]
128
+ result = raw[:succinctProperties]
132
129
  elsif raw[:properties]
133
- raw[:properties].reduce({}) { |h, (k, v)| h.merge(k => v[:value]) }
130
+ result = raw[:properties].reduce({}) { |h, (k, v)| h.merge(k => v[:value]) }
134
131
  else
135
- {}
132
+ result = {}
133
+ end
134
+ [:'cmis:creationDate', :'cmis:lastModificationDate'].each do |k|
135
+ result[k] = Time.at(result[k] / 1000) if result[k]
136
136
  end
137
+ result
137
138
  end
138
139
  end
139
140
  end
data/lib/yaccl/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module YACCL
2
- VERSION = '0.0.17'
2
+ VERSION = '0.0.18'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yaccl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.17
4
+ version: 0.0.18
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: 2013-04-24 00:00:00.000000000 Z
12
+ date: 2013-04-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty