stuka 0.0.3 → 0.0.4
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/new_command.rb +23 -0
- data/lib/stuka/commands/{concrete_commands → public_commands}/process_command.rb +3 -4
- data/lib/stuka/commands/public_commands/setup_command.rb +18 -0
- data/lib/stuka/commands/{concrete_commands → public_commands}/step_command.rb +2 -3
- data/lib/stuka/commands/subcommands/create/create_action.rb +15 -0
- data/lib/stuka/commands/subcommands/create/create_process.rb +15 -0
- data/lib/stuka/commands/subcommands/create/create_project.rb +35 -0
- data/lib/stuka/commands/{concrete_commands/setup_command.rb → subcommands/setup/setup_directories.rb} +3 -6
- data/lib/stuka/commands/subcommands/setup/setup_gemfile.rb +20 -0
- data/lib/stuka/commands/subcommands/setup/setup_rakefile.rb +20 -0
- data/lib/stuka/commands/subcommands/setup/setup_tasks.rb +20 -0
- data/lib/stuka/stuka_cli.rb +1 -1
- data/lib/stuka/templates/tasks/build_actions.tt +3 -0
- data/lib/stuka/templates/{configs/tasks.tt → tasks/build_processes.tt} +0 -1
- data/lib/stuka/templates/tasks/rakefile.tt +1 -0
- data/lib/stuka/version.rb +1 -1
- metadata +16 -7
- data/lib/stuka/commands/concrete_commands/new_command.rb +0 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74cabc0d52d1196e6960722b406a44ab2bd9ec97
|
4
|
+
data.tar.gz: cf69f59d19c96221d1a6823239a94c85b8428206
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3dc590c7f6959b30ea3b13d62e12a8d65d541fe3d6f1c5658ec9915f4c7d1d9a027384b28300c5470018f221bfb9957e064be129c52001e6ae4990bdbbb4f585
|
7
|
+
data.tar.gz: 54f783482a72e976f643b3915d0f5b3049efb904301cca85561348b1437cd1dc6c274b73cc88ac858beea9623c20b2830131d7430fee15a1b2ade11eda75aa17
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require_relative "../command"
|
2
|
+
require_relative "../subcommands/create/create_project"
|
3
|
+
require_relative "setup_command"
|
4
|
+
|
5
|
+
module Stuka
|
6
|
+
|
7
|
+
class NewCommand < Command
|
8
|
+
|
9
|
+
argument :name, :desc => "Name of the project"
|
10
|
+
|
11
|
+
invoke Stuka::CreateProject
|
12
|
+
|
13
|
+
def self.description
|
14
|
+
"generates a project skeleton"
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.usage
|
18
|
+
"new NAME"
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
@@ -1,14 +1,13 @@
|
|
1
1
|
require_relative "../command"
|
2
|
+
require_relative "../subcommands/create/create_process"
|
2
3
|
|
3
4
|
module Stuka
|
4
5
|
|
5
6
|
class ProcessCommand < Command
|
6
7
|
|
7
|
-
argument :name, :desc => "
|
8
|
+
argument :name, :desc => "Name of the process"
|
8
9
|
|
9
|
-
|
10
|
-
template('templates/definitions/process.tt', "process_definition/processes/#{name}.rb")
|
11
|
-
end
|
10
|
+
invoke Stuka::CreateProcess
|
12
11
|
|
13
12
|
def self.description
|
14
13
|
"generates a process stub"
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require_relative "../command"
|
2
|
+
require_relative "../subcommands/setup/setup_directories"
|
3
|
+
require_relative "../subcommands/setup/setup_gemfile"
|
4
|
+
require_relative "../subcommands/setup/setup_rakefile"
|
5
|
+
require_relative "../subcommands/setup/setup_tasks"
|
6
|
+
|
7
|
+
module Stuka
|
8
|
+
|
9
|
+
class SetupCommand < Command
|
10
|
+
|
11
|
+
invoke Stuka::SetupDirectories
|
12
|
+
|
13
|
+
def self.description
|
14
|
+
"generates stuka DSL source folders and a Gemfile"
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require_relative "../command"
|
2
|
+
require_relative "../subcommands/create/create_action"
|
2
3
|
|
3
4
|
module Stuka
|
4
5
|
|
@@ -7,9 +8,7 @@ module Stuka
|
|
7
8
|
argument :namespace, :desc => "Namespace of the step"
|
8
9
|
argument :name, :desc => "Name of the step"
|
9
10
|
|
10
|
-
|
11
|
-
template('templates/definitions/step.tt', "process_definition/steps/#{namespace}/#{name}.rb")
|
12
|
-
end
|
11
|
+
invoke Stuka::CreateAction
|
13
12
|
|
14
13
|
def self.description
|
15
14
|
"generates a step stub"
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require_relative "../../command"
|
2
|
+
|
3
|
+
module Stuka
|
4
|
+
|
5
|
+
class CreateAction < Command
|
6
|
+
|
7
|
+
argument :name, :desc => "The name of the action"
|
8
|
+
|
9
|
+
def create
|
10
|
+
template('templates/definitions/step.tt', "process_definition/steps/#{namespace}/#{name}.rb")
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require_relative "../../command"
|
2
|
+
|
3
|
+
module Stuka
|
4
|
+
|
5
|
+
class CreateProcess < Command
|
6
|
+
|
7
|
+
argument :name, :desc => "The name of the process"
|
8
|
+
|
9
|
+
def create
|
10
|
+
template('templates/definitions/process.tt', "process_definition/processes/#{name}.rb")
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require_relative "../../command"
|
2
|
+
Dir["#{File.dirname(__FILE__)}/../setup/*.rb"].each { |file| require_relative file }
|
3
|
+
|
4
|
+
|
5
|
+
module Stuka
|
6
|
+
|
7
|
+
class CreateProject < Command
|
8
|
+
|
9
|
+
argument :name, :desc => "The name of the project"
|
10
|
+
|
11
|
+
def create
|
12
|
+
project_dir_exists = File.directory?("#{Dir.pwd}/#{name}")
|
13
|
+
|
14
|
+
if project_dir_exists
|
15
|
+
say("Directory already exists, choose another name.")
|
16
|
+
return
|
17
|
+
end
|
18
|
+
|
19
|
+
Dir.mkdir name
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
def setup
|
24
|
+
Dir.chdir(name) do
|
25
|
+
SetupDirectories.new.setup
|
26
|
+
SetupGemfile.new.setup
|
27
|
+
SetupRakefile.new.setup
|
28
|
+
SetupTasks.new.setup
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
@@ -1,8 +1,8 @@
|
|
1
|
-
require_relative "
|
1
|
+
require_relative "../../command"
|
2
2
|
|
3
3
|
module Stuka
|
4
4
|
|
5
|
-
class
|
5
|
+
class SetupDirectories < Command
|
6
6
|
|
7
7
|
def setup
|
8
8
|
processes_dir_exists = File.directory?("#{Dir.pwd}/process_definition/processes")
|
@@ -18,9 +18,6 @@ module Stuka
|
|
18
18
|
template('templates/samples/my_process.tt', "process_definition/processes/my_process.rb")
|
19
19
|
end
|
20
20
|
|
21
|
-
def self.description
|
22
|
-
"generates necessary folders and a couple of sample files"
|
23
|
-
end
|
24
|
-
|
25
21
|
end
|
22
|
+
|
26
23
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require_relative "../../command"
|
2
|
+
|
3
|
+
module Stuka
|
4
|
+
|
5
|
+
class SetupGemfile < Command
|
6
|
+
|
7
|
+
def setup
|
8
|
+
gemfile_exists = File.file?("#{Dir.pwd}/Gemfile")
|
9
|
+
|
10
|
+
if gemfile_exists
|
11
|
+
say("Gemfile already setup")
|
12
|
+
return
|
13
|
+
end
|
14
|
+
|
15
|
+
template('templates/configs/gemfile.tt', "Gemfile")
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require_relative "../../command"
|
2
|
+
|
3
|
+
module Stuka
|
4
|
+
|
5
|
+
class SetupRakefile < Command
|
6
|
+
|
7
|
+
def setup
|
8
|
+
rakefile_exists = File.file?("#{Dir.pwd}/Rakefile")
|
9
|
+
|
10
|
+
if rakefile_exists
|
11
|
+
say("Rakefile already setup")
|
12
|
+
return
|
13
|
+
end
|
14
|
+
|
15
|
+
template('templates/tasks/rakefile.tt', "Rakefile")
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require_relative "../../command"
|
2
|
+
|
3
|
+
module Stuka
|
4
|
+
|
5
|
+
class SetupTasks < Command
|
6
|
+
|
7
|
+
def setup
|
8
|
+
rakefile_exists = File.directory?("#{Dir.pwd}/lib/tasks/stuka")
|
9
|
+
|
10
|
+
if rakefile_exists
|
11
|
+
say("Rakefile already setup")
|
12
|
+
return
|
13
|
+
end
|
14
|
+
|
15
|
+
template('templates/tasks/build_processes.tt', "lib/tasks/stuka/build_processes.rake")
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
data/lib/stuka/stuka_cli.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Stuka
|
2
2
|
|
3
3
|
require 'thor'
|
4
|
-
Dir["#{File.dirname(__FILE__)}/commands/
|
4
|
+
Dir["#{File.dirname(__FILE__)}/commands/public_commands/*.rb"].each { |file| require_relative file }
|
5
5
|
|
6
6
|
class StukaCli < Thor
|
7
7
|
|
@@ -0,0 +1 @@
|
|
1
|
+
Dir.glob('lib/tasks/stuka/*.rake').each { |r| import r }
|
data/lib/stuka/version.rb
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.4
|
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-08-
|
11
|
+
date: 2014-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -68,18 +68,27 @@ files:
|
|
68
68
|
- bin/stuka
|
69
69
|
- lib/stuka.rb
|
70
70
|
- lib/stuka/commands/command.rb
|
71
|
-
- lib/stuka/commands/
|
72
|
-
- lib/stuka/commands/
|
73
|
-
- lib/stuka/commands/
|
74
|
-
- lib/stuka/commands/
|
71
|
+
- lib/stuka/commands/public_commands/new_command.rb
|
72
|
+
- lib/stuka/commands/public_commands/process_command.rb
|
73
|
+
- lib/stuka/commands/public_commands/setup_command.rb
|
74
|
+
- lib/stuka/commands/public_commands/step_command.rb
|
75
|
+
- lib/stuka/commands/subcommands/create/create_action.rb
|
76
|
+
- lib/stuka/commands/subcommands/create/create_process.rb
|
77
|
+
- lib/stuka/commands/subcommands/create/create_project.rb
|
78
|
+
- lib/stuka/commands/subcommands/setup/setup_directories.rb
|
79
|
+
- lib/stuka/commands/subcommands/setup/setup_gemfile.rb
|
80
|
+
- lib/stuka/commands/subcommands/setup/setup_rakefile.rb
|
81
|
+
- lib/stuka/commands/subcommands/setup/setup_tasks.rb
|
75
82
|
- lib/stuka/stuka_cli.rb
|
76
83
|
- lib/stuka/templates/configs/gemfile.tt
|
77
|
-
- lib/stuka/templates/configs/tasks.tt
|
78
84
|
- lib/stuka/templates/definitions/process.tt
|
79
85
|
- lib/stuka/templates/definitions/step.tt
|
80
86
|
- lib/stuka/templates/samples/my_first_step.tt
|
81
87
|
- lib/stuka/templates/samples/my_process.tt
|
82
88
|
- 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
|
+
- lib/stuka/templates/tasks/rakefile.tt
|
83
92
|
- lib/stuka/version.rb
|
84
93
|
- stuka.gemspec
|
85
94
|
homepage: ''
|
@@ -1,30 +0,0 @@
|
|
1
|
-
require_relative "../command"
|
2
|
-
|
3
|
-
module Stuka
|
4
|
-
|
5
|
-
class NewCommand < Command
|
6
|
-
|
7
|
-
argument :name, :desc => "The name of the project"
|
8
|
-
|
9
|
-
def generate_gemfile
|
10
|
-
template('templates/configs/gemfile.tt', "#{name}/Gemfile")
|
11
|
-
end
|
12
|
-
|
13
|
-
def setup_project
|
14
|
-
template('templates/samples/my_first_step.tt', "#{name}/process_definition/steps/example/my_first_step.rb")
|
15
|
-
template('templates/samples/my_second_step.tt', "#{name}/process_definition/steps/example/my_second_step.rb")
|
16
|
-
template('templates/samples/my_process.tt', "#{name}/process_definition/processes/my_process.rb")
|
17
|
-
say("Stuka project is setup, don't forget to cd into #{name}")
|
18
|
-
end
|
19
|
-
|
20
|
-
def self.description
|
21
|
-
"generates a project skeleton"
|
22
|
-
end
|
23
|
-
|
24
|
-
def self.usage
|
25
|
-
"new NAME"
|
26
|
-
end
|
27
|
-
|
28
|
-
end
|
29
|
-
|
30
|
-
end
|