weel 1.99.49 → 1.99.50
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +3 -3
- data/lib/weel.rb +6 -3
- data/weel.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 234266663393f98240e6382ec4dc03e3497161e6
|
4
|
+
data.tar.gz: 83ba3c0d8971441f5f647fbd4cbbecd691da2f1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5099bdd7820b8171857796d48c9d1631228f31ab5df77d8439643e36edf244ce696c026dfc48f6f54c2aafc3e631846bf36d1eff87134626d285c427d9e8dd73
|
7
|
+
data.tar.gz: 875ebe947fbdb7724525bea24d4123089db7e11746c2d8184a819783ffc9d6864f6f9cb94bbe7c536114cc584ad14e502b99fd2899962cce92732ab4a9c4e1ce
|
data/Rakefile
CHANGED
data/lib/weel.rb
CHANGED
@@ -447,17 +447,17 @@ class WEEL
|
|
447
447
|
# searchmode is active (to find the starting position)
|
448
448
|
def alternative(condition,args={})# {{{
|
449
449
|
return if self.__weel_state == :stopping || self.__weel_state == :stopped || Thread.current[:nolongernecessary]
|
450
|
-
hw, pos = __weel_sim_start(:alternative,args.merge(:mode => Thread.current[:alternative_mode].last, :condition => condition.is_a?(String) ? condition : nil)) if __weel_sim
|
450
|
+
hw, pos = __weel_sim_start(:alternative,args.merge(:mode => Thread.current[:alternative_mode].last, :condition => ((condition.is_a?(String) || condition.is_a?(Proc)) ? condition : nil))) if __weel_sim
|
451
451
|
Thread.current[:mutex] ||= Mutex.new
|
452
452
|
Thread.current[:mutex].synchronize do
|
453
453
|
return if Thread.current[:alternative_mode][-1] == :exclusive && Thread.current[:alternative_executed][-1] == true
|
454
|
-
if condition.is_a?(String) && !__weel_sim
|
454
|
+
if (condition.is_a?(String) || condition.is_a?(Proc)) && !__weel_sim
|
455
455
|
condition = __weel_eval_condition(condition)
|
456
456
|
end
|
457
457
|
Thread.current[:alternative_executed][-1] = true if condition
|
458
458
|
end
|
459
459
|
__weel_protect_yield(&Proc.new) if __weel_is_in_search_mode || __weel_sim || condition
|
460
|
-
__weel_sim_stop(:alternative,hw,pos,args.merge(:mode => Thread.current[:alternative_mode].last, :condition => condition.is_a?(String) ? condition : nil)) if __weel_sim
|
460
|
+
__weel_sim_stop(:alternative,hw,pos,args.merge(:mode => Thread.current[:alternative_mode].last, :condition => ((condition.is_a?(String) || condition.is_a?(Proc)) ? condition : nil))) if __weel_sim
|
461
461
|
end # }}}
|
462
462
|
def otherwise(args={}) # {{{
|
463
463
|
return if self.__weel_state == :stopping || self.__weel_state == :stopped || Thread.current[:nolongernecessary]
|
@@ -515,6 +515,9 @@ class WEEL
|
|
515
515
|
end
|
516
516
|
end # }}}
|
517
517
|
|
518
|
+
def test(code=nil,&blk)# {{{
|
519
|
+
code || blk
|
520
|
+
end # }}}
|
518
521
|
def pre_test(code=nil,&blk)# {{{
|
519
522
|
[code || blk, :pre_test]
|
520
523
|
end # }}}
|
data/weel.gemspec
CHANGED