action_command 0.1.2 → 0.1.3
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/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/Rakefile +1 -1
- data/lib/action_command/input_output.rb +5 -0
- data/lib/action_command/version.rb +1 -1
- data/lib/action_command.rb +2 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f453f4bd9d5de25bb5d0509ce6572f83d9fb61f
|
4
|
+
data.tar.gz: 180d47f86c8e4121c5daa5e6ad22220ce8925907
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93c26718dd95a05f3d739d757bcbed33ecde64b27a8b566cf31a188fb8cc8133f21fbc28843920ecad0170dc03102560ae5618c5dc8efce7ac43cf1ce16958ee
|
7
|
+
data.tar.gz: 09328459ee69b500f94c9931f816b3c27283d073ac01212982af0a50749cde885942468a129218795afab652b10857982e4be4eefca40ba906fc8f6659519310
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -77,7 +77,7 @@ configure your actions as task with one line:
|
|
77
77
|
```
|
78
78
|
namespace :my_namespace do
|
79
79
|
|
80
|
-
# use [:
|
80
|
+
# use [:environment] as the last parameter if you want to do things that require
|
81
81
|
# rails startup in your command, like connecting to your database.
|
82
82
|
ActionCommand.install_rake(self, :hello_world, HelloWorldCommand, [])
|
83
83
|
|
data/Rakefile
CHANGED
@@ -21,6 +21,11 @@ module ActionCommand
|
|
21
21
|
# input(:help, 'Help on this command', OPTIONAL)
|
22
22
|
end
|
23
23
|
|
24
|
+
# the number of input parameters for this command.
|
25
|
+
def input_count
|
26
|
+
return @input.length
|
27
|
+
end
|
28
|
+
|
24
29
|
# @param dest [ActionCommand::Executable] the executable in question
|
25
30
|
# @return true if the executable is not in a testing context.
|
26
31
|
def should_validate(dest)
|
data/lib/action_command.rb
CHANGED
@@ -95,6 +95,7 @@ module ActionCommand
|
|
95
95
|
result.push(result_key)
|
96
96
|
ActionCommand.create_and_execute(cls, params, parent, result)
|
97
97
|
result.pop(result_key)
|
98
|
+
return result
|
98
99
|
end
|
99
100
|
|
100
101
|
# Create a global description of the inputs and outputs of a command. Should
|
@@ -107,6 +108,7 @@ module ActionCommand
|
|
107
108
|
params = InputOutput.new(cmd_cls, desc)
|
108
109
|
@@params[name] = params
|
109
110
|
yield params
|
111
|
+
params.input(:help, 'Help for this command', OPTIONAL) if params.input_count == 0
|
110
112
|
end
|
111
113
|
return params
|
112
114
|
end
|