nocode 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/nocode/context.rb +8 -0
- data/lib/nocode/job_executor.rb +8 -16
- data/lib/nocode/step_registry.rb +3 -3
- data/lib/nocode/steps_executor.rb +1 -12
- data/lib/nocode/util/class_registry.rb +2 -2
- data/lib/nocode/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73aa9b620a2823a96b00c4b38f5a8e0fc8f5f040b5100e255e5f3df546263544
|
4
|
+
data.tar.gz: d5dbacadf0759e59ddd279c7446f679052ff89b4f2d3ea8d49378173368bd28f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fe2d5363d14bb6d035072629e280d6e87717a3a16e3d28d69e520ea6a8aa21d1ad330f554c94c6d6c5113c8acbb665fc3d4b9f8bde74d7652e8b14d3c1b42c8
|
7
|
+
data.tar.gz: c8f2c04683439abecfc3de0c63a909cc1b52686f2741f1936f03ea152bef263a41c4613d26e2ae46c732c6f879a6cfe40e62eed6d8922cb7b862a87329624b45
|
data/CHANGELOG.md
CHANGED
data/lib/nocode/context.rb
CHANGED
data/lib/nocode/job_executor.rb
CHANGED
@@ -31,33 +31,25 @@ module Nocode
|
|
31
31
|
registers: registers
|
32
32
|
)
|
33
33
|
|
34
|
-
log_title
|
34
|
+
log_title(context)
|
35
35
|
|
36
36
|
StepsExecutor.new(context: context, steps: steps).execute
|
37
37
|
|
38
|
-
log("Ended: #{DateTime.now}")
|
39
|
-
log_line
|
38
|
+
context.log("Ended: #{DateTime.now}")
|
39
|
+
context.log_line
|
40
40
|
|
41
41
|
context
|
42
42
|
end
|
43
43
|
|
44
44
|
private
|
45
45
|
|
46
|
-
def log_title
|
47
|
-
log_line
|
46
|
+
def log_title(context)
|
47
|
+
context.log_line
|
48
48
|
|
49
|
-
log('Nocode Execution')
|
50
|
-
log("Started: #{DateTime.now}")
|
49
|
+
context.log('Nocode Execution')
|
50
|
+
context.log("Started: #{DateTime.now}")
|
51
51
|
|
52
|
-
log_line
|
53
|
-
end
|
54
|
-
|
55
|
-
def log_line
|
56
|
-
log('-' * 50)
|
57
|
-
end
|
58
|
-
|
59
|
-
def log(msg)
|
60
|
-
io.puts(msg)
|
52
|
+
context.log_line
|
61
53
|
end
|
62
54
|
end
|
63
55
|
end
|
data/lib/nocode/step_registry.rb
CHANGED
@@ -10,8 +10,8 @@ module Nocode
|
|
10
10
|
class StepRegistry < Util::ClassRegistry
|
11
11
|
include Singleton
|
12
12
|
|
13
|
-
|
14
|
-
DIR
|
13
|
+
CLASS_PREFIX = 'Nocode::Steps::'
|
14
|
+
DIR = File.join(__dir__, 'steps')
|
15
15
|
|
16
16
|
class << self
|
17
17
|
extend Forwardable
|
@@ -27,7 +27,7 @@ module Nocode
|
|
27
27
|
files_loaded = Util::ClassLoader.new(DIR).load!
|
28
28
|
|
29
29
|
# Class the parent to load up the registry with the files we found.
|
30
|
-
load(files_loaded,
|
30
|
+
load(files_loaded, class_prefix: CLASS_PREFIX)
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
@@ -13,7 +13,7 @@ module Nocode
|
|
13
13
|
|
14
14
|
attr_reader :context, :steps
|
15
15
|
|
16
|
-
def_delegators :context, :
|
16
|
+
def_delegators :context, :log_line, :log
|
17
17
|
|
18
18
|
def initialize(context:, steps:)
|
19
19
|
@context = context
|
@@ -32,9 +32,6 @@ module Nocode
|
|
32
32
|
|
33
33
|
private
|
34
34
|
|
35
|
-
# TODO: It could be better encapsulated to move the evaluation logic into the step itself
|
36
|
-
# and let it deal with compilation. This may call for re-working the lifecycle of the Step
|
37
|
-
# class so I will temporarily defer this refactoring.
|
38
35
|
def make_step(step)
|
39
36
|
evaluated_step = Util::ObjectTemplate.new(step).evaluate(context.to_h)
|
40
37
|
type = evaluated_step[TYPE_KEY].to_s
|
@@ -67,13 +64,5 @@ module Nocode
|
|
67
64
|
|
68
65
|
log_line
|
69
66
|
end
|
70
|
-
|
71
|
-
def log_line
|
72
|
-
log('-' * 50)
|
73
|
-
end
|
74
|
-
|
75
|
-
def log(msg)
|
76
|
-
io.puts(msg)
|
77
|
-
end
|
78
67
|
end
|
79
68
|
end
|
@@ -20,13 +20,13 @@ module Nocode
|
|
20
20
|
freeze
|
21
21
|
end
|
22
22
|
|
23
|
-
def load(types,
|
23
|
+
def load(types, class_prefix: '', type_prefix: '')
|
24
24
|
types.each do |type|
|
25
25
|
pascal_cased = type.split(File::SEPARATOR).map do |part|
|
26
26
|
part.split('_').collect(&:capitalize).join
|
27
27
|
end.join('::')
|
28
28
|
|
29
|
-
register(type, "#{
|
29
|
+
register("#{type_prefix}#{type}", "#{class_prefix}#{pascal_cased}")
|
30
30
|
end
|
31
31
|
|
32
32
|
self
|
data/lib/nocode/version.rb
CHANGED