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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 879f72610d61724fbc97d332f42f5747684fcf87
4
- data.tar.gz: 6708760e32d75083d4bf016df78879ef76e385d7
3
+ metadata.gz: 1f453f4bd9d5de25bb5d0509ce6572f83d9fb61f
4
+ data.tar.gz: 180d47f86c8e4121c5daa5e6ad22220ce8925907
5
5
  SHA512:
6
- metadata.gz: aefeb76599b455594b3e07b2c8ce73615b4f34a161f0ef36d148b7a2b348bea923bab3ef7fd4d2a5e8c8b389192f098b06bcaeec2e4089e582333a1c3e308bdb
7
- data.tar.gz: 9ff15a57e4c1f95837787dbd2574ae5d0f751c1effd340bc6bdd6798558fe927ecb23bf4b5b95c2f4fb67c0097dd6404075cf95d3fd975253dd3d006f7b8282a
6
+ metadata.gz: 93c26718dd95a05f3d739d757bcbed33ecde64b27a8b566cf31a188fb8cc8133f21fbc28843920ecad0170dc03102560ae5618c5dc8efce7ac43cf1ce16958ee
7
+ data.tar.gz: 09328459ee69b500f94c9931f816b3c27283d073ac01212982af0a50749cde885942468a129218795afab652b10857982e4be4eefca40ba906fc8f6659519310
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- action_command (0.1.2)
4
+ action_command (0.1.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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 [:initialize] as the last parameter if you want to do things that require
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
@@ -4,7 +4,7 @@ require 'rubocop/rake_task'
4
4
  require 'yard'
5
5
  require 'rake_command_filter'
6
6
 
7
- load './spec/test_rake/helloworld.rake'
7
+ load './spec/test_rake/tests.rake'
8
8
 
9
9
  RSpec::Core::RakeTask.new(:spec)
10
10
  RuboCop::RakeTask.new(:rubocop)
@@ -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)
@@ -1,4 +1,4 @@
1
1
  module ActionCommand
2
2
  # Version of this Gem
3
- VERSION = '0.1.2'.freeze
3
+ VERSION = '0.1.3'.freeze
4
4
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action_command
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Jones