pione 0.3.2 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/.s3cfg +42 -0
- data/.travis.yml +18 -4
- data/.yardopts +1 -0
- data/Gemfile +3 -0
- data/History.txt +14 -0
- data/Procfile +7 -0
- data/Rakefile +25 -0
- data/bin/pione-interactive +6 -0
- data/bin/{pione-compiler → pione-notification-listener} +1 -1
- data/bin/{pione-broker → pione-task-worker-broker} +1 -1
- data/doc/man/pione-list-param.md +36 -0
- data/example/ActionError/ActionError.pione +9 -0
- data/example/ActionError/pione-package.json +15 -0
- data/example/CountChar/CountChar.pione +1 -1
- data/example/ScoreAggregation/ScoreAggregation.pione +1 -1
- data/example/Touch/pione-package.json +15 -0
- data/lib/pione.rb +12 -0
- data/lib/pione/agent.rb +3 -3
- data/lib/pione/agent/basic-agent.rb +10 -4
- data/lib/pione/agent/input-generator.rb +3 -3
- data/lib/pione/agent/{process-manager.rb → job-manager.rb} +10 -7
- data/lib/pione/agent/job-terminator.rb +2 -2
- data/lib/pione/agent/logger.rb +3 -3
- data/lib/pione/agent/messenger.rb +20 -9
- data/lib/pione/agent/notification-listener.rb +88 -0
- data/lib/pione/agent/task-worker-broker.rb +84 -0
- data/lib/pione/agent/task-worker.rb +3 -2
- data/lib/pione/agent/tuple-space-client.rb +1 -0
- data/lib/pione/agent/tuple-space-provider.rb +17 -35
- data/lib/pione/command.rb +33 -15
- data/lib/pione/command/action.rb +105 -0
- data/lib/pione/command/basic-command.rb +34 -376
- data/lib/pione/command/command-exception.rb +12 -11
- data/lib/pione/command/common.rb +198 -0
- data/lib/pione/command/option.rb +159 -204
- data/lib/pione/command/pione-action-exec.rb +85 -0
- data/lib/pione/command/pione-action-list.rb +43 -19
- data/lib/pione/command/pione-action-print.rb +79 -0
- data/lib/pione/command/pione-action.rb +8 -67
- data/lib/pione/command/pione-clean.rb +88 -68
- data/lib/pione/command/pione-client.rb +475 -332
- data/lib/pione/command/pione-command.rb +14 -31
- data/lib/pione/command/pione-compile.rb +90 -0
- data/lib/pione/command/pione-config-get.rb +53 -0
- data/lib/pione/command/pione-config-list.rb +64 -0
- data/lib/pione/command/pione-config-set.rb +59 -0
- data/lib/pione/command/pione-config-unset.rb +50 -0
- data/lib/pione/command/pione-config.rb +61 -0
- data/lib/pione/command/pione-diagnosis-notification.rb +235 -0
- data/lib/pione/command/pione-diagnosis.rb +21 -0
- data/lib/pione/command/pione-interactive.rb +188 -0
- data/lib/pione/command/pione-lang-check-syntax.rb +163 -0
- data/lib/pione/command/pione-lang-interactive.rb +146 -0
- data/lib/pione/command/pione-lang.rb +22 -0
- data/lib/pione/command/pione-log-format.rb +163 -0
- data/lib/pione/command/pione-log-list-id.rb +48 -0
- data/lib/pione/command/pione-log.rb +19 -101
- data/lib/pione/command/pione-notification-listener.rb +95 -0
- data/lib/pione/command/pione-package-add.rb +137 -0
- data/lib/pione/command/pione-package-build.rb +122 -0
- data/lib/pione/command/pione-package-show.rb +96 -0
- data/lib/pione/command/pione-package-update.rb +59 -0
- data/lib/pione/command/pione-package.rb +11 -139
- data/lib/pione/command/pione-task-worker-broker.rb +88 -0
- data/lib/pione/command/pione-task-worker.rb +148 -98
- data/lib/pione/command/pione-tuple-space-provider.rb +62 -54
- data/lib/pione/command/pione-tuple-space-viewer.rb +105 -83
- data/lib/pione/command/pione-val.rb +39 -39
- data/lib/pione/command/spawner.rb +34 -27
- data/lib/pione/front.rb +4 -2
- data/lib/pione/front/basic-front.rb +86 -23
- data/lib/pione/front/client-front.rb +2 -2
- data/lib/pione/front/diagnosis-notification-front.rb +40 -0
- data/lib/pione/front/front-exception.rb +7 -1
- data/lib/pione/front/notification-listener-front.rb +36 -0
- data/lib/pione/front/notification-recipient-interface.rb +19 -0
- data/lib/pione/front/relay-front.rb +4 -4
- data/lib/pione/front/task-worker-broker-front.rb +19 -0
- data/lib/pione/front/task-worker-front.rb +2 -2
- data/lib/pione/front/tuple-space-provider-front.rb +3 -2
- data/lib/pione/global.rb +3 -1
- data/lib/pione/global/client-variable.rb +1 -1
- data/lib/pione/global/config.rb +63 -7
- data/lib/pione/global/diagnosis-variable.rb +26 -0
- data/lib/pione/global/item.rb +28 -5
- data/lib/pione/global/log-variable.rb +6 -5
- data/lib/pione/global/network-variable.rb +75 -4
- data/lib/pione/global/path-variable.rb +1 -1
- data/lib/pione/global/system-variable.rb +12 -12
- data/lib/pione/global/task-worker-broker-variable.rb +43 -0
- data/lib/pione/global/tuple-space-notifier-variable.rb +3 -55
- data/lib/pione/lang/boolean.rb +4 -0
- data/lib/pione/lang/data-expr.rb +1 -1
- data/lib/pione/lang/integer.rb +1 -1
- data/lib/pione/lang/string.rb +4 -0
- data/lib/pione/lang/type.rb +1 -1
- data/lib/pione/location.rb +1 -0
- data/lib/pione/location/data-location.rb +41 -13
- data/lib/pione/location/dropbox-location.rb +175 -56
- data/lib/pione/location/ftp-location.rb +4 -1
- data/lib/pione/location/http-location.rb +5 -3
- data/lib/pione/location/https-location.rb +4 -2
- data/lib/pione/location/local-location.rb +6 -3
- data/lib/pione/location/location-exception.rb +12 -0
- data/lib/pione/location/notification-scheme.rb +46 -0
- data/lib/pione/log.rb +8 -7
- data/lib/pione/log/debug.rb +9 -9
- data/lib/pione/log/domain-log.rb +6 -1
- data/lib/pione/log/message-log-receiver.rb +32 -0
- data/lib/pione/log/system-log.rb +62 -141
- data/lib/pione/model.rb +7 -0
- data/lib/pione/model/notification-listener-model.rb +29 -0
- data/lib/pione/model/task-worker-broker-model.rb +129 -0
- data/lib/pione/notification.rb +13 -0
- data/lib/pione/notification/address.rb +104 -0
- data/lib/pione/notification/exception.rb +10 -0
- data/lib/pione/notification/message.rb +109 -0
- data/lib/pione/notification/receiver.rb +90 -0
- data/lib/pione/notification/recipient.rb +68 -0
- data/lib/pione/notification/task-worker-broker-recipient.rb +85 -0
- data/lib/pione/notification/transmitter.rb +84 -0
- data/lib/pione/pnml.rb +35 -0
- data/lib/pione/pnml/annotation-extractor.rb +47 -0
- data/lib/pione/pnml/compiler.rb +176 -0
- data/lib/pione/pnml/input-merge-complement.rb +78 -0
- data/lib/pione/pnml/input-parallelization-complement.rb +75 -0
- data/lib/pione/pnml/input-reduction.rb +80 -0
- data/lib/pione/pnml/invalid-arc-elimination.rb +41 -0
- data/lib/pione/pnml/io-expansion.rb +88 -0
- data/lib/pione/pnml/isolated-element-elimination.rb +32 -0
- data/lib/pione/pnml/net-rewriter.rb +44 -0
- data/lib/pione/pnml/output-decomposition-complement.rb +77 -0
- data/lib/pione/pnml/output-reduction.rb +86 -0
- data/lib/pione/pnml/output-synchronization-complement.rb +77 -0
- data/lib/pione/pnml/pione-model.rb +417 -0
- data/lib/pione/pnml/pnml-exception.rb +23 -0
- data/lib/pione/pnml/pnml-model.rb +368 -0
- data/lib/pione/pnml/reader.rb +51 -0
- data/lib/pione/rule-engine/action-handler.rb +8 -6
- data/lib/pione/rule-engine/basic-handler.rb +5 -5
- data/lib/pione/rule-engine/engine-exception.rb +7 -6
- data/lib/pione/rule-engine/flow-handler.rb +27 -18
- data/lib/pione/system.rb +3 -1
- data/lib/pione/system/domain-dump.rb +34 -0
- data/lib/pione/system/file-cache.rb +92 -13
- data/lib/pione/system/init.rb +3 -0
- data/lib/pione/system/normalizer.rb +40 -0
- data/lib/pione/system/status.rb +5 -5
- data/lib/pione/system/system-exception.rb +14 -1
- data/lib/pione/task-worker-broker.rb +7 -0
- data/lib/pione/task-worker-broker/basic-provider.rb +20 -0
- data/lib/pione/task-worker-broker/easy-provider.rb +65 -0
- data/lib/pione/test-helper.rb +27 -0
- data/lib/pione/test-helper/command-helper.rb +9 -101
- data/lib/pione/tuple-space/basic-tuple.rb +1 -1
- data/lib/pione/tuple-space/tuple-definition.yml +4 -6
- data/lib/pione/tuple-space/tuple-space-interface.rb +3 -45
- data/lib/pione/tuple-space/tuple-space-server.rb +45 -0
- data/lib/pione/util.rb +1 -2
- data/lib/pione/util/boolean-value.rb +62 -0
- data/lib/pione/util/completion.rb +111 -0
- data/lib/pione/util/evaluatable.rb +13 -27
- data/lib/pione/util/package-parameters-list.rb +15 -27
- data/lib/pione/util/zip.rb +8 -3
- data/lib/pione/version.rb +1 -1
- data/lib/rootage.rb +20 -0
- data/lib/rootage/action.rb +114 -0
- data/lib/rootage/argument.rb +46 -0
- data/lib/rootage/command.rb +218 -0
- data/lib/rootage/core.rb +532 -0
- data/lib/rootage/exception.rb +107 -0
- data/lib/rootage/help.rb +148 -0
- data/lib/rootage/help.txt.erb +31 -0
- data/lib/rootage/log.rb +226 -0
- data/lib/rootage/normalizer.rb +184 -0
- data/lib/rootage/option.rb +152 -0
- data/lib/rootage/scenario-test-result.erb +39 -0
- data/lib/rootage/scenario.rb +362 -0
- data/lib/rootage/test-helper.rb +115 -0
- data/man/pione-list-param.1 +44 -0
- data/misc/clock.rb +9 -0
- data/misc/machine-info.sh +21 -0
- data/misc/pione-completion.bash +238 -0
- data/misc/pione-completion.erb +53 -0
- data/misc/pione-completion.zsh +238 -0
- data/misc/pione.god +22 -0
- data/misc/ui.xml +23 -0
- data/pione.gemspec +3 -1
- data/test/agent/spec_basic-agent.rb +1 -1
- data/test/agent/spec_input-generator.rb +2 -2
- data/test/agent/spec_messenger.rb +6 -9
- data/test/agent/spec_notification-listener.rb +80 -0
- data/test/agent/{spec_broker.rb → spec_task-worker-broker.rb} +13 -10
- data/test/agent/spec_tuple-space-provider.rb +10 -6
- data/test/command/command-behavior.rb +3 -11
- data/test/command/data/pione-list-param/AdvancedParameters.pione +12 -0
- data/test/command/data/pione-list-param/BasicParameters.pione +12 -0
- data/test/command/spec_pione-action-exec.rb +16 -0
- data/test/command/spec_pione-action-list.rb +15 -10
- data/test/command/spec_pione-action-print.rb +14 -0
- data/test/command/spec_pione-action.rb +6 -19
- data/test/command/spec_pione-clean.rb +29 -46
- data/test/command/spec_pione-client.rb +29 -36
- data/test/command/spec_pione-command.rb +6 -6
- data/test/command/{spec_pione-compiler.rb → spec_pione-compile.rb} +11 -13
- data/test/command/spec_pione-config-get.rb +47 -0
- data/test/command/spec_pione-config-list.rb +42 -0
- data/test/command/spec_pione-config-set.rb +38 -0
- data/test/command/spec_pione-config-unset.rb +44 -0
- data/test/command/spec_pione-config.rb +11 -0
- data/test/command/spec_pione-diagnosis-notification.rb +23 -0
- data/test/command/spec_pione-diagnosis.rb +11 -0
- data/test/command/spec_pione-lang-check-syntax.rb +12 -0
- data/test/command/spec_pione-lang.rb +11 -0
- data/test/command/spec_pione-log-format.rb +29 -0
- data/test/command/spec_pione-log-list-id.rb +17 -0
- data/test/command/spec_pione-log.rb +6 -20
- data/test/command/spec_pione-package-add.rb +55 -0
- data/test/command/spec_pione-package-build.rb +57 -0
- data/test/command/spec_pione-package-show.rb +72 -0
- data/test/command/{spec_pione-update-package-info.rb → spec_pione-package-update.rb} +12 -13
- data/test/command/spec_pione-package.rb +4 -104
- data/test/command/spec_pione-val.rb +10 -7
- data/test/global/spec_config.rb +50 -0
- data/test/global/spec_item.rb +1 -1
- data/test/literate-action/data/HelloWorld.md +1 -1
- data/test/location/location-behavior.rb +1 -1
- data/test/location/spec_dropbox-location.rb +39 -0
- data/test/location/spec_notification-scheme.rb +37 -0
- data/test/log/spec_debug.rb +5 -4
- data/test/log/spec_message-log-receiver.rb +13 -0
- data/test/log/spec_message-log.rb +6 -9
- data/test/log/spec_system-log.rb +5 -3
- data/test/notification/spec_address.rb +229 -0
- data/test/notification/spec_message.rb +30 -0
- data/test/notification/spec_receiver.rb +36 -0
- data/test/notification/spec_transmitter.rb +37 -0
- data/test/pnml/data/ConditionalBranchIf.pnml +270 -0
- data/test/pnml/data/ConditionalBranchIfElse.pnml +309 -0
- data/test/pnml/data/IOExpansionComplex.pnml +363 -0
- data/test/pnml/data/IOExpansionSimple.pnml +140 -0
- data/test/pnml/data/InputMergeComplementComplex.pnml +381 -0
- data/test/pnml/data/InputMergeComplementSimple.pnml +248 -0
- data/test/pnml/data/InputParallelizationComplementComplex.pnml +433 -0
- data/test/pnml/data/InputParallelizationComplementSimple.pnml +288 -0
- data/test/pnml/data/InputReductionComplex.pnml +192 -0
- data/test/pnml/data/InputReductionLong.pnml +344 -0
- data/test/pnml/data/InputReductionSimple.pnml +140 -0
- data/test/pnml/data/IsolatedElementElimination.pnml +171 -0
- data/test/pnml/data/OutputDecompositionComplementComplex.pnml +381 -0
- data/test/pnml/data/OutputDecompositionComplementSimple.pnml +242 -0
- data/test/pnml/data/OutputReductionComplex.pnml +186 -0
- data/test/pnml/data/OutputReductionLong.pnml +344 -0
- data/test/pnml/data/OutputReductionSimple.pnml +140 -0
- data/test/pnml/data/OutputSynchronizationComplementComplex.pnml +498 -0
- data/test/pnml/data/OutputSynchronizationComplementSimple.pnml +347 -0
- data/test/pnml/data/SampleNet.pnml +238 -0
- data/test/pnml/spec_input-merge-complement.rb +40 -0
- data/test/pnml/spec_input-parallelization-complement.rb +50 -0
- data/test/pnml/spec_input-reduction.rb +113 -0
- data/test/pnml/spec_invalid-arc-elimination.rb +33 -0
- data/test/pnml/spec_io-expansion.rb +126 -0
- data/test/pnml/spec_isolated-element-elimination.rb +25 -0
- data/test/pnml/spec_output-decomposition-complement.rb +40 -0
- data/test/pnml/spec_output-reduction.rb +114 -0
- data/test/pnml/spec_output-synchronization-complement.rb +62 -0
- data/test/pnml/spec_pione-element.rb +144 -0
- data/test/pnml/spec_pnml-element.rb +373 -0
- data/test/pnml/spec_reader.rb +16 -0
- data/test/rootage/spec_argument.rb +18 -0
- data/test/rootage/spec_command.rb +239 -0
- data/test/rootage/spec_core.rb +198 -0
- data/test/rootage/spec_scenario.rb +149 -0
- data/test/system/{spec_domain-info.rb → spec_domain-dump.rb} +6 -6
- data/test/system/spec_file-cache.rb +6 -9
- data/test/tuple-space/spec_finished-tuple.rb +1 -1
- data/test/util/{spec_package-parameters-list_1.pione → data/package-parameters-list/Param1.pione} +0 -0
- data/test/util/{spec_package-parameters-list_2.pione → data/package-parameters-list/Param2.pione} +0 -0
- data/test/util/{spec_package-parameters-list_3.pione → data/package-parameters-list/Param3.pione} +0 -0
- data/test/util/{spec_package-parameters-list_4.pione → data/package-parameters-list/Param4.pione} +0 -0
- data/test/util/spec_boolean-value.rb +32 -0
- data/test/util/spec_completion.rb +22 -0
- data/test/util/spec_package-parameters-list.rb +39 -52
- data/test/util/spec_zip.rb +28 -1
- metadata +288 -47
- data/bin/pione-tuple-space-receiver +0 -5
- data/lib/pione/agent/broker.rb +0 -304
- data/lib/pione/agent/tuple-space-receiver.rb +0 -137
- data/lib/pione/command/pione-broker.rb +0 -104
- data/lib/pione/command/pione-compiler.rb +0 -57
- data/lib/pione/command/pione-relay-account-db.rb +0 -141
- data/lib/pione/command/pione-relay-client-db.rb +0 -118
- data/lib/pione/command/pione-relay.rb +0 -59
- data/lib/pione/command/pione-syntax-checker.rb +0 -214
- data/lib/pione/command/pione-tuple-space-receiver.rb +0 -111
- data/lib/pione/command/pione-update-package-info.rb +0 -53
- data/lib/pione/front/broker-front.rb +0 -22
- data/lib/pione/front/tuple-space-receiver-front.rb +0 -11
- data/lib/pione/global/broker-variable.rb +0 -33
- data/lib/pione/system/domain-info.rb +0 -25
- data/lib/pione/util/pnml-compiler.rb +0 -168
- data/test/agent/spec_tuple-space-receiver.rb +0 -47
- data/test/util/spec_pnml-compiler.rb +0 -32
@@ -0,0 +1,238 @@
|
|
1
|
+
if type compdef 1>/dev/null 2>&1;
|
2
|
+
then
|
3
|
+
|
4
|
+
#
|
5
|
+
# `pione` command
|
6
|
+
#
|
7
|
+
|
8
|
+
# set completion function
|
9
|
+
compdef _pione pione
|
10
|
+
|
11
|
+
_pione() {
|
12
|
+
# setup subcommans list
|
13
|
+
local name2="${words[2]}"
|
14
|
+
local name3="${words[3]}"
|
15
|
+
|
16
|
+
case $name2 in
|
17
|
+
action)
|
18
|
+
case $name3 in
|
19
|
+
exec) _pione_action_exec_options;;
|
20
|
+
list) _pione_action_list_options;;
|
21
|
+
print) _pione_action_print_options;;
|
22
|
+
*) _pione_action_subcommands;;
|
23
|
+
esac;;
|
24
|
+
clean) _pione_clean_options;;
|
25
|
+
compile) _pione_compile_options;;
|
26
|
+
config)
|
27
|
+
case $name3 in
|
28
|
+
get) _pione_config_get_options;;
|
29
|
+
list) _pione_config_list_options;;
|
30
|
+
set) _pione_config_set_options;;
|
31
|
+
unset) _pione_config_unset_options;;
|
32
|
+
*) _pione_config_subcommands;;
|
33
|
+
esac;;
|
34
|
+
diagnosis)
|
35
|
+
case $name3 in
|
36
|
+
notification) _pione_diagnosis_notification_options;;
|
37
|
+
*) _pione_diagnosis_subcommands;;
|
38
|
+
esac;;
|
39
|
+
lang)
|
40
|
+
case $name3 in
|
41
|
+
check-syntax) _pione_lang_check-syntax_options;;
|
42
|
+
*) _pione_lang_subcommands;;
|
43
|
+
esac;;
|
44
|
+
log)
|
45
|
+
case $name3 in
|
46
|
+
format) _pione_log_format_options;;
|
47
|
+
list-id) _pione_log_list-id_options;;
|
48
|
+
*) _pione_log_subcommands;;
|
49
|
+
esac;;
|
50
|
+
package)
|
51
|
+
case $name3 in
|
52
|
+
add) _pione_package_add_options;;
|
53
|
+
build) _pione_package_build_options;;
|
54
|
+
show) _pione_package_show_options;;
|
55
|
+
update) _pione_package_update_options;;
|
56
|
+
*) _pione_package_subcommands;;
|
57
|
+
esac;;
|
58
|
+
*) _pione_subcommands;;
|
59
|
+
esac
|
60
|
+
}
|
61
|
+
|
62
|
+
_pione_subcommands() {
|
63
|
+
list=(action:"execute an action in literate action document" clean:"Remove PIONE's temporary files, cache, and etc" compile:"translate from PNML to PIONE document" config:"Configure PIONE global variables" diagnosis:"PIONE diagnosis tools" lang:"PIONE language utilities" log:"Log utilities" package:"PIONE package utility") _describe -t common-commands 'common commands' list;
|
64
|
+
}
|
65
|
+
|
66
|
+
_pione_action_subcommands() {
|
67
|
+
list=(exec:"Execute an action rule in literate action document" list:"List action names in document" print:"Print action contents") _describe -t common-commands 'common commands' list;
|
68
|
+
}
|
69
|
+
|
70
|
+
_pione_action_exec_options() {
|
71
|
+
_arguments -s -S "--color[Turn on/off color mode]" "--debug[Turn on debug mode about the type]" "--directory PATH[execute in the PATH]" "--domain-dump[Load the domain dump file]" '*:file:_files' && return 0;
|
72
|
+
}
|
73
|
+
|
74
|
+
_pione_action_list_options() {
|
75
|
+
_arguments -s -S "--color[Turn on/off color mode]" "--compact[one-line list]" '*:file:_files' && return 0;
|
76
|
+
}
|
77
|
+
|
78
|
+
_pione_action_print_options() {
|
79
|
+
_arguments -s -S "--color[Turn on/off color mode]" "--debug[Turn on debug mode about the type]" "--domain-dump[Import the domain dump file]" '*:file:_files' && return 0;
|
80
|
+
}
|
81
|
+
|
82
|
+
_pione_clean_options() {
|
83
|
+
_arguments -s -S "--debug[Turn on debug mode about the type]" "--older[remove file older than the date]" "--type NAME[remove only files of the type]" '*:file:_files' && return 0;
|
84
|
+
}
|
85
|
+
|
86
|
+
_pione_compile_options() {
|
87
|
+
_arguments -s -S "--debug[Turn on debug mode about the type]" "--editor[Set package editor]" "--flow-name[Set flow name]" "--package-name[Set package name]" "--tag[Set package tag]" '*:file:_files' && return 0;
|
88
|
+
}
|
89
|
+
|
90
|
+
_pione_config_subcommands() {
|
91
|
+
list=(get:"Get a value of PIONE global variable" list:"List PIONE global variables" set:"Set a value of PIONE global variable" unset:"Unset a value of PIONE global variable") _describe -t common-commands 'common commands' list;
|
92
|
+
}
|
93
|
+
|
94
|
+
_pione_config_get_options() {
|
95
|
+
_arguments -s -S "--debug[Turn on debug mode about the type]" "--file[path of config file]" '*:file:_files' && return 0;
|
96
|
+
}
|
97
|
+
|
98
|
+
_pione_config_list_options() {
|
99
|
+
_arguments -s -S "--debug[Turn on debug mode about the type]" "--file[path of config file]" '*:file:_files' && return 0;
|
100
|
+
}
|
101
|
+
|
102
|
+
_pione_config_set_options() {
|
103
|
+
_arguments -s -S "--debug[Turn on debug mode about the type]" "--file[path of config file]" '*:file:_files' && return 0;
|
104
|
+
}
|
105
|
+
|
106
|
+
_pione_config_unset_options() {
|
107
|
+
_arguments -s -S "--debug[Turn on debug mode about the type]" "--file[path of config file]" '*:file:_files' && return 0;
|
108
|
+
}
|
109
|
+
|
110
|
+
_pione_diagnosis_subcommands() {
|
111
|
+
list=(notification:"Diagnose notification settings") _describe -t common-commands 'common commands' list;
|
112
|
+
}
|
113
|
+
|
114
|
+
_pione_diagnosis_notification_options() {
|
115
|
+
_arguments -s -S "--color[Turn on/off color mode]" "--debug[Turn on debug mode about the type]" "--notification-receiver[Receiver address that notifications are received at]" "--notification-target[Target address that notifications are sent to]" "--timeout[timeout after N second]" "--type[transmitter, receiver, or both]" '*:file:_files' && return 0;
|
116
|
+
}
|
117
|
+
|
118
|
+
_pione_lang_subcommands() {
|
119
|
+
list=(check-syntax:"Interactive environment for PIONE language") _describe -t common-commands 'common commands' list;
|
120
|
+
}
|
121
|
+
|
122
|
+
_pione_lang_check-syntax_options() {
|
123
|
+
_arguments -s -S "--color[Turn on/off color mode]" "--expr[PIONE expression]" "--file[PIONE document that is checked]" "--model[show internal model]" "--parser[Parser name]" "--syntax[show syntax tree]" '*:file:_files' && return 0;
|
124
|
+
}
|
125
|
+
|
126
|
+
_pione_log_subcommands() {
|
127
|
+
list=(format:"Convert PIONE raw log into XES or other formats" list-id:"List log IDs") _describe -t common-commands 'common commands' list;
|
128
|
+
}
|
129
|
+
|
130
|
+
_pione_log_format_options() {
|
131
|
+
_arguments -s -S "--agent-type[Output only the agent type: "task_worker", "input_generator", ...]" "--color[Turn on/off color mode]" "--debug[Turn on debug mode about the type]" "--format[Set format type]" "--log-id[Target log ID]" "--trace-type[Output only the trace type: "agent", "rule", or "task"]" '*:file:_files' && return 0;
|
132
|
+
}
|
133
|
+
|
134
|
+
_pione_log_list-id_options() {
|
135
|
+
_arguments -s -S "--color[Turn on/off color mode]" "--debug[Turn on debug mode about the type]" '*:file:_files' && return 0;
|
136
|
+
}
|
137
|
+
|
138
|
+
_pione_package_subcommands() {
|
139
|
+
list=(add:"Add the package to package database" build:"Build PIONE archive package" show:"Show the package informations" update:"Update the package to package database") _describe -t common-commands 'common commands' list;
|
140
|
+
}
|
141
|
+
|
142
|
+
_pione_package_add_options() {
|
143
|
+
_arguments -s -S "--tag[Specify tag name]" '*:file:_files' && return 0;
|
144
|
+
}
|
145
|
+
|
146
|
+
_pione_package_build_options() {
|
147
|
+
_arguments -s -S "--color[Turn on/off color mode]" "--debug[Turn on debug mode about the type]" "--hash-id[Specify git hash ID]" "--output[Output file or directory location]" "--tag[Specify tag name]" '*:file:_files' && return 0;
|
148
|
+
}
|
149
|
+
|
150
|
+
_pione_package_show_options() {
|
151
|
+
_arguments -s -S "--advanced[show advanced parameters]" "--color[Turn on/off color mode]" "--debug[Turn on debug mode about the type]" '*:file:_files' && return 0;
|
152
|
+
}
|
153
|
+
|
154
|
+
_pione_package_update_options() {
|
155
|
+
_arguments -s -S "--color[Turn on/off color mode]" "--debug[Turn on debug mode about the type]" "--force[update pacakge info files]" '*:file:_files' && return 0;
|
156
|
+
}
|
157
|
+
|
158
|
+
#
|
159
|
+
# `pione-client` command
|
160
|
+
#
|
161
|
+
|
162
|
+
# set completion function
|
163
|
+
compdef _pione-client pione-client
|
164
|
+
|
165
|
+
_pione-client() {
|
166
|
+
# set option list
|
167
|
+
_pione-client_options
|
168
|
+
}
|
169
|
+
|
170
|
+
_pione-client_options() {
|
171
|
+
_arguments -s -S "--color[Turn on/off color mode]" "--communication-address[Set the IP address for interprocess communication]" "--debug[Turn on debug mode about the type]" "--dry-run[Turn on dry run mode]" "--features[Set features]" "--file-cache-method[use NAME as a file cache method]" "--file-sliding[Enable/disable to slide files in file server]" "--input[Set input directory]" "--notification-receiver[Receiver address that notifications are received at]" "--notification-target[Target address that notifications are sent to]" "--output[Set output directory]" "--params="{Var:1,...}"[Set user parameters]" "--parent-front[set parent front URI]" "--rehearse[rehearse the scenario]" "--request-task-worker[Set request number of task workers]" "--stand-alone[Turn on stand alone mode]" "--stream[Turn on/off stream mode]" "--task-worker-size[Set task worker size that this process creates]" "--timeout[timeout processing after SEC]" '*:file:_files' && return 0;
|
172
|
+
}
|
173
|
+
|
174
|
+
#
|
175
|
+
# `pione-task-worker` command
|
176
|
+
#
|
177
|
+
|
178
|
+
# set completion function
|
179
|
+
compdef _pione-task-worker pione-task-worker
|
180
|
+
|
181
|
+
_pione-task-worker() {
|
182
|
+
# set option list
|
183
|
+
_pione-task-worker_options
|
184
|
+
}
|
185
|
+
|
186
|
+
_pione-task-worker_options() {
|
187
|
+
_arguments -s -S "--color[Turn on/off color mode]" "--communication-address[Set the IP address for interprocess communication]" "--debug[Turn on debug mode about the type]" "--features[Set features]" "--file-cache-method[use NAME as a file cache method]" "--file-sliding[Enable/disable to slide files in file server]" "--parent-front[set parent front URI]" "--tuple-space-id[Tuple space ID that the worker joins]" '*:file:_files' && return 0;
|
188
|
+
}
|
189
|
+
|
190
|
+
#
|
191
|
+
# `pione-task-worker-broker` command
|
192
|
+
#
|
193
|
+
|
194
|
+
# set completion function
|
195
|
+
compdef _pione-task-worker-broker pione-task-worker-broker
|
196
|
+
|
197
|
+
_pione-task-worker-broker() {
|
198
|
+
# set option list
|
199
|
+
_pione-task-worker-broker_options
|
200
|
+
}
|
201
|
+
|
202
|
+
_pione-task-worker-broker_options() {
|
203
|
+
_arguments -s -S "--color[Turn on/off color mode]" "--communication-address[Set the IP address for interprocess communication]" "--debug[Turn on debug mode about the type]" "--features[Set features]" "--file-cache-method[use NAME as a file cache method]" "--file-sliding[Enable/disable to slide files in file server]" "--task-worker-size[Set task worker size that this process creates]" '*:file:_files' && return 0;
|
204
|
+
}
|
205
|
+
|
206
|
+
#
|
207
|
+
# `pione-tuple-space-provider` command
|
208
|
+
#
|
209
|
+
|
210
|
+
# set completion function
|
211
|
+
compdef _pione-tuple-space-provider pione-tuple-space-provider
|
212
|
+
|
213
|
+
_pione-tuple-space-provider() {
|
214
|
+
# set option list
|
215
|
+
_pione-tuple-space-provider_options
|
216
|
+
}
|
217
|
+
|
218
|
+
_pione-tuple-space-provider_options() {
|
219
|
+
_arguments -s -S "--color[Turn on/off color mode]" "--communication-address[Set the IP address for interprocess communication]" "--debug[Turn on debug mode about the type]" "--notification-target[Target address that notifications are sent to]" "--parent-front[set parent front URI]" '*:file:_files' && return 0;
|
220
|
+
}
|
221
|
+
|
222
|
+
#
|
223
|
+
# `pione-notification-listener` command
|
224
|
+
#
|
225
|
+
|
226
|
+
# set completion function
|
227
|
+
compdef _pione-notification-listener pione-notification-listener
|
228
|
+
|
229
|
+
_pione-notification-listener() {
|
230
|
+
# set option list
|
231
|
+
_pione-notification-listener_options
|
232
|
+
}
|
233
|
+
|
234
|
+
_pione-notification-listener_options() {
|
235
|
+
_arguments -s -S "--color[Turn on/off color mode]" "--communication-address[Set the IP address for interprocess communication]" "--debug[Turn on debug mode about the type]" "--notification-receiver[Receiver address that notifications are received at]" '*:file:_files' && return 0;
|
236
|
+
}
|
237
|
+
|
238
|
+
fi
|
data/misc/pione.god
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
DIR = File.join(File.dirname(__FILE__), "..")
|
4
|
+
|
5
|
+
# Watch `pione-task-worker-broker` command.
|
6
|
+
God.watch do |w|
|
7
|
+
w.name = "pione-notification-listener"
|
8
|
+
w.start = "bundle exec pione-notification-listener"
|
9
|
+
w.log = File.join(DIR, "god-notification-listener.log")
|
10
|
+
w.dir = DIR
|
11
|
+
w.keepalive
|
12
|
+
end
|
13
|
+
|
14
|
+
# Watch `pione-task-worker-broker` command.
|
15
|
+
God.watch do |w|
|
16
|
+
w.name = "pione-task-worker-broker"
|
17
|
+
w.start = "bundle exec pione-task-worker-broker"
|
18
|
+
w.log = File.join(DIR, "god-task-worker-broker.log")
|
19
|
+
w.dir = DIR
|
20
|
+
w.keepalive
|
21
|
+
end
|
22
|
+
|
data/misc/ui.xml
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8" ?>
|
2
|
+
<pione:interactive type="Browser" xmlns:pione="https://github.com/pione/pione">
|
3
|
+
<pione:content type="text/html">
|
4
|
+
<button id="yes">YES</button>
|
5
|
+
<button id="no">NO</button>
|
6
|
+
</pione:content>
|
7
|
+
<pione:script type="text/javascript">
|
8
|
+
var sendEvent = function (res) {
|
9
|
+
event = document.createEvent("HTMLEvents");
|
10
|
+
event.initEvent("pione-interactive-result", true, false);
|
11
|
+
event.result = res;
|
12
|
+
document.dispatchEvent(event);
|
13
|
+
};
|
14
|
+
|
15
|
+
document.getElementById("yes").addEventListener("click", function () {
|
16
|
+
sendEvent("yes");
|
17
|
+
});
|
18
|
+
|
19
|
+
document.getElementById("no").addEventListener("click", function () {
|
20
|
+
sendEvent("no");
|
21
|
+
});
|
22
|
+
</pione:script>
|
23
|
+
</pione:interactive>
|
data/pione.gemspec
CHANGED
@@ -53,9 +53,11 @@ Gem::Specification.new do |gem|
|
|
53
53
|
gem.add_runtime_dependency "lettercase", "~> 0.0.3"
|
54
54
|
gem.add_runtime_dependency "rubyzip", "~> 1.0.0"
|
55
55
|
gem.add_runtime_dependency "kramdown", "~> 1.2.0"
|
56
|
+
gem.add_runtime_dependency "os", "~> 0.9.6"
|
57
|
+
gem.add_runtime_dependency "sys-proctable", "~> 0.9.3"
|
56
58
|
|
57
59
|
# for locations
|
58
|
-
gem.add_runtime_dependency "dropbox-sdk", "~> 1.
|
60
|
+
gem.add_runtime_dependency "dropbox-sdk", "~> 1.6.2"
|
59
61
|
gem.add_runtime_dependency "em-ftpd", "~> 0.0.1"
|
60
62
|
|
61
63
|
# test framework
|
@@ -115,7 +115,7 @@ class TestExceptionTransition < Agent::BasicAgent
|
|
115
115
|
end
|
116
116
|
end
|
117
117
|
|
118
|
-
describe
|
118
|
+
describe Pione::Agent::BasicAgent do
|
119
119
|
describe 'agent type' do
|
120
120
|
it 'should get the agent type' do
|
121
121
|
TestAgentType.agent_type.should == :test_agent_type
|
@@ -60,7 +60,7 @@ describe "Pione::Agent::InputGenerator" do
|
|
60
60
|
(dir + "3.c").create("33")
|
61
61
|
|
62
62
|
# make generator and wait to finish it's job
|
63
|
-
generator = Agent[:input_generator].start(
|
63
|
+
generator = Agent[:input_generator].start(@tuple_space, :dir, dir, true)
|
64
64
|
generator.should.stream
|
65
65
|
generator.terminate
|
66
66
|
end
|
@@ -78,7 +78,7 @@ describe "Pione::Agent::InputGenerator" do
|
|
78
78
|
(dir + "3.c").create("33")
|
79
79
|
|
80
80
|
# make generator and wait to finish it's job
|
81
|
-
generator = Agent[:input_generator].start(
|
81
|
+
generator = Agent[:input_generator].start(@tuple_space, :dir, dir, true)
|
82
82
|
generator.wait_until_before(:sleep)
|
83
83
|
|
84
84
|
# check exceptions
|
@@ -1,14 +1,11 @@
|
|
1
1
|
require 'pione/test-helper'
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe Pione::Agent::Messenger do
|
4
4
|
before do
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
define_method(:puts) {|msg| @msgs << msg}
|
10
|
-
end
|
11
|
-
@messenger.msgs = []
|
5
|
+
@io = StringIO.new("", "w+")
|
6
|
+
tuple_space = TestHelper::TupleSpace.create(self)
|
7
|
+
receiver = Log::CUIMessageLogReceiver.new(@io)
|
8
|
+
@messenger = Agent::Messenger.new(tuple_space, receiver)
|
12
9
|
end
|
13
10
|
|
14
11
|
after do
|
@@ -19,7 +16,7 @@ describe "Pione::Agent::Messenger" do
|
|
19
16
|
write(TupleSpace::MessageTuple.new(type: "test", head: "test", color: :green, contents: "test", level: 0))
|
20
17
|
@messenger.start
|
21
18
|
sleep 1
|
22
|
-
@
|
19
|
+
@io.string.lines.to_a.compact.size.should == 1
|
23
20
|
end
|
24
21
|
end
|
25
22
|
|
@@ -0,0 +1,80 @@
|
|
1
|
+
require 'pione/test-helper'
|
2
|
+
|
3
|
+
TestHelper.scope do |this|
|
4
|
+
class this::TestSender
|
5
|
+
def initialize(uri)
|
6
|
+
@targets = Global.notification_targets
|
7
|
+
@notification = Notification::Message.new(
|
8
|
+
"TEST_SENDER", "TEST", {"front" => uri}
|
9
|
+
)
|
10
|
+
end
|
11
|
+
|
12
|
+
def send
|
13
|
+
Notification::Transmitter.transmit(@notification, @targets)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
class this::TestRecipient
|
18
|
+
include Front::NotificationRecipientInterface
|
19
|
+
def initialize
|
20
|
+
set_recipient()
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
describe Pione::Agent::NotificationListener do
|
25
|
+
before do
|
26
|
+
@tuple_space = TestHelper::TupleSpace.create(self)
|
27
|
+
Global.expressional_features = Util.parse_features("*")
|
28
|
+
|
29
|
+
# broker
|
30
|
+
@broker_model = Model::TaskWorkerBrokerModel.new
|
31
|
+
@broker_model[:spawn_task_worker] = false
|
32
|
+
@broker_model[:task_worker_size] = 5
|
33
|
+
@broker = Agent::TaskWorkerBroker.start(@broker_model)
|
34
|
+
|
35
|
+
# provider
|
36
|
+
@provider_cmd = Command::PioneTupleSpaceProvider.new([])
|
37
|
+
|
38
|
+
@model = Model::NotificationListenerModel.new
|
39
|
+
@model.add_recipient("druby://localhost:0") # fake URI
|
40
|
+
@listener = Agent::NotificationListener.new(@model, URI.parse("pnu://127.0.0.1:%s" % 12345))
|
41
|
+
end
|
42
|
+
|
43
|
+
after do
|
44
|
+
@broker.terminate
|
45
|
+
@tuple_space.terminate
|
46
|
+
Global.expressional_features = nil
|
47
|
+
end
|
48
|
+
|
49
|
+
it "should run and terminate listener" do
|
50
|
+
@listener.start
|
51
|
+
@listener.wait_until(:receive)
|
52
|
+
@listener.terminate
|
53
|
+
@listener.wait_until_terminated
|
54
|
+
@listener.should.terminated
|
55
|
+
end
|
56
|
+
|
57
|
+
# it "should receive messages" do
|
58
|
+
# @provider_cmd.run
|
59
|
+
# provider = Agent::TupleSpaceProvider.start(@provider_cmd.model[:front].uri)
|
60
|
+
# @listener.start
|
61
|
+
|
62
|
+
# # wait receiver to handle notification
|
63
|
+
# @listener.wait_until_after(:receive, 10)
|
64
|
+
# @listener.notification_handlers.list.each {|thread| thread.join}
|
65
|
+
|
66
|
+
# # test tuple spaces
|
67
|
+
# spaces = listener.tuple_spaces
|
68
|
+
# spaces.size.should == 1
|
69
|
+
# spaces.first.should == @tuple_space
|
70
|
+
|
71
|
+
# # terminate agents
|
72
|
+
# provider.terminate
|
73
|
+
# @listener.terminate
|
74
|
+
# provider.wait_until_terminated
|
75
|
+
# @listener.wait_until_terminated
|
76
|
+
# provider.should.terminated
|
77
|
+
# @listener.should.terminated
|
78
|
+
# end
|
79
|
+
end
|
80
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'pione/test-helper'
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe Pione::Agent::TaskWorkerBroker do
|
4
4
|
before do
|
5
5
|
# setup language environment
|
6
6
|
@env = TestHelper::Lang.env
|
@@ -11,9 +11,12 @@ describe "Pione::Agent::Broker" do
|
|
11
11
|
@space3 = TupleSpaceServer.new({task_worker_resource: 3}, false)
|
12
12
|
[@space1, @space2, @space3].each {|space| space.write(TupleSpace::EnvTuple.new(obj: @env))}
|
13
13
|
|
14
|
-
# setup broker
|
14
|
+
# setup task worker broker
|
15
15
|
Global.expressional_features = Util.parse_features("*")
|
16
|
-
@
|
16
|
+
@model = Model::TaskWorkerBrokerModel.new
|
17
|
+
@model[:spawn_task_worker] = false
|
18
|
+
@model[:task_worker_size] = 5
|
19
|
+
@broker = Agent::TaskWorkerBroker.new(@model)
|
17
20
|
end
|
18
21
|
|
19
22
|
after do
|
@@ -23,27 +26,27 @@ describe "Pione::Agent::Broker" do
|
|
23
26
|
|
24
27
|
it "should run workers" do
|
25
28
|
@broker.start
|
26
|
-
@
|
29
|
+
@model.quantity.should == 0
|
27
30
|
|
28
31
|
# with space1
|
29
|
-
@
|
32
|
+
@model.add_tuple_space @space1
|
30
33
|
@broker.wait_until_before(:sleep)
|
31
|
-
@
|
34
|
+
@model.quantity.should == 5
|
32
35
|
sleep 0.1 # wait workers to join the space
|
33
36
|
@space1.current_task_worker_size.should == 5
|
34
37
|
|
35
38
|
# with space1 and space2
|
36
|
-
@
|
39
|
+
@model.add_tuple_space @space2
|
37
40
|
@broker.wait_until_before(:sleep)
|
38
|
-
@
|
41
|
+
@model.quantity.should == 5
|
39
42
|
sleep 0.1 # wait workers to join the space
|
40
43
|
@space1.current_task_worker_size.should == 2
|
41
44
|
@space2.current_task_worker_size.should == 3
|
42
45
|
|
43
46
|
# with space1, space2, and space3
|
44
|
-
@
|
47
|
+
@model.add_tuple_space @space3
|
45
48
|
@broker.wait_until_before(:sleep)
|
46
|
-
@
|
49
|
+
@model.quantity.should == 5
|
47
50
|
sleep 0.1 # wait workers to join the space
|
48
51
|
@space1.current_task_worker_size.should == 1
|
49
52
|
@space2.current_task_worker_size.should == 2
|