pione 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. data/History.txt +9 -0
  2. data/Rakefile +13 -0
  3. data/bin/pione +5 -0
  4. data/bin/pione-compiler +5 -0
  5. data/example/ScoreAggregation/ScoreAggregation.pione +2 -0
  6. data/example/ScoreAggregation/bin/apply-template.rb +1 -1
  7. data/example/ScoreAggregation/bin/mean-summary.rb +1 -1
  8. data/example/ScoreAggregation/bin/total-mean.rb +1 -1
  9. data/example/ScoreAggregation/bin/total-statistics.rb +3 -3
  10. data/example/ScoreAggregation/pione-package.json +21 -0
  11. data/example/ScoreAggregation/scenario/case1/Scenario.pione +1 -0
  12. data/example/ScoreAggregation/scenario/case1/pione-scenario.json +36 -0
  13. data/lib/pione.rb +15 -2
  14. data/lib/pione/agent/basic-agent.rb +0 -1
  15. data/lib/pione/agent/job-terminator.rb +8 -3
  16. data/lib/pione/agent/task-worker.rb +9 -2
  17. data/lib/pione/command.rb +2 -0
  18. data/lib/pione/command/basic-command.rb +4 -0
  19. data/lib/pione/command/option.rb +4 -1
  20. data/lib/pione/command/pione-clean.rb +104 -17
  21. data/lib/pione/command/pione-client.rb +16 -3
  22. data/lib/pione/command/pione-command.rb +45 -0
  23. data/lib/pione/command/pione-compiler.rb +39 -0
  24. data/lib/pione/command/pione-log.rb +1 -0
  25. data/lib/pione/command/pione-task-worker.rb +6 -2
  26. data/lib/pione/command/pione-val.rb +1 -0
  27. data/lib/pione/front.rb +1 -0
  28. data/lib/pione/front/basic-front.rb +1 -1
  29. data/lib/pione/front/front-exception.rb +5 -1
  30. data/lib/pione/global.rb +3 -118
  31. data/lib/pione/global/broker-variable.rb +21 -8
  32. data/lib/pione/global/client-variable.rb +16 -8
  33. data/lib/pione/{system → global}/config.rb +2 -2
  34. data/lib/pione/global/global-exception.rb +40 -0
  35. data/lib/pione/global/input-generator-variable.rb +4 -1
  36. data/lib/pione/global/item.rb +168 -0
  37. data/lib/pione/global/log-variable.rb +64 -13
  38. data/lib/pione/global/network-variable.rb +4 -1
  39. data/lib/pione/global/package-variable.rb +25 -10
  40. data/lib/pione/global/path-variable.rb +62 -26
  41. data/lib/pione/global/relay-variable.rb +101 -36
  42. data/lib/pione/global/system-variable.rb +26 -9
  43. data/lib/pione/global/task-worker-variable.rb +19 -7
  44. data/lib/pione/global/tuple-space-notifier-variable.rb +60 -20
  45. data/lib/pione/lang.rb +0 -2
  46. data/lib/pione/lang/data-expr.rb +8 -0
  47. data/lib/pione/package/package-exception.rb +1 -1
  48. data/lib/pione/rule-engine/action-handler.rb +14 -12
  49. data/lib/pione/rule-engine/engine-exception.rb +11 -0
  50. data/lib/pione/rule-engine/flow-handler.rb +20 -11
  51. data/lib/pione/system.rb +1 -1
  52. data/lib/pione/system/file-cache.rb +1 -1
  53. data/lib/pione/system/init.rb +13 -15
  54. data/lib/pione/system/status.rb +30 -0
  55. data/lib/pione/system/system-exception.rb +0 -24
  56. data/lib/pione/test-helper.rb +8 -1
  57. data/lib/pione/test-helper/command-helper.rb +42 -15
  58. data/lib/pione/util.rb +1 -0
  59. data/lib/pione/util/embeded-expr-expander.rb +5 -11
  60. data/lib/pione/util/pnml-compiler.rb +97 -0
  61. data/lib/pione/util/profiler.rb +107 -0
  62. data/lib/pione/version.rb +1 -1
  63. data/man/pione-clean.1 +76 -0
  64. data/pione.gemspec +5 -2
  65. data/test/agent/spec_job-terminator.rb +41 -3
  66. data/test/command/data/pione-client/ActionError.pione +5 -0
  67. data/test/command/data/pione-compiler/Sequence.pnml +137 -0
  68. data/test/command/spec_pione-clean.rb +250 -5
  69. data/test/command/spec_pione-client.rb +57 -46
  70. data/test/command/spec_pione-command.rb +18 -0
  71. data/test/command/spec_pione-compiler.rb +13 -0
  72. data/test/global/spec_item.rb +77 -0
  73. data/test/lang/data/data-expr.yml +5 -0
  74. data/test/rule-engine/{spec_action-handler.pione → data/action-handler/BasicAction.pione} +0 -0
  75. data/test/rule-engine/data/action-handler/UsePackageScript.pione +17 -0
  76. data/test/rule-engine/spec_action-handler.rb +143 -80
  77. data/test/system/spec_status.rb +13 -0
  78. data/test/{tuple → tuple-space}/spec_basic-tuple.rb +0 -0
  79. data/test/{tuple → tuple-space}/spec_data-tuple.rb +0 -0
  80. data/test/{tuple → tuple-space}/spec_finished-tuple.rb +0 -0
  81. data/test/{tuple → tuple-space}/spec_message-tuple.rb +0 -0
  82. data/test/{tuple → tuple-space}/spec_task-tuple.rb +0 -0
  83. data/test/{tuple → tuple-space}/spec_touch-tuple.rb +0 -0
  84. data/test/{tuple → tuple-space}/spec_working-tuple.rb +0 -0
  85. data/test/{tuple → tuple-space}/tuple-behavior.rb +0 -0
  86. data/test/util/data/pnml/Sequence.pnml +137 -0
  87. data/test/util/spec_pnml-compiler.rb +21 -0
  88. data/test/util/spec_profiler.rb +53 -0
  89. metadata +75 -32
  90. data/example/ScoreAggregation/package.yml +0 -5
  91. data/example/ScoreAggregation/scenario/case1/scenario.yml +0 -29
  92. data/lib/pione/lang/interpolator-parser.rb +0 -44
  93. data/lib/pione/lang/interpolator-transformer.rb +0 -13
  94. data/test/lang/spec_interpolator-parser.rb +0 -5
  95. data/test/lang/spec_interpolator-transformer.rb +0 -15
@@ -1,5 +0,0 @@
1
- PackageName: ScoreAggregation
2
- Documents:
3
- - "ScoreAggregation.pione"
4
- Scenarios:
5
- - "scenario/case1"
@@ -1,29 +0,0 @@
1
- ScenarioName: case1
2
- Inputs:
3
- - "A.score"
4
- - "B.score"
5
- - "C.score"
6
- - "D.score"
7
- - "E.score"
8
- - "F.score"
9
- - "G.score"
10
- - "H.score"
11
- - "I.score"
12
- - "J.score"
13
- - "K.score"
14
- - "L.score"
15
- - "M.score"
16
- - "N.score"
17
- - "O.score"
18
- - "P.score"
19
- - "Q.score"
20
- - "R.score"
21
- - "S.score"
22
- - "T.score"
23
- - "U.score"
24
- - "V.score"
25
- - "W.score"
26
- - "X.score"
27
- - "Y.score"
28
- - "Z.score"
29
-
@@ -1,44 +0,0 @@
1
- module Pione
2
- module Lang
3
- # InterpolatorParser is a parser for handling embeded expression in strings.
4
- class InterpolatorParser < Parslet::Parser
5
- include Util::ParsletParserExtension
6
- include CommonParser
7
- include LiteralParser
8
- include ExprParser
9
-
10
- #
11
- # root
12
- #
13
- root(:interpolators)
14
-
15
- # +interpolator+ matches interpolation parts.
16
- rule(:interpolator) { embeded_variable | embeded_expr | narrative }
17
- rule(:interpolators) { interpolator.repeat.as(:interpolators) }
18
-
19
- # +embeded_variable+ matches embeded expressions with variable heading.
20
- rule(:embeded_variable) {
21
- start_embeded_variable >> padded?(expr!).as(:embeded_expr) >> end_embeded_variable!
22
- }
23
- rule(:start_embeded_variable) { str("{") >> variable.present? }
24
- rule(:end_embeded_variable) { str("}") }
25
- rule(:end_embeded_variable!) { end_embeded_variable.or_error("should be '}'") }
26
-
27
- # +embeded_expr+ matches arbitrary embeded expressions.
28
- rule(:embeded_expr) {
29
- start_embeded_expr >> padded?(expr!).as(:embeded_expr) >> end_embeded_expr!
30
- }
31
- rule(:start_embeded_expr) { str("<?") }
32
- rule(:end_embeded_expr) { str("?>") }
33
- rule(:end_embeded_expr!) { end_embeded_expr.or_error("should be '?>'") }
34
-
35
- # +start_symbol+ matches start symbols of embeded expressions.
36
- rule(:start_symbol) { start_embeded_variable | start_embeded_expr }
37
-
38
- # +narrative+ matches other than embeded expressions.
39
- rule(:narrative) {
40
- (start_symbol.absent? >> any).repeat(1).as(:narrative)
41
- }
42
- end
43
- end
44
- end
@@ -1,13 +0,0 @@
1
- module Pione
2
- module Lang
3
- # InterpolatorTransformer is a transformer for PIONE embeded expressions.
4
- class InterpolatorTransformer < Parslet::Transform
5
- include LiteralTransformer
6
- include ExprTransformer
7
-
8
- rule(:interpolators => sequence(:list)) { list }
9
- rule(:embeded_expr => simple(:expr)) { expr }
10
- rule(:narrative => simple(:str)) { str.to_s }
11
- end
12
- end
13
- end
@@ -1,5 +0,0 @@
1
- require 'pione/test-helper'
2
-
3
- describe 'Pione::Parser::InterpolatorParser' do
4
- TestHelper::Parser.spec(__FILE__, self, Lang::InterpolatorParser)
5
- end
@@ -1,15 +0,0 @@
1
- require 'pione/test-helper'
2
-
3
- describe 'Pione::Transformer::InterpolatorTransformer' do
4
- opts = {
5
- parser_class: Lang::InterpolatorParser,
6
- transformer_class: Lang::InterpolatorTransformer
7
- }
8
-
9
- transformer_spec("embeded_variable", :embeded_variable, opts) do
10
- test("{$x}", TestHelper::Lang.expr("$x"))
11
- test("{$x.as_string}", TestHelper::Lang.expr("$x.as_string"))
12
- test("{$x.m(A, 1, true)}", TestHelper::Lang.expr("$x.m(A, 1, true)"))
13
- test("{$x + $y}", TestHelper::Lang.expr("$x + $y"))
14
- end
15
- end