isomorfeus-operation 1.0.0.zeta5 → 1.0.0.zeta6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/lib/isomorfeus-operation.rb +3 -12
- data/lib/isomorfeus/operation/config.rb +1 -0
- data/lib/isomorfeus/operation/handler/operation_handler.rb +14 -16
- data/lib/isomorfeus/operation/version.rb +1 -1
- data/lib/lucid_operation/base.rb +2 -2
- data/lib/lucid_operation/mixin.rb +1 -1
- data/lib/lucid_quick_op/base.rb +2 -2
- data/lib/lucid_quick_op/mixin.rb +1 -1
- metadata +19 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d40da619afe17206cc317311ead0a56f84460681c9405e616afc56dde6eddd2d
|
4
|
+
data.tar.gz: eb5f416c5297e572011cfaec2f21a2c7bd63ad6d769e07e67b3190c9040ef374
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 936de075f600276a26404fe2a4bba20ba6c55b34e53145204c506d457e19c2e0550d86fc5901c59b9e8721ef057a3018fd520f36a601845cbd83fd4dca5fe167
|
7
|
+
data.tar.gz: f1681cdcc67065f6dc1165308f987d3f807dacf436312390d7afe3a50b9d027f29832bca367fb701e0c6992fc29754d2226185f6c885ec4fff19e8d2cf3588ba
|
data/README.md
CHANGED
data/lib/isomorfeus-operation.rb
CHANGED
@@ -1,8 +1,3 @@
|
|
1
|
-
require 'opal'
|
2
|
-
require 'opal-autoloader'
|
3
|
-
require 'opal-activesupport'
|
4
|
-
require 'isomorfeus-redux'
|
5
|
-
require 'isomorfeus-react'
|
6
1
|
require 'isomorfeus-transport'
|
7
2
|
require 'isomorfeus/operation/config'
|
8
3
|
require 'isomorfeus/operation/gherkin'
|
@@ -16,20 +11,16 @@ require 'lucid_operation/mixin'
|
|
16
11
|
require 'lucid_operation/base'
|
17
12
|
|
18
13
|
if RUBY_ENGINE == 'opal'
|
19
|
-
|
14
|
+
Isomorfeus.zeitwerk.push_dir('operations')
|
20
15
|
else
|
21
16
|
require 'oj'
|
22
17
|
require 'isomorfeus/operation/handler/operation_handler'
|
23
18
|
|
24
19
|
Opal.append_path(__dir__.untaint) unless Opal.paths.include?(__dir__.untaint)
|
25
20
|
|
26
|
-
require 'active_support/dependencies'
|
21
|
+
# require 'active_support/dependencies'
|
27
22
|
|
28
23
|
path = File.expand_path(File.join('isomorfeus', 'operations'))
|
29
24
|
|
30
|
-
|
31
|
-
# we also need to require them all, so classes are registered accordingly
|
32
|
-
Dir.glob("#{path}/**/*.rb").each do |file|
|
33
|
-
require file
|
34
|
-
end
|
25
|
+
Isomorfeus.zeitwerk.push_dir(path)
|
35
26
|
end
|
@@ -5,6 +5,7 @@ module Isomorfeus
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def cached_operation_class(class_name)
|
8
|
+
return "::#{class_name}".constantize if Isomorfeus.development?
|
8
9
|
return cached_operation_classes[class_name] if cached_operation_classes.key?(class_name)
|
9
10
|
cached_operation_classes[class_name] = "::#{class_name}".constantize
|
10
11
|
end
|
@@ -4,21 +4,20 @@ module Isomorfeus
|
|
4
4
|
module Operation
|
5
5
|
module Handler
|
6
6
|
class OperationHandler < LucidHandler::Base
|
7
|
-
on_request do |pub_sub_client, current_user,
|
8
|
-
result = { error: 'No such thing' }
|
7
|
+
on_request do |pub_sub_client, current_user, response_agent|
|
9
8
|
# promise_send_path('Isomorfeus::Operation::Handler::OperationHandler', self.to_s, props_hash)
|
10
|
-
request.each_key do |operation_class_name|
|
9
|
+
response_agent.request.each_key do |operation_class_name|
|
11
10
|
if Isomorfeus.valid_operation_class_name?(operation_class_name)
|
12
11
|
operation_class = Isomorfeus.cached_operation_class(operation_class_name)
|
13
12
|
if operation_class
|
14
|
-
props_json = request[operation_class_name]
|
13
|
+
props_json = response_agent.request[operation_class_name]
|
15
14
|
begin
|
16
15
|
props = Oj.load(props_json, mode: :strict)
|
17
16
|
props.merge!({pub_sub_client: pub_sub_client, current_user: current_user})
|
18
17
|
if current_user.authorized?(operation_class, :promise_run, props)
|
19
18
|
operation_promise = operation_class.promise_run(props)
|
20
19
|
if operation_promise.realized?
|
21
|
-
|
20
|
+
response_agent.agent_result = { success: 'ok' , result: operation_promise.value }
|
22
21
|
else
|
23
22
|
start = Time.now
|
24
23
|
timeout = false
|
@@ -30,29 +29,28 @@ module Isomorfeus
|
|
30
29
|
sleep 0.01
|
31
30
|
end
|
32
31
|
if timeout
|
33
|
-
|
32
|
+
response_agent.error = { error: 'Timeout' }
|
34
33
|
else
|
35
|
-
|
34
|
+
response_agent.agent_result = { success: 'ok' , result: operation_promise.value }
|
36
35
|
end
|
37
36
|
end
|
38
37
|
else
|
39
|
-
|
38
|
+
response_agent.error = { error: 'Access denied!' }
|
40
39
|
end
|
41
40
|
rescue Exception => e
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
41
|
+
response_agent.error = if Isomorfeus.production?
|
42
|
+
{ error: { operation_class_name => 'No such thing!' }}
|
43
|
+
else
|
44
|
+
{ error: { operation_class_name => "Isomorfeus::Operation::Handler::OperationHandler: #{e.message}" }}
|
45
|
+
end
|
47
46
|
end
|
48
47
|
else
|
49
|
-
|
48
|
+
response_agent.error = { error: { operation_class_name => 'No such thing!' }}
|
50
49
|
end
|
51
50
|
else
|
52
|
-
|
51
|
+
response_agent.error = { error: { operation_class_name => 'No such thing!' }}
|
53
52
|
end
|
54
53
|
end
|
55
|
-
result
|
56
54
|
end
|
57
55
|
end
|
58
56
|
end
|
data/lib/lucid_operation/base.rb
CHANGED
data/lib/lucid_quick_op/base.rb
CHANGED
data/lib/lucid_quick_op/mixin.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isomorfeus-operation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.zeta6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Biedermann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,42 +16,42 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '6.0'
|
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: '
|
26
|
+
version: '6.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: oj
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.
|
33
|
+
version: 3.10.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.
|
40
|
+
version: 3.10.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: opal
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 1.0.0
|
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: 0.
|
54
|
+
version: 1.0.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: opal-activesupport
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,90 +66,76 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 0.3.3
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: opal-autoloader
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: 0.1.0
|
76
|
-
type: :runtime
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: 0.1.0
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
70
|
name: isomorfeus-react
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
86
72
|
requirements:
|
87
73
|
- - ">="
|
88
74
|
- !ruby/object:Gem::Version
|
89
|
-
version: 16.
|
75
|
+
version: 16.12.1
|
90
76
|
type: :runtime
|
91
77
|
prerelease: false
|
92
78
|
version_requirements: !ruby/object:Gem::Requirement
|
93
79
|
requirements:
|
94
80
|
- - ">="
|
95
81
|
- !ruby/object:Gem::Version
|
96
|
-
version: 16.
|
82
|
+
version: 16.12.1
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
84
|
name: isomorfeus-redux
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
100
86
|
requirements:
|
101
87
|
- - "~>"
|
102
88
|
- !ruby/object:Gem::Version
|
103
|
-
version: 4.0.
|
89
|
+
version: 4.0.16
|
104
90
|
type: :runtime
|
105
91
|
prerelease: false
|
106
92
|
version_requirements: !ruby/object:Gem::Requirement
|
107
93
|
requirements:
|
108
94
|
- - "~>"
|
109
95
|
- !ruby/object:Gem::Version
|
110
|
-
version: 4.0.
|
96
|
+
version: 4.0.16
|
111
97
|
- !ruby/object:Gem::Dependency
|
112
98
|
name: isomorfeus-transport
|
113
99
|
requirement: !ruby/object:Gem::Requirement
|
114
100
|
requirements:
|
115
101
|
- - '='
|
116
102
|
- !ruby/object:Gem::Version
|
117
|
-
version: 1.0.0.
|
103
|
+
version: 1.0.0.zeta6
|
118
104
|
type: :runtime
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
107
|
requirements:
|
122
108
|
- - '='
|
123
109
|
- !ruby/object:Gem::Version
|
124
|
-
version: 1.0.0.
|
110
|
+
version: 1.0.0.zeta6
|
125
111
|
- !ruby/object:Gem::Dependency
|
126
|
-
name: isomorfeus
|
112
|
+
name: isomorfeus
|
127
113
|
requirement: !ruby/object:Gem::Requirement
|
128
114
|
requirements:
|
129
115
|
- - '='
|
130
116
|
- !ruby/object:Gem::Version
|
131
|
-
version: 1.0.0.
|
117
|
+
version: 1.0.0.zeta6
|
132
118
|
type: :development
|
133
119
|
prerelease: false
|
134
120
|
version_requirements: !ruby/object:Gem::Requirement
|
135
121
|
requirements:
|
136
122
|
- - '='
|
137
123
|
- !ruby/object:Gem::Version
|
138
|
-
version: 1.0.0.
|
124
|
+
version: 1.0.0.zeta6
|
139
125
|
- !ruby/object:Gem::Dependency
|
140
126
|
name: opal-webpack-loader
|
141
127
|
requirement: !ruby/object:Gem::Requirement
|
142
128
|
requirements:
|
143
129
|
- - ">="
|
144
130
|
- !ruby/object:Gem::Version
|
145
|
-
version: 0.9.
|
131
|
+
version: 0.9.9
|
146
132
|
type: :development
|
147
133
|
prerelease: false
|
148
134
|
version_requirements: !ruby/object:Gem::Requirement
|
149
135
|
requirements:
|
150
136
|
- - ">="
|
151
137
|
- !ruby/object:Gem::Version
|
152
|
-
version: 0.9.
|
138
|
+
version: 0.9.9
|
153
139
|
- !ruby/object:Gem::Dependency
|
154
140
|
name: rake
|
155
141
|
requirement: !ruby/object:Gem::Requirement
|