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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 63d1e6cbd2d6ffad0f792e6f96a21e889c3d6fc5
4
- data.tar.gz: 462107b26e7f12226e0ee9cb70aea2f65c69feba
3
+ metadata.gz: 2be620b3ea23dd8af7f061906eb36770615248c4
4
+ data.tar.gz: df9cc9ddcb337eae01a20c6b844637c83071ff39
5
5
  SHA512:
6
- metadata.gz: 3976d7e6592ad9b51b1b3526bd14fc38e50c143fb07a5573376f826242ba6631627a6238f84caa00439d2464184e78c89e5b59c330e284f240a75421ec616e3d
7
- data.tar.gz: 105d81e15805b52f57def80769231181a4d26ceefcbc51dcfd0045d0e0f8dd685b8bfd3c2f830b95a79f24a7ce48065fef6a0779946388f5c6eb7b54c7150e99
6
+ metadata.gz: 9a0d541919670208cd3609a2f3a7ce82752f6e4834c94cdaa7bd35bef2d664da23e057ce500efc82f86b7738c21d6de9f44bf047e74a2cfc1e0179636ce0a976
7
+ data.tar.gz: 8af874ca863f0773d96c32f091eac49ea499d58db61aaff7ad214bf11d64126518fea02241e576e94bdfef442668c133076b11b1e33a629ef9ad6c7b66390636
data/.gitignore CHANGED
@@ -1,4 +1,4 @@
1
1
  Gemfile.lock
2
- *.gem
2
+
3
3
  .idea
4
4
  *.iml
@@ -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[:cardinality] == 'single'
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
@@ -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
- if response.code.to_i == 404 && result[:exception] == "objectNotFound"
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 ObjectNotFoundError, "No repository found with ID #{repository_id}." unless repository_infos.has_key?(repository_id)
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'] }
@@ -1,3 +1,3 @@
1
1
  module YACCL
2
- VERSION = '0.1.4'
2
+ VERSION = '0.1.5'
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.1.4
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-02-19 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: 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: