pione 0.3.2 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (304) hide show
  1. data/.gitignore +2 -0
  2. data/.s3cfg +42 -0
  3. data/.travis.yml +18 -4
  4. data/.yardopts +1 -0
  5. data/Gemfile +3 -0
  6. data/History.txt +14 -0
  7. data/Procfile +7 -0
  8. data/Rakefile +25 -0
  9. data/bin/pione-interactive +6 -0
  10. data/bin/{pione-compiler → pione-notification-listener} +1 -1
  11. data/bin/{pione-broker → pione-task-worker-broker} +1 -1
  12. data/doc/man/pione-list-param.md +36 -0
  13. data/example/ActionError/ActionError.pione +9 -0
  14. data/example/ActionError/pione-package.json +15 -0
  15. data/example/CountChar/CountChar.pione +1 -1
  16. data/example/ScoreAggregation/ScoreAggregation.pione +1 -1
  17. data/example/Touch/pione-package.json +15 -0
  18. data/lib/pione.rb +12 -0
  19. data/lib/pione/agent.rb +3 -3
  20. data/lib/pione/agent/basic-agent.rb +10 -4
  21. data/lib/pione/agent/input-generator.rb +3 -3
  22. data/lib/pione/agent/{process-manager.rb → job-manager.rb} +10 -7
  23. data/lib/pione/agent/job-terminator.rb +2 -2
  24. data/lib/pione/agent/logger.rb +3 -3
  25. data/lib/pione/agent/messenger.rb +20 -9
  26. data/lib/pione/agent/notification-listener.rb +88 -0
  27. data/lib/pione/agent/task-worker-broker.rb +84 -0
  28. data/lib/pione/agent/task-worker.rb +3 -2
  29. data/lib/pione/agent/tuple-space-client.rb +1 -0
  30. data/lib/pione/agent/tuple-space-provider.rb +17 -35
  31. data/lib/pione/command.rb +33 -15
  32. data/lib/pione/command/action.rb +105 -0
  33. data/lib/pione/command/basic-command.rb +34 -376
  34. data/lib/pione/command/command-exception.rb +12 -11
  35. data/lib/pione/command/common.rb +198 -0
  36. data/lib/pione/command/option.rb +159 -204
  37. data/lib/pione/command/pione-action-exec.rb +85 -0
  38. data/lib/pione/command/pione-action-list.rb +43 -19
  39. data/lib/pione/command/pione-action-print.rb +79 -0
  40. data/lib/pione/command/pione-action.rb +8 -67
  41. data/lib/pione/command/pione-clean.rb +88 -68
  42. data/lib/pione/command/pione-client.rb +475 -332
  43. data/lib/pione/command/pione-command.rb +14 -31
  44. data/lib/pione/command/pione-compile.rb +90 -0
  45. data/lib/pione/command/pione-config-get.rb +53 -0
  46. data/lib/pione/command/pione-config-list.rb +64 -0
  47. data/lib/pione/command/pione-config-set.rb +59 -0
  48. data/lib/pione/command/pione-config-unset.rb +50 -0
  49. data/lib/pione/command/pione-config.rb +61 -0
  50. data/lib/pione/command/pione-diagnosis-notification.rb +235 -0
  51. data/lib/pione/command/pione-diagnosis.rb +21 -0
  52. data/lib/pione/command/pione-interactive.rb +188 -0
  53. data/lib/pione/command/pione-lang-check-syntax.rb +163 -0
  54. data/lib/pione/command/pione-lang-interactive.rb +146 -0
  55. data/lib/pione/command/pione-lang.rb +22 -0
  56. data/lib/pione/command/pione-log-format.rb +163 -0
  57. data/lib/pione/command/pione-log-list-id.rb +48 -0
  58. data/lib/pione/command/pione-log.rb +19 -101
  59. data/lib/pione/command/pione-notification-listener.rb +95 -0
  60. data/lib/pione/command/pione-package-add.rb +137 -0
  61. data/lib/pione/command/pione-package-build.rb +122 -0
  62. data/lib/pione/command/pione-package-show.rb +96 -0
  63. data/lib/pione/command/pione-package-update.rb +59 -0
  64. data/lib/pione/command/pione-package.rb +11 -139
  65. data/lib/pione/command/pione-task-worker-broker.rb +88 -0
  66. data/lib/pione/command/pione-task-worker.rb +148 -98
  67. data/lib/pione/command/pione-tuple-space-provider.rb +62 -54
  68. data/lib/pione/command/pione-tuple-space-viewer.rb +105 -83
  69. data/lib/pione/command/pione-val.rb +39 -39
  70. data/lib/pione/command/spawner.rb +34 -27
  71. data/lib/pione/front.rb +4 -2
  72. data/lib/pione/front/basic-front.rb +86 -23
  73. data/lib/pione/front/client-front.rb +2 -2
  74. data/lib/pione/front/diagnosis-notification-front.rb +40 -0
  75. data/lib/pione/front/front-exception.rb +7 -1
  76. data/lib/pione/front/notification-listener-front.rb +36 -0
  77. data/lib/pione/front/notification-recipient-interface.rb +19 -0
  78. data/lib/pione/front/relay-front.rb +4 -4
  79. data/lib/pione/front/task-worker-broker-front.rb +19 -0
  80. data/lib/pione/front/task-worker-front.rb +2 -2
  81. data/lib/pione/front/tuple-space-provider-front.rb +3 -2
  82. data/lib/pione/global.rb +3 -1
  83. data/lib/pione/global/client-variable.rb +1 -1
  84. data/lib/pione/global/config.rb +63 -7
  85. data/lib/pione/global/diagnosis-variable.rb +26 -0
  86. data/lib/pione/global/item.rb +28 -5
  87. data/lib/pione/global/log-variable.rb +6 -5
  88. data/lib/pione/global/network-variable.rb +75 -4
  89. data/lib/pione/global/path-variable.rb +1 -1
  90. data/lib/pione/global/system-variable.rb +12 -12
  91. data/lib/pione/global/task-worker-broker-variable.rb +43 -0
  92. data/lib/pione/global/tuple-space-notifier-variable.rb +3 -55
  93. data/lib/pione/lang/boolean.rb +4 -0
  94. data/lib/pione/lang/data-expr.rb +1 -1
  95. data/lib/pione/lang/integer.rb +1 -1
  96. data/lib/pione/lang/string.rb +4 -0
  97. data/lib/pione/lang/type.rb +1 -1
  98. data/lib/pione/location.rb +1 -0
  99. data/lib/pione/location/data-location.rb +41 -13
  100. data/lib/pione/location/dropbox-location.rb +175 -56
  101. data/lib/pione/location/ftp-location.rb +4 -1
  102. data/lib/pione/location/http-location.rb +5 -3
  103. data/lib/pione/location/https-location.rb +4 -2
  104. data/lib/pione/location/local-location.rb +6 -3
  105. data/lib/pione/location/location-exception.rb +12 -0
  106. data/lib/pione/location/notification-scheme.rb +46 -0
  107. data/lib/pione/log.rb +8 -7
  108. data/lib/pione/log/debug.rb +9 -9
  109. data/lib/pione/log/domain-log.rb +6 -1
  110. data/lib/pione/log/message-log-receiver.rb +32 -0
  111. data/lib/pione/log/system-log.rb +62 -141
  112. data/lib/pione/model.rb +7 -0
  113. data/lib/pione/model/notification-listener-model.rb +29 -0
  114. data/lib/pione/model/task-worker-broker-model.rb +129 -0
  115. data/lib/pione/notification.rb +13 -0
  116. data/lib/pione/notification/address.rb +104 -0
  117. data/lib/pione/notification/exception.rb +10 -0
  118. data/lib/pione/notification/message.rb +109 -0
  119. data/lib/pione/notification/receiver.rb +90 -0
  120. data/lib/pione/notification/recipient.rb +68 -0
  121. data/lib/pione/notification/task-worker-broker-recipient.rb +85 -0
  122. data/lib/pione/notification/transmitter.rb +84 -0
  123. data/lib/pione/pnml.rb +35 -0
  124. data/lib/pione/pnml/annotation-extractor.rb +47 -0
  125. data/lib/pione/pnml/compiler.rb +176 -0
  126. data/lib/pione/pnml/input-merge-complement.rb +78 -0
  127. data/lib/pione/pnml/input-parallelization-complement.rb +75 -0
  128. data/lib/pione/pnml/input-reduction.rb +80 -0
  129. data/lib/pione/pnml/invalid-arc-elimination.rb +41 -0
  130. data/lib/pione/pnml/io-expansion.rb +88 -0
  131. data/lib/pione/pnml/isolated-element-elimination.rb +32 -0
  132. data/lib/pione/pnml/net-rewriter.rb +44 -0
  133. data/lib/pione/pnml/output-decomposition-complement.rb +77 -0
  134. data/lib/pione/pnml/output-reduction.rb +86 -0
  135. data/lib/pione/pnml/output-synchronization-complement.rb +77 -0
  136. data/lib/pione/pnml/pione-model.rb +417 -0
  137. data/lib/pione/pnml/pnml-exception.rb +23 -0
  138. data/lib/pione/pnml/pnml-model.rb +368 -0
  139. data/lib/pione/pnml/reader.rb +51 -0
  140. data/lib/pione/rule-engine/action-handler.rb +8 -6
  141. data/lib/pione/rule-engine/basic-handler.rb +5 -5
  142. data/lib/pione/rule-engine/engine-exception.rb +7 -6
  143. data/lib/pione/rule-engine/flow-handler.rb +27 -18
  144. data/lib/pione/system.rb +3 -1
  145. data/lib/pione/system/domain-dump.rb +34 -0
  146. data/lib/pione/system/file-cache.rb +92 -13
  147. data/lib/pione/system/init.rb +3 -0
  148. data/lib/pione/system/normalizer.rb +40 -0
  149. data/lib/pione/system/status.rb +5 -5
  150. data/lib/pione/system/system-exception.rb +14 -1
  151. data/lib/pione/task-worker-broker.rb +7 -0
  152. data/lib/pione/task-worker-broker/basic-provider.rb +20 -0
  153. data/lib/pione/task-worker-broker/easy-provider.rb +65 -0
  154. data/lib/pione/test-helper.rb +27 -0
  155. data/lib/pione/test-helper/command-helper.rb +9 -101
  156. data/lib/pione/tuple-space/basic-tuple.rb +1 -1
  157. data/lib/pione/tuple-space/tuple-definition.yml +4 -6
  158. data/lib/pione/tuple-space/tuple-space-interface.rb +3 -45
  159. data/lib/pione/tuple-space/tuple-space-server.rb +45 -0
  160. data/lib/pione/util.rb +1 -2
  161. data/lib/pione/util/boolean-value.rb +62 -0
  162. data/lib/pione/util/completion.rb +111 -0
  163. data/lib/pione/util/evaluatable.rb +13 -27
  164. data/lib/pione/util/package-parameters-list.rb +15 -27
  165. data/lib/pione/util/zip.rb +8 -3
  166. data/lib/pione/version.rb +1 -1
  167. data/lib/rootage.rb +20 -0
  168. data/lib/rootage/action.rb +114 -0
  169. data/lib/rootage/argument.rb +46 -0
  170. data/lib/rootage/command.rb +218 -0
  171. data/lib/rootage/core.rb +532 -0
  172. data/lib/rootage/exception.rb +107 -0
  173. data/lib/rootage/help.rb +148 -0
  174. data/lib/rootage/help.txt.erb +31 -0
  175. data/lib/rootage/log.rb +226 -0
  176. data/lib/rootage/normalizer.rb +184 -0
  177. data/lib/rootage/option.rb +152 -0
  178. data/lib/rootage/scenario-test-result.erb +39 -0
  179. data/lib/rootage/scenario.rb +362 -0
  180. data/lib/rootage/test-helper.rb +115 -0
  181. data/man/pione-list-param.1 +44 -0
  182. data/misc/clock.rb +9 -0
  183. data/misc/machine-info.sh +21 -0
  184. data/misc/pione-completion.bash +238 -0
  185. data/misc/pione-completion.erb +53 -0
  186. data/misc/pione-completion.zsh +238 -0
  187. data/misc/pione.god +22 -0
  188. data/misc/ui.xml +23 -0
  189. data/pione.gemspec +3 -1
  190. data/test/agent/spec_basic-agent.rb +1 -1
  191. data/test/agent/spec_input-generator.rb +2 -2
  192. data/test/agent/spec_messenger.rb +6 -9
  193. data/test/agent/spec_notification-listener.rb +80 -0
  194. data/test/agent/{spec_broker.rb → spec_task-worker-broker.rb} +13 -10
  195. data/test/agent/spec_tuple-space-provider.rb +10 -6
  196. data/test/command/command-behavior.rb +3 -11
  197. data/test/command/data/pione-list-param/AdvancedParameters.pione +12 -0
  198. data/test/command/data/pione-list-param/BasicParameters.pione +12 -0
  199. data/test/command/spec_pione-action-exec.rb +16 -0
  200. data/test/command/spec_pione-action-list.rb +15 -10
  201. data/test/command/spec_pione-action-print.rb +14 -0
  202. data/test/command/spec_pione-action.rb +6 -19
  203. data/test/command/spec_pione-clean.rb +29 -46
  204. data/test/command/spec_pione-client.rb +29 -36
  205. data/test/command/spec_pione-command.rb +6 -6
  206. data/test/command/{spec_pione-compiler.rb → spec_pione-compile.rb} +11 -13
  207. data/test/command/spec_pione-config-get.rb +47 -0
  208. data/test/command/spec_pione-config-list.rb +42 -0
  209. data/test/command/spec_pione-config-set.rb +38 -0
  210. data/test/command/spec_pione-config-unset.rb +44 -0
  211. data/test/command/spec_pione-config.rb +11 -0
  212. data/test/command/spec_pione-diagnosis-notification.rb +23 -0
  213. data/test/command/spec_pione-diagnosis.rb +11 -0
  214. data/test/command/spec_pione-lang-check-syntax.rb +12 -0
  215. data/test/command/spec_pione-lang.rb +11 -0
  216. data/test/command/spec_pione-log-format.rb +29 -0
  217. data/test/command/spec_pione-log-list-id.rb +17 -0
  218. data/test/command/spec_pione-log.rb +6 -20
  219. data/test/command/spec_pione-package-add.rb +55 -0
  220. data/test/command/spec_pione-package-build.rb +57 -0
  221. data/test/command/spec_pione-package-show.rb +72 -0
  222. data/test/command/{spec_pione-update-package-info.rb → spec_pione-package-update.rb} +12 -13
  223. data/test/command/spec_pione-package.rb +4 -104
  224. data/test/command/spec_pione-val.rb +10 -7
  225. data/test/global/spec_config.rb +50 -0
  226. data/test/global/spec_item.rb +1 -1
  227. data/test/literate-action/data/HelloWorld.md +1 -1
  228. data/test/location/location-behavior.rb +1 -1
  229. data/test/location/spec_dropbox-location.rb +39 -0
  230. data/test/location/spec_notification-scheme.rb +37 -0
  231. data/test/log/spec_debug.rb +5 -4
  232. data/test/log/spec_message-log-receiver.rb +13 -0
  233. data/test/log/spec_message-log.rb +6 -9
  234. data/test/log/spec_system-log.rb +5 -3
  235. data/test/notification/spec_address.rb +229 -0
  236. data/test/notification/spec_message.rb +30 -0
  237. data/test/notification/spec_receiver.rb +36 -0
  238. data/test/notification/spec_transmitter.rb +37 -0
  239. data/test/pnml/data/ConditionalBranchIf.pnml +270 -0
  240. data/test/pnml/data/ConditionalBranchIfElse.pnml +309 -0
  241. data/test/pnml/data/IOExpansionComplex.pnml +363 -0
  242. data/test/pnml/data/IOExpansionSimple.pnml +140 -0
  243. data/test/pnml/data/InputMergeComplementComplex.pnml +381 -0
  244. data/test/pnml/data/InputMergeComplementSimple.pnml +248 -0
  245. data/test/pnml/data/InputParallelizationComplementComplex.pnml +433 -0
  246. data/test/pnml/data/InputParallelizationComplementSimple.pnml +288 -0
  247. data/test/pnml/data/InputReductionComplex.pnml +192 -0
  248. data/test/pnml/data/InputReductionLong.pnml +344 -0
  249. data/test/pnml/data/InputReductionSimple.pnml +140 -0
  250. data/test/pnml/data/IsolatedElementElimination.pnml +171 -0
  251. data/test/pnml/data/OutputDecompositionComplementComplex.pnml +381 -0
  252. data/test/pnml/data/OutputDecompositionComplementSimple.pnml +242 -0
  253. data/test/pnml/data/OutputReductionComplex.pnml +186 -0
  254. data/test/pnml/data/OutputReductionLong.pnml +344 -0
  255. data/test/pnml/data/OutputReductionSimple.pnml +140 -0
  256. data/test/pnml/data/OutputSynchronizationComplementComplex.pnml +498 -0
  257. data/test/pnml/data/OutputSynchronizationComplementSimple.pnml +347 -0
  258. data/test/pnml/data/SampleNet.pnml +238 -0
  259. data/test/pnml/spec_input-merge-complement.rb +40 -0
  260. data/test/pnml/spec_input-parallelization-complement.rb +50 -0
  261. data/test/pnml/spec_input-reduction.rb +113 -0
  262. data/test/pnml/spec_invalid-arc-elimination.rb +33 -0
  263. data/test/pnml/spec_io-expansion.rb +126 -0
  264. data/test/pnml/spec_isolated-element-elimination.rb +25 -0
  265. data/test/pnml/spec_output-decomposition-complement.rb +40 -0
  266. data/test/pnml/spec_output-reduction.rb +114 -0
  267. data/test/pnml/spec_output-synchronization-complement.rb +62 -0
  268. data/test/pnml/spec_pione-element.rb +144 -0
  269. data/test/pnml/spec_pnml-element.rb +373 -0
  270. data/test/pnml/spec_reader.rb +16 -0
  271. data/test/rootage/spec_argument.rb +18 -0
  272. data/test/rootage/spec_command.rb +239 -0
  273. data/test/rootage/spec_core.rb +198 -0
  274. data/test/rootage/spec_scenario.rb +149 -0
  275. data/test/system/{spec_domain-info.rb → spec_domain-dump.rb} +6 -6
  276. data/test/system/spec_file-cache.rb +6 -9
  277. data/test/tuple-space/spec_finished-tuple.rb +1 -1
  278. data/test/util/{spec_package-parameters-list_1.pione → data/package-parameters-list/Param1.pione} +0 -0
  279. data/test/util/{spec_package-parameters-list_2.pione → data/package-parameters-list/Param2.pione} +0 -0
  280. data/test/util/{spec_package-parameters-list_3.pione → data/package-parameters-list/Param3.pione} +0 -0
  281. data/test/util/{spec_package-parameters-list_4.pione → data/package-parameters-list/Param4.pione} +0 -0
  282. data/test/util/spec_boolean-value.rb +32 -0
  283. data/test/util/spec_completion.rb +22 -0
  284. data/test/util/spec_package-parameters-list.rb +39 -52
  285. data/test/util/spec_zip.rb +28 -1
  286. metadata +288 -47
  287. data/bin/pione-tuple-space-receiver +0 -5
  288. data/lib/pione/agent/broker.rb +0 -304
  289. data/lib/pione/agent/tuple-space-receiver.rb +0 -137
  290. data/lib/pione/command/pione-broker.rb +0 -104
  291. data/lib/pione/command/pione-compiler.rb +0 -57
  292. data/lib/pione/command/pione-relay-account-db.rb +0 -141
  293. data/lib/pione/command/pione-relay-client-db.rb +0 -118
  294. data/lib/pione/command/pione-relay.rb +0 -59
  295. data/lib/pione/command/pione-syntax-checker.rb +0 -214
  296. data/lib/pione/command/pione-tuple-space-receiver.rb +0 -111
  297. data/lib/pione/command/pione-update-package-info.rb +0 -53
  298. data/lib/pione/front/broker-front.rb +0 -22
  299. data/lib/pione/front/tuple-space-receiver-front.rb +0 -11
  300. data/lib/pione/global/broker-variable.rb +0 -33
  301. data/lib/pione/system/domain-info.rb +0 -25
  302. data/lib/pione/util/pnml-compiler.rb +0 -168
  303. data/test/agent/spec_tuple-space-receiver.rb +0 -47
  304. data/test/util/spec_pnml-compiler.rb +0 -32
@@ -0,0 +1,115 @@
1
+ require 'rootage'
2
+
3
+ Thread.abort_on_exception = true
4
+
5
+ unless Rootage::Log.get_logger_block
6
+ logger = Rootage::RubyStandardLogger.new
7
+ Rootage::Log.set_logger_block {logger}
8
+ end
9
+
10
+ module Rootage
11
+ def self.scope(&b)
12
+ @scope_id = (@scope_id || 0) + 1
13
+ mod = Module.new
14
+ const_set("MODULE%s" % @scope_id, mod)
15
+ mod.send(:define_method, :this) do
16
+ mod
17
+ end
18
+ mod.instance_exec(mod, &b)
19
+ end
20
+
21
+ # `ScenarioResult` is a result of scenario execution. This has result status,
22
+ # stdout, stdin, and etc, so you can analyze and check it.
23
+ class ScenarioResult < StructX
24
+ member :scenario
25
+ member :model
26
+ member :args
27
+ member :stdout
28
+ member :stderr
29
+ member :exception
30
+
31
+ # Return true if the scenario succeeded.
32
+ def success?
33
+ exception.nil? or (exception.kind_of?(SystemExit) and exception.success?)
34
+ end
35
+
36
+ # Print the scenario result report.
37
+ def report
38
+ template = File.read(File.join(File.dirname(__FILE__), "scenario-test-result.erb"))
39
+ File.open("scenario-test-result.txt", "a") do |file|
40
+ file.write(ERB.new(template, nil, "<>").result(binding))
41
+ end
42
+ end
43
+ end
44
+
45
+ # This module helps tests of command execution.
46
+ module ScenarioTest
47
+ class << self
48
+ # Run the action, expecting scenario execution succeeds.
49
+ def succeed(scenario, args=nil, &block)
50
+ res = execute(scenario, args, &block)
51
+ res.report if not(res.success?)
52
+ res.success?.should.be.true
53
+ return res
54
+ end
55
+
56
+ # Run the action, expecting scenario execution fails.
57
+ def fail(scenario, args=nil, &block)
58
+ res = execute(scenario, args, &block)
59
+ res.report if res.success?
60
+ res.should.not.success
61
+ return res
62
+ end
63
+
64
+ private
65
+
66
+ # Run the scenario.
67
+ def execute(scenario, args=nil, &b)
68
+ # make result
69
+ _args = args ? args : scenario.args.clone
70
+ stdout = StringIO.new("", "w")
71
+ stderr = StringIO.new("", "w")
72
+ res = ScenarioResult.new(
73
+ scenario: scenario, args: _args, stdout: stdout, stderr: stderr
74
+ )
75
+
76
+ # setup stdout and stderr
77
+ $stdout = stdout
78
+ $stderr = stderr
79
+
80
+ orig_logger_block = Log.get_logger_block
81
+ null_logger = NullLogger.new
82
+ Log.set_logger_block {null_logger}
83
+
84
+ # run the action
85
+ begin
86
+ if block_given?
87
+ b.call(scenario, args)
88
+ else
89
+ if scenario.is_a?(Scenario)
90
+ scenario.run
91
+ else
92
+ scenario.run(args)
93
+ end
94
+ end
95
+ rescue Object => e
96
+ res.exception = e
97
+ end
98
+
99
+ # revert
100
+ $stdout = STDOUT
101
+ $stderr = STDERR
102
+ Log.set_logger_block(&orig_logger_block)
103
+
104
+ # kill childs
105
+ Sys::ProcTable.ps.select {|ps|
106
+ if ps.ppid == Process.pid
107
+ Process.kill(:TERM, ps.pid)
108
+ end
109
+ }
110
+
111
+ return res
112
+ end
113
+ end
114
+ end
115
+ end
@@ -0,0 +1,44 @@
1
+ .TH pione\-list\-param 1 "" "PIONE User Manual"
2
+ .SH NAME
3
+ .PP
4
+ pione\-list\-param \- show a list of parameters in the document or
5
+ package.
6
+ .SH SYNOPSIS
7
+ .PP
8
+ \f[B]pione list\-param\f[] [options] location
9
+ .SH DESCRIPTION
10
+ .PP
11
+ \f[B]list\-param\f[] command shows a list of parameters in the document
12
+ or package.
13
+ The list includes basic parameters only by default, set
14
+ \f[C]\-\-advanced\f[] option if you want to show advanced parameters.
15
+ .SH OPTIONS
16
+ .TP
17
+ .B \-a, \-\-advanced
18
+ Show advanced parameters.
19
+ .RS
20
+ .RE
21
+ .SH EXAMPLES
22
+ .TP
23
+ .B pione list\-param example/HelloWorld/HelloWorld.pione
24
+ Show basic parameters in the document
25
+ \f[C]example/HelloWorld/HelloWorld.pione\f[].
26
+ .RS
27
+ .RE
28
+ .TP
29
+ .B pione list\-param example/HelloWorld
30
+ Show basic parameters in the package \f[C]example/HelloWorld\f[].
31
+ .RS
32
+ .RE
33
+ .TP
34
+ .B pione list\-param \-\-advanced example/HelloWorld
35
+ Show basic and advanced parameters in the package
36
+ \f[C]example/HelloWorld\f[].
37
+ .RS
38
+ .RE
39
+ .SH REPORTING BUGS
40
+ .PP
41
+ Report bugs or feature requests to PIONE\[aq]s issue
42
+ tracker(https://github.com/pione/pione/issues).
43
+ .SH AUTHORS
44
+ Keita Yamaguchi.
data/misc/clock.rb ADDED
@@ -0,0 +1,9 @@
1
+ require 'clockwork'
2
+
3
+ module Clockwork
4
+ handler do |job|
5
+ `pione clean`
6
+ end
7
+
8
+ every(1.day, "clean", :at => ['00:00', '12:00'])
9
+ end
@@ -0,0 +1,21 @@
1
+ #!/bin/sh
2
+
3
+ cat <<EOF
4
+
5
+ Test Matchine Information
6
+ =========================
7
+
8
+ EOF
9
+
10
+ # kernel
11
+ uname -a
12
+
13
+ # distribution name
14
+ head -n1 /etc/issue
15
+
16
+ # memory size
17
+ grep MemTotal /proc/meminfo
18
+
19
+ # cpus
20
+ grep -E "processor|model name|cpu MHz|cache size" /proc/cpuinfo
21
+ echo
@@ -0,0 +1,238 @@
1
+ if type complete 1>/dev/null 2>&1;
2
+ then
3
+
4
+ #
5
+ # `pione` command
6
+ #
7
+
8
+ # set completion function
9
+ complete -F _pione pione
10
+
11
+ _pione() {
12
+ # setup subcommans list
13
+ local name2="${COMP_WORDS[1]}"
14
+ local name3="${COMP_WORDS[2]}"
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
+ COMPREPLY=($(compgen -W "action clean compile config diagnosis lang log package" -- "${COMP_WORDS[COMP_CWORD]}"));
64
+ }
65
+
66
+ _pione_action_subcommands() {
67
+ COMPREPLY=($(compgen -W "exec list print" -- "${COMP_WORDS[COMP_CWORD]}"));
68
+ }
69
+
70
+ _pione_action_exec_options() {
71
+ COMPREPLY=($(compgen -W "--color --debug --directory PATH --domain-dump" -- "${COMP_WORDS[COMP_CWORD]}"));
72
+ }
73
+
74
+ _pione_action_list_options() {
75
+ COMPREPLY=($(compgen -W "--color --compact" -- "${COMP_WORDS[COMP_CWORD]}"));
76
+ }
77
+
78
+ _pione_action_print_options() {
79
+ COMPREPLY=($(compgen -W "--color --debug --domain-dump" -- "${COMP_WORDS[COMP_CWORD]}"));
80
+ }
81
+
82
+ _pione_clean_options() {
83
+ COMPREPLY=($(compgen -W "--debug --older --type NAME" -- "${COMP_WORDS[COMP_CWORD]}"));
84
+ }
85
+
86
+ _pione_compile_options() {
87
+ COMPREPLY=($(compgen -W "--debug --editor --flow-name --package-name --tag" -- "${COMP_WORDS[COMP_CWORD]}"));
88
+ }
89
+
90
+ _pione_config_subcommands() {
91
+ COMPREPLY=($(compgen -W "get list set unset" -- "${COMP_WORDS[COMP_CWORD]}"));
92
+ }
93
+
94
+ _pione_config_get_options() {
95
+ COMPREPLY=($(compgen -W "--debug --file" -- "${COMP_WORDS[COMP_CWORD]}"));
96
+ }
97
+
98
+ _pione_config_list_options() {
99
+ COMPREPLY=($(compgen -W "--debug --file" -- "${COMP_WORDS[COMP_CWORD]}"));
100
+ }
101
+
102
+ _pione_config_set_options() {
103
+ COMPREPLY=($(compgen -W "--debug --file" -- "${COMP_WORDS[COMP_CWORD]}"));
104
+ }
105
+
106
+ _pione_config_unset_options() {
107
+ COMPREPLY=($(compgen -W "--debug --file" -- "${COMP_WORDS[COMP_CWORD]}"));
108
+ }
109
+
110
+ _pione_diagnosis_subcommands() {
111
+ COMPREPLY=($(compgen -W "notification" -- "${COMP_WORDS[COMP_CWORD]}"));
112
+ }
113
+
114
+ _pione_diagnosis_notification_options() {
115
+ COMPREPLY=($(compgen -W "--color --debug --notification-receiver --notification-target --timeout --type" -- "${COMP_WORDS[COMP_CWORD]}"));
116
+ }
117
+
118
+ _pione_lang_subcommands() {
119
+ COMPREPLY=($(compgen -W "check-syntax" -- "${COMP_WORDS[COMP_CWORD]}"));
120
+ }
121
+
122
+ _pione_lang_check-syntax_options() {
123
+ COMPREPLY=($(compgen -W "--color --expr --file --model --parser --syntax" -- "${COMP_WORDS[COMP_CWORD]}"));
124
+ }
125
+
126
+ _pione_log_subcommands() {
127
+ COMPREPLY=($(compgen -W "format list-id" -- "${COMP_WORDS[COMP_CWORD]}"));
128
+ }
129
+
130
+ _pione_log_format_options() {
131
+ COMPREPLY=($(compgen -W "--agent-type --color --debug --format --log-id --trace-type" -- "${COMP_WORDS[COMP_CWORD]}"));
132
+ }
133
+
134
+ _pione_log_list-id_options() {
135
+ COMPREPLY=($(compgen -W "--color --debug" -- "${COMP_WORDS[COMP_CWORD]}"));
136
+ }
137
+
138
+ _pione_package_subcommands() {
139
+ COMPREPLY=($(compgen -W "add build show update" -- "${COMP_WORDS[COMP_CWORD]}"));
140
+ }
141
+
142
+ _pione_package_add_options() {
143
+ COMPREPLY=($(compgen -W "--tag" -- "${COMP_WORDS[COMP_CWORD]}"));
144
+ }
145
+
146
+ _pione_package_build_options() {
147
+ COMPREPLY=($(compgen -W "--color --debug --hash-id --output --tag" -- "${COMP_WORDS[COMP_CWORD]}"));
148
+ }
149
+
150
+ _pione_package_show_options() {
151
+ COMPREPLY=($(compgen -W "--advanced --color --debug" -- "${COMP_WORDS[COMP_CWORD]}"));
152
+ }
153
+
154
+ _pione_package_update_options() {
155
+ COMPREPLY=($(compgen -W "--color --debug --force" -- "${COMP_WORDS[COMP_CWORD]}"));
156
+ }
157
+
158
+ #
159
+ # `pione-client` command
160
+ #
161
+
162
+ # set completion function
163
+ complete -F _pione-client pione-client
164
+
165
+ _pione-client() {
166
+ # set option list
167
+ _pione-client_options
168
+ }
169
+
170
+ _pione-client_options() {
171
+ COMPREPLY=($(compgen -W "--color --communication-address --debug --dry-run --features --file-cache-method --file-sliding --input --notification-receiver --notification-target --output --params="{Var:1,...}" --parent-front --rehearse --request-task-worker --stand-alone --stream --task-worker-size --timeout" -- "${COMP_WORDS[COMP_CWORD]}"));
172
+ }
173
+
174
+ #
175
+ # `pione-task-worker` command
176
+ #
177
+
178
+ # set completion function
179
+ complete -F _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
+ COMPREPLY=($(compgen -W "--color --communication-address --debug --features --file-cache-method --file-sliding --parent-front --tuple-space-id" -- "${COMP_WORDS[COMP_CWORD]}"));
188
+ }
189
+
190
+ #
191
+ # `pione-task-worker-broker` command
192
+ #
193
+
194
+ # set completion function
195
+ complete -F _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
+ COMPREPLY=($(compgen -W "--color --communication-address --debug --features --file-cache-method --file-sliding --task-worker-size" -- "${COMP_WORDS[COMP_CWORD]}"));
204
+ }
205
+
206
+ #
207
+ # `pione-tuple-space-provider` command
208
+ #
209
+
210
+ # set completion function
211
+ complete -F _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
+ COMPREPLY=($(compgen -W "--color --communication-address --debug --notification-target --parent-front" -- "${COMP_WORDS[COMP_CWORD]}"));
220
+ }
221
+
222
+ #
223
+ # `pione-notification-listener` command
224
+ #
225
+
226
+ # set completion function
227
+ complete -F _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
+ COMPREPLY=($(compgen -W "--color --communication-address --debug --notification-receiver" -- "${COMP_WORDS[COMP_CWORD]}"));
236
+ }
237
+
238
+ fi
@@ -0,0 +1,53 @@
1
+ if type <%= completion_command %> 1>/dev/null 2>&1;
2
+ then
3
+
4
+ <%- toplevel_commands(Pione::Command).each do |key1, cmd1| -%>
5
+ #
6
+ # `<%= key1 %>` command
7
+ #
8
+
9
+ # set completion function
10
+ <%= completion_exec %> _<%= key1 %> <%= key1 %>
11
+
12
+ _<%= key1 %>() {
13
+ <%- if cmd1.subcommand.keys.empty? -%>
14
+ # set option list
15
+ _<%= key1 %>_options
16
+ <%- else -%>
17
+ # setup subcommans list
18
+ local name2="<%= name2 %>"
19
+ local name3="<%= name3 %>"
20
+
21
+ case $name2 in
22
+ <%- cmd1.subcommand.each do |key2, cmd2| -%>
23
+ <%- if cmd2.subcommand.empty? -%>
24
+ <%= key2 %>) _<%= key1 %>_<%= key2 %>_options;;
25
+ <%- else -%>
26
+ <%= key2 %>)
27
+ case $name3 in
28
+ <%- cmd2.subcommand.each do |key3, cmd3| -%>
29
+ <%= key3 %>) _<%= key1 %>_<%= key2 %>_<%= key3 %>_options;;
30
+ <%- end -%>
31
+ *) _<%= key1 %>_<%= key2 %>_subcommands;;
32
+ esac;;
33
+ <%- end -%>
34
+ <%- end -%>
35
+ *) _<%= key1 %>_subcommands;;
36
+ esac
37
+ <%- end -%>
38
+ }
39
+
40
+ <%- descendants([key1], cmd1).each do |keys, cmd| -%>
41
+ <%- if cmd.subcommand.keys.empty? -%>
42
+ _<%= keys.join("_") %>_options() {
43
+ <%= fun_options(cmd) %>
44
+ }
45
+ <%- else -%>
46
+ _<%= keys.join("_") %>_subcommands() {
47
+ <%= fun_subcommands(cmd) %>
48
+ }
49
+ <%- end -%>
50
+
51
+ <%- end -%>
52
+ <%- end -%>
53
+ fi