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.
- checksums.yaml +4 -4
- data/LICENSE +47 -21
- data/README.md +38 -46
- data/lib/isomorfeus/data/attribute_support.rb +176 -176
- data/lib/isomorfeus/data/config.rb +79 -110
- data/lib/isomorfeus/data/element_validator.rb +147 -147
- data/lib/isomorfeus/data/ferret_accelerator.rb +66 -0
- data/lib/isomorfeus/data/field_support.rb +110 -0
- data/lib/isomorfeus/data/generic_class_api.rb +136 -116
- data/lib/isomorfeus/data/generic_instance_api.rb +150 -145
- data/lib/isomorfeus/data/hamster_accelerator.rb +87 -0
- data/lib/isomorfeus/data/hamster_storage_expander.rb +94 -0
- data/lib/isomorfeus/data/handler/generic.rb +134 -138
- data/lib/isomorfeus/data/reducer.rb +30 -30
- data/lib/isomorfeus/data/version.rb +4 -4
- data/lib/isomorfeus-data.rb +56 -64
- data/lib/isomorfeus_data/lucid_document/base.rb +10 -0
- data/lib/isomorfeus_data/lucid_document/mixin.rb +148 -0
- data/lib/isomorfeus_data/lucid_file/base.rb +10 -0
- data/lib/isomorfeus_data/lucid_file/mixin.rb +217 -0
- data/lib/isomorfeus_data/lucid_object/base.rb +10 -0
- data/lib/isomorfeus_data/lucid_object/mixin.rb +216 -0
- data/lib/isomorfeus_data/lucid_query/base.rb +10 -0
- data/lib/isomorfeus_data/lucid_query/mixin.rb +81 -0
- data/lib/isomorfeus_data/lucid_query_result.rb +97 -0
- data/opal/uri/common.rb +18 -0
- data/opal/uri/generic.rb +47 -0
- data/opal/uri.rb +29 -0
- metadata +85 -96
- data/lib/isomorfeus/data/handler/arango.rb +0 -56
- data/lib/isomorfeus/data/handler/object_call.rb +0 -40
- data/lib/isomorfeus/data/handler/object_store.rb +0 -40
- data/lib/isomorfeus_data/lucid_data/array/base.rb +0 -13
- data/lib/isomorfeus_data/lucid_data/array/mixin.rb +0 -580
- data/lib/isomorfeus_data/lucid_data/collection/base.rb +0 -13
- data/lib/isomorfeus_data/lucid_data/collection/finders.rb +0 -83
- data/lib/isomorfeus_data/lucid_data/collection/mixin.rb +0 -737
- data/lib/isomorfeus_data/lucid_data/composition/base.rb +0 -13
- data/lib/isomorfeus_data/lucid_data/composition/mixin.rb +0 -234
- data/lib/isomorfeus_data/lucid_data/document/base.rb +0 -13
- data/lib/isomorfeus_data/lucid_data/document/mixin.rb +0 -9
- data/lib/isomorfeus_data/lucid_data/edge/base.rb +0 -13
- data/lib/isomorfeus_data/lucid_data/edge/mixin.rb +0 -286
- data/lib/isomorfeus_data/lucid_data/edge_collection/base.rb +0 -13
- data/lib/isomorfeus_data/lucid_data/edge_collection/finders.rb +0 -134
- data/lib/isomorfeus_data/lucid_data/edge_collection/mixin.rb +0 -747
- data/lib/isomorfeus_data/lucid_data/generic_collection.rb +0 -4
- data/lib/isomorfeus_data/lucid_data/generic_edge.rb +0 -4
- data/lib/isomorfeus_data/lucid_data/generic_edge_collection.rb +0 -4
- data/lib/isomorfeus_data/lucid_data/generic_node.rb +0 -4
- data/lib/isomorfeus_data/lucid_data/graph/base.rb +0 -13
- data/lib/isomorfeus_data/lucid_data/graph/finders.rb +0 -141
- data/lib/isomorfeus_data/lucid_data/graph/mixin.rb +0 -489
- data/lib/isomorfeus_data/lucid_data/hash/base.rb +0 -13
- data/lib/isomorfeus_data/lucid_data/hash/mixin.rb +0 -427
- data/lib/isomorfeus_data/lucid_data/link/base.rb +0 -13
- data/lib/isomorfeus_data/lucid_data/link/mixin.rb +0 -9
- data/lib/isomorfeus_data/lucid_data/link_collection/base.rb +0 -13
- data/lib/isomorfeus_data/lucid_data/link_collection/mixin.rb +0 -9
- data/lib/isomorfeus_data/lucid_data/node/base.rb +0 -13
- data/lib/isomorfeus_data/lucid_data/node/mixin.rb +0 -232
- data/lib/isomorfeus_data/lucid_data/query/base.rb +0 -13
- data/lib/isomorfeus_data/lucid_data/query/mixin.rb +0 -83
- data/lib/isomorfeus_data/lucid_data/query_result.rb +0 -95
- data/lib/isomorfeus_data/lucid_data/vertex/base.rb +0 -13
- data/lib/isomorfeus_data/lucid_data/vertex/mixin.rb +0 -9
- data/lib/lucid_arango/collection/base.rb +0 -13
- data/lib/lucid_arango/collection/mixin.rb +0 -18
- data/lib/lucid_arango/document/base.rb +0 -13
- data/lib/lucid_arango/document/mixin.rb +0 -9
- data/lib/lucid_arango/edge/base.rb +0 -13
- data/lib/lucid_arango/edge/mixin.rb +0 -18
- data/lib/lucid_arango/edge_collection/base.rb +0 -13
- data/lib/lucid_arango/edge_collection/mixin.rb +0 -18
- data/lib/lucid_arango/graph/base.rb +0 -13
- data/lib/lucid_arango/graph/mixin.rb +0 -18
- data/lib/lucid_arango/node/base.rb +0 -13
- data/lib/lucid_arango/node/mixin.rb +0 -79
- data/lib/lucid_arango/object/base.rb +0 -11
- data/lib/lucid_arango/object/mixin.rb +0 -158
- data/lib/lucid_arango/remote_object/base.rb +0 -11
- data/lib/lucid_arango/remote_object/mixin.rb +0 -17
- data/lib/lucid_arango/vertex/base.rb +0 -13
- data/lib/lucid_arango/vertex/mixin.rb +0 -9
@@ -0,0 +1,94 @@
|
|
1
|
+
module Isomorfeus
|
2
|
+
module Data
|
3
|
+
class HamsterStorageExpander
|
4
|
+
class << self
|
5
|
+
def environment
|
6
|
+
@environment
|
7
|
+
end
|
8
|
+
|
9
|
+
def environment=(env)
|
10
|
+
@environment = env
|
11
|
+
end
|
12
|
+
|
13
|
+
def ref
|
14
|
+
@ref ||= 0
|
15
|
+
end
|
16
|
+
|
17
|
+
def ref=(val)
|
18
|
+
@ref = val
|
19
|
+
end
|
20
|
+
|
21
|
+
def refa
|
22
|
+
self.ref += 1
|
23
|
+
end
|
24
|
+
|
25
|
+
def refs
|
26
|
+
self.ref -= 1 if self.ref > 0
|
27
|
+
end
|
28
|
+
|
29
|
+
def finalize(cls)
|
30
|
+
proc do
|
31
|
+
cls.refs
|
32
|
+
if cls.ref == 0
|
33
|
+
cls.environment.close rescue nil
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def initialize(&block)
|
40
|
+
if block_given?
|
41
|
+
res = block.call(self)
|
42
|
+
self.class.environment = res unless self.class.environment
|
43
|
+
else
|
44
|
+
open_environment
|
45
|
+
end
|
46
|
+
@db = self.class.environment.database('objects', create: true)
|
47
|
+
@index_db = self.class.environment.database('index', create: true, dupsort: true)
|
48
|
+
ObjectSpace.define_finalizer(self, self.class.finalize(self.class))
|
49
|
+
end
|
50
|
+
|
51
|
+
def create_object(sid_s, obj)
|
52
|
+
Isomorfeus::Hamster::Marshal.dump(@db, sid_s, obj)
|
53
|
+
end
|
54
|
+
|
55
|
+
def destroy_object(sid_s)
|
56
|
+
@db.delete(sid_s) rescue nil
|
57
|
+
true
|
58
|
+
end
|
59
|
+
|
60
|
+
def load_object(sid_s)
|
61
|
+
Isomorfeus::Hamster::Marshal.load(@db, sid_s)
|
62
|
+
end
|
63
|
+
|
64
|
+
def save_object(sid_s, obj)
|
65
|
+
Isomorfeus::Hamster::Marshal.dump(@db, sid_s, obj)
|
66
|
+
end
|
67
|
+
|
68
|
+
def index_delete(key, val)
|
69
|
+
@index_db.delete(key, val) rescue nil
|
70
|
+
end
|
71
|
+
|
72
|
+
def index_get(key)
|
73
|
+
@index_db.get(key)
|
74
|
+
end
|
75
|
+
|
76
|
+
def index_put(key, val)
|
77
|
+
@index_db.put(key, val)
|
78
|
+
end
|
79
|
+
|
80
|
+
def search(val_key, &block)
|
81
|
+
@index_db.each_value(val_key, &block)
|
82
|
+
end
|
83
|
+
|
84
|
+
private
|
85
|
+
|
86
|
+
def open_environment
|
87
|
+
return self.class.refa if self.class.environment
|
88
|
+
FileUtils.mkdir_p(Isomorfeus.data_object_env_path) unless Dir.exist?(Isomorfeus.data_object_env_path)
|
89
|
+
self.class.environment = Isomorfeus::Hamster.new(Isomorfeus.data_object_env_path)
|
90
|
+
self.class.refa
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
@@ -1,138 +1,134 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Isomorfeus
|
4
|
-
module Data
|
5
|
-
module Handler
|
6
|
-
class Generic < LucidHandler::Base
|
7
|
-
# responsible for loading:
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
when '
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
response_agent.
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
response_agent.
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
response_agent.
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
response_agent.
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
end
|
136
|
-
end
|
137
|
-
end
|
138
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Isomorfeus
|
4
|
+
module Data
|
5
|
+
module Handler
|
6
|
+
class Generic < LucidHandler::Base
|
7
|
+
# responsible for loading:
|
8
|
+
# LucidObject
|
9
|
+
# LucidDocument
|
10
|
+
# LucidFile
|
11
|
+
# LucidQuery
|
12
|
+
|
13
|
+
def process_request(response_agent)
|
14
|
+
# promise_send_path('Isomorfeus::Data::Handler::Generic', self.to_s, action, props_hash)
|
15
|
+
response_agent.request.each_key do |type_class_name|
|
16
|
+
if Isomorfeus.valid_data_class_name?(type_class_name)
|
17
|
+
type_class = Isomorfeus.cached_data_class(type_class_name)
|
18
|
+
if type_class
|
19
|
+
response_agent.request[type_class_name].each_key do |action|
|
20
|
+
case action
|
21
|
+
when 'load' then process_load(response_agent, type_class, type_class_name)
|
22
|
+
when 'query' then process_query(response_agent, type_class, type_class_name)
|
23
|
+
when 'create' then process_create(response_agent, type_class, type_class_name)
|
24
|
+
when 'save' then process_save(response_agent, type_class, type_class_name)
|
25
|
+
when 'destroy' then process_destroy(response_agent, type_class, type_class_name)
|
26
|
+
else response_agent.error = { error: { action => 'No such thing!' }}
|
27
|
+
end
|
28
|
+
end
|
29
|
+
else response_agent.error = { error: { type_class_name => 'No such class!' }}
|
30
|
+
end
|
31
|
+
else response_agent.error = { error: { type_class_name => 'Not a valid LucidData class!' }}
|
32
|
+
end
|
33
|
+
end
|
34
|
+
rescue Exception => e
|
35
|
+
response_agent.error = { error: "Isomorfeus::Data::Handler::Generic: #{e.message}\n#{e.backtrace.join("\n")}" }
|
36
|
+
end
|
37
|
+
|
38
|
+
def process_create(response_agent, type_class, type_class_name)
|
39
|
+
# 'Isomorfeus::Data::Handler::Generic', self.name, :create, data_hash
|
40
|
+
data = response_agent.request[type_class_name]['create']
|
41
|
+
instance_data = data['instance']
|
42
|
+
included_items_data = data.key?('included_items') ? data['included_items'] : nil
|
43
|
+
if Isomorfeus.current_user.authorized?(type_class, :create, data)
|
44
|
+
instance = type_class.instance_from_transport(instance_data, included_items_data)
|
45
|
+
created_type = instance.create
|
46
|
+
if created_type
|
47
|
+
response_agent.outer_result = {} unless response_agent.outer_result
|
48
|
+
response_agent.outer_result.deep_merge!(data: created_type.to_transport)
|
49
|
+
if created_type.respond_to?(:included_items_to_transport)
|
50
|
+
response_agent.outer_result.deep_merge!(data: created_type.included_items_to_transport)
|
51
|
+
end
|
52
|
+
response_agent.agent_result = { success: 'ok' }
|
53
|
+
else response_agent.error = { error: { type_class_name => 'Create returned nothing!' }}
|
54
|
+
end
|
55
|
+
else response_agent.error = { error: 'Access denied!' }
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def process_load(response_agent, type_class, type_class_name)
|
60
|
+
# 'Isomorfeus::Data::Handler::Generic', self.name, :load, key: key
|
61
|
+
props = response_agent.request[type_class_name]['load']
|
62
|
+
props.transform_keys!(&:to_sym)
|
63
|
+
if Isomorfeus.current_user.authorized?(type_class, :load, props)
|
64
|
+
loaded_type = type_class.load(**props)
|
65
|
+
if loaded_type
|
66
|
+
response_agent.outer_result = {} unless response_agent.outer_result
|
67
|
+
response_agent.outer_result.deep_merge!(data: loaded_type.to_transport)
|
68
|
+
if loaded_type.respond_to?(:included_items_to_transport)
|
69
|
+
response_agent.outer_result.deep_merge!(data: loaded_type.included_items_to_transport)
|
70
|
+
end
|
71
|
+
response_agent.agent_result = { success: 'ok' }
|
72
|
+
else response_agent.error = { error: { type_class_name => 'Load returned nothing!' }}
|
73
|
+
end
|
74
|
+
else response_agent.error = { error: 'Access denied!' }
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
def process_query(response_agent, type_class, type_class_name)
|
79
|
+
# 'Isomorfeus::Data::Handler::Generic', self.name, :query, props_json
|
80
|
+
props = response_agent.request[type_class_name]['query']
|
81
|
+
props.transform_keys!(&:to_sym)
|
82
|
+
if Isomorfeus.current_user.authorized?(type_class, :query, props)
|
83
|
+
queried_type = type_class.execute(**props)
|
84
|
+
if queried_type
|
85
|
+
response_agent.outer_result = {} unless response_agent.outer_result
|
86
|
+
response_agent.outer_result.deep_merge!(data: queried_type.to_transport)
|
87
|
+
if queried_type.respond_to?(:included_items_to_transport)
|
88
|
+
response_agent.outer_result.deep_merge!(data: queried_type.included_items_to_transport)
|
89
|
+
end
|
90
|
+
response_agent.agent_result = { success: 'ok' }
|
91
|
+
else response_agent.error = { error: { type_class_name => 'Query returned nothing!' }}
|
92
|
+
end
|
93
|
+
else response_agent.error = { error: 'Access denied!' }
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
def process_save(response_agent, type_class, type_class_name)
|
98
|
+
# 'Isomorfeus::Data::Handler::Generic', self.name, :save, data_hash
|
99
|
+
data = response_agent.request[type_class_name]['save']
|
100
|
+
instance_data = data['instance']
|
101
|
+
included_items_data = data.key?('included_items') ? data['included_items'] : nil
|
102
|
+
if Isomorfeus.current_user.authorized?(type_class, :save, data)
|
103
|
+
instance = type_class.instance_from_transport(instance_data, included_items_data)
|
104
|
+
saved_type = instance.save
|
105
|
+
if saved_type
|
106
|
+
response_agent.outer_result = {} unless response_agent.outer_result
|
107
|
+
response_agent.outer_result.deep_merge!(data: saved_type.to_transport)
|
108
|
+
if saved_type.respond_to?(:included_items_to_transport)
|
109
|
+
response_agent.outer_result.deep_merge!(data: saved_type.included_items_to_transport)
|
110
|
+
end
|
111
|
+
response_agent.agent_result = { success: 'ok' }
|
112
|
+
else response_agent.error = { error: { type_class_name => 'Save returned nothing!' }}
|
113
|
+
end
|
114
|
+
else response_agent.error = { error: 'Access denied!' }
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
def process_destroy(response_agent, type_class, type_class_name)
|
119
|
+
props = response_agent.request[type_class_name]['destroy']
|
120
|
+
props.transform_keys!(&:to_sym)
|
121
|
+
if Isomorfeus.current_user.authorized?(type_class, :destroy, props)
|
122
|
+
result = type_class.destroy(**props)
|
123
|
+
if result
|
124
|
+
response_agent.agent_result = { success: 'ok' }
|
125
|
+
else
|
126
|
+
response_agent.error = { error: { type_class_name => 'Destroy failed!' }}
|
127
|
+
end
|
128
|
+
else response_agent.error = { error: 'Access denied!' }
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|
@@ -1,30 +1,30 @@
|
|
1
|
-
module Isomorfeus
|
2
|
-
module Data
|
3
|
-
module Reducer
|
4
|
-
def self.add_reducer_to_store
|
5
|
-
data_reducer = Redux.create_reducer do |prev_state, action|
|
6
|
-
action_type = action[:type]
|
7
|
-
if action_type.JS.startsWith('DATA_')
|
8
|
-
case action_type
|
9
|
-
when 'DATA_STATE'
|
10
|
-
if action.key?(:set_state)
|
11
|
-
action[:set_state]
|
12
|
-
else
|
13
|
-
prev_state
|
14
|
-
end
|
15
|
-
when 'DATA_LOAD'
|
16
|
-
prev_state.deep_merge(action[:data])
|
17
|
-
else
|
18
|
-
prev_state
|
19
|
-
end
|
20
|
-
else
|
21
|
-
prev_state
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
Redux::Store.preloaded_state_merge!(data_state: {})
|
26
|
-
Redux::Store.add_reducer(data_state: data_reducer)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
1
|
+
module Isomorfeus
|
2
|
+
module Data
|
3
|
+
module Reducer
|
4
|
+
def self.add_reducer_to_store
|
5
|
+
data_reducer = Redux.create_reducer do |prev_state, action|
|
6
|
+
action_type = action[:type]
|
7
|
+
if action_type.JS.startsWith('DATA_')
|
8
|
+
case action_type
|
9
|
+
when 'DATA_STATE'
|
10
|
+
if action.key?(:set_state)
|
11
|
+
action[:set_state]
|
12
|
+
else
|
13
|
+
prev_state
|
14
|
+
end
|
15
|
+
when 'DATA_LOAD'
|
16
|
+
prev_state.deep_merge(action[:data])
|
17
|
+
else
|
18
|
+
prev_state
|
19
|
+
end
|
20
|
+
else
|
21
|
+
prev_state
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
Redux::Store.preloaded_state_merge!(data_state: {})
|
26
|
+
Redux::Store.add_reducer(data_state: data_reducer)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
module Isomorfeus
|
2
|
-
module Data
|
3
|
-
VERSION = '
|
4
|
-
end
|
1
|
+
module Isomorfeus
|
2
|
+
module Data
|
3
|
+
VERSION = '2.0.0.rc1'
|
4
|
+
end
|
5
5
|
end
|
data/lib/isomorfeus-data.rb
CHANGED
@@ -1,64 +1,56 @@
|
|
1
|
-
require '
|
2
|
-
require '
|
3
|
-
require '
|
4
|
-
require '
|
5
|
-
require 'isomorfeus
|
6
|
-
require 'isomorfeus/data/
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
require '
|
22
|
-
require '
|
23
|
-
require '
|
24
|
-
require '
|
25
|
-
|
26
|
-
require '
|
27
|
-
require '
|
28
|
-
|
29
|
-
require '
|
30
|
-
require '
|
31
|
-
require '
|
32
|
-
|
33
|
-
require 'isomorfeus_data/
|
34
|
-
require 'isomorfeus_data/
|
35
|
-
require 'isomorfeus_data/
|
36
|
-
require 'isomorfeus_data/
|
37
|
-
require 'isomorfeus_data/
|
38
|
-
require 'isomorfeus_data/
|
39
|
-
require 'isomorfeus_data/
|
40
|
-
require 'isomorfeus_data/
|
41
|
-
require 'isomorfeus_data/
|
42
|
-
|
43
|
-
require '
|
44
|
-
|
45
|
-
require '
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
require 'isomorfeus/data/handler/generic'
|
58
|
-
|
59
|
-
Opal.append_path(__dir__.untaint) unless Opal.paths.include?(__dir__.untaint)
|
60
|
-
|
61
|
-
path = File.expand_path(File.join('app', 'data'))
|
62
|
-
|
63
|
-
Isomorfeus.zeitwerk.push_dir(path)
|
64
|
-
end
|
1
|
+
require 'base64'
|
2
|
+
require 'stringio'
|
3
|
+
require 'data_uri'
|
4
|
+
require 'securerandom'
|
5
|
+
require 'isomorfeus-transport'
|
6
|
+
require 'isomorfeus/data/config'
|
7
|
+
require 'isomorfeus/data/attribute_support'
|
8
|
+
require 'isomorfeus/data/field_support'
|
9
|
+
require 'isomorfeus/data/generic_class_api'
|
10
|
+
require 'isomorfeus/data/generic_instance_api'
|
11
|
+
require 'isomorfeus/data/element_validator'
|
12
|
+
|
13
|
+
if RUBY_ENGINE == 'opal'
|
14
|
+
require 'isomorfeus/data/reducer'
|
15
|
+
Isomorfeus::Data::Reducer.add_reducer_to_store
|
16
|
+
Isomorfeus.zeitwerk.push_dir('isomorfeus_data')
|
17
|
+
require_tree 'isomorfeus_data', autoload: true
|
18
|
+
Isomorfeus.zeitwerk.push_dir('data')
|
19
|
+
else
|
20
|
+
require 'fileutils'
|
21
|
+
require 'uri'
|
22
|
+
require 'oj'
|
23
|
+
require 'active_support'
|
24
|
+
require 'active_support/core_ext/hash'
|
25
|
+
|
26
|
+
require 'isomorfeus-ferret'
|
27
|
+
require 'isomorfeus/data/ferret_accelerator'
|
28
|
+
|
29
|
+
require 'isomorfeus-hamster'
|
30
|
+
require 'isomorfeus/data/hamster_storage_expander'
|
31
|
+
require 'isomorfeus/data/hamster_accelerator'
|
32
|
+
|
33
|
+
require 'isomorfeus_data/lucid_query_result'
|
34
|
+
require 'isomorfeus_data/lucid_object/mixin'
|
35
|
+
require 'isomorfeus_data/lucid_object/base'
|
36
|
+
require 'isomorfeus_data/lucid_document/mixin'
|
37
|
+
require 'isomorfeus_data/lucid_document/base'
|
38
|
+
require 'isomorfeus_data/lucid_query/mixin'
|
39
|
+
require 'isomorfeus_data/lucid_query/base'
|
40
|
+
require 'isomorfeus_data/lucid_file/mixin'
|
41
|
+
require 'isomorfeus_data/lucid_file/base'
|
42
|
+
|
43
|
+
require 'isomorfeus/data/handler/generic'
|
44
|
+
|
45
|
+
require 'iso_opal'
|
46
|
+
Opal.append_path(__dir__.untaint) unless IsoOpal.paths.include?(__dir__.untaint)
|
47
|
+
uri_path = File.expand_path(File.join(__dir__.untaint, '..', 'opal'))
|
48
|
+
Opal.append_path(uri_path) unless IsoOpal.paths.include?(uri_path)
|
49
|
+
|
50
|
+
data_uri_path = File.join(Gem::Specification.find_by_name('data_uri').gem_dir, 'lib')
|
51
|
+
Opal.append_path(data_uri_path) unless IsoOpal.paths.include?(data_uri_path)
|
52
|
+
|
53
|
+
path = File.expand_path(File.join('app', 'data'))
|
54
|
+
|
55
|
+
Isomorfeus.zeitwerk.push_dir(path)
|
56
|
+
end
|