spline 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 209139512c300777b5a3df975664b217b832636d
4
- data.tar.gz: 43c5ba18a6bb7a814865009a0a22d3c00647ee11
3
+ metadata.gz: c235bb708fffd5ae04e0981b9613da998d8db07f
4
+ data.tar.gz: f61b6e0970c559c1502db31f6564624d0f54d30e
5
5
  SHA512:
6
- metadata.gz: 6725201a9556a9ad394ee13692a74879d8369fcc9bb604b4ff5cfc93af288cebf0f13ac3f07dce9981ab76a045b8b7ff24324d2a6f900228055472fadbb2a874
7
- data.tar.gz: 03531c9d687d7dcdf5c4e76ab98ec7a356c62830f631dba30545f2f521e3ffa3838284aa8d77c72eb0f5a735722c46370900c16c8801294fc6e5beaa7c0596b6
6
+ metadata.gz: 8e6b88e262dc831deac44897ea4a92a3ec51188acb9db96d3d782f8237d40032a612c8e40d0e56c3c1933652691d28709b64991759da365dbe4126f1c79e21f2
7
+ data.tar.gz: 5207f47e1bdbc3a50f5c05dc5f36d7b749c18c09ac1a0f18d852968c52e0c5dfed89968680ccd6c20dd04c7460775f75af1942559bd628135b0125544b71ad2c
@@ -0,0 +1,26 @@
1
+ require 'thor/group'
2
+
3
+ module Spline
4
+
5
+ class Command < Thor::Group
6
+ include Thor::Actions
7
+
8
+ def self.source_root
9
+ File.dirname(__FILE__) + "/.."
10
+ end
11
+
12
+ def self.alias
13
+ name.downcase
14
+ end
15
+
16
+ def self.usage_tip
17
+ name.downcase
18
+ end
19
+
20
+ def self.description
21
+ "#{name.downcase} description"
22
+ end
23
+
24
+ end
25
+
26
+ end
@@ -1,13 +1,13 @@
1
- require_relative "../cli_command"
1
+ require_relative "../command"
2
2
 
3
3
  module Spline
4
4
 
5
- class ActionCommand < CliCommand
5
+ class ActionCommand < Command
6
6
 
7
7
  argument :namespace, :desc => "Namespace of the action"
8
8
  argument :name, :desc => "Name of the action"
9
9
 
10
- def generate_process
10
+ def generate_action
11
11
  template('templates/action.tt', "process_definition/actions/#{namespace}/#{name}.rb")
12
12
  end
13
13
 
@@ -1,8 +1,7 @@
1
- require_relative "../cli_command"
1
+ require_relative "../command"
2
2
 
3
- module Spline
4
-
5
- class InstallCommand < CliCommand
3
+ module Spline
4
+ class InstallCommand < Command
6
5
 
7
6
  def install
8
7
  processes_dir_exists = File.directory?("#{Dir.pwd}/process_definition/processes")
@@ -17,7 +16,5 @@ module Spline
17
16
  template('templates/my_second_action.tt', "process_definition/actions/example/my_second_action.rb")
18
17
  template('templates/my_process.tt', "process_definition/processes/my_process.rb")
19
18
  end
20
-
21
19
  end
22
-
23
20
  end
@@ -1,8 +1,8 @@
1
- require_relative "../cli_command"
1
+ require_relative "../command"
2
2
 
3
3
  module Spline
4
4
 
5
- class ProcessCommand < CliCommand
5
+ class ProcessCommand < Command
6
6
 
7
7
  argument :name, :desc => "The name of the process"
8
8
 
@@ -6,11 +6,14 @@ module Spline
6
6
  class SplineCli < Thor
7
7
 
8
8
  # register(class_name, subcommand_alias, usage_list_string, description_string)
9
- register(InstallCommand, "install", "install", "setup spline")
10
- register(ActionCommand, "paction", "paction", "Generate action stub")
11
- register(ProcessCommand, "process", "process", "Generate process stub")
12
9
 
10
+ commands = Spline.constants.select { |c| c.match(/\w+Command/) && Spline.const_get(c).is_a? Class }
11
+ commands.each do |command|
12
+ commandClass = Spline.const_get(command)
13
+ register(commandClass, commandClass.alias, commandClass.usage_tip, commandClass.description)
14
+ end
15
+ #register(InstallCommand, "install", "install", "setup spline")
16
+ #register(ActionCommand, "paction", "paction", "Generate action stub")
17
+ #register(ProcessCommand, "process", "process", "Generate process stub")
13
18
  end
14
-
15
-
16
19
  end
@@ -1,3 +1,3 @@
1
1
  module Spline
2
- VERSION = "0.0.14"
2
+ VERSION = "0.0.15"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mrav Atomski
@@ -67,7 +67,7 @@ files:
67
67
  - Rakefile
68
68
  - bin/spline
69
69
  - lib/spline.rb
70
- - lib/spline/commands/cli_command.rb
70
+ - lib/spline/commands/command.rb
71
71
  - lib/spline/commands/concrete_commands/action_command.rb
72
72
  - lib/spline/commands/concrete_commands/install_command.rb
73
73
  - lib/spline/commands/concrete_commands/process_command.rb
@@ -1,14 +0,0 @@
1
- require 'thor/group'
2
-
3
- module Spline
4
-
5
- class CliCommand < Thor::Group
6
- include Thor::Actions
7
-
8
- def self.source_root
9
- File.dirname(__FILE__) + "/.."
10
- end
11
-
12
- end
13
-
14
- end