isomorfeus-data 1.0.0.zeta25 → 2.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +47 -21
  3. data/README.md +38 -46
  4. data/lib/isomorfeus/data/attribute_support.rb +176 -176
  5. data/lib/isomorfeus/data/config.rb +79 -110
  6. data/lib/isomorfeus/data/element_validator.rb +147 -147
  7. data/lib/isomorfeus/data/ferret_accelerator.rb +66 -0
  8. data/lib/isomorfeus/data/field_support.rb +110 -0
  9. data/lib/isomorfeus/data/generic_class_api.rb +136 -116
  10. data/lib/isomorfeus/data/generic_instance_api.rb +150 -145
  11. data/lib/isomorfeus/data/hamster_accelerator.rb +87 -0
  12. data/lib/isomorfeus/data/hamster_storage_expander.rb +94 -0
  13. data/lib/isomorfeus/data/handler/generic.rb +134 -138
  14. data/lib/isomorfeus/data/reducer.rb +30 -30
  15. data/lib/isomorfeus/data/version.rb +4 -4
  16. data/lib/isomorfeus-data.rb +56 -64
  17. data/lib/isomorfeus_data/lucid_document/base.rb +10 -0
  18. data/lib/isomorfeus_data/lucid_document/mixin.rb +148 -0
  19. data/lib/isomorfeus_data/lucid_file/base.rb +10 -0
  20. data/lib/isomorfeus_data/lucid_file/mixin.rb +217 -0
  21. data/lib/isomorfeus_data/lucid_object/base.rb +10 -0
  22. data/lib/isomorfeus_data/lucid_object/mixin.rb +216 -0
  23. data/lib/isomorfeus_data/lucid_query/base.rb +10 -0
  24. data/lib/isomorfeus_data/lucid_query/mixin.rb +81 -0
  25. data/lib/isomorfeus_data/lucid_query_result.rb +97 -0
  26. data/opal/uri/common.rb +18 -0
  27. data/opal/uri/generic.rb +47 -0
  28. data/opal/uri.rb +29 -0
  29. metadata +85 -96
  30. data/lib/isomorfeus/data/handler/arango.rb +0 -56
  31. data/lib/isomorfeus/data/handler/object_call.rb +0 -40
  32. data/lib/isomorfeus/data/handler/object_store.rb +0 -40
  33. data/lib/isomorfeus_data/lucid_data/array/base.rb +0 -13
  34. data/lib/isomorfeus_data/lucid_data/array/mixin.rb +0 -580
  35. data/lib/isomorfeus_data/lucid_data/collection/base.rb +0 -13
  36. data/lib/isomorfeus_data/lucid_data/collection/finders.rb +0 -83
  37. data/lib/isomorfeus_data/lucid_data/collection/mixin.rb +0 -737
  38. data/lib/isomorfeus_data/lucid_data/composition/base.rb +0 -13
  39. data/lib/isomorfeus_data/lucid_data/composition/mixin.rb +0 -234
  40. data/lib/isomorfeus_data/lucid_data/document/base.rb +0 -13
  41. data/lib/isomorfeus_data/lucid_data/document/mixin.rb +0 -9
  42. data/lib/isomorfeus_data/lucid_data/edge/base.rb +0 -13
  43. data/lib/isomorfeus_data/lucid_data/edge/mixin.rb +0 -286
  44. data/lib/isomorfeus_data/lucid_data/edge_collection/base.rb +0 -13
  45. data/lib/isomorfeus_data/lucid_data/edge_collection/finders.rb +0 -134
  46. data/lib/isomorfeus_data/lucid_data/edge_collection/mixin.rb +0 -747
  47. data/lib/isomorfeus_data/lucid_data/generic_collection.rb +0 -4
  48. data/lib/isomorfeus_data/lucid_data/generic_edge.rb +0 -4
  49. data/lib/isomorfeus_data/lucid_data/generic_edge_collection.rb +0 -4
  50. data/lib/isomorfeus_data/lucid_data/generic_node.rb +0 -4
  51. data/lib/isomorfeus_data/lucid_data/graph/base.rb +0 -13
  52. data/lib/isomorfeus_data/lucid_data/graph/finders.rb +0 -141
  53. data/lib/isomorfeus_data/lucid_data/graph/mixin.rb +0 -489
  54. data/lib/isomorfeus_data/lucid_data/hash/base.rb +0 -13
  55. data/lib/isomorfeus_data/lucid_data/hash/mixin.rb +0 -427
  56. data/lib/isomorfeus_data/lucid_data/link/base.rb +0 -13
  57. data/lib/isomorfeus_data/lucid_data/link/mixin.rb +0 -9
  58. data/lib/isomorfeus_data/lucid_data/link_collection/base.rb +0 -13
  59. data/lib/isomorfeus_data/lucid_data/link_collection/mixin.rb +0 -9
  60. data/lib/isomorfeus_data/lucid_data/node/base.rb +0 -13
  61. data/lib/isomorfeus_data/lucid_data/node/mixin.rb +0 -232
  62. data/lib/isomorfeus_data/lucid_data/query/base.rb +0 -13
  63. data/lib/isomorfeus_data/lucid_data/query/mixin.rb +0 -83
  64. data/lib/isomorfeus_data/lucid_data/query_result.rb +0 -95
  65. data/lib/isomorfeus_data/lucid_data/vertex/base.rb +0 -13
  66. data/lib/isomorfeus_data/lucid_data/vertex/mixin.rb +0 -9
  67. data/lib/lucid_arango/collection/base.rb +0 -13
  68. data/lib/lucid_arango/collection/mixin.rb +0 -18
  69. data/lib/lucid_arango/document/base.rb +0 -13
  70. data/lib/lucid_arango/document/mixin.rb +0 -9
  71. data/lib/lucid_arango/edge/base.rb +0 -13
  72. data/lib/lucid_arango/edge/mixin.rb +0 -18
  73. data/lib/lucid_arango/edge_collection/base.rb +0 -13
  74. data/lib/lucid_arango/edge_collection/mixin.rb +0 -18
  75. data/lib/lucid_arango/graph/base.rb +0 -13
  76. data/lib/lucid_arango/graph/mixin.rb +0 -18
  77. data/lib/lucid_arango/node/base.rb +0 -13
  78. data/lib/lucid_arango/node/mixin.rb +0 -79
  79. data/lib/lucid_arango/object/base.rb +0 -11
  80. data/lib/lucid_arango/object/mixin.rb +0 -158
  81. data/lib/lucid_arango/remote_object/base.rb +0 -11
  82. data/lib/lucid_arango/remote_object/mixin.rb +0 -17
  83. data/lib/lucid_arango/vertex/base.rb +0 -13
  84. data/lib/lucid_arango/vertex/mixin.rb +0 -9
@@ -0,0 +1,97 @@
1
+ class LucidQueryResult
2
+ attr_reader :key
3
+
4
+ def sid
5
+ [@class_name, @key]
6
+ end
7
+
8
+ def sid_s
9
+ "[#{@class_name}|#{@key}]"
10
+ end
11
+
12
+ if RUBY_ENGINE == 'opal'
13
+ def initialize(key: nil, result_set: {})
14
+ @class_name = 'LucidQueryResult'
15
+ @key = key ? key.to_s : self.object_id.to_s
16
+ @result_set = result_set
17
+ end
18
+
19
+ def _load_from_store!
20
+ @result_set = nil
21
+ end
22
+
23
+ def loaded?
24
+ Redux.fetch_by_path(:data_state, @class_name, @key) ? true : false
25
+ end
26
+
27
+ def key?(k)
28
+ if @result_set
29
+ @result_set.key?(k)
30
+ else
31
+ stored_results = Redux.fetch_by_path(:data_state, @class_name, @key)
32
+ return false unless stored_results
33
+ `Object.hasOwnProperty(stored_results, k)`
34
+ end
35
+ end
36
+ alias has_key? key?
37
+
38
+ def result_set=(r)
39
+ @result_set = r
40
+ end
41
+
42
+ def method_missing(accessor_name, *args, &block)
43
+ sid = if @result_set
44
+ @result_set[accessor_name]
45
+ else
46
+ stored_results = Redux.fetch_by_path(:data_state, @class_name, @key)
47
+ stored_results.JS[accessor_name] if stored_results
48
+ end
49
+ Isomorfeus.raise_error(message: "#{@class_name}: no such thing '#{accessor_name}' in the results!") unless sid
50
+ Isomorfeus.instance_from_sid(sid)
51
+ end
52
+ else
53
+ def initialize(key: nil, result_set: {})
54
+ @class_name = 'LucidQueryResult'
55
+ @key = key ? key.to_s : self.object_id.to_s
56
+ @result_set = result_set.nil? ? {} : result_set
57
+ @result_set.transform_keys!(&:to_sym)
58
+ end
59
+
60
+ def loaded?
61
+ @result_set.any?
62
+ end
63
+
64
+ def key?(k)
65
+ @result_set.key?(k)
66
+ end
67
+ alias has_key? key?
68
+
69
+ def result_set=(r)
70
+ @result_set = r
71
+ end
72
+
73
+ def method_missing(accessor_name, *args, &block)
74
+ Isomorfeus.raise_error(message: "#{@class_name}: no such thing '#{accessor_name}' in the results!") unless @result_set.key?(accessor_name)
75
+ @result_set[accessor_name]
76
+ end
77
+
78
+ def to_transport
79
+ sids_hash = {}
80
+ @result_set.each do |key, value|
81
+ sids_hash[key.to_s] = value.sid
82
+ end
83
+ { @class_name => { @key => sids_hash }}
84
+ end
85
+
86
+ def included_items_to_transport
87
+ data_hash = {}
88
+ @result_set.each_value do |value|
89
+ data_hash.deep_merge!(value.to_transport)
90
+ if value.respond_to?(:included_items_to_transport)
91
+ data_hash.deep_merge!(value.included_items_to_transport)
92
+ end
93
+ end
94
+ data_hash
95
+ end
96
+ end
97
+ end
@@ -0,0 +1,18 @@
1
+ module Kernel
2
+
3
+ #
4
+ # Returns +uri+ converted to a URI object.
5
+ #
6
+ def URI(uri)
7
+ if uri.is_a?(URI::Generic)
8
+ uri
9
+ elsif uri = String.try_convert(uri)
10
+ URI.parse(uri)
11
+ else
12
+ raise ArgumentError,
13
+ "bad argument (expected URI object or URI string)"
14
+ end
15
+ end
16
+ module_function :URI
17
+ end
18
+
@@ -0,0 +1,47 @@
1
+ module URI
2
+ class Generic
3
+ attr_reader :scheme, :userinfo, :user, :password, :host, :port, :path,
4
+ :query, :fragment, :opaque, :registry
5
+
6
+ #
7
+ # An Array of the available components for URI::Generic
8
+ #
9
+ COMPONENT = [
10
+ :scheme,
11
+ :userinfo, :host, :port, :registry,
12
+ :path, :opaque,
13
+ :query,
14
+ :fragment
15
+ ].freeze
16
+
17
+ def initialize(scheme,
18
+ userinfo, host, port, registry,
19
+ path, opaque,
20
+ query,
21
+ fragment,
22
+ parser = nil,
23
+ arg_check = false)
24
+ @scheme = scheme
25
+ @userinfo = userinfo
26
+ @host = host
27
+ @port = port
28
+ @path = path
29
+ @query = query
30
+ @fragment = fragment
31
+ @user, @password = userinfo.split(/:/) if userinfo
32
+ end
33
+
34
+ def ==(other)
35
+ self.class == other.class &&
36
+ component_ary == other.component_ary
37
+ end
38
+
39
+ protected
40
+
41
+ def component_ary
42
+ self.class::COMPONENT.collect do |x|
43
+ self.send(x)
44
+ end
45
+ end
46
+ end
47
+ end
data/opal/uri.rb ADDED
@@ -0,0 +1,29 @@
1
+ require "uri/common"
2
+ require "uri/generic"
3
+
4
+ module URI
5
+ @@schemes = {}
6
+
7
+ class InvalidURIError < Exception
8
+ end
9
+
10
+ def self.parse(url)
11
+ # scheme://conn_data/path?query#hash
12
+ match = url.match(%r[(\w+)://([^/]+)([^\?]+)(\?[^\#]+)?(\#.*)?])
13
+
14
+ _, scheme, connection_data, path, query, fragment = match.to_a
15
+
16
+ connection_data = connection_data.split(/@/)
17
+ userinfo = connection_data.size > 1 ? connection_data.first : nil
18
+ host, port = connection_data.last.split(/:/)
19
+
20
+ port = port.to_i
21
+ query = query[1..-1] if query
22
+
23
+ registry = opaque = nil
24
+
25
+ Generic.new(scheme, userinfo, host, port,
26
+ registry, path, opaque, query,
27
+ fragment)
28
+ end
29
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isomorfeus-data
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.zeta25
4
+ version: 2.0.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-02 00:00:00.000000000 Z
11
+ date: 2021-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,56 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '6.0'
19
+ version: '6.1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '6.0'
26
+ version: '6.1'
27
27
  - !ruby/object:Gem::Dependency
28
- name: arango-driver
28
+ name: data_uri
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 3.5.0.alpha1
33
+ version: 0.1.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 3.5.0.alpha1
40
+ version: 0.1.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: oj
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 3.10.0
47
+ version: 3.13.9
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 3.10.0
54
+ version: 3.13.9
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: opal
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 1.0.0
61
+ version: 1.3.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 1.0.0
68
+ version: 1.3.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: opal-activesupport
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -81,75 +81,103 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: 0.3.3
83
83
  - !ruby/object:Gem::Dependency
84
- name: isomorfeus-react
84
+ name: isomorfeus-asset-manager
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 16.13.0
89
+ version: 0.13.2
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 16.13.0
96
+ version: 0.13.2
97
97
  - !ruby/object:Gem::Dependency
98
- name: isomorfeus-redux
98
+ name: isomorfeus-ferret
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 4.0.22
103
+ version: 0.12.0
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 4.0.22
110
+ version: 0.12.0
111
111
  - !ruby/object:Gem::Dependency
112
- name: isomorfeus-transport
112
+ name: isomorfeus-hamster
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - '='
115
+ - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 1.0.0.zeta25
117
+ version: 0.6.1
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - '='
122
+ - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 1.0.0.zeta25
124
+ version: 0.6.1
125
125
  - !ruby/object:Gem::Dependency
126
- name: isomorfeus
126
+ name: isomorfeus-preact
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: 10.5.11
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: 10.5.11
139
+ - !ruby/object:Gem::Dependency
140
+ name: isomorfeus-redux
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: 4.1.8
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: 4.1.8
153
+ - !ruby/object:Gem::Dependency
154
+ name: isomorfeus-transport
127
155
  requirement: !ruby/object:Gem::Requirement
128
156
  requirements:
129
157
  - - '='
130
158
  - !ruby/object:Gem::Version
131
- version: 1.0.0.zeta25
132
- type: :development
159
+ version: 2.0.0.rc1
160
+ type: :runtime
133
161
  prerelease: false
134
162
  version_requirements: !ruby/object:Gem::Requirement
135
163
  requirements:
136
164
  - - '='
137
165
  - !ruby/object:Gem::Version
138
- version: 1.0.0.zeta25
166
+ version: 2.0.0.rc1
139
167
  - !ruby/object:Gem::Dependency
140
- name: opal-webpack-loader
168
+ name: isomorfeus
141
169
  requirement: !ruby/object:Gem::Requirement
142
170
  requirements:
143
- - - ">="
171
+ - - '='
144
172
  - !ruby/object:Gem::Version
145
- version: 0.9.10
173
+ version: 2.0.0.rc1
146
174
  type: :development
147
175
  prerelease: false
148
176
  version_requirements: !ruby/object:Gem::Requirement
149
177
  requirements:
150
- - - ">="
178
+ - - '='
151
179
  - !ruby/object:Gem::Version
152
- version: 0.9.10
180
+ version: 2.0.0.rc1
153
181
  - !ruby/object:Gem::Dependency
154
182
  name: rake
155
183
  requirement: !ruby/object:Gem::Requirement
@@ -191,72 +219,33 @@ files:
191
219
  - lib/isomorfeus/data/attribute_support.rb
192
220
  - lib/isomorfeus/data/config.rb
193
221
  - lib/isomorfeus/data/element_validator.rb
222
+ - lib/isomorfeus/data/ferret_accelerator.rb
223
+ - lib/isomorfeus/data/field_support.rb
194
224
  - lib/isomorfeus/data/generic_class_api.rb
195
225
  - lib/isomorfeus/data/generic_instance_api.rb
196
- - lib/isomorfeus/data/handler/arango.rb
226
+ - lib/isomorfeus/data/hamster_accelerator.rb
227
+ - lib/isomorfeus/data/hamster_storage_expander.rb
197
228
  - lib/isomorfeus/data/handler/generic.rb
198
- - lib/isomorfeus/data/handler/object_call.rb
199
- - lib/isomorfeus/data/handler/object_store.rb
200
229
  - lib/isomorfeus/data/reducer.rb
201
230
  - lib/isomorfeus/data/version.rb
202
- - lib/isomorfeus_data/lucid_data/array/base.rb
203
- - lib/isomorfeus_data/lucid_data/array/mixin.rb
204
- - lib/isomorfeus_data/lucid_data/collection/base.rb
205
- - lib/isomorfeus_data/lucid_data/collection/finders.rb
206
- - lib/isomorfeus_data/lucid_data/collection/mixin.rb
207
- - lib/isomorfeus_data/lucid_data/composition/base.rb
208
- - lib/isomorfeus_data/lucid_data/composition/mixin.rb
209
- - lib/isomorfeus_data/lucid_data/document/base.rb
210
- - lib/isomorfeus_data/lucid_data/document/mixin.rb
211
- - lib/isomorfeus_data/lucid_data/edge/base.rb
212
- - lib/isomorfeus_data/lucid_data/edge/mixin.rb
213
- - lib/isomorfeus_data/lucid_data/edge_collection/base.rb
214
- - lib/isomorfeus_data/lucid_data/edge_collection/finders.rb
215
- - lib/isomorfeus_data/lucid_data/edge_collection/mixin.rb
216
- - lib/isomorfeus_data/lucid_data/generic_collection.rb
217
- - lib/isomorfeus_data/lucid_data/generic_edge.rb
218
- - lib/isomorfeus_data/lucid_data/generic_edge_collection.rb
219
- - lib/isomorfeus_data/lucid_data/generic_node.rb
220
- - lib/isomorfeus_data/lucid_data/graph/base.rb
221
- - lib/isomorfeus_data/lucid_data/graph/finders.rb
222
- - lib/isomorfeus_data/lucid_data/graph/mixin.rb
223
- - lib/isomorfeus_data/lucid_data/hash/base.rb
224
- - lib/isomorfeus_data/lucid_data/hash/mixin.rb
225
- - lib/isomorfeus_data/lucid_data/link/base.rb
226
- - lib/isomorfeus_data/lucid_data/link/mixin.rb
227
- - lib/isomorfeus_data/lucid_data/link_collection/base.rb
228
- - lib/isomorfeus_data/lucid_data/link_collection/mixin.rb
229
- - lib/isomorfeus_data/lucid_data/node/base.rb
230
- - lib/isomorfeus_data/lucid_data/node/mixin.rb
231
- - lib/isomorfeus_data/lucid_data/query/base.rb
232
- - lib/isomorfeus_data/lucid_data/query/mixin.rb
233
- - lib/isomorfeus_data/lucid_data/query_result.rb
234
- - lib/isomorfeus_data/lucid_data/vertex/base.rb
235
- - lib/isomorfeus_data/lucid_data/vertex/mixin.rb
236
- - lib/lucid_arango/collection/base.rb
237
- - lib/lucid_arango/collection/mixin.rb
238
- - lib/lucid_arango/document/base.rb
239
- - lib/lucid_arango/document/mixin.rb
240
- - lib/lucid_arango/edge/base.rb
241
- - lib/lucid_arango/edge/mixin.rb
242
- - lib/lucid_arango/edge_collection/base.rb
243
- - lib/lucid_arango/edge_collection/mixin.rb
244
- - lib/lucid_arango/graph/base.rb
245
- - lib/lucid_arango/graph/mixin.rb
246
- - lib/lucid_arango/node/base.rb
247
- - lib/lucid_arango/node/mixin.rb
248
- - lib/lucid_arango/object/base.rb
249
- - lib/lucid_arango/object/mixin.rb
250
- - lib/lucid_arango/remote_object/base.rb
251
- - lib/lucid_arango/remote_object/mixin.rb
252
- - lib/lucid_arango/vertex/base.rb
253
- - lib/lucid_arango/vertex/mixin.rb
231
+ - lib/isomorfeus_data/lucid_document/base.rb
232
+ - lib/isomorfeus_data/lucid_document/mixin.rb
233
+ - lib/isomorfeus_data/lucid_file/base.rb
234
+ - lib/isomorfeus_data/lucid_file/mixin.rb
235
+ - lib/isomorfeus_data/lucid_object/base.rb
236
+ - lib/isomorfeus_data/lucid_object/mixin.rb
237
+ - lib/isomorfeus_data/lucid_query/base.rb
238
+ - lib/isomorfeus_data/lucid_query/mixin.rb
239
+ - lib/isomorfeus_data/lucid_query_result.rb
240
+ - opal/uri.rb
241
+ - opal/uri/common.rb
242
+ - opal/uri/generic.rb
254
243
  homepage: http://isomorfeus.com
255
244
  licenses:
256
245
  - MIT
257
246
  metadata:
258
247
  github_repo: ssh://github.com/isomorfeus/gems
259
- post_install_message:
248
+ post_install_message:
260
249
  rdoc_options: []
261
250
  require_paths:
262
251
  - lib
@@ -271,8 +260,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
271
260
  - !ruby/object:Gem::Version
272
261
  version: 1.3.1
273
262
  requirements: []
274
- rubygems_version: 3.0.6
275
- signing_key:
263
+ rubygems_version: 3.2.22
264
+ signing_key:
276
265
  specification_version: 4
277
266
  summary: Compose Graphs and Collections of data just as needed for a isomorfeus app.
278
267
  test_files: []
@@ -1,56 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Isomorfeus
4
- module Data
5
- module Handler
6
- class Arango < LucidHandler::Base
7
- on_request do |response_agent|
8
- # promise_send_path('Isomorfeus::Data::Handler::Generic', action, type, self.to_s, props_hash)
9
- response_agent.request.each_key do |action|
10
- if action == 'load'
11
- response_agent.request[action].each_key do |type|
12
- if %w[collection graph document edge].include?(type)
13
- response_agent.request.each_key do |type_class_name|
14
- if Isomorfeus.send("valid_#{type}_class_name?", type_class_name)
15
- type_class = Isomorfeus.send("cached_#{type}_class", type_class_name)
16
- if type_class
17
- props_json = response_agent.request[type_class_name]
18
- begin
19
- props = Oj.load(props_json, mode: :strict)
20
- if current_user.authorized?(type_class, :load, *props)
21
- loaded_type = type_class.load(props)
22
- loaded_type.instance_exec do
23
- type_class.on_load_block.call() if type_class.on_load_block
24
- end
25
- response_agent.outer_result = { data: loaded_type.to_transport }
26
- if %w[collection graph].include?(type)
27
- response_agent.outer_result.deep_merge!(data: loaded_type.included_items_to_transport)
28
- end
29
- response_agent.agent_result = { success: 'ok' }
30
- else
31
- response_agent.error = { error: 'Access denied!' }
32
- end
33
- rescue Exception => e
34
- response_agent.error = { error: { type_class_name => "Isomorfeus::Data::Handler::Arango: #{e.message}" }}
35
- end
36
- else
37
- response_agent.error = { error: { type_class_name => 'No such thing!' }}
38
- end
39
- else
40
- response_agent.error = { error: { type_class_name => 'No such thing!' }}
41
- end
42
- end
43
- else
44
- response_agent.error = { error: { type => 'No such thing!' }}
45
- end
46
- end
47
- elsif action == 'store'
48
- else
49
- response_agent.error = { error: { action => 'No such thing!' }}
50
- end
51
- end
52
- end
53
- end
54
- end
55
- end
56
- end
@@ -1,40 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Isomorfeus
4
- module Data
5
- module Handler
6
- class Object < LucidHandler::Base
7
- on_request do |response_agent|
8
- # promise_send_path('Isomorfeus::Data::Handler::Object', action, object_hash)
9
- response_agent.request.each_key do |array_class_name|
10
- if Isomorfeus.valid_array_class_name?(array_class_name)
11
- array_class = Isomorfeus.cached_array_class(array_class_name)
12
- if array_class
13
- props_json = response_agent.request[array_class_name]
14
- begin
15
- props = Oj.load(props_json, mode: :strict)
16
- if current_user.authorized?(array_class, :load, *props)
17
- array = array_class.load(props)
18
- array.instance_exec do
19
- array_class.on_load_block.call() if array_class.on_load_block
20
- end
21
- response_agent.outer_result = { data: array.to_transport }
22
- response_agent.agent_result = { success: 'ok' }
23
- else
24
- response_agent.error = { error: 'Access denied!' }
25
- end
26
- rescue Exception => e
27
- response_agent.error = { error: { array_class_name => "Isomorfeus::Data::Handler::ObjectCall: #{e.message}" }}
28
- end
29
- else
30
- response_agent.error = { error: { array_class_name => 'No such thing!' }}
31
- end
32
- else
33
- response_agent.error = { error: { array_class_name => 'No such thing!' }}
34
- end
35
- end
36
- end
37
- end
38
- end
39
- end
40
- end
@@ -1,40 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Isomorfeus
4
- module Data
5
- module Handler
6
- class Object < LucidHandler::Base
7
- on_request do |response_agent|
8
- # promise_send_path('Isomorfeus::Data::Handler::Object', action, object_hash)
9
- response_agent.request.each_key do |array_class_name|
10
- if Isomorfeus.valid_array_class_name?(array_class_name)
11
- array_class = Isomorfeus.cached_array_class(array_class_name)
12
- if array_class
13
- props_json = response_agent.request[array_class_name]
14
- begin
15
- props = Oj.load(props_json, mode: :strict)
16
- if current_user.authorized?(array_class, :load, *props)
17
- array = array_class.load(props)
18
- array.instance_exec do
19
- array_class.on_load_block.call() if array_class.on_load_block
20
- end
21
- response_agent.outer_result = { data: array.to_transport }
22
- response_agent.agent_result = { success: 'ok' }
23
- else
24
- response_agent.error = { error: 'Access denied!' }
25
- end
26
- rescue Exception => e
27
- response_agent.error = { error: { array_class_name => "Isomorfeus::Data::Handler::Object: #{e.message}" }}
28
- end
29
- else
30
- response_agent.error = { error: { array_class_name => 'No such thing!' }}
31
- end
32
- else
33
- response_agent.error = { error: { array_class_name => 'No such thing!' }}
34
- end
35
- end
36
- end
37
- end
38
- end
39
- end
40
- end
@@ -1,13 +0,0 @@
1
- module LucidData
2
- module Array
3
- class Base
4
- include LucidData::Array::Mixin
5
-
6
- if RUBY_ENGINE != 'opal'
7
- def self.inherited(base)
8
- Isomorfeus.add_valid_data_class(base)
9
- end
10
- end
11
- end
12
- end
13
- end