weel 1.99.157 → 1.99.159
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/example/SimpleHandlerWrapper.rb +4 -4
- data/example/SimpleWorkflow.rb +4 -4
- data/example/runme.rb +4 -4
- data/lib/weel.rb +50 -72
- data/weel.gemspec +2 -2
- metadata +2 -2
- /data/{COPYING → LICENSE} +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fafdbf4bc9a94b4a5fce5eed31a8fbf89669f3da12851afc42df9e77a305ce52
|
|
4
|
+
data.tar.gz: 93104709ba1854a7c367e064a8f406bfd4772d6156a86751758089b5bbcecb21
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f39dd292ce02c906f629a6940071af46c4798fe3ad26b0f6d9e0b720b912203ecbcfcf6fc271ecefbc414fe402e4879d4038681dbfd548f578bdf0de9bafbff5
|
|
7
|
+
data.tar.gz: c9b0e23d365fba38ab66c5524d050b7aef3c11e23eb56024669f252ddd5430ad5c90bb670b8d96e35f5fcbaf20381bbe517a569022fac4319f0a057a6d8225da
|
data/README.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# This file is part of WEEL.
|
|
2
2
|
#
|
|
3
3
|
# WEEL is free software: you can redistribute it and/or modify it under the terms
|
|
4
|
-
# of the GNU General Public License as published by the Free Software Foundation,
|
|
4
|
+
# of the GNU Lesser General Public License as published by the Free Software Foundation,
|
|
5
5
|
# either version 3 of the License, or (at your option) any later version.
|
|
6
6
|
#
|
|
7
7
|
# WEEL is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
8
8
|
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
9
|
-
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
9
|
+
# PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
|
10
10
|
#
|
|
11
|
-
# You should have received a copy of the GNU General Public License along with
|
|
12
|
-
# WEEL (file
|
|
11
|
+
# You should have received a copy of the GNU Lesser General Public License along with
|
|
12
|
+
# WEEL (file LICENSE in the main directory). If not, see
|
|
13
13
|
# <http://www.gnu.org/licenses/>.
|
|
14
14
|
|
|
15
15
|
require "pp"
|
data/example/SimpleWorkflow.rb
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# This file is part of WEEL.
|
|
2
2
|
#
|
|
3
3
|
# WEEL is free software: you can redistribute it and/or modify it under the terms
|
|
4
|
-
# of the GNU General Public License as published by the Free Software Foundation,
|
|
4
|
+
# of the GNU Lesser General Public License as published by the Free Software Foundation,
|
|
5
5
|
# either version 3 of the License, or (at your option) any later version.
|
|
6
6
|
#
|
|
7
7
|
# WEEL is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
8
8
|
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
9
|
-
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
9
|
+
# PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
|
10
10
|
#
|
|
11
|
-
# You should have received a copy of the GNU General Public License along with
|
|
12
|
-
# WEEL (file
|
|
11
|
+
# You should have received a copy of the GNU Lesser General Public License along with
|
|
12
|
+
# WEEL (file LICENSE in the main directory). If not, see
|
|
13
13
|
# <http://www.gnu.org/licenses/>.
|
|
14
14
|
|
|
15
15
|
require ::File.dirname(__FILE__) + '/../lib/weel'
|
data/example/runme.rb
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
# This file is part of WEEL.
|
|
3
3
|
#
|
|
4
4
|
# WEEL is free software: you can redistribute it and/or modify it under the terms
|
|
5
|
-
# of the GNU General Public License as published by the Free Software Foundation,
|
|
5
|
+
# of the GNU Lesser General Public License as published by the Free Software Foundation,
|
|
6
6
|
# either version 3 of the License, or (at your option) any later version.
|
|
7
7
|
#
|
|
8
8
|
# WEEL is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
9
9
|
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
10
|
-
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
10
|
+
# PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
|
11
11
|
#
|
|
12
|
-
# You should have received a copy of the GNU General Public License along with
|
|
13
|
-
# WEEL (file
|
|
12
|
+
# You should have received a copy of the GNU Lesser General Public License along with
|
|
13
|
+
# WEEL (file LICENSE in the main directory). If not, see
|
|
14
14
|
# <http://www.gnu.org/licenses/>.
|
|
15
15
|
|
|
16
16
|
require ::File.dirname(__FILE__) + '/SimpleWorkflow'
|
data/lib/weel.rb
CHANGED
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
# This file is part of WEEL.
|
|
4
4
|
#
|
|
5
5
|
# WEEL is free software: you can redistribute it and/or modify it under the terms
|
|
6
|
-
# of the GNU General Public License as published by the Free Software Foundation,
|
|
6
|
+
# of the GNU Lesser General Public License as published by the Free Software Foundation,
|
|
7
7
|
# either version 3 of the License, or (at your option) any later version.
|
|
8
8
|
#
|
|
9
9
|
# WEEL is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
10
10
|
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
11
|
-
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
11
|
+
# PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
|
12
12
|
#
|
|
13
|
-
# You should have received a copy of the GNU General Public License along with
|
|
14
|
-
# WEEL (file
|
|
13
|
+
# You should have received a copy of the GNU Lesser General Public License along with
|
|
14
|
+
# WEEL (file LICENSE in the main directory). If not, see
|
|
15
15
|
# <http://www.gnu.org/licenses/>.
|
|
16
16
|
|
|
17
17
|
require 'thread'
|
|
@@ -45,6 +45,43 @@ class WEEL
|
|
|
45
45
|
class Salvage < Exception; end
|
|
46
46
|
end # }}}
|
|
47
47
|
|
|
48
|
+
module HashExt #{{{
|
|
49
|
+
alias __send send
|
|
50
|
+
instance_methods.each do |meth|
|
|
51
|
+
# skipping undef of methods that "may cause serious problems"
|
|
52
|
+
undef_method(meth) if meth !~ /^(__|object_id)/
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def any?
|
|
56
|
+
@__weel_values&.any?
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def empty?
|
|
60
|
+
@__weel_values.nil? || @__weel_values.empty?
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def to_json(*args)
|
|
64
|
+
@__weel_values.nil? ? '{}' : @__weel_values.to_json(*args)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def method_missing(name,*args)
|
|
68
|
+
if args.empty? && @__weel_values.key?(name)
|
|
69
|
+
@__weel_values[name]
|
|
70
|
+
elsif args.empty? && @__weel_values.key?(name.to_s)
|
|
71
|
+
@__weel_values[name.to_s]
|
|
72
|
+
elsif name.to_s[-1..-1] == "=" && args.length == 1
|
|
73
|
+
temp = name.to_s[0..-2]
|
|
74
|
+
@__weel_values[temp.to_sym] = args[0]
|
|
75
|
+
elsif name.to_s == "[]=" && args.length == 2
|
|
76
|
+
@__weel_values[args[0]] = args[1]
|
|
77
|
+
elsif name.to_s == "[]" && args.length == 1
|
|
78
|
+
@__weel_values[args[0]]
|
|
79
|
+
else
|
|
80
|
+
nil
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end #}}}
|
|
84
|
+
|
|
48
85
|
class ReadStructure # {{{
|
|
49
86
|
def initialize(data,endpoints,local,additional)
|
|
50
87
|
@__weel_data = data.transform_values do |v|
|
|
@@ -201,11 +238,7 @@ class WEEL
|
|
|
201
238
|
class ManipulateHash # {{{
|
|
202
239
|
attr_reader :__weel_touched, :__weel_changed
|
|
203
240
|
|
|
204
|
-
|
|
205
|
-
instance_methods.each do |meth|
|
|
206
|
-
# skipping undef of methods that "may cause serious problems"
|
|
207
|
-
undef_method(meth) if meth !~ /^(__|object_id)/
|
|
208
|
-
end
|
|
241
|
+
include WEEL::HashExt
|
|
209
242
|
|
|
210
243
|
def initialize(values,touched,changed)
|
|
211
244
|
@__weel_values = values
|
|
@@ -220,11 +253,6 @@ class WEEL
|
|
|
220
253
|
end
|
|
221
254
|
end
|
|
222
255
|
|
|
223
|
-
def clear
|
|
224
|
-
@__weel_changed += @__weel_values.keys
|
|
225
|
-
@__weel_values.clear
|
|
226
|
-
end
|
|
227
|
-
|
|
228
256
|
def method_missing(name,*args)
|
|
229
257
|
if args.empty? && @__weel_values.key?(name)
|
|
230
258
|
@__weel_touched << name
|
|
@@ -264,43 +292,14 @@ class WEEL
|
|
|
264
292
|
end #}}}
|
|
265
293
|
|
|
266
294
|
class ReadHash # {{{
|
|
267
|
-
|
|
268
|
-
instance_methods.each do |meth|
|
|
269
|
-
# skipping undef of methods that "may cause serious problems"
|
|
270
|
-
undef_method(meth) if meth !~ /^(__|object_id)/
|
|
271
|
-
end
|
|
295
|
+
include WEEL::HashExt
|
|
272
296
|
|
|
273
297
|
def initialize(values)
|
|
274
298
|
@__weel_values = values
|
|
275
299
|
end
|
|
276
|
-
|
|
277
|
-
def to_json(*args)
|
|
278
|
-
@__weel_values.to_json(*args)
|
|
279
|
-
end
|
|
280
|
-
|
|
281
|
-
def method_missing(name,*args)
|
|
282
|
-
if args.empty? && @__weel_values.key?(name)
|
|
283
|
-
@__weel_values[name]
|
|
284
|
-
elsif args.empty? && @__weel_values.key?(name.to_s)
|
|
285
|
-
@__weel_values[name.to_s]
|
|
286
|
-
elsif name.to_s[-1..-1] == "=" && args.length == 1
|
|
287
|
-
temp = name.to_s[0..-2]
|
|
288
|
-
@__weel_values[temp.to_sym] = args[0]
|
|
289
|
-
elsif name.to_s == "[]=" && args.length == 2
|
|
290
|
-
@__weel_values[args[0]] = args[1]
|
|
291
|
-
elsif name.to_s == "[]" && args.length == 1
|
|
292
|
-
@__weel_values[args[0]]
|
|
293
|
-
else
|
|
294
|
-
nil
|
|
295
|
-
end
|
|
296
|
-
end
|
|
297
300
|
end # }}}
|
|
298
301
|
class ReadOnlyHash # {{{
|
|
299
|
-
|
|
300
|
-
instance_methods.each do |meth|
|
|
301
|
-
# skipping undef of methods that "may cause serious problems"
|
|
302
|
-
undef_method(meth) if meth !~ /^(__|object_id)/
|
|
303
|
-
end
|
|
302
|
+
include WEEL::HashExt
|
|
304
303
|
|
|
305
304
|
def initialize(values)
|
|
306
305
|
@__weel_values = values.transform_values do |v|
|
|
@@ -315,27 +314,6 @@ class WEEL
|
|
|
315
314
|
end
|
|
316
315
|
end
|
|
317
316
|
end
|
|
318
|
-
|
|
319
|
-
def to_json(*args)
|
|
320
|
-
@__weel_values.to_json(*args)
|
|
321
|
-
end
|
|
322
|
-
|
|
323
|
-
def method_missing(name,*args)
|
|
324
|
-
if args.empty? && @__weel_values.key?(name)
|
|
325
|
-
@__weel_values[name]
|
|
326
|
-
elsif args.empty? && @__weel_values.key?(name.to_s)
|
|
327
|
-
@__weel_values[name.to_s]
|
|
328
|
-
elsif name.to_s[-1..-1] == "=" && args.length == 1
|
|
329
|
-
temp = name.to_s[0..-2]
|
|
330
|
-
@__weel_values[temp.to_sym] = args[0]
|
|
331
|
-
elsif name.to_s == "[]=" && args.length == 2
|
|
332
|
-
@__weel_values[args[0]] = args[1]
|
|
333
|
-
elsif name.to_s == "[]" && args.length == 1
|
|
334
|
-
@__weel_values[args[0]]
|
|
335
|
-
else
|
|
336
|
-
nil
|
|
337
|
-
end
|
|
338
|
-
end
|
|
339
317
|
end # }}}
|
|
340
318
|
|
|
341
319
|
class ProcString #{{{
|
|
@@ -376,7 +354,7 @@ class WEEL
|
|
|
376
354
|
def mem_guard; end
|
|
377
355
|
|
|
378
356
|
def prepare(lock,dataelements,endpoints,status,local,additional,code,exec_endpoints,exec_parameters); end
|
|
379
|
-
def test_condition(eid,dataelements,endpoints,local,additional,code,args={}); ReadStructure.new(dataelements,endpoints,local,additional).instance_eval(code); end
|
|
357
|
+
def test_condition(eid,dataelements,endpoints,local,additional,code,args={},props={}); ReadStructure.new(dataelements,endpoints,local,additional).instance_eval(code); end
|
|
380
358
|
def manipulate(readonly,lock,dataelements,endpoints,status,local,additional,code,where,result=nil,options=nil)
|
|
381
359
|
lock.synchronize do
|
|
382
360
|
if readonly
|
|
@@ -668,7 +646,7 @@ class WEEL
|
|
|
668
646
|
Thread.current[:mutex].synchronize do
|
|
669
647
|
return if Thread.current[:alternative_mode][-1] == :exclusive && Thread.current[:alternative_executed][-1] == true
|
|
670
648
|
if condition.is_a?(String)
|
|
671
|
-
condition = __weel_eval_condition(eid, condition, args)
|
|
649
|
+
condition = __weel_eval_condition(eid, condition, args, {:type => 'alternative', :count => nil})
|
|
672
650
|
end
|
|
673
651
|
Thread.current[:alternative_executed][-1] = true if condition
|
|
674
652
|
end
|
|
@@ -751,7 +729,7 @@ class WEEL
|
|
|
751
729
|
catch :escape do
|
|
752
730
|
case condition[1]
|
|
753
731
|
when :pre_test
|
|
754
|
-
while __weel_eval_condition(eid, condition[0],args) && self.__weel_state != :stopping && self.__weel_state != :stopped && self.__weel_state != :finishing && !Thread.current[:nolongernecessary]
|
|
732
|
+
while __weel_eval_condition(eid, condition[0],args,{:type => 'loop', :variant => 'head', :count => loop_guard}) && self.__weel_state != :stopping && self.__weel_state != :stopped && self.__weel_state != :finishing && !Thread.current[:nolongernecessary]
|
|
755
733
|
loop_guard += 1
|
|
756
734
|
__weel_protect_yield(&block)
|
|
757
735
|
sleep 1 if @__weel_connectionwrapper::loop_guard(@__weel_connectionwrapper_args,loop_id,loop_guard)
|
|
@@ -761,7 +739,7 @@ class WEEL
|
|
|
761
739
|
loop_guard += 1
|
|
762
740
|
__weel_protect_yield(&block)
|
|
763
741
|
sleep 1 if @__weel_connectionwrapper::loop_guard(@__weel_connectionwrapper_args,loop_id,loop_guard)
|
|
764
|
-
end while __weel_eval_condition(eid, condition[0],args) && self.__weel_state != :stopping && self.__weel_state != :stopped && self.__weel_state != :finishing && !Thread.current[:nolongernecessary]
|
|
742
|
+
end while __weel_eval_condition(eid, condition[0],args,{:type => 'loop', :variant => 'tail', :count => loop_guard}) && self.__weel_state != :stopping && self.__weel_state != :stopped && self.__weel_state != :finishing && !Thread.current[:nolongernecessary]
|
|
765
743
|
end
|
|
766
744
|
end
|
|
767
745
|
end # }}}
|
|
@@ -822,10 +800,10 @@ class WEEL
|
|
|
822
800
|
end
|
|
823
801
|
end #}}}
|
|
824
802
|
|
|
825
|
-
def __weel_eval_condition(eid,condition,args={}) #{{{
|
|
803
|
+
def __weel_eval_condition(eid,condition,args={},props={}) #{{{
|
|
826
804
|
begin
|
|
827
805
|
connectionwrapper = @__weel_connectionwrapper.new @__weel_connectionwrapper_args
|
|
828
|
-
connectionwrapper.test_condition(eid,@__weel_data,@__weel_endpoints,Thread.current[:local],connectionwrapper.additional,condition,args)
|
|
806
|
+
connectionwrapper.test_condition(eid,@__weel_data,@__weel_endpoints,Thread.current[:local],connectionwrapper.additional,condition,args,props)
|
|
829
807
|
rescue NameError => err # don't look into it, or it will explode
|
|
830
808
|
self.__weel_state = :stopping
|
|
831
809
|
@__weel_connectionwrapper::inform_syntax_error(@__weel_connectionwrapper_args,Exception.new("eval_condition: `#{err.name}` is not a thing that can be used. Maybe it is meant to be a string and you forgot quotes?"),nil)
|
data/weel.gemspec
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Gem::Specification.new do |s|
|
|
2
2
|
s.name = "weel"
|
|
3
|
-
s.version = "1.99.
|
|
3
|
+
s.version = "1.99.159"
|
|
4
4
|
s.platform = Gem::Platform::RUBY
|
|
5
5
|
s.license = "LGPL-3.0-or-later"
|
|
6
6
|
s.summary = "Workflow Execution Engine Library (WEEL)"
|
|
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
|
|
|
9
9
|
|
|
10
10
|
s.required_ruby_version = '>=2.5.0'
|
|
11
11
|
|
|
12
|
-
s.files = Dir['{example/**/*,lib/weel.rb}'] + %w(
|
|
12
|
+
s.files = Dir['{example/**/*,lib/weel.rb}'] + %w(LICENSE Changelog FEATURES INSTALL Rakefile weel.gemspec README.md AUTHORS)
|
|
13
13
|
s.require_path = 'lib'
|
|
14
14
|
s.extra_rdoc_files = ['README.md']
|
|
15
15
|
s.test_files = Dir['{test/*,test/*/tc_*.rb}']
|
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.159
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Juergen eTM Mangler
|
|
@@ -60,10 +60,10 @@ extra_rdoc_files:
|
|
|
60
60
|
- README.md
|
|
61
61
|
files:
|
|
62
62
|
- AUTHORS
|
|
63
|
-
- COPYING
|
|
64
63
|
- Changelog
|
|
65
64
|
- FEATURES
|
|
66
65
|
- INSTALL
|
|
66
|
+
- LICENSE
|
|
67
67
|
- README.md
|
|
68
68
|
- Rakefile
|
|
69
69
|
- example/SimpleHandlerWrapper.rb
|
/data/{COPYING → LICENSE}
RENAMED
|
File without changes
|