stuka 0.0.10 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/lib/stuka/commands/command.rb +0 -8
- data/lib/stuka/commands/public_commands/new_command.rb +0 -1
- data/lib/stuka/commands/public_commands/process_command.rb +2 -2
- data/lib/stuka/commands/public_commands/setup_command.rb +3 -4
- data/lib/stuka/{stuka_cli.rb → commands/stuka_cli.rb} +4 -4
- data/lib/stuka/commands/subcommands/create/{create_process.rb → create_process_file.rb} +3 -3
- data/lib/stuka/commands/subcommands/setup/setup_directories.rb +6 -6
- data/lib/stuka/external/action_finder.rb +25 -0
- data/lib/stuka/external/business_action.rb +18 -0
- data/lib/stuka/external/business_process.rb +85 -0
- data/lib/stuka/external/dispatcher.rb +27 -0
- data/lib/stuka/external/process_states/finished_state.rb +13 -0
- data/lib/stuka/external/process_states/inactive_state.rb +16 -0
- data/lib/stuka/external/process_states/started_state.rb +21 -0
- data/lib/stuka/external/process_states/starting_state.rb +16 -0
- data/lib/stuka/external/unknown_action.rb +9 -0
- data/lib/stuka/internal/domain/action.rb +32 -0
- data/lib/stuka/internal/domain/domain.rb +29 -0
- data/lib/stuka/internal/domain/process.rb +32 -0
- data/lib/stuka/internal/domain_builders/action_domain_builder.rb +19 -0
- data/lib/stuka/internal/domain_builders/domain_builder.rb +32 -0
- data/lib/stuka/internal/domain_builders/process_domain_builder.rb +17 -0
- data/lib/stuka/internal/process_cleaner.rb +0 -2
- data/lib/stuka/internal/source_builders/action_builder.rb +32 -0
- data/lib/stuka/internal/source_builders/process_builder.rb +38 -0
- data/lib/stuka/internal/source_builders/source_builder.rb +14 -0
- data/lib/stuka/internal/validator.rb +22 -7
- data/lib/stuka/paths/stuka_paths.rb +18 -0
- data/lib/stuka/templates/source/process.tt +18 -3
- data/lib/stuka/version.rb +2 -2
- data/lib/stuka.rb +0 -1
- data/spec/{commands → aceptance/commands}/new_command_spec.rb +1 -1
- data/spec/aceptance/commands/process_command_spec.rb +22 -0
- data/spec/{commands → aceptance/commands}/setup_command_spec.rb +1 -1
- data/spec/aceptance/external/action_aceptance_spec.rb +24 -0
- data/spec/aceptance/external/feed_cat_process_aceptance_spec.rb +46 -0
- data/spec/aceptance/external/processes/cat/check_food.rb +14 -0
- data/spec/aceptance/external/processes/cat/fill_up_plate.rb +14 -0
- data/spec/aceptance/external/processes/cat/go_to_store.rb +14 -0
- data/spec/aceptance/external/processes/feed_cat_process.rb +28 -0
- data/spec/spec_helper.rb +10 -2
- data/spec/unit/external/example_source/create_world.rb +28 -0
- data/spec/unit/external/example_source/kill_monster.rb +38 -0
- data/spec/unit/external/example_source/world/gather_materials.rb +13 -0
- data/spec/unit/external/example_source/world/scrap_world.rb +13 -0
- data/spec/unit/external/example_source/world/seperate_light_from_darkness.rb +13 -0
- data/spec/unit/external/finder_spec.rb +37 -0
- data/spec/unit/external/process_interface.rb +9 -0
- data/spec/unit/external/process_to_action.rb +61 -0
- data/spec/unit/external/process_to_dispatcher_spec.rb +35 -0
- data/spec/unit/external/process_to_finder_spec.rb +138 -0
- data/spec/{build/process_builder_spec.rb → unit/internal/action_builder_spec.rb} +6 -7
- data/spec/unit/internal/action_domain_builder_spec.rb +44 -0
- data/spec/unit/internal/action_spec.rb +14 -0
- data/spec/unit/internal/process_builder_spec.rb +44 -0
- data/spec/{build → unit/internal}/process_cleaner_spec.rb +2 -3
- data/spec/unit/internal/process_domain_builder_spec.rb +51 -0
- data/spec/unit/internal/process_spec.rb +14 -0
- data/spec/unit/internal/process_validator_spec.rb +42 -0
- data/spec/{build → unit/internal}/processes_dsl_test/correct_test_process.rb +12 -5
- data/stuka.gemspec +1 -1
- metadata +82 -41
- data/lib/stuka/commands/public_commands/step_command.rb +0 -25
- data/lib/stuka/commands/subcommands/create/create_action.rb +0 -16
- data/lib/stuka/internal/action.rb +0 -33
- data/lib/stuka/internal/action_builder.rb +0 -31
- data/lib/stuka/internal/action_incubator.rb +0 -37
- data/lib/stuka/internal/process.rb +0 -38
- data/lib/stuka/internal/process_builder.rb +0 -30
- data/lib/stuka/internal/process_incubator.rb +0 -37
- data/lib/stuka/stuka_paths.rb +0 -21
- data/lib/stuka/templates/definitions/step.tt +0 -8
- data/spec/build/action_builder_spec.rb +0 -23
- data/spec/build/action_incubator_spec.rb +0 -24
- data/spec/build/dsl_spec.rb +0 -44
- data/spec/build/process_incubator_spec.rb +0 -27
- data/spec/build/process_validator_spec.rb +0 -40
- data/spec/commands/process_command_spec.rb +0 -19
- data/spec/commands/step_command_spec.rb +0 -19
- /data/spec/{build/processes_dsl_test/incorrect → unit/internal/processes_dsl_test_incorrect}/incorrect_test_process.rb +0 -0
@@ -0,0 +1,138 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require "unit/external/example_source/kill_monster"
|
3
|
+
require "unit/external/process_interface"
|
4
|
+
require "stuka/external/business_process"
|
5
|
+
|
6
|
+
describe KillMonster do
|
7
|
+
|
8
|
+
it_behaves_like "a process"
|
9
|
+
|
10
|
+
let(:finder) { double() }
|
11
|
+
|
12
|
+
let(:process) do
|
13
|
+
|
14
|
+
KillMonster.new(action_finder: finder) do |on|
|
15
|
+
|
16
|
+
on.success {
|
17
|
+
puts "yay success"
|
18
|
+
}
|
19
|
+
on.failure {
|
20
|
+
puts "nay failure"
|
21
|
+
}
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
let(:train_hard) { double(process: process) }
|
28
|
+
let(:get_a_sharp_sword) { double(process: process) }
|
29
|
+
let(:get_a_new_gun) { double(process: process) }
|
30
|
+
let(:train_fast_running) { double(process: process) }
|
31
|
+
let(:get_bullets) { double(process: process) }
|
32
|
+
|
33
|
+
before :each do
|
34
|
+
Stuka::StukaPaths::PROCESSES_SOURCE_PATH.replace "#{File.dirname(__FILE__)}/example_source"
|
35
|
+
|
36
|
+
allow(finder).to receive(:find_action) do |action, process|
|
37
|
+
|
38
|
+
case action
|
39
|
+
when "monster::train_hard"
|
40
|
+
train_hard
|
41
|
+
when "monster::get_a_sharp_sword"
|
42
|
+
get_a_sharp_sword
|
43
|
+
when "monster::get_a_new_gun"
|
44
|
+
get_a_new_gun
|
45
|
+
when "monster::train_fast_running"
|
46
|
+
train_fast_running
|
47
|
+
when "gun::get_bullets"
|
48
|
+
get_bullets
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
|
55
|
+
context "first path, killing monster with sword" do
|
56
|
+
|
57
|
+
before :each do
|
58
|
+
allow(train_hard).to receive(:run) { self.process.transition({}, :good_with_sword) }
|
59
|
+
allow(get_a_sharp_sword).to receive(:run) { self.process.transition({}, :success) }
|
60
|
+
allow(get_a_new_gun).to receive(:run) { self.process.transition({}, :success) }
|
61
|
+
allow(train_fast_running).to receive(:run) { self.process.transition({}, :success) }
|
62
|
+
allow(get_bullets).to receive(:run) { self.process.transition({}, :success) }
|
63
|
+
end
|
64
|
+
|
65
|
+
it "sends the find_action message to finder so it can find action classes" do
|
66
|
+
|
67
|
+
expect(finder).to receive(:find_action).with("monster::train_hard", process)
|
68
|
+
expect(finder).to receive(:find_action).with("monster::get_a_sharp_sword", process)
|
69
|
+
|
70
|
+
expect(finder).to_not receive(:find_action).with("monster::get_a_new_gun", process)
|
71
|
+
expect(finder).to_not receive(:find_action).with("monster::get_bullets", process)
|
72
|
+
|
73
|
+
process.run({})
|
74
|
+
|
75
|
+
expect(process.current_state).to eq Stuka::BusinessProcess::PROCESS_STATES[:finished]
|
76
|
+
|
77
|
+
end
|
78
|
+
|
79
|
+
end
|
80
|
+
|
81
|
+
context "second path, killing monster with firearm" do
|
82
|
+
|
83
|
+
before :each do
|
84
|
+
|
85
|
+
allow(train_hard).to receive(:run) { self.process.transition({}, :sharp_shooter) }
|
86
|
+
allow(get_a_sharp_sword).to receive(:run) { self.process.transition({}, :success) }
|
87
|
+
allow(get_a_new_gun).to receive(:run) { self.process.transition({}, :success) }
|
88
|
+
allow(train_fast_running).to receive(:run) { self.process.transition({}, :success) }
|
89
|
+
allow(get_bullets).to receive(:run) { self.process.transition({}, :success) }
|
90
|
+
|
91
|
+
end
|
92
|
+
|
93
|
+
it "sends correct find_action messages to action finder object" do
|
94
|
+
|
95
|
+
expect(finder).to receive(:find_action).with("monster::train_hard", process)
|
96
|
+
expect(finder).to receive(:find_action).with("monster::get_a_new_gun", process)
|
97
|
+
expect(finder).to receive(:find_action).with("gun::get_bullets", process)
|
98
|
+
|
99
|
+
expect(finder).to_not receive(:find_action).with("monster::get_a_sharp_sword", process)
|
100
|
+
|
101
|
+
process.run({})
|
102
|
+
|
103
|
+
expect(process.current_state).to eq Stuka::BusinessProcess::PROCESS_STATES[:finished]
|
104
|
+
|
105
|
+
end
|
106
|
+
|
107
|
+
|
108
|
+
end
|
109
|
+
|
110
|
+
context "failure path" do
|
111
|
+
|
112
|
+
before :each do
|
113
|
+
|
114
|
+
allow(train_hard).to receive(:run) { self.process.transition({}, :good_with_sword) }
|
115
|
+
allow(get_a_sharp_sword).to receive(:run) { self.process.transition({}, :failure) }
|
116
|
+
allow(get_a_new_gun).to receive(:run) { self.process.transition({}, :success) }
|
117
|
+
allow(train_fast_running).to receive(:run) { self.process.transition({}, :success) }
|
118
|
+
allow(get_bullets).to receive(:run) { self.process.transition({}, :success) }
|
119
|
+
|
120
|
+
end
|
121
|
+
|
122
|
+
it "sends correct find_action messages to action finder object" do
|
123
|
+
|
124
|
+
expect(finder).to receive(:find_action).with("monster::train_hard", process)
|
125
|
+
expect(finder).to receive(:find_action).with("monster::get_a_sharp_sword", process)
|
126
|
+
|
127
|
+
expect(finder).to_not receive(:find_action).with("monster::get_a_new_gun", process)
|
128
|
+
expect(finder).to_not receive(:find_action).with("gun::get_bullets", process)
|
129
|
+
|
130
|
+
process.run({})
|
131
|
+
|
132
|
+
expect(process.current_state).to eq Stuka::BusinessProcess::PROCESS_STATES[:finished]
|
133
|
+
|
134
|
+
end
|
135
|
+
|
136
|
+
end
|
137
|
+
|
138
|
+
end
|
@@ -1,8 +1,7 @@
|
|
1
1
|
require "spec_helper"
|
2
|
-
|
3
|
-
require_relative "../../lib/stuka/stuka_paths"
|
2
|
+
require "stuka/internal/source_builders/action_builder"
|
4
3
|
|
5
|
-
describe "
|
4
|
+
describe "ActionBuilder" do
|
6
5
|
|
7
6
|
around(:each) do |example|
|
8
7
|
FileUtils.rm_rf("#{Stuka::StukaPaths::TEST_PROCESSES_SOURCE_PATH}/.", secure: true)
|
@@ -10,14 +9,14 @@ describe "ProcessBuilder" do
|
|
10
9
|
FileUtils.rm_rf("#{Stuka::StukaPaths::TEST_PROCESSES_SOURCE_PATH}/.", secure: true)
|
11
10
|
end
|
12
11
|
|
13
|
-
it "builds ruby source with
|
14
|
-
Stuka::
|
12
|
+
it "builds ruby source with ActionBuilder::build" do
|
13
|
+
Stuka::ActionBuilder.build
|
15
14
|
|
16
15
|
source_files = Dir["#{Stuka::StukaPaths::PROCESSES_SOURCE_PATH}/*.rb"]
|
17
16
|
source_files = source_files.map{ |path| File.basename(path) }
|
18
17
|
expect(source_files.count).to eq(2)
|
19
|
-
expect(source_files.include? "
|
20
|
-
expect(source_files.include? "
|
18
|
+
expect(source_files.include? "acc1_action.rb").to be(true)
|
19
|
+
expect(source_files.include? "acc2_action.rb").to be(true)
|
21
20
|
end
|
22
21
|
|
23
22
|
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require "stuka/internal/domain_builders/action_domain_builder"
|
3
|
+
|
4
|
+
describe Stuka::ActionDomainBuilder do
|
5
|
+
|
6
|
+
let(:adb) { Stuka::ActionDomainBuilder.new }
|
7
|
+
|
8
|
+
it "Creates an action and stores it in @instances attribute with ActionDomainBuilder#action method, this method is called in the dsl." do
|
9
|
+
|
10
|
+
adb.action("new_action1") do
|
11
|
+
description "desc1"
|
12
|
+
end
|
13
|
+
|
14
|
+
adb.action("new_action2") do
|
15
|
+
description "desc2"
|
16
|
+
end
|
17
|
+
|
18
|
+
expect(adb.instances.count).to eq(2)
|
19
|
+
|
20
|
+
act1 = adb.instances[0]
|
21
|
+
expect(act1.name).to eq("new_action1")
|
22
|
+
expect(act1.description).to eq("desc1")
|
23
|
+
|
24
|
+
act2 = adb.instances[1]
|
25
|
+
expect(act2.name).to eq("new_action2")
|
26
|
+
expect(act2.description).to eq("desc2")
|
27
|
+
end
|
28
|
+
|
29
|
+
context "when reserved 'prospect' namespace is used for an action" do
|
30
|
+
|
31
|
+
it "should reaise an error with message" do
|
32
|
+
|
33
|
+
dsl = Proc.new do
|
34
|
+
description "this action uses reserved keywords"
|
35
|
+
namespace "process"
|
36
|
+
end
|
37
|
+
|
38
|
+
expect { adb.action("new_action", &dsl) }.to raise_error "'process' namespace is reserved"
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require "stuka/internal/domain/action"
|
3
|
+
|
4
|
+
describe Stuka::Action do
|
5
|
+
|
6
|
+
it "Reacts to basic stuff" do
|
7
|
+
acc = Stuka::Action.new("test")
|
8
|
+
acc.description "ddd"
|
9
|
+
|
10
|
+
expect(acc.name).to eq("test")
|
11
|
+
expect(acc.description).to eq("ddd")
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require "stuka/internal/source_builders/process_builder"
|
3
|
+
require "stuka/paths/stuka_paths"
|
4
|
+
|
5
|
+
|
6
|
+
describe "ProcessBuilder" do
|
7
|
+
|
8
|
+
around(:each) do |example|
|
9
|
+
FileUtils.rm_rf("#{Stuka::StukaPaths::TEST_PROCESSES_SOURCE_PATH}/.", secure: true)
|
10
|
+
example.run
|
11
|
+
FileUtils.rm_rf("#{Stuka::StukaPaths::TEST_PROCESSES_SOURCE_PATH}/.", secure: true)
|
12
|
+
end
|
13
|
+
|
14
|
+
it "builds ruby source with ProcessBuilder::build" do
|
15
|
+
Stuka::ProcessBuilder.build
|
16
|
+
|
17
|
+
source_files = Dir["#{Stuka::StukaPaths::PROCESSES_SOURCE_PATH}/*.rb"]
|
18
|
+
source_files = source_files.map{ |path| File.basename(path) }
|
19
|
+
expect(source_files.count).to eq(2)
|
20
|
+
expect(source_files.include? "test1.rb").to be(true)
|
21
|
+
expect(source_files.include? "test2.rb").to be(true)
|
22
|
+
|
23
|
+
require_relative "processes_source_test/test1"
|
24
|
+
|
25
|
+
process = Test1.new
|
26
|
+
|
27
|
+
expect(process.transition_map).to eq(
|
28
|
+
{
|
29
|
+
"test::akcija" => {
|
30
|
+
success: "test::druga",
|
31
|
+
failure: "process::failure"
|
32
|
+
},
|
33
|
+
"test::druga" => {
|
34
|
+
success: "process::success",
|
35
|
+
failure: "process::failure"
|
36
|
+
}
|
37
|
+
}
|
38
|
+
)
|
39
|
+
|
40
|
+
expect(process.start_action).to eq("test::akcija")
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require "spec_helper"
|
2
|
-
|
3
|
-
|
4
|
-
require_relative "../../lib/stuka/stuka_paths"
|
2
|
+
require "stuka/internal/process_cleaner"
|
3
|
+
require "stuka/internal/source_builders/process_builder"
|
5
4
|
|
6
5
|
describe "ProcessCleaner" do
|
7
6
|
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require "stuka/internal/domain_builders/process_domain_builder"
|
3
|
+
|
4
|
+
describe Stuka::ProcessDomainBuilder do
|
5
|
+
|
6
|
+
it "creates a process, initializes it and stores it in @instances attribute with ProcessDomainBuilder#process, this method is called in the dsl." do
|
7
|
+
pdb = Stuka::ProcessDomainBuilder.new
|
8
|
+
|
9
|
+
pdb.process("new_process1") do
|
10
|
+
description "desc1"
|
11
|
+
end
|
12
|
+
|
13
|
+
pdb.process("new_process2") do
|
14
|
+
description "desc2"
|
15
|
+
end
|
16
|
+
|
17
|
+
expect(pdb.instances.count).to eq(2)
|
18
|
+
|
19
|
+
proc1 = pdb.instances[0]
|
20
|
+
expect(proc1.name).to eq("new_process1")
|
21
|
+
expect(proc1.description).to eq("desc1")
|
22
|
+
|
23
|
+
proc2 = pdb.instances[1]
|
24
|
+
expect(proc2.name).to eq("new_process2")
|
25
|
+
expect(proc2.description).to eq("desc2")
|
26
|
+
end
|
27
|
+
|
28
|
+
context "when dsl syntax is correct" do
|
29
|
+
it "evaluates correct test files with ProcessDomainBuilder#build_domain" do
|
30
|
+
pdb = Stuka::ProcessDomainBuilder.new
|
31
|
+
pdb.build_domain
|
32
|
+
expect(pdb.instances.count).to eq(2)
|
33
|
+
expect(pdb.instances.map(&:name).include? "test1").to be true
|
34
|
+
expect(pdb.instances.map(&:name).include? "test2").to be true
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
context "when dsl syntax is incorrect" do
|
39
|
+
|
40
|
+
before(:each) do
|
41
|
+
Stuka::StukaPaths::PROCESSES_DEFINITION_PATH.replace Stuka::StukaPaths::TEST_PROCESSES_INCORRECT_DEFINITION_PATH
|
42
|
+
end
|
43
|
+
|
44
|
+
it "ProcessIncubator#incubate evaluates bad test files" do
|
45
|
+
pdb = Stuka::ProcessDomainBuilder.new
|
46
|
+
expect{pdb.build_domain}.to raise_error
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require "stuka/internal/domain/process"
|
3
|
+
|
4
|
+
describe Stuka::Process do
|
5
|
+
|
6
|
+
it "Reacts to basic stuff" do
|
7
|
+
proc = Stuka::Process.new("test")
|
8
|
+
proc.description "ddd"
|
9
|
+
|
10
|
+
expect(proc.name).to eq("test")
|
11
|
+
expect(proc.description).to eq("ddd")
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require "stuka/internal/validator"
|
3
|
+
require 'stuka/internal/domain/process'
|
4
|
+
|
5
|
+
describe "Validator" do
|
6
|
+
|
7
|
+
let(:validator) { Stuka::Validator.new }
|
8
|
+
|
9
|
+
let(:valid_process) { Stuka::Process.new("pr1", "pr2_desc", ["arg1", "arg2"], "start_action") }
|
10
|
+
let(:valid_process2) { Stuka::Process.new("pr2", "pr2_desc", [], "start_action") }
|
11
|
+
|
12
|
+
let(:invalid_process) { Stuka::Process.new("pr3", nil, ["arg1", "arg2"], "start_action") }
|
13
|
+
let(:invalid_process2) { Stuka::Process.new("", "description", ["arg1", "arg2"], "start_action") }
|
14
|
+
|
15
|
+
context "when testing single process" do
|
16
|
+
|
17
|
+
it "validates process atributes with Validator::process_valid?" do
|
18
|
+
expect(validator.process_valid? valid_process).to eq(true)
|
19
|
+
expect(validator.process_valid? valid_process2).to eq(true)
|
20
|
+
expect(validator.process_valid? invalid_process).to eq(false)
|
21
|
+
expect(validator.process_valid? invalid_process2).to eq(false)
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
context "when testing a set of processes" do
|
27
|
+
|
28
|
+
let(:valid_process_set) { [valid_process, valid_process2] }
|
29
|
+
let(:invalid_process_set) { [valid_process, valid_process, valid_process2] }
|
30
|
+
let(:invalid_process_set2) { [valid_process, valid_process, nil] }
|
31
|
+
let(:invalid_process_set3) { [valid_process, valid_process2, invalid_process2] }
|
32
|
+
|
33
|
+
it "checks if all processes have different names with Validator::process_set_valid?" do
|
34
|
+
expect(validator.process_set_valid? valid_process_set).to eq(true)
|
35
|
+
expect(validator.process_set_valid? invalid_process_set).to eq(false)
|
36
|
+
expect(validator.process_set_valid? invalid_process_set2).to eq(false)
|
37
|
+
expect(validator.process_set_valid? invalid_process_set3).to eq(false)
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
@@ -1,14 +1,21 @@
|
|
1
1
|
process "test1" do
|
2
2
|
description "pro description"
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
|
4
|
+
start_action "test::akcija"
|
5
|
+
|
6
|
+
action_transition "test::akcija",
|
7
|
+
success: "test::druga",
|
8
|
+
failure: "process::failure"
|
9
|
+
|
10
|
+
action_transition "test::druga",
|
11
|
+
success: "process::success",
|
12
|
+
failure: "process::failure"
|
7
13
|
end
|
8
14
|
|
9
15
|
process "test2" do
|
10
16
|
description "proc2 description"
|
11
|
-
|
17
|
+
|
18
|
+
start_action "akcija"
|
12
19
|
action_transition "akcija",
|
13
20
|
success: "bla",
|
14
21
|
failure: "foo"
|
data/stuka.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.authors = ["David Sljukic"]
|
11
11
|
spec.email = ["david.sljukic@gmail.com"]
|
12
12
|
spec.summary = %q{Stuka is a dsl for managing business processes}
|
13
|
-
spec.description = %q{Stuka is a dsl for managing business processes}
|
13
|
+
spec.description = %q{Stuka is a dsl for managing business processes yadda yadda}
|
14
14
|
spec.homepage = ""
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stuka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Sljukic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
-
description: Stuka is a dsl for managing business processes
|
69
|
+
description: Stuka is a dsl for managing business processes yadda yadda
|
70
70
|
email:
|
71
71
|
- david.sljukic@gmail.com
|
72
72
|
executables:
|
@@ -86,27 +86,36 @@ files:
|
|
86
86
|
- lib/stuka/commands/public_commands/new_command.rb
|
87
87
|
- lib/stuka/commands/public_commands/process_command.rb
|
88
88
|
- lib/stuka/commands/public_commands/setup_command.rb
|
89
|
-
- lib/stuka/commands/
|
90
|
-
- lib/stuka/commands/subcommands/create/
|
91
|
-
- lib/stuka/commands/subcommands/create/create_process.rb
|
89
|
+
- lib/stuka/commands/stuka_cli.rb
|
90
|
+
- lib/stuka/commands/subcommands/create/create_process_file.rb
|
92
91
|
- lib/stuka/commands/subcommands/create/create_project.rb
|
93
92
|
- lib/stuka/commands/subcommands/setup/setup_directories.rb
|
94
93
|
- lib/stuka/commands/subcommands/setup/setup_gemfile.rb
|
95
94
|
- lib/stuka/commands/subcommands/setup/setup_rakefile.rb
|
96
95
|
- lib/stuka/commands/subcommands/setup/setup_tasks.rb
|
97
|
-
- lib/stuka/
|
98
|
-
- lib/stuka/
|
99
|
-
- lib/stuka/
|
100
|
-
- lib/stuka/
|
101
|
-
- lib/stuka/
|
96
|
+
- lib/stuka/external/action_finder.rb
|
97
|
+
- lib/stuka/external/business_action.rb
|
98
|
+
- lib/stuka/external/business_process.rb
|
99
|
+
- lib/stuka/external/dispatcher.rb
|
100
|
+
- lib/stuka/external/process_states/finished_state.rb
|
101
|
+
- lib/stuka/external/process_states/inactive_state.rb
|
102
|
+
- lib/stuka/external/process_states/started_state.rb
|
103
|
+
- lib/stuka/external/process_states/starting_state.rb
|
104
|
+
- lib/stuka/external/unknown_action.rb
|
105
|
+
- lib/stuka/internal/domain/action.rb
|
106
|
+
- lib/stuka/internal/domain/domain.rb
|
107
|
+
- lib/stuka/internal/domain/process.rb
|
108
|
+
- lib/stuka/internal/domain_builders/action_domain_builder.rb
|
109
|
+
- lib/stuka/internal/domain_builders/domain_builder.rb
|
110
|
+
- lib/stuka/internal/domain_builders/process_domain_builder.rb
|
102
111
|
- lib/stuka/internal/process_cleaner.rb
|
103
|
-
- lib/stuka/internal/
|
112
|
+
- lib/stuka/internal/source_builders/action_builder.rb
|
113
|
+
- lib/stuka/internal/source_builders/process_builder.rb
|
114
|
+
- lib/stuka/internal/source_builders/source_builder.rb
|
104
115
|
- lib/stuka/internal/validator.rb
|
105
|
-
- lib/stuka/
|
106
|
-
- lib/stuka/stuka_paths.rb
|
116
|
+
- lib/stuka/paths/stuka_paths.rb
|
107
117
|
- lib/stuka/templates/configs/gemfile.tt
|
108
118
|
- lib/stuka/templates/definitions/process.tt
|
109
|
-
- lib/stuka/templates/definitions/step.tt
|
110
119
|
- lib/stuka/templates/samples/my_first_step.tt
|
111
120
|
- lib/stuka/templates/samples/my_process.tt
|
112
121
|
- lib/stuka/templates/samples/my_second_step.tt
|
@@ -114,20 +123,36 @@ files:
|
|
114
123
|
- lib/stuka/templates/source/process.tt
|
115
124
|
- lib/stuka/templates/tasks/rakefile.tt
|
116
125
|
- lib/stuka/version.rb
|
117
|
-
- spec/
|
118
|
-
- spec/
|
119
|
-
- spec/
|
120
|
-
- spec/
|
121
|
-
- spec/
|
122
|
-
- spec/
|
123
|
-
- spec/
|
124
|
-
- spec/
|
125
|
-
- spec/
|
126
|
-
- spec/commands/new_command_spec.rb
|
127
|
-
- spec/commands/process_command_spec.rb
|
128
|
-
- spec/commands/setup_command_spec.rb
|
129
|
-
- spec/commands/step_command_spec.rb
|
126
|
+
- spec/aceptance/commands/new_command_spec.rb
|
127
|
+
- spec/aceptance/commands/process_command_spec.rb
|
128
|
+
- spec/aceptance/commands/setup_command_spec.rb
|
129
|
+
- spec/aceptance/external/action_aceptance_spec.rb
|
130
|
+
- spec/aceptance/external/feed_cat_process_aceptance_spec.rb
|
131
|
+
- spec/aceptance/external/processes/cat/check_food.rb
|
132
|
+
- spec/aceptance/external/processes/cat/fill_up_plate.rb
|
133
|
+
- spec/aceptance/external/processes/cat/go_to_store.rb
|
134
|
+
- spec/aceptance/external/processes/feed_cat_process.rb
|
130
135
|
- spec/spec_helper.rb
|
136
|
+
- spec/unit/external/example_source/create_world.rb
|
137
|
+
- spec/unit/external/example_source/kill_monster.rb
|
138
|
+
- spec/unit/external/example_source/world/gather_materials.rb
|
139
|
+
- spec/unit/external/example_source/world/scrap_world.rb
|
140
|
+
- spec/unit/external/example_source/world/seperate_light_from_darkness.rb
|
141
|
+
- spec/unit/external/finder_spec.rb
|
142
|
+
- spec/unit/external/process_interface.rb
|
143
|
+
- spec/unit/external/process_to_action.rb
|
144
|
+
- spec/unit/external/process_to_dispatcher_spec.rb
|
145
|
+
- spec/unit/external/process_to_finder_spec.rb
|
146
|
+
- spec/unit/internal/action_builder_spec.rb
|
147
|
+
- spec/unit/internal/action_domain_builder_spec.rb
|
148
|
+
- spec/unit/internal/action_spec.rb
|
149
|
+
- spec/unit/internal/process_builder_spec.rb
|
150
|
+
- spec/unit/internal/process_cleaner_spec.rb
|
151
|
+
- spec/unit/internal/process_domain_builder_spec.rb
|
152
|
+
- spec/unit/internal/process_spec.rb
|
153
|
+
- spec/unit/internal/process_validator_spec.rb
|
154
|
+
- spec/unit/internal/processes_dsl_test/correct_test_process.rb
|
155
|
+
- spec/unit/internal/processes_dsl_test_incorrect/incorrect_test_process.rb
|
131
156
|
- stuka.gemspec
|
132
157
|
homepage: ''
|
133
158
|
licenses:
|
@@ -154,17 +179,33 @@ signing_key:
|
|
154
179
|
specification_version: 4
|
155
180
|
summary: Stuka is a dsl for managing business processes
|
156
181
|
test_files:
|
157
|
-
- spec/
|
158
|
-
- spec/
|
159
|
-
- spec/
|
160
|
-
- spec/
|
161
|
-
- spec/
|
162
|
-
- spec/
|
163
|
-
- spec/
|
164
|
-
- spec/
|
165
|
-
- spec/
|
166
|
-
- spec/commands/new_command_spec.rb
|
167
|
-
- spec/commands/process_command_spec.rb
|
168
|
-
- spec/commands/setup_command_spec.rb
|
169
|
-
- spec/commands/step_command_spec.rb
|
182
|
+
- spec/aceptance/commands/new_command_spec.rb
|
183
|
+
- spec/aceptance/commands/process_command_spec.rb
|
184
|
+
- spec/aceptance/commands/setup_command_spec.rb
|
185
|
+
- spec/aceptance/external/action_aceptance_spec.rb
|
186
|
+
- spec/aceptance/external/feed_cat_process_aceptance_spec.rb
|
187
|
+
- spec/aceptance/external/processes/cat/check_food.rb
|
188
|
+
- spec/aceptance/external/processes/cat/fill_up_plate.rb
|
189
|
+
- spec/aceptance/external/processes/cat/go_to_store.rb
|
190
|
+
- spec/aceptance/external/processes/feed_cat_process.rb
|
170
191
|
- spec/spec_helper.rb
|
192
|
+
- spec/unit/external/example_source/create_world.rb
|
193
|
+
- spec/unit/external/example_source/kill_monster.rb
|
194
|
+
- spec/unit/external/example_source/world/gather_materials.rb
|
195
|
+
- spec/unit/external/example_source/world/scrap_world.rb
|
196
|
+
- spec/unit/external/example_source/world/seperate_light_from_darkness.rb
|
197
|
+
- spec/unit/external/finder_spec.rb
|
198
|
+
- spec/unit/external/process_interface.rb
|
199
|
+
- spec/unit/external/process_to_action.rb
|
200
|
+
- spec/unit/external/process_to_dispatcher_spec.rb
|
201
|
+
- spec/unit/external/process_to_finder_spec.rb
|
202
|
+
- spec/unit/internal/action_builder_spec.rb
|
203
|
+
- spec/unit/internal/action_domain_builder_spec.rb
|
204
|
+
- spec/unit/internal/action_spec.rb
|
205
|
+
- spec/unit/internal/process_builder_spec.rb
|
206
|
+
- spec/unit/internal/process_cleaner_spec.rb
|
207
|
+
- spec/unit/internal/process_domain_builder_spec.rb
|
208
|
+
- spec/unit/internal/process_spec.rb
|
209
|
+
- spec/unit/internal/process_validator_spec.rb
|
210
|
+
- spec/unit/internal/processes_dsl_test/correct_test_process.rb
|
211
|
+
- spec/unit/internal/processes_dsl_test_incorrect/incorrect_test_process.rb
|
@@ -1,25 +0,0 @@
|
|
1
|
-
require_relative "../command"
|
2
|
-
require_relative "../subcommands/create/create_action"
|
3
|
-
|
4
|
-
module Stuka
|
5
|
-
|
6
|
-
class StepCommand < Command
|
7
|
-
|
8
|
-
argument :namespace, :desc => "Namespace of the step"
|
9
|
-
argument :name, :desc => "Name of the step"
|
10
|
-
|
11
|
-
def execute
|
12
|
-
Stuka::CreateAction.new.create(namespace, name)
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.description
|
16
|
-
"generates a step stub"
|
17
|
-
end
|
18
|
-
|
19
|
-
def self.usage
|
20
|
-
"step NAMESPACE NAME"
|
21
|
-
end
|
22
|
-
|
23
|
-
end
|
24
|
-
|
25
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
require_relative "../../command"
|
2
|
-
|
3
|
-
module Stuka
|
4
|
-
|
5
|
-
class CreateAction < Command
|
6
|
-
|
7
|
-
def create(namespace, name)
|
8
|
-
@namespace = namespace
|
9
|
-
@name = name
|
10
|
-
template('templates/definitions/step.tt', "process_definition/actions/#{namespace}/#{name}.rb")
|
11
|
-
say("Action #{namespace}::#{name} created")
|
12
|
-
end
|
13
|
-
|
14
|
-
end
|
15
|
-
|
16
|
-
end
|