pione 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +9 -0
- data/Rakefile +13 -0
- data/bin/pione +5 -0
- data/bin/pione-compiler +5 -0
- data/example/ScoreAggregation/ScoreAggregation.pione +2 -0
- data/example/ScoreAggregation/bin/apply-template.rb +1 -1
- data/example/ScoreAggregation/bin/mean-summary.rb +1 -1
- data/example/ScoreAggregation/bin/total-mean.rb +1 -1
- data/example/ScoreAggregation/bin/total-statistics.rb +3 -3
- data/example/ScoreAggregation/pione-package.json +21 -0
- data/example/ScoreAggregation/scenario/case1/Scenario.pione +1 -0
- data/example/ScoreAggregation/scenario/case1/pione-scenario.json +36 -0
- data/lib/pione.rb +15 -2
- data/lib/pione/agent/basic-agent.rb +0 -1
- data/lib/pione/agent/job-terminator.rb +8 -3
- data/lib/pione/agent/task-worker.rb +9 -2
- data/lib/pione/command.rb +2 -0
- data/lib/pione/command/basic-command.rb +4 -0
- data/lib/pione/command/option.rb +4 -1
- data/lib/pione/command/pione-clean.rb +104 -17
- data/lib/pione/command/pione-client.rb +16 -3
- data/lib/pione/command/pione-command.rb +45 -0
- data/lib/pione/command/pione-compiler.rb +39 -0
- data/lib/pione/command/pione-log.rb +1 -0
- data/lib/pione/command/pione-task-worker.rb +6 -2
- data/lib/pione/command/pione-val.rb +1 -0
- data/lib/pione/front.rb +1 -0
- data/lib/pione/front/basic-front.rb +1 -1
- data/lib/pione/front/front-exception.rb +5 -1
- data/lib/pione/global.rb +3 -118
- data/lib/pione/global/broker-variable.rb +21 -8
- data/lib/pione/global/client-variable.rb +16 -8
- data/lib/pione/{system → global}/config.rb +2 -2
- data/lib/pione/global/global-exception.rb +40 -0
- data/lib/pione/global/input-generator-variable.rb +4 -1
- data/lib/pione/global/item.rb +168 -0
- data/lib/pione/global/log-variable.rb +64 -13
- data/lib/pione/global/network-variable.rb +4 -1
- data/lib/pione/global/package-variable.rb +25 -10
- data/lib/pione/global/path-variable.rb +62 -26
- data/lib/pione/global/relay-variable.rb +101 -36
- data/lib/pione/global/system-variable.rb +26 -9
- data/lib/pione/global/task-worker-variable.rb +19 -7
- data/lib/pione/global/tuple-space-notifier-variable.rb +60 -20
- data/lib/pione/lang.rb +0 -2
- data/lib/pione/lang/data-expr.rb +8 -0
- data/lib/pione/package/package-exception.rb +1 -1
- data/lib/pione/rule-engine/action-handler.rb +14 -12
- data/lib/pione/rule-engine/engine-exception.rb +11 -0
- data/lib/pione/rule-engine/flow-handler.rb +20 -11
- data/lib/pione/system.rb +1 -1
- data/lib/pione/system/file-cache.rb +1 -1
- data/lib/pione/system/init.rb +13 -15
- data/lib/pione/system/status.rb +30 -0
- data/lib/pione/system/system-exception.rb +0 -24
- data/lib/pione/test-helper.rb +8 -1
- data/lib/pione/test-helper/command-helper.rb +42 -15
- data/lib/pione/util.rb +1 -0
- data/lib/pione/util/embeded-expr-expander.rb +5 -11
- data/lib/pione/util/pnml-compiler.rb +97 -0
- data/lib/pione/util/profiler.rb +107 -0
- data/lib/pione/version.rb +1 -1
- data/man/pione-clean.1 +76 -0
- data/pione.gemspec +5 -2
- data/test/agent/spec_job-terminator.rb +41 -3
- data/test/command/data/pione-client/ActionError.pione +5 -0
- data/test/command/data/pione-compiler/Sequence.pnml +137 -0
- data/test/command/spec_pione-clean.rb +250 -5
- data/test/command/spec_pione-client.rb +57 -46
- data/test/command/spec_pione-command.rb +18 -0
- data/test/command/spec_pione-compiler.rb +13 -0
- data/test/global/spec_item.rb +77 -0
- data/test/lang/data/data-expr.yml +5 -0
- data/test/rule-engine/{spec_action-handler.pione → data/action-handler/BasicAction.pione} +0 -0
- data/test/rule-engine/data/action-handler/UsePackageScript.pione +17 -0
- data/test/rule-engine/spec_action-handler.rb +143 -80
- data/test/system/spec_status.rb +13 -0
- data/test/{tuple → tuple-space}/spec_basic-tuple.rb +0 -0
- data/test/{tuple → tuple-space}/spec_data-tuple.rb +0 -0
- data/test/{tuple → tuple-space}/spec_finished-tuple.rb +0 -0
- data/test/{tuple → tuple-space}/spec_message-tuple.rb +0 -0
- data/test/{tuple → tuple-space}/spec_task-tuple.rb +0 -0
- data/test/{tuple → tuple-space}/spec_touch-tuple.rb +0 -0
- data/test/{tuple → tuple-space}/spec_working-tuple.rb +0 -0
- data/test/{tuple → tuple-space}/tuple-behavior.rb +0 -0
- data/test/util/data/pnml/Sequence.pnml +137 -0
- data/test/util/spec_pnml-compiler.rb +21 -0
- data/test/util/spec_profiler.rb +53 -0
- metadata +75 -32
- data/example/ScoreAggregation/package.yml +0 -5
- data/example/ScoreAggregation/scenario/case1/scenario.yml +0 -29
- data/lib/pione/lang/interpolator-parser.rb +0 -44
- data/lib/pione/lang/interpolator-transformer.rb +0 -13
- data/test/lang/spec_interpolator-parser.rb +0 -5
- data/test/lang/spec_interpolator-transformer.rb +0 -15
@@ -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,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
|