exel 1.2.1 → 1.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.codeclimate.yml +4 -4
- data/.gitignore +1 -2
- data/.rubocop.yml +23 -14
- data/.rubocop_airbnb.yml +2 -0
- data/.rubocop_todo.yml +1 -13
- data/.travis.yml +26 -0
- data/Gemfile +2 -2
- data/Gemfile.lock +118 -0
- data/Guardfile +1 -0
- data/README.md +96 -31
- data/Rakefile +2 -0
- data/exel.gemspec +7 -7
- data/lib/exel.rb +7 -1
- data/lib/exel/ast_node.rb +6 -10
- data/lib/exel/context.rb +4 -1
- data/lib/exel/deferred_context_value.rb +3 -1
- data/lib/exel/error/job_termination.rb +12 -0
- data/lib/exel/events.rb +6 -0
- data/lib/exel/instruction.rb +5 -2
- data/lib/exel/instruction_node.rb +2 -0
- data/lib/exel/job.rb +8 -4
- data/lib/exel/listen_instruction.rb +2 -0
- data/lib/exel/logging.rb +24 -1
- data/lib/exel/logging/logger_wrapper.rb +31 -0
- data/lib/exel/logging_helper.rb +36 -0
- data/lib/exel/middleware/chain.rb +67 -0
- data/lib/exel/middleware/logging.rb +30 -0
- data/lib/exel/null_instruction.rb +2 -0
- data/lib/exel/processor_helper.rb +9 -1
- data/lib/exel/processors/async_processor.rb +2 -8
- data/lib/exel/processors/run_processor.rb +2 -6
- data/lib/exel/processors/split_processor.rb +15 -10
- data/lib/exel/providers/local_file_provider.rb +9 -6
- data/lib/exel/providers/threaded_async_provider.rb +2 -0
- data/lib/exel/remote_value.rb +11 -0
- data/lib/exel/sequence_node.rb +2 -0
- data/lib/exel/value.rb +2 -0
- data/lib/exel/version.rb +3 -1
- data/spec/exel/ast_node_spec.rb +48 -27
- data/spec/exel/context_spec.rb +77 -77
- data/spec/exel/deferred_context_value_spec.rb +42 -42
- data/spec/exel/events_spec.rb +68 -59
- data/spec/exel/instruction_node_spec.rb +17 -16
- data/spec/exel/instruction_spec.rb +49 -42
- data/spec/exel/job_spec.rb +99 -84
- data/spec/exel/listen_instruction_spec.rb +11 -10
- data/spec/exel/logging/logger_wrapper_spec.rb +93 -0
- data/spec/exel/logging_helper_spec.rb +24 -0
- data/spec/exel/logging_spec.rb +69 -24
- data/spec/exel/middleware/chain_spec.rb +65 -0
- data/spec/exel/middleware/logging_spec.rb +31 -0
- data/spec/exel/middleware_spec.rb +68 -0
- data/spec/exel/null_instruction_spec.rb +4 -4
- data/spec/exel/processors/async_processor_spec.rb +17 -18
- data/spec/exel/processors/run_processor_spec.rb +10 -11
- data/spec/exel/processors/split_processor_spec.rb +99 -74
- data/spec/exel/providers/local_file_provider_spec.rb +26 -28
- data/spec/exel/providers/threaded_async_provider_spec.rb +37 -38
- data/spec/exel/sequence_node_spec.rb +12 -11
- data/spec/exel/value_spec.rb +33 -33
- data/spec/exel_spec.rb +9 -7
- data/spec/integration/integration_spec.rb +3 -1
- data/spec/spec_helper.rb +4 -2
- data/spec/support/integration_test_classes.rb +4 -3
- metadata +37 -48
data/spec/exel_spec.rb
CHANGED
@@ -1,4 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
describe EXEL do
|
4
|
+
after :each do
|
5
|
+
EXEL.configure do |config|
|
6
|
+
config.remote_provider = nil # reset providers to default
|
7
|
+
config.async_provider = nil
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
2
11
|
describe '.async_provider' do
|
3
12
|
context 'with no async provider set in the configuration' do
|
4
13
|
it 'defaults to ThreadedAsyncProvider' do
|
@@ -38,11 +47,4 @@ describe EXEL do
|
|
38
47
|
end
|
39
48
|
end
|
40
49
|
end
|
41
|
-
|
42
|
-
after :each do
|
43
|
-
EXEL.configure do |config|
|
44
|
-
config.remote_provider = nil # reset providers to default
|
45
|
-
config.async_provider = nil
|
46
|
-
end
|
47
|
-
end
|
48
50
|
end
|
@@ -1,9 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
describe EXEL do
|
2
4
|
let(:context) { EXEL::Context.new(resource: csv_file, email_service: email_service, delete_resource: false) }
|
3
5
|
let(:csv_file) { File.open(File.expand_path('../../fixtures/sample.csv', __FILE__)) }
|
4
6
|
let(:email_service) { EmailService.new }
|
5
7
|
|
6
|
-
before :all do
|
8
|
+
before :all do # rubocop:disable RSpec/BeforeAfterAll
|
7
9
|
EXEL::Job.define :processing_steps do
|
8
10
|
process with: RecordLoader
|
9
11
|
process with: EmailProcessor
|
data/spec/spec_helper.rb
CHANGED
@@ -1,4 +1,7 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class Person < Struct.new(:name, :email)
|
4
|
+
end
|
2
5
|
|
3
6
|
class RecordLoader
|
4
7
|
def initialize(context)
|
@@ -17,8 +20,6 @@ end
|
|
17
20
|
class EmailProcessor
|
18
21
|
include EXEL::Events
|
19
22
|
|
20
|
-
attr_reader :context
|
21
|
-
|
22
23
|
def initialize(context)
|
23
24
|
@context = context
|
24
25
|
@people = context[:people]
|
metadata
CHANGED
@@ -1,57 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: exel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2
|
4
|
+
version: 1.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yroo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: rake
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '13'
|
20
20
|
type: :development
|
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: '13'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '3'
|
34
34
|
type: :development
|
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: '
|
40
|
+
version: '3'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: simplecov
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0.17'
|
48
48
|
type: :development
|
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: '
|
54
|
+
version: '0.17'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: guard
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,70 +100,42 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: 1.6.0
|
104
104
|
type: :development
|
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:
|
110
|
+
version: 1.6.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: terminal-notifier-guard
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - "~>"
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '1'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: rubocop
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - "~>"
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: 0.37.0
|
117
|
+
version: 1.7.0
|
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:
|
124
|
+
version: 1.7.0
|
139
125
|
- !ruby/object:Gem::Dependency
|
140
|
-
name: rubocop-
|
126
|
+
name: rubocop-airbnb
|
141
127
|
requirement: !ruby/object:Gem::Requirement
|
142
128
|
requirements:
|
143
129
|
- - "~>"
|
144
130
|
- !ruby/object:Gem::Version
|
145
|
-
version: '
|
131
|
+
version: '3.0'
|
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: '
|
153
|
-
- !ruby/object:Gem::Dependency
|
154
|
-
name: rubocop-rspec-focused
|
155
|
-
requirement: !ruby/object:Gem::Requirement
|
156
|
-
requirements:
|
157
|
-
- - "~>"
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: '0'
|
160
|
-
type: :development
|
161
|
-
prerelease: false
|
162
|
-
version_requirements: !ruby/object:Gem::Requirement
|
163
|
-
requirements:
|
164
|
-
- - "~>"
|
165
|
-
- !ruby/object:Gem::Version
|
166
|
-
version: '0'
|
138
|
+
version: '3.0'
|
167
139
|
- !ruby/object:Gem::Dependency
|
168
140
|
name: pry-byebug
|
169
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -189,8 +161,11 @@ files:
|
|
189
161
|
- ".gitignore"
|
190
162
|
- ".rspec"
|
191
163
|
- ".rubocop.yml"
|
164
|
+
- ".rubocop_airbnb.yml"
|
192
165
|
- ".rubocop_todo.yml"
|
166
|
+
- ".travis.yml"
|
193
167
|
- Gemfile
|
168
|
+
- Gemfile.lock
|
194
169
|
- Guardfile
|
195
170
|
- LICENSE.txt
|
196
171
|
- README.md
|
@@ -207,6 +182,10 @@ files:
|
|
207
182
|
- lib/exel/job.rb
|
208
183
|
- lib/exel/listen_instruction.rb
|
209
184
|
- lib/exel/logging.rb
|
185
|
+
- lib/exel/logging/logger_wrapper.rb
|
186
|
+
- lib/exel/logging_helper.rb
|
187
|
+
- lib/exel/middleware/chain.rb
|
188
|
+
- lib/exel/middleware/logging.rb
|
210
189
|
- lib/exel/null_instruction.rb
|
211
190
|
- lib/exel/processor_helper.rb
|
212
191
|
- lib/exel/processors/async_processor.rb
|
@@ -214,6 +193,7 @@ files:
|
|
214
193
|
- lib/exel/processors/split_processor.rb
|
215
194
|
- lib/exel/providers/local_file_provider.rb
|
216
195
|
- lib/exel/providers/threaded_async_provider.rb
|
196
|
+
- lib/exel/remote_value.rb
|
217
197
|
- lib/exel/sequence_node.rb
|
218
198
|
- lib/exel/value.rb
|
219
199
|
- lib/exel/version.rb
|
@@ -225,7 +205,12 @@ files:
|
|
225
205
|
- spec/exel/instruction_spec.rb
|
226
206
|
- spec/exel/job_spec.rb
|
227
207
|
- spec/exel/listen_instruction_spec.rb
|
208
|
+
- spec/exel/logging/logger_wrapper_spec.rb
|
209
|
+
- spec/exel/logging_helper_spec.rb
|
228
210
|
- spec/exel/logging_spec.rb
|
211
|
+
- spec/exel/middleware/chain_spec.rb
|
212
|
+
- spec/exel/middleware/logging_spec.rb
|
213
|
+
- spec/exel/middleware_spec.rb
|
229
214
|
- spec/exel/null_instruction_spec.rb
|
230
215
|
- spec/exel/processors/async_processor_spec.rb
|
231
216
|
- spec/exel/processors/run_processor_spec.rb
|
@@ -258,8 +243,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
258
243
|
- !ruby/object:Gem::Version
|
259
244
|
version: '0'
|
260
245
|
requirements: []
|
261
|
-
|
262
|
-
rubygems_version: 2.4.5.1
|
246
|
+
rubygems_version: 3.1.2
|
263
247
|
signing_key:
|
264
248
|
specification_version: 4
|
265
249
|
summary: EXEL, the Elastic eXEcution Language
|
@@ -272,7 +256,12 @@ test_files:
|
|
272
256
|
- spec/exel/instruction_spec.rb
|
273
257
|
- spec/exel/job_spec.rb
|
274
258
|
- spec/exel/listen_instruction_spec.rb
|
259
|
+
- spec/exel/logging/logger_wrapper_spec.rb
|
260
|
+
- spec/exel/logging_helper_spec.rb
|
275
261
|
- spec/exel/logging_spec.rb
|
262
|
+
- spec/exel/middleware/chain_spec.rb
|
263
|
+
- spec/exel/middleware/logging_spec.rb
|
264
|
+
- spec/exel/middleware_spec.rb
|
276
265
|
- spec/exel/null_instruction_spec.rb
|
277
266
|
- spec/exel/processors/async_processor_spec.rb
|
278
267
|
- spec/exel/processors/run_processor_spec.rb
|