flow-lite 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -2
- data/lib/flow-lite.rb +21 -3
- data/lib/flow-lite/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8af53ae94d759087b598975a3228f8243f2ac3e8
|
4
|
+
data.tar.gz: 98474c25143943b759864a7dc5e9e31925e0e692
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77a5ef9970b4bfa189caf93ff22f80232a192392848518e05e22638df4701ad73ae60c3ec28d7d7ddc0932aef009dcfb7a56a3aaffd0f5568a8f67f8272ee02c
|
7
|
+
data.tar.gz: f4284f4f791a083c920c7bb3e1d232eb8957f91c7ebf7040542b6ae2bbde4525ec3c79236b41748433ed363d7e74b3c761bf20f795b7875710d9e660a3a762ed
|
data/README.md
CHANGED
@@ -42,8 +42,13 @@ $ flow first_step
|
|
42
42
|
|
43
43
|
Note: By default the `flow` command line tool reads in and looks for `flowfile`, `Flowfile`, `flowfile.rb`, `Flowfile.rb`
|
44
44
|
in that order.
|
45
|
-
Use the `-f/--flowfile` option to use a different file
|
46
|
-
|
45
|
+
Use the `-f/--flowfile` option to use a different file.
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
**Prelude / Prolog**
|
50
|
+
|
51
|
+
Use the `-r/--require` option to (auto-)require
|
47
52
|
some extra libraries or scripts.
|
48
53
|
By default for now the "prelude / prolog" that always
|
49
54
|
gets auto-required includes:
|
data/lib/flow-lite.rb
CHANGED
@@ -68,9 +68,26 @@ class Base ## base class for flow class (auto)-constructed/build from flowfil
|
|
68
68
|
|
69
69
|
## run step by symbol/name (e.g. step :hello - etc.)
|
70
70
|
def step( name )
|
71
|
-
|
72
|
-
if respond_to?(
|
73
|
-
|
71
|
+
step_name = :"step_#{name}" ## note: make sure we always use symbols
|
72
|
+
if respond_to?( step_name )
|
73
|
+
#######
|
74
|
+
## check: track (and report) call stack - why? why not?
|
75
|
+
## e.g.
|
76
|
+
## [flow >(1) first_step)] step >first_step< - starting...
|
77
|
+
## [flow >(2) ..first_step > second_step)] step >second_step< - starting...
|
78
|
+
## [flow >(3) ....first_step > second_step > third_step)] step >third_step< - starting...
|
79
|
+
@stack ||= [] ## use a call stack of step names
|
80
|
+
@stack.push( name )
|
81
|
+
|
82
|
+
puts "[flow >(#{@stack.size}) #{'..'*(@stack.size-1)}#{@stack.join(' > ')})] step >#{name}< - starting..."
|
83
|
+
start_time = Time.now ## todo: use Timer? t = Timer.start / stop / diff etc. - why? why not?
|
84
|
+
|
85
|
+
__send__( step_name )
|
86
|
+
|
87
|
+
end_time = Time.now
|
88
|
+
diff_time = end_time - start_time
|
89
|
+
puts "[flow <(#{@stack.size}) #{'..'*(@stack.size-1)}#{@stack.join(' < ')})] step >#{name}< - done in #{diff_time} sec(s)"
|
90
|
+
@stack.pop
|
74
91
|
else
|
75
92
|
puts "!! ERROR: step definition >#{name}< not found; cannot run/execute - known (defined) steps include:"
|
76
93
|
pp self.class.step_methods #=> e.g. [:hello, ...]
|
@@ -78,6 +95,7 @@ class Base ## base class for flow class (auto)-constructed/build from flowfil
|
|
78
95
|
end
|
79
96
|
end # method step
|
80
97
|
|
98
|
+
|
81
99
|
def self.step_methods
|
82
100
|
names = instance_methods.reduce([]) do |names, name|
|
83
101
|
names << $1.to_sym if name =~ /^step_(.+)/
|
data/lib/flow-lite/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flow-lite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|