stuka 0.0.12 → 0.1.0
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/lib/stuka/commands/public_commands/setup_command.rb +1 -0
- data/lib/stuka/commands/subcommands/create/create_project.rb +1 -0
- data/lib/stuka/commands/subcommands/setup/setup_config.rb +21 -0
- data/lib/stuka/commands/subcommands/setup/setup_directories.rb +6 -5
- data/lib/stuka/commands/subcommands/setup/setup_gemfile.rb +2 -2
- data/lib/stuka/commands/subcommands/setup/setup_rakefile.rb +1 -1
- data/lib/stuka/config/stuka_paths.rb +109 -0
- data/lib/stuka/config/template_config.rb +59 -0
- data/lib/stuka/external/action_finder.rb +9 -7
- data/lib/stuka/external/business_action.rb +7 -4
- data/lib/stuka/external/business_process.rb +17 -13
- data/lib/stuka/external/dispatcher.rb +1 -1
- data/lib/stuka/external/process_states/finished_state.rb +1 -1
- data/lib/stuka/external/process_states/inactive_state.rb +3 -3
- data/lib/stuka/external/process_states/started_state.rb +7 -6
- data/lib/stuka/external/unknown_action.rb +1 -1
- data/lib/stuka/internal/domain/action.rb +16 -3
- data/lib/stuka/internal/domain/process.rb +32 -9
- data/lib/stuka/internal/domain_builders/action_domain_builder.rb +5 -1
- data/lib/stuka/internal/domain_builders/domain_builder.rb +1 -1
- data/lib/stuka/internal/process_cleaner.rb +3 -7
- data/lib/stuka/internal/source_builders/action_builder.rb +77 -7
- data/lib/stuka/internal/source_builders/process_builder.rb +29 -5
- data/lib/stuka/monkeypatch/string_patch.rb +12 -0
- data/lib/stuka/templates/configs/stuka_config.tt +11 -0
- data/lib/stuka/templates/samples/process_file.tt +39 -0
- data/lib/stuka/templates/source/action.tt +5 -5
- data/lib/stuka/templates/source/action_header.tt +8 -0
- data/lib/stuka/templates/source/process.tt +10 -17
- data/lib/stuka/templates/source/process_header.tt +8 -0
- data/lib/stuka/templates/tasks/stuka.tt +28 -20
- data/lib/stuka/version.rb +1 -1
- data/lib/stuka.rb +6 -0
- data/spec/aceptance/commands/process_command_spec.rb +3 -3
- data/spec/aceptance/external/action_aceptance_spec.rb +2 -2
- data/spec/aceptance/external/actions/cat/check_food.rb +16 -0
- data/spec/aceptance/external/actions/cat/fill_up_plate.rb +16 -0
- data/spec/aceptance/external/actions/cat/go_to_store.rb +16 -0
- data/spec/aceptance/external/feed_cat_process_aceptance_spec.rb +15 -14
- data/spec/aceptance/external/processes/feed_cat_process.rb +13 -14
- data/spec/spec_helper.rb +2 -1
- data/spec/unit/external/example_source/{world → actions/world}/gather_materials.rb +1 -1
- data/spec/unit/external/example_source/{world → actions/world}/scrap_world.rb +1 -1
- data/spec/unit/external/example_source/{world → actions/world}/seperate_light_from_darkness.rb +1 -1
- data/spec/unit/external/example_source/processes/create_world.rb +29 -0
- data/spec/unit/external/example_source/processes/kill_monster.rb +39 -0
- data/spec/unit/external/finder_spec.rb +8 -8
- data/spec/unit/external/process_to_dispatcher_spec.rb +3 -2
- data/spec/unit/external/process_to_finder_spec.rb +35 -17
- data/spec/unit/internal/action_builder_spec.rb +76 -6
- data/spec/unit/internal/action_domain_builder_spec.rb +8 -2
- data/spec/unit/internal/process_builder_spec.rb +18 -14
- data/spec/unit/internal/process_domain_builder_spec.rb +1 -1
- data/spec/unit/internal/processes_dsl_test/correct_test_process.rb +39 -19
- data/stuka.gemspec +1 -1
- metadata +27 -22
- data/lib/stuka/external/process_states/starting_state.rb +0 -16
- data/lib/stuka/paths/stuka_paths.rb +0 -18
- data/lib/stuka/templates/samples/my_process.tt +0 -19
- data/spec/aceptance/external/processes/cat/check_food.rb +0 -14
- data/spec/aceptance/external/processes/cat/fill_up_plate.rb +0 -14
- data/spec/aceptance/external/processes/cat/go_to_store.rb +0 -14
- data/spec/unit/external/example_source/create_world.rb +0 -28
- data/spec/unit/external/example_source/kill_monster.rb +0 -38
@@ -1,19 +1,19 @@
|
|
1
1
|
require "spec_helper"
|
2
|
-
require "unit/external/example_source/create_world"
|
2
|
+
require "unit/external/example_source/processes/create_world"
|
3
3
|
require "unit/external/process_interface"
|
4
4
|
require "stuka/external/action_finder"
|
5
5
|
|
6
|
-
require "unit/external/example_source/world/gather_materials"
|
7
|
-
require "unit/external/example_source/world/scrap_world"
|
8
|
-
require "unit/external/example_source/world/seperate_light_from_darkness"
|
6
|
+
require "unit/external/example_source/actions/world/gather_materials"
|
7
|
+
require "unit/external/example_source/actions/world/scrap_world"
|
8
|
+
require "unit/external/example_source/actions/world/seperate_light_from_darkness"
|
9
9
|
|
10
|
-
describe Stuka::ActionFinder do
|
10
|
+
describe Stuka::External::ActionFinder do
|
11
11
|
|
12
|
-
let(:finder) { Stuka::ActionFinder.new }
|
12
|
+
let(:finder) { Stuka::External::ActionFinder.new }
|
13
13
|
let(:process) { double() }
|
14
14
|
|
15
15
|
before :each do
|
16
|
-
Stuka::StukaPaths::
|
16
|
+
Stuka::StukaPaths::ACTIONS_SOURCE_PATH.replace "#{File.dirname(__FILE__)}/example_source/actions"
|
17
17
|
end
|
18
18
|
|
19
19
|
it "finds actions" do
|
@@ -31,7 +31,7 @@ describe Stuka::ActionFinder do
|
|
31
31
|
end
|
32
32
|
|
33
33
|
it "throws an UnknownAction error if it can't find the action class" do
|
34
|
-
expect { finder.find_action("some::unknown_action", process) }.to raise_error(Stuka::UnknownAction)
|
34
|
+
expect { finder.find_action("some::unknown_action", process) }.to raise_error(Stuka::External::UnknownAction)
|
35
35
|
end
|
36
36
|
|
37
37
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
require "spec_helper"
|
2
|
-
require_relative "example_source/create_world"
|
2
|
+
require_relative "example_source/processes/create_world"
|
3
3
|
require "stuka/external/business_process"
|
4
4
|
|
5
5
|
describe "ExampleProcess" do
|
@@ -22,6 +22,7 @@ describe "ExampleProcess" do
|
|
22
22
|
|
23
23
|
before :each do
|
24
24
|
Stuka::StukaPaths::PROCESSES_SOURCE_PATH.replace "#{File.dirname(__FILE__)}/example_source"
|
25
|
+
Stuka::StukaPaths::ACTIONS_SOURCE_PATH.replace "#{File.dirname(__FILE__)}/example_source/actions"
|
25
26
|
end
|
26
27
|
|
27
28
|
it "notifies the dispatcher of any other end event" do
|
@@ -29,7 +30,7 @@ describe "ExampleProcess" do
|
|
29
30
|
expect(dispatcher).to receive(:call).with(:failure, {})
|
30
31
|
process.run({})
|
31
32
|
|
32
|
-
expect(process.current_state).to eq(Stuka::BusinessProcess::PROCESS_STATES[:finished])
|
33
|
+
expect(process.current_state).to eq(Stuka::External::BusinessProcess::PROCESS_STATES[:finished])
|
33
34
|
end
|
34
35
|
|
35
36
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
require "spec_helper"
|
2
|
-
require "unit/external/example_source/kill_monster"
|
2
|
+
require "unit/external/example_source/processes/kill_monster"
|
3
3
|
require "unit/external/process_interface"
|
4
4
|
require "stuka/external/business_process"
|
5
5
|
|
@@ -11,16 +11,7 @@ describe KillMonster do
|
|
11
11
|
|
12
12
|
let(:process) do
|
13
13
|
|
14
|
-
KillMonster.new(action_finder: finder)
|
15
|
-
|
16
|
-
on.success {
|
17
|
-
puts "yay success"
|
18
|
-
}
|
19
|
-
on.failure {
|
20
|
-
puts "nay failure"
|
21
|
-
}
|
22
|
-
|
23
|
-
end
|
14
|
+
KillMonster.new(action_finder: finder)
|
24
15
|
|
25
16
|
end
|
26
17
|
|
@@ -70,9 +61,18 @@ describe KillMonster do
|
|
70
61
|
expect(finder).to_not receive(:find_action).with("monster::get_a_new_gun", process)
|
71
62
|
expect(finder).to_not receive(:find_action).with("monster::get_bullets", process)
|
72
63
|
|
73
|
-
process.run({})
|
64
|
+
process.run({}) do |on|
|
65
|
+
|
66
|
+
on.success {
|
67
|
+
puts "yay success"
|
68
|
+
}
|
69
|
+
on.failure {
|
70
|
+
puts "nay failure"
|
71
|
+
}
|
72
|
+
|
73
|
+
end
|
74
74
|
|
75
|
-
expect(process.current_state).to eq Stuka::BusinessProcess::PROCESS_STATES[:finished]
|
75
|
+
expect(process.current_state).to eq Stuka::External::BusinessProcess::PROCESS_STATES[:finished]
|
76
76
|
|
77
77
|
end
|
78
78
|
|
@@ -98,9 +98,18 @@ describe KillMonster do
|
|
98
98
|
|
99
99
|
expect(finder).to_not receive(:find_action).with("monster::get_a_sharp_sword", process)
|
100
100
|
|
101
|
-
process.run({})
|
101
|
+
process.run({}) do |on|
|
102
|
+
|
103
|
+
on.success {
|
104
|
+
puts "yay success"
|
105
|
+
}
|
106
|
+
on.failure {
|
107
|
+
puts "nay failure"
|
108
|
+
}
|
109
|
+
|
110
|
+
end
|
102
111
|
|
103
|
-
expect(process.current_state).to eq Stuka::BusinessProcess::PROCESS_STATES[:finished]
|
112
|
+
expect(process.current_state).to eq Stuka::External::BusinessProcess::PROCESS_STATES[:finished]
|
104
113
|
|
105
114
|
end
|
106
115
|
|
@@ -127,9 +136,18 @@ describe KillMonster do
|
|
127
136
|
expect(finder).to_not receive(:find_action).with("monster::get_a_new_gun", process)
|
128
137
|
expect(finder).to_not receive(:find_action).with("gun::get_bullets", process)
|
129
138
|
|
130
|
-
process.run({})
|
139
|
+
process.run({}) do |on|
|
140
|
+
|
141
|
+
on.success {
|
142
|
+
puts "yay success"
|
143
|
+
}
|
144
|
+
on.failure {
|
145
|
+
puts "nay failure"
|
146
|
+
}
|
147
|
+
|
148
|
+
end
|
131
149
|
|
132
|
-
expect(process.current_state).to eq Stuka::BusinessProcess::PROCESS_STATES[:finished]
|
150
|
+
expect(process.current_state).to eq Stuka::External::BusinessProcess::PROCESS_STATES[:finished]
|
133
151
|
|
134
152
|
end
|
135
153
|
|
@@ -1,22 +1,92 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
require "stuka/internal/source_builders/action_builder"
|
3
|
+
require "stuka/config/stuka_paths"
|
4
|
+
require "fileutils"
|
3
5
|
|
4
6
|
describe "ActionBuilder" do
|
5
7
|
|
8
|
+
let(:stream) { double(puts: "") }
|
9
|
+
|
6
10
|
around(:each) do |example|
|
7
|
-
FileUtils.rm_rf("#{Stuka::StukaPaths::
|
11
|
+
FileUtils.rm_rf("#{Stuka::StukaPaths::TEST_ACTIONS_SOURCE_PATH}/.", secure: true)
|
8
12
|
example.run
|
9
|
-
FileUtils.rm_rf("#{Stuka::StukaPaths::
|
13
|
+
FileUtils.rm_rf("#{Stuka::StukaPaths::TEST_ACTIONS_SOURCE_PATH}/.", secure: true)
|
10
14
|
end
|
11
15
|
|
12
16
|
it "builds ruby source with ActionBuilder::build" do
|
13
|
-
Stuka::ActionBuilder.build
|
17
|
+
Stuka::ActionBuilder.build(stream)
|
14
18
|
|
15
|
-
source_files = Dir["#{Stuka::StukaPaths
|
19
|
+
source_files = Dir["#{Stuka::StukaPaths.actions_source_path}/*/*.rb"]
|
16
20
|
source_files = source_files.map{ |path| File.basename(path) }
|
17
21
|
expect(source_files.count).to eq(2)
|
18
|
-
expect(source_files.include? "
|
19
|
-
expect(source_files.include? "
|
22
|
+
expect(source_files.include? "acc1.rb").to be(true)
|
23
|
+
expect(source_files.include? "acc2.rb").to be(true)
|
24
|
+
end
|
25
|
+
|
26
|
+
it "notifies if the action file already exists using stdout passed as an argument" do
|
27
|
+
|
28
|
+
Stuka::ActionBuilder.build(stream)
|
29
|
+
|
30
|
+
expect(stream).to receive(:puts).with("action file bla::acc1 already exists.")
|
31
|
+
|
32
|
+
Stuka::ActionBuilder.build(stream)
|
33
|
+
|
34
|
+
source_files = Dir["#{Stuka::StukaPaths.actions_source_path}/*/*.rb"]
|
35
|
+
source_files = source_files.map{ |path| File.basename(path) }
|
36
|
+
expect(source_files.count).to eq(2)
|
37
|
+
expect(source_files.include? "acc1.rb").to be(true)
|
38
|
+
expect(source_files.include? "acc2.rb").to be(true)
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
it "edits only comments of existing action file and leaves the whole class intact" do
|
43
|
+
|
44
|
+
make_test_action_file
|
45
|
+
|
46
|
+
Stuka::ActionBuilder.build(stream)
|
47
|
+
|
48
|
+
require_relative "#{File.dirname(__FILE__)}/actions_source_test/bla/acc1.rb"
|
49
|
+
expect(Bla::Acc1.instance_methods.include? :additional_method).to be true
|
50
|
+
end
|
51
|
+
|
52
|
+
private
|
53
|
+
|
54
|
+
def make_test_action_file
|
55
|
+
file_content = <<-TEST
|
56
|
+
|
57
|
+
##
|
58
|
+
# example action file
|
59
|
+
# this is the old description
|
60
|
+
# it should be overriden
|
61
|
+
# by the new description
|
62
|
+
# of the action
|
63
|
+
# bla
|
64
|
+
#
|
65
|
+
|
66
|
+
# but the next comment section should stay
|
67
|
+
|
68
|
+
require 'stuka/external/business_action'
|
69
|
+
|
70
|
+
module Bla
|
71
|
+
class Acc1 < Stuka::External::BusinessAction
|
72
|
+
|
73
|
+
def run(params)
|
74
|
+
params[stream].puts "test"
|
75
|
+
end
|
76
|
+
|
77
|
+
def additional_method
|
78
|
+
|
79
|
+
end
|
80
|
+
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
TEST
|
85
|
+
|
86
|
+
FileUtils.mkdir_p "#{File.dirname(__FILE__)}/actions_source_test/bla"
|
87
|
+
out_file = File.new("#{File.dirname(__FILE__)}/actions_source_test/bla/acc1.rb", "w")
|
88
|
+
out_file.puts(file_content)
|
89
|
+
out_file.close
|
20
90
|
end
|
21
91
|
|
22
92
|
end
|
@@ -7,23 +7,29 @@ describe Stuka::ActionDomainBuilder do
|
|
7
7
|
|
8
8
|
it "Creates an action and stores it in @instances attribute with ActionDomainBuilder#action method, this method is called in the dsl." do
|
9
9
|
|
10
|
-
adb.action("new_action1") do
|
10
|
+
adb.action("sample::new_action1") do
|
11
11
|
description "desc1"
|
12
|
+
endings [:first_ending, :second_ending]
|
12
13
|
end
|
13
14
|
|
14
|
-
adb.action("new_action2") do
|
15
|
+
adb.action("sample::new_action2") do
|
15
16
|
description "desc2"
|
17
|
+
endings ["success", "failure"]
|
16
18
|
end
|
17
19
|
|
18
20
|
expect(adb.instances.count).to eq(2)
|
19
21
|
|
20
22
|
act1 = adb.instances[0]
|
23
|
+
expect(act1.namespace).to eq("sample")
|
21
24
|
expect(act1.name).to eq("new_action1")
|
22
25
|
expect(act1.description).to eq("desc1")
|
26
|
+
expect(act1.endings).to eq([:first_ending, :second_ending])
|
23
27
|
|
24
28
|
act2 = adb.instances[1]
|
29
|
+
expect(act2.namespace).to eq("sample")
|
25
30
|
expect(act2.name).to eq("new_action2")
|
26
31
|
expect(act2.description).to eq("desc2")
|
32
|
+
expect(act2.endings).to eq([:success, :failure])
|
27
33
|
end
|
28
34
|
|
29
35
|
context "when reserved 'prospect' namespace is used for an action" do
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
require "stuka/internal/source_builders/process_builder"
|
3
|
-
require "stuka/
|
3
|
+
require "stuka/config/stuka_paths"
|
4
4
|
|
5
5
|
|
6
6
|
describe "ProcessBuilder" do
|
@@ -8,36 +8,40 @@ describe "ProcessBuilder" do
|
|
8
8
|
around(:each) do |example|
|
9
9
|
FileUtils.rm_rf("#{Stuka::StukaPaths::TEST_PROCESSES_SOURCE_PATH}/.", secure: true)
|
10
10
|
example.run
|
11
|
-
FileUtils.rm_rf("#{Stuka::StukaPaths::TEST_PROCESSES_SOURCE_PATH}/.", secure: true)
|
11
|
+
#FileUtils.rm_rf("#{Stuka::StukaPaths::TEST_PROCESSES_SOURCE_PATH}/.", secure: true)
|
12
12
|
end
|
13
13
|
|
14
14
|
it "builds ruby source with ProcessBuilder::build" do
|
15
15
|
Stuka::ProcessBuilder.build
|
16
16
|
|
17
|
-
source_files = Dir["#{Stuka::StukaPaths
|
17
|
+
source_files = Dir["#{Stuka::StukaPaths.processes_source_path}/*.rb"]
|
18
18
|
source_files = source_files.map{ |path| File.basename(path) }
|
19
19
|
expect(source_files.count).to eq(2)
|
20
|
-
expect(source_files.include? "
|
20
|
+
expect(source_files.include? "check_smth.rb").to be(true)
|
21
21
|
expect(source_files.include? "test2.rb").to be(true)
|
22
22
|
|
23
|
-
require_relative "processes_source_test/
|
23
|
+
require_relative "processes_source_test/check_smth"
|
24
24
|
|
25
|
-
process =
|
25
|
+
process = Processes::CheckSmth.new
|
26
26
|
|
27
|
-
expect(process.
|
27
|
+
expect(process.blocks).to eq(
|
28
28
|
{
|
29
|
-
"
|
30
|
-
|
31
|
-
|
29
|
+
"test_block_1" => {
|
30
|
+
action: "bla::acc1",
|
31
|
+
success: "test_block_2",
|
32
|
+
failure: "process::failure",
|
32
33
|
},
|
33
|
-
|
34
|
+
|
35
|
+
"test_block_2" => {
|
36
|
+
action: "bla::acc2",
|
34
37
|
success: "process::success",
|
35
|
-
failure: "process::failure"
|
36
|
-
}
|
38
|
+
failure: "process::failure",
|
39
|
+
},
|
40
|
+
|
37
41
|
}
|
38
42
|
)
|
39
43
|
|
40
|
-
expect(process.
|
44
|
+
expect(process.start_block).to eq("test_block_1")
|
41
45
|
|
42
46
|
end
|
43
47
|
|
@@ -30,7 +30,7 @@ describe Stuka::ProcessDomainBuilder do
|
|
30
30
|
pdb = Stuka::ProcessDomainBuilder.new
|
31
31
|
pdb.build_domain
|
32
32
|
expect(pdb.instances.count).to eq(2)
|
33
|
-
expect(pdb.instances.map(&:name).include? "
|
33
|
+
expect(pdb.instances.map(&:name).include? "check_smth").to be true
|
34
34
|
expect(pdb.instances.map(&:name).include? "test2").to be true
|
35
35
|
end
|
36
36
|
end
|
@@ -1,32 +1,52 @@
|
|
1
|
-
process "
|
2
|
-
description "
|
1
|
+
process "check_smth" do
|
2
|
+
description "process checks smth"
|
3
3
|
|
4
|
-
|
4
|
+
start_block "test_block_1"
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
block "test_block_1" do
|
7
|
+
action "bla::acc1"
|
8
|
+
endings(
|
9
|
+
success: "test_block_2",
|
10
|
+
failure: "process::failure"
|
11
|
+
)
|
12
|
+
end
|
9
13
|
|
10
|
-
|
11
|
-
|
12
|
-
|
14
|
+
block "test_block_2" do
|
15
|
+
action "bla::acc2"
|
16
|
+
endings(
|
17
|
+
success: "process::success",
|
18
|
+
failure: "process::failure"
|
19
|
+
)
|
20
|
+
end
|
13
21
|
end
|
14
22
|
|
23
|
+
|
15
24
|
process "test2" do
|
16
|
-
description "
|
25
|
+
description "process description"
|
26
|
+
|
27
|
+
start_block "block_1"
|
17
28
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
29
|
+
block "block_1" do
|
30
|
+
action "bla::acc1"
|
31
|
+
endings(
|
32
|
+
success: "process::success",
|
33
|
+
failure: "process::failure"
|
34
|
+
)
|
35
|
+
end
|
22
36
|
end
|
23
37
|
|
24
|
-
|
25
|
-
|
26
|
-
|
38
|
+
|
39
|
+
action "bla::acc1" do
|
40
|
+
description "acc description
|
41
|
+
some more
|
42
|
+
text"
|
43
|
+
|
44
|
+
endings [:success, :failure]
|
27
45
|
end
|
28
46
|
|
29
|
-
|
47
|
+
|
48
|
+
action "bla::acc2" do
|
30
49
|
description "acc description"
|
31
|
-
|
50
|
+
|
51
|
+
endings [:success, :failure]
|
32
52
|
end
|
data/stuka.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.email = ["david.sljukic@gmail.com"]
|
12
12
|
spec.summary = %q{Stuka is a dsl for managing business processes}
|
13
13
|
spec.description = %q{Stuka is a dsl for managing business processes yadda yadda}
|
14
|
-
spec.homepage = ""
|
14
|
+
spec.homepage = "https://github.com/sljuka/stuka"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0")
|
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.1.0
|
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-10-
|
11
|
+
date: 2014-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -89,10 +89,13 @@ files:
|
|
89
89
|
- lib/stuka/commands/stuka_cli.rb
|
90
90
|
- lib/stuka/commands/subcommands/create/create_process_file.rb
|
91
91
|
- lib/stuka/commands/subcommands/create/create_project.rb
|
92
|
+
- lib/stuka/commands/subcommands/setup/setup_config.rb
|
92
93
|
- lib/stuka/commands/subcommands/setup/setup_directories.rb
|
93
94
|
- lib/stuka/commands/subcommands/setup/setup_gemfile.rb
|
94
95
|
- lib/stuka/commands/subcommands/setup/setup_rakefile.rb
|
95
96
|
- lib/stuka/commands/subcommands/setup/setup_tasks.rb
|
97
|
+
- lib/stuka/config/stuka_paths.rb
|
98
|
+
- lib/stuka/config/template_config.rb
|
96
99
|
- lib/stuka/external/action_finder.rb
|
97
100
|
- lib/stuka/external/business_action.rb
|
98
101
|
- lib/stuka/external/business_process.rb
|
@@ -100,7 +103,6 @@ files:
|
|
100
103
|
- lib/stuka/external/process_states/finished_state.rb
|
101
104
|
- lib/stuka/external/process_states/inactive_state.rb
|
102
105
|
- lib/stuka/external/process_states/started_state.rb
|
103
|
-
- lib/stuka/external/process_states/starting_state.rb
|
104
106
|
- lib/stuka/external/unknown_action.rb
|
105
107
|
- lib/stuka/internal/domain/action.rb
|
106
108
|
- lib/stuka/internal/domain/domain.rb
|
@@ -113,31 +115,34 @@ files:
|
|
113
115
|
- lib/stuka/internal/source_builders/process_builder.rb
|
114
116
|
- lib/stuka/internal/source_builders/source_builder.rb
|
115
117
|
- lib/stuka/internal/validator.rb
|
116
|
-
- lib/stuka/
|
118
|
+
- lib/stuka/monkeypatch/string_patch.rb
|
117
119
|
- lib/stuka/templates/configs/gemfile.tt
|
120
|
+
- lib/stuka/templates/configs/stuka_config.tt
|
118
121
|
- lib/stuka/templates/definitions/process.tt
|
119
122
|
- lib/stuka/templates/samples/my_first_step.tt
|
120
|
-
- lib/stuka/templates/samples/my_process.tt
|
121
123
|
- lib/stuka/templates/samples/my_second_step.tt
|
124
|
+
- lib/stuka/templates/samples/process_file.tt
|
122
125
|
- lib/stuka/templates/source/action.tt
|
126
|
+
- lib/stuka/templates/source/action_header.tt
|
123
127
|
- lib/stuka/templates/source/process.tt
|
128
|
+
- lib/stuka/templates/source/process_header.tt
|
124
129
|
- lib/stuka/templates/tasks/stuka.tt
|
125
130
|
- lib/stuka/version.rb
|
126
131
|
- spec/aceptance/commands/new_command_spec.rb
|
127
132
|
- spec/aceptance/commands/process_command_spec.rb
|
128
133
|
- spec/aceptance/commands/setup_command_spec.rb
|
129
134
|
- spec/aceptance/external/action_aceptance_spec.rb
|
135
|
+
- spec/aceptance/external/actions/cat/check_food.rb
|
136
|
+
- spec/aceptance/external/actions/cat/fill_up_plate.rb
|
137
|
+
- spec/aceptance/external/actions/cat/go_to_store.rb
|
130
138
|
- 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
139
|
- spec/aceptance/external/processes/feed_cat_process.rb
|
135
140
|
- spec/spec_helper.rb
|
136
|
-
- spec/unit/external/example_source/
|
137
|
-
- spec/unit/external/example_source/
|
138
|
-
- spec/unit/external/example_source/world/
|
139
|
-
- spec/unit/external/example_source/
|
140
|
-
- spec/unit/external/example_source/
|
141
|
+
- spec/unit/external/example_source/actions/world/gather_materials.rb
|
142
|
+
- spec/unit/external/example_source/actions/world/scrap_world.rb
|
143
|
+
- spec/unit/external/example_source/actions/world/seperate_light_from_darkness.rb
|
144
|
+
- spec/unit/external/example_source/processes/create_world.rb
|
145
|
+
- spec/unit/external/example_source/processes/kill_monster.rb
|
141
146
|
- spec/unit/external/finder_spec.rb
|
142
147
|
- spec/unit/external/process_interface.rb
|
143
148
|
- spec/unit/external/process_to_action.rb
|
@@ -154,7 +159,7 @@ files:
|
|
154
159
|
- spec/unit/internal/processes_dsl_test/correct_test_process.rb
|
155
160
|
- spec/unit/internal/processes_dsl_test_incorrect/incorrect_test_process.rb
|
156
161
|
- stuka.gemspec
|
157
|
-
homepage:
|
162
|
+
homepage: https://github.com/sljuka/stuka
|
158
163
|
licenses:
|
159
164
|
- MIT
|
160
165
|
metadata: {}
|
@@ -183,17 +188,17 @@ test_files:
|
|
183
188
|
- spec/aceptance/commands/process_command_spec.rb
|
184
189
|
- spec/aceptance/commands/setup_command_spec.rb
|
185
190
|
- spec/aceptance/external/action_aceptance_spec.rb
|
191
|
+
- spec/aceptance/external/actions/cat/check_food.rb
|
192
|
+
- spec/aceptance/external/actions/cat/fill_up_plate.rb
|
193
|
+
- spec/aceptance/external/actions/cat/go_to_store.rb
|
186
194
|
- 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
195
|
- spec/aceptance/external/processes/feed_cat_process.rb
|
191
196
|
- spec/spec_helper.rb
|
192
|
-
- spec/unit/external/example_source/
|
193
|
-
- spec/unit/external/example_source/
|
194
|
-
- spec/unit/external/example_source/world/
|
195
|
-
- spec/unit/external/example_source/
|
196
|
-
- spec/unit/external/example_source/
|
197
|
+
- spec/unit/external/example_source/actions/world/gather_materials.rb
|
198
|
+
- spec/unit/external/example_source/actions/world/scrap_world.rb
|
199
|
+
- spec/unit/external/example_source/actions/world/seperate_light_from_darkness.rb
|
200
|
+
- spec/unit/external/example_source/processes/create_world.rb
|
201
|
+
- spec/unit/external/example_source/processes/kill_monster.rb
|
197
202
|
- spec/unit/external/finder_spec.rb
|
198
203
|
- spec/unit/external/process_interface.rb
|
199
204
|
- spec/unit/external/process_to_action.rb
|
@@ -1,16 +0,0 @@
|
|
1
|
-
module Stuka
|
2
|
-
|
3
|
-
class StartingState
|
4
|
-
|
5
|
-
def handle_transition(context, transition)
|
6
|
-
context.instance_eval do
|
7
|
-
set_current_action(start_action)
|
8
|
-
start_action_class = transition_helper.find_action(start_action)
|
9
|
-
change_state(:started)
|
10
|
-
start_action_class.new(context).run(action_params)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
end
|
15
|
-
|
16
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
module Stuka
|
2
|
-
|
3
|
-
module StukaPaths
|
4
|
-
|
5
|
-
PROCESSES_DEFINITION_PATH = "#{Dir.pwd}/process_definition"
|
6
|
-
|
7
|
-
PROCESSES_SOURCE_PATH = "#{Dir.pwd}/processes"
|
8
|
-
|
9
|
-
TEST_PROCESSES_DEFINITION_PATH = "#{File.expand_path(File.dirname(__FILE__))}/../../../spec/unit/internal/processes_dsl_test"
|
10
|
-
TEST_PROCESSES_INCORRECT_DEFINITION_PATH = "#{File.expand_path(File.dirname(__FILE__))}/../../../spec/unit/internal/processes_dsl_test_incorrect"
|
11
|
-
|
12
|
-
TEST_PROCESSES_SOURCE_PATH = "#{File.expand_path(File.dirname(__FILE__))}/../../../spec/unit/internal/processes_source_test"
|
13
|
-
|
14
|
-
TEMPLATES_PATH = "#{File.expand_path(File.dirname(__FILE__))}/../templates"
|
15
|
-
|
16
|
-
end
|
17
|
-
|
18
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
|
2
|
-
process "this is an example process" { |p|
|
3
|
-
|
4
|
-
p.name "my process"
|
5
|
-
p.attributes ["repo", "example_attribute"]
|
6
|
-
|
7
|
-
p.start_step "example:my_first_step"
|
8
|
-
|
9
|
-
p.step_transition "example:my_first_step" { |a|
|
10
|
-
a.success "example:my_second_step"
|
11
|
-
a.failure process_failure
|
12
|
-
}
|
13
|
-
|
14
|
-
p.step_transition "example:my_second_step" { |a|
|
15
|
-
a.success process_success
|
16
|
-
a.failure process_failure
|
17
|
-
}
|
18
|
-
|
19
|
-
}
|