pione 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -2
- data/History.txt +6 -0
- data/Rakefile +1 -1
- data/bin/pione-broker +1 -1
- data/bin/pione-clean +1 -1
- data/bin/pione-client +1 -1
- data/bin/pione-log +1 -1
- data/bin/pione-relay +1 -1
- data/bin/pione-relay-account-db +1 -1
- data/bin/pione-relay-client-db +1 -1
- data/bin/pione-syntax-checker +1 -1
- data/bin/pione-task-worker +1 -1
- data/bin/pione-tuple-space-provider +1 -1
- data/bin/pione-tuple-space-receiver +1 -1
- data/bin/pione-tuple-space-viewer +1 -1
- data/bin/pione-val +1 -1
- data/example/CTFCorrection/CTFCorrection.pione +78 -0
- data/example/CTFCorrection/package.yml +1 -0
- data/example/HelloWorld/scenario/output/message.txt +1 -0
- data/example/LoopByTouch/LoopByTouch.pione +10 -18
- data/example/LoopByTouch/PairLoop.pione +18 -0
- data/example/LoopByTouch/SingleLoop.pione +5 -0
- data/example/LoopByTouch/TripletLoop.pione +24 -0
- data/example/MakePair/scenario/output/comb-1-2.pair +0 -0
- data/example/MakePair/scenario/output/comb-1-3.pair +0 -0
- data/example/MakePair/scenario/output/comb-1-4.pair +0 -0
- data/example/MakePair/scenario/output/comb-1-5.pair +0 -0
- data/example/MakePair/scenario/output/comb-2-3.pair +0 -0
- data/example/MakePair/scenario/output/comb-2-4.pair +0 -0
- data/example/MakePair/scenario/output/comb-2-5.pair +0 -0
- data/example/MakePair/scenario/output/comb-3-4.pair +0 -0
- data/example/MakePair/scenario/output/comb-3-5.pair +0 -0
- data/example/MakePair/scenario/output/comb-4-5.pair +0 -0
- data/example/MakePair/scenario/output/perm-1-2.pair +0 -0
- data/example/MakePair/scenario/output/perm-1-3.pair +0 -0
- data/example/MakePair/scenario/output/perm-1-4.pair +0 -0
- data/example/MakePair/scenario/output/perm-1-5.pair +0 -0
- data/example/MakePair/scenario/output/perm-2-1.pair +0 -0
- data/example/MakePair/scenario/output/perm-2-3.pair +0 -0
- data/example/MakePair/scenario/output/perm-2-4.pair +0 -0
- data/example/MakePair/scenario/output/perm-2-5.pair +0 -0
- data/example/MakePair/scenario/output/perm-3-1.pair +0 -0
- data/example/MakePair/scenario/output/perm-3-2.pair +0 -0
- data/example/MakePair/scenario/output/perm-3-4.pair +0 -0
- data/example/MakePair/scenario/output/perm-3-5.pair +0 -0
- data/example/MakePair/scenario/output/perm-4-1.pair +0 -0
- data/example/MakePair/scenario/output/perm-4-2.pair +0 -0
- data/example/MakePair/scenario/output/perm-4-3.pair +0 -0
- data/example/MakePair/scenario/output/perm-4-5.pair +0 -0
- data/example/MakePair/scenario/output/perm-5-1.pair +0 -0
- data/example/MakePair/scenario/output/perm-5-2.pair +0 -0
- data/example/MakePair/scenario/output/perm-5-3.pair +0 -0
- data/example/MakePair/scenario/output/perm-5-4.pair +0 -0
- data/example/MakePair/scenario/output/succ-1-2.pair +0 -0
- data/example/MakePair/scenario/output/succ-2-3.pair +0 -0
- data/example/MakePair/scenario/output/succ-3-4.pair +0 -0
- data/example/MakePair/scenario/output/succ-4-5.pair +0 -0
- data/example/SyntaxError/output_line_error.pione +6 -0
- data/example/WorkflowPatterns/38_GeneralSynchronizingMerge/GeneralSynchronizingMerge.pione +94 -0
- data/lib/pione.rb +1 -10
- data/lib/pione/agent/process-manager.rb +6 -5
- data/lib/pione/agent/rule-provider.rb +7 -9
- data/lib/pione/agent/task-worker.rb +1 -1
- data/lib/pione/command.rb +1 -0
- data/lib/pione/command/basic-command.rb +12 -77
- data/lib/pione/command/child-process.rb +19 -13
- data/lib/pione/command/daemon-process.rb +0 -9
- data/lib/pione/command/front-owner-command.rb +0 -6
- data/lib/pione/command/option.rb +243 -0
- data/lib/pione/command/pione-broker.rb +10 -5
- data/lib/pione/command/pione-clean.rb +4 -0
- data/lib/pione/command/pione-client.rb +257 -210
- data/lib/pione/command/pione-log.rb +38 -19
- data/lib/pione/command/pione-relay-account-db.rb +42 -17
- data/lib/pione/command/pione-relay-client-db.rb +35 -14
- data/lib/pione/command/pione-relay.rb +16 -8
- data/lib/pione/command/pione-syntax-checker.rb +33 -13
- data/lib/pione/command/pione-task-worker.rb +26 -23
- data/lib/pione/command/pione-tuple-space-provider.rb +8 -17
- data/lib/pione/command/pione-tuple-space-receiver.rb +13 -3
- data/lib/pione/command/pione-tuple-space-viewer.rb +42 -23
- data/lib/pione/command/pione-val.rb +15 -7
- data/lib/pione/component/document.rb +49 -70
- data/lib/pione/component/package.rb +125 -83
- data/lib/pione/location/basic-location.rb +1 -0
- data/lib/pione/model/assignment.rb +11 -0
- data/lib/pione/model/parameters.rb +10 -0
- data/lib/pione/model/variable.rb +14 -0
- data/lib/pione/parser/common-parser.rb +4 -0
- data/lib/pione/parser/document-parser.rb +4 -3
- data/lib/pione/parser/rule-definition-parser.rb +2 -1
- data/lib/pione/patch/rinda-patch.rb +1 -1
- data/lib/pione/rule-handler/action-handler.rb +6 -1
- data/lib/pione/rule-handler/basic-handler.rb +0 -6
- data/lib/pione/rule-handler/flow-handler.rb +14 -9
- data/lib/pione/system/global.rb +3 -0
- data/lib/pione/system/package-cache.rb +18 -0
- data/lib/pione/transformer/document-transformer.rb +26 -3
- data/lib/pione/transformer/rule-definition-transformer.rb +10 -2
- data/lib/pione/tuple-space/presence-notifier.rb +4 -3
- data/lib/pione/uri-scheme.rb +11 -0
- data/lib/pione/uri-scheme/git-scheme.rb +12 -0
- data/lib/pione/util.rb +2 -0
- data/lib/pione/util/package-parameters-list.rb +32 -0
- data/lib/pione/util/process-info.rb +21 -0
- data/lib/pione/version.rb +1 -1
- data/pione.gemspec +1 -1
- data/test/agent/spec_rule-provider.rb +57 -44
- data/test/command/command-behavior.rb +15 -0
- data/test/command/spec_pione-client.rb +56 -0
- data/test/command/spec_pione-val.domain.dump +0 -0
- data/test/command/spec_pione-val.rb +22 -0
- data/test/component/spec_document.pione +51 -0
- data/test/component/spec_document.rb +41 -70
- data/test/component/spec_package.rb +18 -3
- data/test/parser/spec_document-parser.yml +15 -0
- data/test/parser/spec_rule-definition-parser.yml +7 -2
- data/test/rule-handler/spec_action-handler.rb +6 -6
- data/test/rule-handler/spec_flow-handler.pione +25 -0
- data/test/rule-handler/spec_flow-handler.rb +35 -95
- data/test/rule-handler/spec_update-criteria.rb +2 -2
- data/test/test-util.rb +68 -4
- data/test/transformer/spec_block-transformer.rb +1 -1
- data/test/transformer/spec_document-transformer.rb +50 -0
- data/test/transformer/spec_expr-transformer.rb +1 -1
- data/test/transformer/spec_flow-element-transformer.rb +13 -13
- data/test/transformer/spec_literal-transformer.rb +1 -1
- data/test/transformer/spec_rule-definition-transformer.rb +31 -19
- data/test/uri-scheme/spec_git-scheme.rb +20 -0
- data/test/util/spec_id.rb +6 -6
- data/test/util/spec_package-parameters-list.rb +59 -0
- data/test/util/spec_package-parameters-list_1.pione +17 -0
- data/test/util/spec_package-parameters-list_2.pione +13 -0
- data/test/util/spec_package-parameters-list_3.pione +12 -0
- data/test/util/spec_package-parameters-list_4.pione +6 -0
- data/test/util/spec_process-info.rb +56 -0
- metadata +79 -16
- data/lib/pione/option.rb +0 -13
- data/lib/pione/option/child-process-option.rb +0 -19
- data/lib/pione/option/common-option.rb +0 -31
- data/lib/pione/option/option-interface.rb +0 -73
- data/lib/pione/option/presence-notifier-option.rb +0 -16
- data/lib/pione/option/task-worker-owner-option.rb +0 -24
- data/lib/pione/option/tuple-space-provider-option.rb +0 -28
- data/lib/pione/option/tuple-space-provider-owner-option.rb +0 -18
- data/lib/pione/option/tuple-space-receiver-option.rb +0 -8
data/lib/pione/option.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
module Pione
|
2
|
-
# Option is a name space for command option set modules.
|
3
|
-
module Option; end
|
4
|
-
end
|
5
|
-
|
6
|
-
require 'pione/option/option-interface'
|
7
|
-
require 'pione/option/common-option'
|
8
|
-
require 'pione/option/child-process-option'
|
9
|
-
require 'pione/option/presence-notifier-option'
|
10
|
-
require 'pione/option/tuple-space-provider-option'
|
11
|
-
require 'pione/option/tuple-space-provider-owner-option'
|
12
|
-
require 'pione/option/tuple-space-receiver-option'
|
13
|
-
require 'pione/option/task-worker-owner-option'
|
@@ -1,19 +0,0 @@
|
|
1
|
-
module Pione
|
2
|
-
module Option
|
3
|
-
# ChildProcessOption provides options for child process like
|
4
|
-
# pione-task-worker or pione-tuple-space-receiver.
|
5
|
-
module ChildProcessOption
|
6
|
-
extend OptionInterface
|
7
|
-
|
8
|
-
# --parent-front
|
9
|
-
option('--parent-front=URI', 'set parent front URI') do |data, uri|
|
10
|
-
data[:parent_front] = DRbObject.new_with_uri(uri)
|
11
|
-
end
|
12
|
-
|
13
|
-
# --no-parent
|
14
|
-
option('--no-parent', 'turn on no parent mode') do
|
15
|
-
data[:no_parent_mode] = true
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
module Pione
|
2
|
-
module Option
|
3
|
-
# CommonOption provides common options for pione commands.
|
4
|
-
module CommonOption
|
5
|
-
extend OptionInterface
|
6
|
-
|
7
|
-
# --debug
|
8
|
-
option('-d', '--debug', "turn on debug mode") do |data, name|
|
9
|
-
Pione.debug_mode = true
|
10
|
-
end
|
11
|
-
|
12
|
-
# --show-communication
|
13
|
-
option('--show-communication', "show object communication") do |data, show|
|
14
|
-
Global.show_communication = true
|
15
|
-
end
|
16
|
-
|
17
|
-
# --color
|
18
|
-
option('--[no-]color', 'turn on/off color mode') do |data, str|
|
19
|
-
bool = nil
|
20
|
-
bool = true if str == "true"
|
21
|
-
bool = false if str == "false"
|
22
|
-
if bool.nil?
|
23
|
-
puts "invalid color option: %s" % bool
|
24
|
-
exit!
|
25
|
-
end
|
26
|
-
# disable rainbow
|
27
|
-
Sickill::Rainbow.enabled = bool
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,73 +0,0 @@
|
|
1
|
-
module Pione
|
2
|
-
module Option
|
3
|
-
# OptionInterface provides basic methods for option modules. All option
|
4
|
-
# modules should be extended by this.
|
5
|
-
module OptionInterface
|
6
|
-
# Make an array of definitions.
|
7
|
-
#
|
8
|
-
# @api private
|
9
|
-
def self.extended(obj)
|
10
|
-
obj.instance_variable_set(:@definitions, [])
|
11
|
-
obj.instance_variable_set(:@default_table, {})
|
12
|
-
obj.instance_variable_set(:@validators, [])
|
13
|
-
end
|
14
|
-
|
15
|
-
attr_reader :definitions
|
16
|
-
attr_reader :default_table
|
17
|
-
attr_reader :validators
|
18
|
-
|
19
|
-
# Define default value of the option data set.
|
20
|
-
#
|
21
|
-
# @param name [Symbol]
|
22
|
-
# option data key
|
23
|
-
# @param value [Object]
|
24
|
-
# option data value
|
25
|
-
# @return [void]
|
26
|
-
def default(name, value)
|
27
|
-
@default_table[name] = value
|
28
|
-
end
|
29
|
-
|
30
|
-
# Define a new option for the command.
|
31
|
-
#
|
32
|
-
# @param args [Array]
|
33
|
-
# OptionParser arguments
|
34
|
-
# @param b [Proc]
|
35
|
-
# option action
|
36
|
-
# @return [void]
|
37
|
-
def option(*args, &b)
|
38
|
-
@definitions << [args, b]
|
39
|
-
end
|
40
|
-
|
41
|
-
# Remove the option.
|
42
|
-
#
|
43
|
-
# @param b [Proc]
|
44
|
-
# remove options that match proc's result
|
45
|
-
# @return [void]
|
46
|
-
def remove_option(&b)
|
47
|
-
@definitions.select! do |definition|
|
48
|
-
not(b.call(definition))
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
# Install the option module.
|
53
|
-
#
|
54
|
-
# @param mod [Module]
|
55
|
-
# PIONE's option set modules
|
56
|
-
# @return [void]
|
57
|
-
def use(mod)
|
58
|
-
@definitions += mod.definitions
|
59
|
-
@default_table.merge!(mod.default_table)
|
60
|
-
@validators += mod.validators
|
61
|
-
end
|
62
|
-
|
63
|
-
# Define validation of the option set.
|
64
|
-
#
|
65
|
-
# @param b [Proc]
|
66
|
-
# validation content
|
67
|
-
# @return [void]
|
68
|
-
def validate(&b)
|
69
|
-
@validators << b
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
module Pione
|
2
|
-
module Option
|
3
|
-
# PresenceNotifierOption provides options for presence notifiers.
|
4
|
-
module PresenceNotifierOption
|
5
|
-
extend OptionInterface
|
6
|
-
|
7
|
-
# --show-presence-notifier
|
8
|
-
option(
|
9
|
-
"--show-presence-notifier",
|
10
|
-
"show presence notifier informations"
|
11
|
-
) do |data|
|
12
|
-
Global.show_presence_notifier = true
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
module Pione
|
2
|
-
module Option
|
3
|
-
# TaskWorkerOwnerOption provides options for commands that make task
|
4
|
-
# workers. Options are:
|
5
|
-
#
|
6
|
-
# - task-worker
|
7
|
-
# - features
|
8
|
-
module TaskWorkerOwnerOption
|
9
|
-
extend OptionInterface
|
10
|
-
|
11
|
-
default :task_worker, Agent::TaskWorker.default_number
|
12
|
-
|
13
|
-
# --task-worker
|
14
|
-
option('-t N', '--task-worker=N', 'set task worker number that this process creates') do |data, n|
|
15
|
-
data[:task_worker] = n.to_i
|
16
|
-
end
|
17
|
-
|
18
|
-
# --features
|
19
|
-
option('--features=FEATURES', 'set features') do |data, features|
|
20
|
-
data[:features] = features
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
module Pione
|
2
|
-
module Option
|
3
|
-
# TupleSpaceProviderOption provides options for commands that make tuple
|
4
|
-
# space provider agent.
|
5
|
-
module TupleSpaceProviderOption
|
6
|
-
extend OptionInterface
|
7
|
-
use PresenceNotifierOption
|
8
|
-
|
9
|
-
# --presence-notification-address
|
10
|
-
option(
|
11
|
-
"--presence-notification-address=255.255.255.255:%s" % Global.presence_port,
|
12
|
-
"set the address for sending presence notifier"
|
13
|
-
) do |data, address|
|
14
|
-
# clear addresses at first time
|
15
|
-
unless @__option_notifier_address__
|
16
|
-
@__option_notifier_address__ = true
|
17
|
-
Global.presence_notification_addresses = []
|
18
|
-
end
|
19
|
-
# add the address
|
20
|
-
address = address =~ /^broadcast/ ? address : "broadcast://%s" % address
|
21
|
-
uri = URI.parse(address)
|
22
|
-
uri.host = "255.255.255.255" if uri.host.nil?
|
23
|
-
uri.port = Global.presence_port if uri.port.nil?
|
24
|
-
Global.presence_notification_addresses << uri
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
module Pione
|
2
|
-
module Option
|
3
|
-
# TupleSpaceProviderOption provides options for commands that make tuple
|
4
|
-
# space provider agent.
|
5
|
-
module TupleSpaceProviderOwnerOption
|
6
|
-
extend OptionInterface
|
7
|
-
use TupleSpaceProviderOption
|
8
|
-
|
9
|
-
# --without-tuple-space-provider
|
10
|
-
option(
|
11
|
-
'--without-tuple-space-provider',
|
12
|
-
'process without tuple space provider'
|
13
|
-
) do |data|
|
14
|
-
data[:without_tuple_space_provider] = true
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|