weel 1.99.84 → 1.99.91
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/weel.rb +55 -28
- data/weel.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb12e6e8a41ba9cd26f4ca0bc599988506df0b95cbc6cc73268feaa24aef97c1
|
4
|
+
data.tar.gz: ede8c709b88e40a901a43e7f74e35a537a36d92fbc0962476f0945a5a4bfc905
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5be98c67503b070738dba25f7328f9d56449f413fbac4be9987d65490f8f9bf08321ca3857cad2d1497b29fbd641dbc744c7578d6f7779480562c1de5098750
|
7
|
+
data.tar.gz: fe8dc90c3edcb5473a41127fd89beff210042f0cc579d2ebd89c49f3ea30e809d4f010543b6c844c3c61597e4f169f842b3ec7141bddc175a24c677ba31ab49e
|
data/lib/weel.rb
CHANGED
@@ -15,6 +15,7 @@
|
|
15
15
|
# <http://www.gnu.org/licenses/>.
|
16
16
|
|
17
17
|
require 'thread'
|
18
|
+
require 'securerandom'
|
18
19
|
|
19
20
|
class WEEL
|
20
21
|
def initialize(*args)# {{{
|
@@ -59,12 +60,17 @@ class WEEL
|
|
59
60
|
@additional = additional
|
60
61
|
end
|
61
62
|
|
62
|
-
def method_missing(m
|
63
|
-
if @additional.
|
63
|
+
def method_missing(m,*args,&block)
|
64
|
+
if @additional.include?(m)
|
64
65
|
begin
|
65
|
-
Marshal.load(Marshal.dump(@
|
66
|
+
tmp = Marshal.load(Marshal.dump(@additional[m]))
|
67
|
+
if tmp.is_a? Hash
|
68
|
+
ReadHash.new(tmp)
|
69
|
+
else
|
70
|
+
tmp
|
71
|
+
end
|
66
72
|
rescue
|
67
|
-
|
73
|
+
m.to_s rescue nil
|
68
74
|
end
|
69
75
|
end
|
70
76
|
end
|
@@ -90,12 +96,17 @@ class WEEL
|
|
90
96
|
@additional = additional
|
91
97
|
end
|
92
98
|
|
93
|
-
def method_missing(m
|
94
|
-
if @additional.
|
99
|
+
def method_missing(m,*args,&block)
|
100
|
+
if @additional.include?(m)
|
95
101
|
begin
|
96
|
-
Marshal.load(Marshal.dump(@
|
102
|
+
tmp = Marshal.load(Marshal.dump(@additional[m]))
|
103
|
+
if tmp.is_a? Hash
|
104
|
+
ReadHash.new(tmp)
|
105
|
+
else
|
106
|
+
tmp
|
107
|
+
end
|
97
108
|
rescue
|
98
|
-
|
109
|
+
m.to_s rescue nil
|
99
110
|
end
|
100
111
|
end
|
101
112
|
end
|
@@ -227,6 +238,7 @@ class WEEL
|
|
227
238
|
end # }}}
|
228
239
|
|
229
240
|
class HandlerWrapperBase # {{{
|
241
|
+
def self::loop_guard(lid,count); false; end
|
230
242
|
def self::inform_state_change(arguments,newstate); end
|
231
243
|
def self::inform_syntax_error(arguments,err,code); end
|
232
244
|
def self::inform_handlerwrapper_error(arguments,err); end
|
@@ -278,7 +290,7 @@ class WEEL
|
|
278
290
|
end
|
279
291
|
def as_json(*)
|
280
292
|
jsn = { 'position' => @position }
|
281
|
-
jsn['
|
293
|
+
jsn['passthrough'] = @passthrough if @passthrough
|
282
294
|
jsn
|
283
295
|
end
|
284
296
|
def to_s
|
@@ -287,6 +299,12 @@ class WEEL
|
|
287
299
|
def to_json(*args)
|
288
300
|
as_json.to_json(*args)
|
289
301
|
end
|
302
|
+
def eql?(other)
|
303
|
+
to_s == other.to_s
|
304
|
+
end
|
305
|
+
def hash
|
306
|
+
to_s.hash
|
307
|
+
end
|
290
308
|
end # }}}
|
291
309
|
|
292
310
|
class Continue # {{{
|
@@ -574,15 +592,21 @@ class WEEL
|
|
574
592
|
__weel_sim_stop(:loop,hw,pos,args.merge(:testing=>condition[1],:condition=>cond))
|
575
593
|
return
|
576
594
|
end
|
595
|
+
loop_guard = 0
|
596
|
+
loop_id = SecureRandom.uuid
|
577
597
|
catch :escape do
|
578
598
|
case condition[1]
|
579
599
|
when :pre_test
|
580
600
|
while __weel_eval_condition(condition[0]) && self.__weel_state != :stopping && self.__weel_state != :stopped && self.__weel_state != :finishing
|
601
|
+
loop_guard += 1
|
581
602
|
__weel_protect_yield(&block)
|
603
|
+
sleep 1 if @__weel_handlerwrapper::loop_guard(@__weel_handlerwrapper_args,loop_id,loop_guard)
|
582
604
|
end
|
583
605
|
when :post_test
|
584
606
|
begin
|
607
|
+
loop_guard += 1
|
585
608
|
__weel_protect_yield(&block)
|
609
|
+
sleep 1 if @__weel_handlerwrapper::loop_guard(@__weel_handlerwrapper_args,loop_id,loop_guard)
|
586
610
|
end while __weel_eval_condition(condition[0]) && self.__weel_state != :stopping && self.__weel_state != :stopped && self.__weel_state != :finishing
|
587
611
|
end
|
588
612
|
end
|
@@ -659,24 +683,27 @@ class WEEL
|
|
659
683
|
|
660
684
|
def __weel_progress(searchmode, position, skip=false) #{{{
|
661
685
|
ipc = {}
|
662
|
-
if
|
663
|
-
|
664
|
-
ipc[:
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
if Thread.current[:branch_position]
|
673
|
-
@__weel_positions.delete Thread.current[:branch_position]
|
674
|
-
ipc[:unmark] ||= []
|
675
|
-
ipc[:unmark] << Thread.current[:branch_position] rescue nil
|
676
|
-
end
|
677
|
-
wp = WEEL::Position.new(position, skip ? :after : :at, nil)
|
678
|
-
ipc[skip ? :after : :at] = [wp]
|
686
|
+
if Thread.current[:branch_parent] && Thread.current[:branch_parent][:branch_position]
|
687
|
+
@__weel_positions.delete Thread.current[:branch_parent][:branch_position]
|
688
|
+
ipc[:unmark] ||= []
|
689
|
+
ipc[:unmark] << Thread.current[:branch_parent][:branch_position] rescue nil
|
690
|
+
Thread.current[:branch_parent][:branch_position] = nil
|
691
|
+
end
|
692
|
+
if Thread.current[:branch_position]
|
693
|
+
@__weel_positions.delete Thread.current[:branch_position]
|
694
|
+
ipc[:unmark] ||= []
|
695
|
+
ipc[:unmark] << Thread.current[:branch_position] rescue nil
|
679
696
|
end
|
697
|
+
wp = WEEL::Position.new(position, skip ? :after : :at, nil)
|
698
|
+
ipc[skip ? :after : :at] = [wp]
|
699
|
+
|
700
|
+
@__weel_search_positions.each do |k,ele| # some may still be in active search but lets unmark them for good measure
|
701
|
+
ipc[:unmark] ||= []
|
702
|
+
ipc[:unmark] << ele
|
703
|
+
true
|
704
|
+
end
|
705
|
+
ipc[:unmark].uniq! if ipc[:unmark]
|
706
|
+
|
680
707
|
@__weel_positions << wp
|
681
708
|
Thread.current[:branch_position] = wp
|
682
709
|
|
@@ -770,7 +797,7 @@ class WEEL
|
|
770
797
|
if self.__weel_state == :stopping || self.__weel_state == :finishing
|
771
798
|
handlerwrapper.activity_stop
|
772
799
|
wp.passthrough = handlerwrapper.activity_passthrough_value
|
773
|
-
raise Signal::Proceed
|
800
|
+
raise Signal::Proceed if wp.passthrough # if stop, but no passthrough, let manipulate happen and then stop
|
774
801
|
end
|
775
802
|
|
776
803
|
code = if waitingresult == WEEL::Signal::Again
|
@@ -900,7 +927,7 @@ class WEEL
|
|
900
927
|
branch = branch[:branch_parent]
|
901
928
|
branch[:branch_search] = false
|
902
929
|
end
|
903
|
-
@__weel_search_positions[position].detail == :after
|
930
|
+
@__weel_search_positions[position].detail == :after
|
904
931
|
else
|
905
932
|
branch[:branch_search] = true
|
906
933
|
end
|
data/weel.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: weel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.99.
|
4
|
+
version: 1.99.91
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juergen eTM Mangler
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-09-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: test-unit
|