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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f61f94156b9718eb74e5a99f9e9c1128f067588
4
- data.tar.gz: b3da7ea83777db3cbe01609ae431bd4ce043ef1d
3
+ metadata.gz: 8af53ae94d759087b598975a3228f8243f2ac3e8
4
+ data.tar.gz: 98474c25143943b759864a7dc5e9e31925e0e692
5
5
  SHA512:
6
- metadata.gz: 49523aa490c50d6b4602090df7c135899f234b9649c406c6f5ca22967bc976732e3a3c5d6589b6c8ebdd31049651b53d2096a038e611a20a1aa5aa5b85f1565f
7
- data.tar.gz: 4321ffd322f70a5288f68d697b4020a8389ac45f273c4f3fd88c7d5e54f104e48e6b1d5be32ee130df158472a69a64e97d0705f2f5380a03e2b474d25132ea37
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
- and use the `-r/--require` to (auto-)require
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:
@@ -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
- name = :"step_#{name}" ## note: make sure we always use symbols
72
- if respond_to?( name )
73
- send( name )
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_(.+)/
@@ -2,7 +2,7 @@ module FlowLite
2
2
 
3
3
  MAJOR = 1 ## todo: namespace inside version or something - why? why not??
4
4
  MINOR = 0
5
- PATCH = 1
5
+ PATCH = 2
6
6
  VERSION = [MAJOR,MINOR,PATCH].join('.')
7
7
 
8
8
  def self.version
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.1
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-27 00:00:00.000000000 Z
11
+ date: 2020-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc