stuka 0.0.4 → 0.0.5
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/.rspec +3 -0
- data/bin/stuka +0 -0
- data/lib/stuka/commands/command.rb +8 -0
- data/lib/stuka/commands/public_commands/new_command.rb +4 -2
- data/lib/stuka/commands/public_commands/process_command.rb +3 -1
- data/lib/stuka/commands/public_commands/setup_command.rb +8 -5
- data/lib/stuka/commands/public_commands/step_command.rb +3 -1
- data/lib/stuka/commands/subcommands/create/create_action.rb +5 -4
- data/lib/stuka/commands/subcommands/create/create_process.rb +3 -3
- data/lib/stuka/commands/subcommands/create/create_project.rb +3 -5
- data/lib/stuka/commands/subcommands/setup/setup_directories.rb +1 -0
- data/lib/stuka/commands/subcommands/setup/setup_gemfile.rb +1 -0
- data/lib/stuka/commands/subcommands/setup/setup_tasks.rb +2 -2
- data/lib/stuka/internal/process.rb +8 -0
- data/lib/stuka/internal/process_builder.rb +19 -0
- data/lib/stuka/templates/definitions/process.tt +2 -2
- data/lib/stuka/templates/definitions/step.tt +3 -3
- data/lib/stuka/templates/tasks/rakefile.tt +7 -1
- data/lib/stuka/templates/tasks/stuka_tasks.tt +4 -0
- data/lib/stuka/version.rb +1 -1
- data/spec/new_command_spec.rb +37 -0
- data/spec/process_command_spec.rb +19 -0
- data/spec/setup_command_spec.rb +19 -0
- data/spec/spec_helper.rb +78 -0
- data/spec/step_command_spec.rb +19 -0
- data/stuka.gemspec +1 -0
- metadata +31 -5
- data/lib/stuka/templates/tasks/build_actions.tt +0 -3
- data/lib/stuka/templates/tasks/build_processes.tt +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0385aed1494252a18d40c819f7615403bb3e278c
|
4
|
+
data.tar.gz: f8faa132b1dcc876a1ebf4e771068036e1a58961
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c910b5c24fbfbb8b6b96e6867028aca890a4d027588f5cf001197d58e60c1d20930671ad2d41a3866646be6366161cc89d94acdf7363cdd6bc47c8b5c3434bc
|
7
|
+
data.tar.gz: a7b7e6f74491dd5c1cf999aeb2bbe62894657646619605ff15b183fe499c5dd28127d7dcad98d563872eba7b0e744d40e3a9b4152ccf394a4d8127b4e1c9a96d
|
data/.rspec
ADDED
data/bin/stuka
CHANGED
File without changes
|
@@ -5,6 +5,10 @@ module Stuka
|
|
5
5
|
class Command < Thor::Group
|
6
6
|
include Thor::Actions
|
7
7
|
|
8
|
+
class << self
|
9
|
+
attr_accessor :pwd
|
10
|
+
end
|
11
|
+
|
8
12
|
# root of project, from where we reference the templates
|
9
13
|
def self.source_root
|
10
14
|
File.dirname(__FILE__) + "/.."
|
@@ -27,6 +31,10 @@ module Stuka
|
|
27
31
|
"#{command_name} description"
|
28
32
|
end
|
29
33
|
|
34
|
+
def self.current_dir(cd)
|
35
|
+
pwd || Dir.pwd
|
36
|
+
end
|
37
|
+
|
30
38
|
end
|
31
39
|
|
32
40
|
end
|
@@ -1,14 +1,17 @@
|
|
1
1
|
require_relative "../command"
|
2
|
-
|
3
|
-
|
4
|
-
require_relative "../subcommands/setup/setup_rakefile"
|
5
|
-
require_relative "../subcommands/setup/setup_tasks"
|
2
|
+
Dir["#{File.dirname(__FILE__)}/../subcommands/setup/*.rb"].each { |file| require_relative file }
|
3
|
+
|
6
4
|
|
7
5
|
module Stuka
|
8
6
|
|
9
7
|
class SetupCommand < Command
|
10
8
|
|
11
|
-
|
9
|
+
def execute
|
10
|
+
Stuka::SetupDirectories.new.setup
|
11
|
+
Stuka::SetupGemfile.new.setup
|
12
|
+
Stuka::SetupRakefile.new.setup
|
13
|
+
Stuka::SetupTasks.new.setup
|
14
|
+
end
|
12
15
|
|
13
16
|
def self.description
|
14
17
|
"generates stuka DSL source folders and a Gemfile"
|
@@ -8,7 +8,9 @@ module Stuka
|
|
8
8
|
argument :namespace, :desc => "Namespace of the step"
|
9
9
|
argument :name, :desc => "Name of the step"
|
10
10
|
|
11
|
-
|
11
|
+
def execute
|
12
|
+
Stuka::CreateAction.new.create(namespace, name)
|
13
|
+
end
|
12
14
|
|
13
15
|
def self.description
|
14
16
|
"generates a step stub"
|
@@ -4,10 +4,11 @@ module Stuka
|
|
4
4
|
|
5
5
|
class CreateAction < Command
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
template('templates/definitions/step.tt', "process_definition/
|
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")
|
11
12
|
end
|
12
13
|
|
13
14
|
end
|
@@ -4,10 +4,10 @@ module Stuka
|
|
4
4
|
|
5
5
|
class CreateProcess < Command
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
def create
|
7
|
+
def create(name)
|
8
|
+
@name = name
|
10
9
|
template('templates/definitions/process.tt', "process_definition/processes/#{name}.rb")
|
10
|
+
say("Process #{name} created")
|
11
11
|
end
|
12
12
|
|
13
13
|
end
|
@@ -6,9 +6,7 @@ module Stuka
|
|
6
6
|
|
7
7
|
class CreateProject < Command
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
def create
|
9
|
+
def create(name)
|
12
10
|
project_dir_exists = File.directory?("#{Dir.pwd}/#{name}")
|
13
11
|
|
14
12
|
if project_dir_exists
|
@@ -17,10 +15,10 @@ module Stuka
|
|
17
15
|
end
|
18
16
|
|
19
17
|
Dir.mkdir name
|
20
|
-
|
18
|
+
setup(name)
|
21
19
|
end
|
22
20
|
|
23
|
-
def setup
|
21
|
+
def setup(name)
|
24
22
|
Dir.chdir(name) do
|
25
23
|
SetupDirectories.new.setup
|
26
24
|
SetupGemfile.new.setup
|
@@ -16,6 +16,7 @@ module Stuka
|
|
16
16
|
template('templates/samples/my_first_step.tt', "process_definition/steps/example/my_first_step.rb")
|
17
17
|
template('templates/samples/my_second_step.tt', "process_definition/steps/example/my_second_step.rb")
|
18
18
|
template('templates/samples/my_process.tt', "process_definition/processes/my_process.rb")
|
19
|
+
say("Source directories setup")
|
19
20
|
end
|
20
21
|
|
21
22
|
end
|
@@ -8,11 +8,11 @@ module Stuka
|
|
8
8
|
rakefile_exists = File.directory?("#{Dir.pwd}/lib/tasks/stuka")
|
9
9
|
|
10
10
|
if rakefile_exists
|
11
|
-
say("
|
11
|
+
say("Tasks already setup")
|
12
12
|
return
|
13
13
|
end
|
14
14
|
|
15
|
-
template('templates/tasks/
|
15
|
+
template('templates/tasks/stuka_tasks.tt', "lib/tasks/stuka/stuka_tasks.rake")
|
16
16
|
end
|
17
17
|
|
18
18
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Stuka
|
2
|
+
|
3
|
+
class ProcessBuilder
|
4
|
+
|
5
|
+
def gather_process_files
|
6
|
+
Dir["#{Dir.pwd}/process_definition/processes/*.rb"]
|
7
|
+
end
|
8
|
+
|
9
|
+
def make_process_model
|
10
|
+
processes = []
|
11
|
+
gather_process_files.each do |file|
|
12
|
+
processes << File.basename(file, ".rb")
|
13
|
+
end
|
14
|
+
puts processes
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
data/lib/stuka/version.rb
CHANGED
@@ -0,0 +1,37 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require_relative "../lib/stuka/stuka_cli"
|
3
|
+
require 'fileutils'
|
4
|
+
|
5
|
+
describe "new command" do
|
6
|
+
|
7
|
+
context "when project doesn't exist" do
|
8
|
+
|
9
|
+
around(:each) do |example|
|
10
|
+
FileUtils.rm_rf('test_pro')
|
11
|
+
example.run
|
12
|
+
FileUtils.rm_rf('test_pro')
|
13
|
+
end
|
14
|
+
|
15
|
+
it "creates a project" do
|
16
|
+
expect { Stuka::StukaCli.start ["new", "test_pro"] }.to output(%r|create Gemfile|).to_stdout
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
context "when project already exists" do
|
22
|
+
|
23
|
+
before(:each) do
|
24
|
+
Stuka::StukaCli.start ["new", "test_pro"]
|
25
|
+
end
|
26
|
+
|
27
|
+
after(:each) do
|
28
|
+
FileUtils.rm_rf('test_pro')
|
29
|
+
end
|
30
|
+
|
31
|
+
it "creates a project" do
|
32
|
+
expect { Stuka::StukaCli.start ["new", "test_pro"] }.to output(%r|already exists|).to_stdout
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require_relative "../lib/stuka/stuka_cli"
|
3
|
+
require 'fileutils'
|
4
|
+
|
5
|
+
describe "process command" do
|
6
|
+
|
7
|
+
around(:each) do |example|
|
8
|
+
Stuka::StukaCli.start ["new", "test_pro"]
|
9
|
+
example.run
|
10
|
+
FileUtils.rm_rf 'test_pro'
|
11
|
+
end
|
12
|
+
|
13
|
+
it "sets up the project" do
|
14
|
+
Dir.chdir "test_pro" do
|
15
|
+
expect { Stuka::StukaCli.start ["process", "test_process"] }.to output(%r|Process test_process created|).to_stdout
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require_relative "../lib/stuka/stuka_cli"
|
3
|
+
require 'fileutils'
|
4
|
+
|
5
|
+
describe "setup command" do
|
6
|
+
|
7
|
+
around(:each) do |example|
|
8
|
+
Dir.mkdir "test_pro"
|
9
|
+
example.run
|
10
|
+
FileUtils.rm_rf 'test_pro'
|
11
|
+
end
|
12
|
+
|
13
|
+
it "sets up the project" do
|
14
|
+
Dir.chdir "test_pro" do
|
15
|
+
expect { Stuka::StukaCli.start ["setup"] }.to output(%r|Source directories setup|).to_stdout
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
2
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
3
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause this
|
4
|
+
# file to always be loaded, without a need to explicitly require it in any files.
|
5
|
+
#
|
6
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
7
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
8
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
9
|
+
# individual file that may not need all of that loaded. Instead, make a
|
10
|
+
# separate helper file that requires this one and then use it only in the specs
|
11
|
+
# that actually need it.
|
12
|
+
#
|
13
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
14
|
+
# users commonly want.
|
15
|
+
#
|
16
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
17
|
+
RSpec.configure do |config|
|
18
|
+
# The settings below are suggested to provide a good initial experience
|
19
|
+
# with RSpec, but feel free to customize to your heart's content.
|
20
|
+
=begin
|
21
|
+
# These two settings work together to allow you to limit a spec run
|
22
|
+
# to individual examples or groups you care about by tagging them with
|
23
|
+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
24
|
+
# get run.
|
25
|
+
config.filter_run :focus
|
26
|
+
config.run_all_when_everything_filtered = true
|
27
|
+
|
28
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
29
|
+
# file, and it's useful to allow more verbose output when running an
|
30
|
+
# individual spec file.
|
31
|
+
if config.files_to_run.one?
|
32
|
+
# Use the documentation formatter for detailed output,
|
33
|
+
# unless a formatter has already been configured
|
34
|
+
# (e.g. via a command-line flag).
|
35
|
+
config.default_formatter = 'doc'
|
36
|
+
end
|
37
|
+
|
38
|
+
# Print the 10 slowest examples and example groups at the
|
39
|
+
# end of the spec run, to help surface which specs are running
|
40
|
+
# particularly slow.
|
41
|
+
config.profile_examples = 10
|
42
|
+
|
43
|
+
# Run specs in random order to surface order dependencies. If you find an
|
44
|
+
# order dependency and want to debug it, you can fix the order by providing
|
45
|
+
# the seed, which is printed after each run.
|
46
|
+
# --seed 1234
|
47
|
+
config.order = :random
|
48
|
+
|
49
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
50
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
51
|
+
# test failures related to randomization by passing the same `--seed` value
|
52
|
+
# as the one that triggered the failure.
|
53
|
+
Kernel.srand config.seed
|
54
|
+
|
55
|
+
# rspec-expectations config goes here. You can use an alternate
|
56
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
57
|
+
# assertions if you prefer.
|
58
|
+
config.expect_with :rspec do |expectations|
|
59
|
+
# Enable only the newer, non-monkey-patching expect syntax.
|
60
|
+
# For more details, see:
|
61
|
+
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
62
|
+
expectations.syntax = :expect
|
63
|
+
end
|
64
|
+
|
65
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
66
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
67
|
+
config.mock_with :rspec do |mocks|
|
68
|
+
# Enable only the newer, non-monkey-patching expect syntax.
|
69
|
+
# For more details, see:
|
70
|
+
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
71
|
+
mocks.syntax = :expect
|
72
|
+
|
73
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
74
|
+
# a real object. This is generally recommended.
|
75
|
+
mocks.verify_partial_doubles = true
|
76
|
+
end
|
77
|
+
=end
|
78
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require_relative "../lib/stuka/stuka_cli"
|
3
|
+
require 'fileutils'
|
4
|
+
|
5
|
+
describe "step command" do
|
6
|
+
|
7
|
+
around(:each) do |example|
|
8
|
+
Stuka::StukaCli.start ["new", "test_pro"]
|
9
|
+
example.run
|
10
|
+
FileUtils.rm_rf 'test_pro'
|
11
|
+
end
|
12
|
+
|
13
|
+
it "sets up the project" do
|
14
|
+
Dir.chdir "test_pro" do
|
15
|
+
expect { Stuka::StukaCli.start ["step", "test_namespace", "test_action"] }.to output(%r|Action test_namespace::test_action created|).to_stdout
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
data/stuka.gemspec
CHANGED
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.5
|
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-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: thor
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -61,6 +75,7 @@ extensions: []
|
|
61
75
|
extra_rdoc_files: []
|
62
76
|
files:
|
63
77
|
- ".gitignore"
|
78
|
+
- ".rspec"
|
64
79
|
- Gemfile
|
65
80
|
- LICENSE.txt
|
66
81
|
- README.md
|
@@ -79,6 +94,8 @@ files:
|
|
79
94
|
- lib/stuka/commands/subcommands/setup/setup_gemfile.rb
|
80
95
|
- lib/stuka/commands/subcommands/setup/setup_rakefile.rb
|
81
96
|
- lib/stuka/commands/subcommands/setup/setup_tasks.rb
|
97
|
+
- lib/stuka/internal/process.rb
|
98
|
+
- lib/stuka/internal/process_builder.rb
|
82
99
|
- lib/stuka/stuka_cli.rb
|
83
100
|
- lib/stuka/templates/configs/gemfile.tt
|
84
101
|
- lib/stuka/templates/definitions/process.tt
|
@@ -86,10 +103,14 @@ files:
|
|
86
103
|
- lib/stuka/templates/samples/my_first_step.tt
|
87
104
|
- lib/stuka/templates/samples/my_process.tt
|
88
105
|
- lib/stuka/templates/samples/my_second_step.tt
|
89
|
-
- lib/stuka/templates/tasks/build_actions.tt
|
90
|
-
- lib/stuka/templates/tasks/build_processes.tt
|
91
106
|
- lib/stuka/templates/tasks/rakefile.tt
|
107
|
+
- lib/stuka/templates/tasks/stuka_tasks.tt
|
92
108
|
- lib/stuka/version.rb
|
109
|
+
- spec/new_command_spec.rb
|
110
|
+
- spec/process_command_spec.rb
|
111
|
+
- spec/setup_command_spec.rb
|
112
|
+
- spec/spec_helper.rb
|
113
|
+
- spec/step_command_spec.rb
|
93
114
|
- stuka.gemspec
|
94
115
|
homepage: ''
|
95
116
|
licenses:
|
@@ -115,4 +136,9 @@ rubygems_version: 2.2.2
|
|
115
136
|
signing_key:
|
116
137
|
specification_version: 4
|
117
138
|
summary: Stuka is a dsl for managing business processes
|
118
|
-
test_files:
|
139
|
+
test_files:
|
140
|
+
- spec/new_command_spec.rb
|
141
|
+
- spec/process_command_spec.rb
|
142
|
+
- spec/setup_command_spec.rb
|
143
|
+
- spec/spec_helper.rb
|
144
|
+
- spec/step_command_spec.rb
|