yaccl 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/lib/yaccl/model/object.rb +1 -1
- data/lib/yaccl/model/property_definition.rb +3 -1
- data/lib/yaccl/model/repository.rb +0 -10
- data/lib/yaccl/model/type.rb +0 -10
- data/lib/yaccl/services/internal/browser_binding_service.rb +2 -7
- data/lib/yaccl/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2be620b3ea23dd8af7f061906eb36770615248c4
|
4
|
+
data.tar.gz: df9cc9ddcb337eae01a20c6b844637c83071ff39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a0d541919670208cd3609a2f3a7ce82752f6e4834c94cdaa7bd35bef2d664da23e057ce500efc82f86b7738c21d6de9f44bf047e74a2cfc1e0179636ce0a976
|
7
|
+
data.tar.gz: 8af874ca863f0773d96c32f091eac49ea499d58db61aaff7ad214bf11d64126518fea02241e576e94bdfef442668c133076b11b1e33a629ef9ad6c7b66390636
|
data/.gitignore
CHANGED
data/lib/yaccl/model/object.rb
CHANGED
@@ -145,7 +145,7 @@ module YACCL
|
|
145
145
|
elsif raw[:properties]
|
146
146
|
result = raw[:properties].reduce({}) do |h, (k, v)|
|
147
147
|
val = v[:value]
|
148
|
-
val = v[:value].first if v[:value].is_a?(Array) and v[:
|
148
|
+
val = v[:value].first if v[:value].is_a?(Array) and v[:type] == 'datetime'
|
149
149
|
val = Time.at(val / 1000) if val and v[:type] == 'datetime'
|
150
150
|
h.merge(k => val)
|
151
151
|
end
|
@@ -3,7 +3,7 @@ module YACCL
|
|
3
3
|
class PropertyDefinition
|
4
4
|
|
5
5
|
attr_accessor :id, :local_name, :query_name,
|
6
|
-
:description, :inherited,
|
6
|
+
:description, :inherited, :open_choice,
|
7
7
|
:orderable, :property_type, :updatability,
|
8
8
|
:display_name, :required, :cardinality, :queryable, :other
|
9
9
|
|
@@ -13,6 +13,7 @@ module YACCL
|
|
13
13
|
@query_name = hash.delete(:queryName)
|
14
14
|
@description = hash.delete(:description)
|
15
15
|
@inherited = hash.delete(:inherited)
|
16
|
+
@open_choice = hash.delete(:openChoice)
|
16
17
|
@orderable = hash.delete(:orderable)
|
17
18
|
@property_type = hash.delete(:propertyType)
|
18
19
|
@updatability = hash.delete(:updatability)
|
@@ -50,6 +51,7 @@ module YACCL
|
|
50
51
|
hash[:queryName] = query_name
|
51
52
|
hash[:description] = description
|
52
53
|
hash[:inherited] = inherited
|
54
|
+
hash[:openChoice] = open_choice
|
53
55
|
hash[:orderable] = orderable
|
54
56
|
hash[:propertyType] = property_type
|
55
57
|
hash[:updatability] = updatability
|
@@ -27,16 +27,6 @@ module YACCL
|
|
27
27
|
name
|
28
28
|
end
|
29
29
|
|
30
|
-
def self.exist?(repository_id)
|
31
|
-
found = true
|
32
|
-
begin
|
33
|
-
Services.get_repository_info(repository_id, true)
|
34
|
-
rescue ObjectNotFoundError
|
35
|
-
found = false
|
36
|
-
end
|
37
|
-
found
|
38
|
-
end
|
39
|
-
|
40
30
|
def self.create(raw_repository)
|
41
31
|
Repository.new(raw_repository)
|
42
32
|
end
|
data/lib/yaccl/model/type.rb
CHANGED
@@ -25,16 +25,6 @@ module YACCL
|
|
25
25
|
attr_accessor :allowed_source_types
|
26
26
|
attr_accessor :allowed_target_types
|
27
27
|
|
28
|
-
def self.exist?(repository_id, type_id)
|
29
|
-
type_found = true
|
30
|
-
begin
|
31
|
-
Services.get_type_definition(repository_id, type_id, true)
|
32
|
-
rescue ObjectNotFoundError
|
33
|
-
type_found = false
|
34
|
-
end
|
35
|
-
type_found
|
36
|
-
end
|
37
|
-
|
38
28
|
def self.create(repository_id, raw)
|
39
29
|
type = Type.new(raw)
|
40
30
|
type.repository_id = repository_id
|
@@ -5,7 +5,6 @@ require 'multi_json'
|
|
5
5
|
require_relative 'simple_cache'
|
6
6
|
|
7
7
|
module YACCL
|
8
|
-
class ObjectNotFoundError < StandardError; end
|
9
8
|
module Services
|
10
9
|
class CMISRequestError < RuntimeError; end
|
11
10
|
|
@@ -55,11 +54,7 @@ module YACCL
|
|
55
54
|
|
56
55
|
unless (200...300).include?(response.code.to_i)
|
57
56
|
if result.is_a?(Hash) && result.has_key?(:exception)
|
58
|
-
|
59
|
-
raise ObjectNotFoundError
|
60
|
-
else
|
61
|
-
raise CMISRequestError, "#{response.code} -- #{result[:exception]} -- #{result[:message]}"
|
62
|
-
end
|
57
|
+
raise CMISRequestError, "#{response.code} -- #{result[:exception]} -- #{result[:message]}"
|
63
58
|
else
|
64
59
|
raise CMISRequestError, "#{response.code} -- #{result}"
|
65
60
|
end
|
@@ -81,7 +76,7 @@ module YACCL
|
|
81
76
|
def repository_urls(repository_id)
|
82
77
|
if @@url_cache[repository_id].nil?
|
83
78
|
repository_infos = MultiJson.load(@basement.get(url: @service_url).body , symbolize_keys: false)
|
84
|
-
raise
|
79
|
+
raise "No repository found with ID #{repository_id}." unless repository_infos.has_key?(repository_id)
|
85
80
|
repository_info = repository_infos[repository_id]
|
86
81
|
@@url_cache[repository_id] = { repository_url: repository_info['repositoryUrl'],
|
87
82
|
root_folder_url: repository_info['rootFolderUrl'] }
|
data/lib/yaccl/version.rb
CHANGED
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.1.
|
4
|
+
version: 0.1.5
|
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-
|
12
|
+
date: 2014-03-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: typhoeus
|
@@ -139,3 +139,4 @@ test_files:
|
|
139
139
|
- spec/services/navigation_services_spec.rb
|
140
140
|
- spec/services/object_services_spec.rb
|
141
141
|
- spec/services/repository_services_spec.rb
|
142
|
+
has_rdoc:
|