weel 1.99.25 → 1.99.26
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 +10 -10
- data/weel.gemspec +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: c9bd94ef3f1ec50791e2a643602536a1d8ac0583
|
4
|
+
data.tar.gz: 3f789f0ee61ac31d1fbba6cff4ec466c3696c2a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8fb935824d9f81f0fd355bcf58d82bc5104c09a05f4964387d83cacbbac174fb18f54c8da578da1f960d224be947eb65ae742b4bdeb32d5f9d2ed3c7f8ba7656
|
7
|
+
data.tar.gz: 33133bcf1dc767f26a2ee6348371a38fc816857391bfeda1be4310faa9be7aee03f820e29b80e24ca410b3ec962a3a24d9da0ffaea74570030633e46bfb9a3c4
|
data/lib/weel.rb
CHANGED
@@ -452,9 +452,9 @@ class WEEL
|
|
452
452
|
# Defines a possible choice of a choose-Construct
|
453
453
|
# Block is executed if condition == true or
|
454
454
|
# searchmode is active (to find the starting position)
|
455
|
-
def alternative(condition)# {{{
|
455
|
+
def alternative(condition,args={})# {{{
|
456
456
|
return if self.__weel_state == :stopping || self.__weel_state == :stopped || Thread.current[:nolongernecessary]
|
457
|
-
hw, pos = __weel_sim_start(:alternative
|
457
|
+
hw, pos = __weel_sim_start(:alternative,args.merge(:mode => Thread.current[:alternative_mode])) if __weel_sim
|
458
458
|
Thread.current[:mutex] ||= Mutex.new
|
459
459
|
Thread.current[:mutex].synchronize do
|
460
460
|
return if Thread.current[:alternative_mode] == :exclusive && Thread.current[:alternative_executed][-1] = true
|
@@ -465,13 +465,13 @@ class WEEL
|
|
465
465
|
Thread.current[:alternative_executed][-1] = true if condition
|
466
466
|
end
|
467
467
|
yield if __weel_is_in_search_mode || __weel_sim || condition
|
468
|
-
__weel_sim_stop(:alternative,hw,pos
|
468
|
+
__weel_sim_stop(:alternative,hw,pos,args.merge(:mode => Thread.current[:alternative_mode])) if __weel_sim
|
469
469
|
end # }}}
|
470
|
-
def otherwise # {{{
|
470
|
+
def otherwise(args={}) # {{{
|
471
471
|
return if self.__weel_state == :stopping || self.__weel_state == :stopped || Thread.current[:nolongernecessary]
|
472
|
-
hw, pos = __weel_sim_start(:otherwise
|
472
|
+
hw, pos = __weel_sim_start(:otherwise,args.merge(:mode => Thread.current[:alternative_mode])) if __weel_sim
|
473
473
|
yield if __weel_is_in_search_mode || __weel_sim || !Thread.current[:alternative_executed].last
|
474
|
-
__weel_sim_stop(:otherwise,hw,pos
|
474
|
+
__weel_sim_stop(:otherwise,hw,pos,args.merge(:mode => Thread.current[:alternative_mode])) if __weel_sim
|
475
475
|
end # }}}
|
476
476
|
|
477
477
|
# Defines a critical block (=Mutex)
|
@@ -489,8 +489,8 @@ class WEEL
|
|
489
489
|
end # }}}
|
490
490
|
|
491
491
|
# Defines a Cycle (loop/iteration)
|
492
|
-
def loop(condition)# {{{
|
493
|
-
unless condition.is_a?(Array) && (condition[0].is_a?(Proc) || condition[0].is_a?(String)) && [:pre_test,:post_test].include?(condition[1])
|
492
|
+
def loop(condition,args={})# {{{
|
493
|
+
unless condition.is_a?(Array) && (condition[0].is_a?(Proc) || condition[0].is_a?(String)) && [:pre_test,:post_test].include?(condition[1]) && args.is_a?(Hash)
|
494
494
|
raise "condition must be called pre_test{} or post_test{}"
|
495
495
|
end
|
496
496
|
return if self.__weel_state == :stopping || self.__weel_state == :stopped || Thread.current[:nolongernecessary]
|
@@ -499,9 +499,9 @@ class WEEL
|
|
499
499
|
return if __weel_is_in_search_mode
|
500
500
|
end
|
501
501
|
if __weel_sim
|
502
|
-
hw, pos = __weel_sim_start(:loop
|
502
|
+
hw, pos = __weel_sim_start(:loop,args.merge(:testing=>condition[1]))
|
503
503
|
yield
|
504
|
-
__weel_sim_stop(:loop,hw,pos
|
504
|
+
__weel_sim_stop(:loop,hw,pos,args.merge(:testing=>condition[1]))
|
505
505
|
return
|
506
506
|
end
|
507
507
|
handlerwrapper = @__weel_handlerwrapper.new @__weel_handlerwrapper_args unless condition[0].is_a?(Proc)
|
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.26
|
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: 2014-08-
|
12
|
+
date: 2014-08-24 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: see http://cpee.org
|
15
15
|
email: juergen.mangler@gmail.com
|