everyday_thor_util 1.3.0 → 1.4.0

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: 78ffaf30b2af503276e36a3ed97972ab1041a77a
4
- data.tar.gz: 9d9ec0e40ad76748c4719d35fa6563201c06226f
3
+ metadata.gz: 36bf4760adf8ab8b33555fc1c41ab010b4d27ebe
4
+ data.tar.gz: 74835c528cf90a6fc72ca97ff85674f448479aa9
5
5
  SHA512:
6
- metadata.gz: 7d281d99c5d904ed5521c5a2a45b000166f63af3bb8611cf070195094b0fc749942a8b92b56def7434bdd6420c3c9674aa727049c316ae0f4dffc7a9b637d352
7
- data.tar.gz: cea4491ee77cf74b4b6e434cf4a34cffa0a9ebc2533648d2b8e315a4dbf17e85002bdaa949fbcc1d5b63dda633fac2ec760a84fe57c9055f043d7a0d3f0f2fd1
6
+ metadata.gz: bc3a29eb9228242f32030ac2e26eca9dfef7e9a8bc167a170f9a0b9a95acb8270664c8d99788b6651c3a8fac8c4d5f455c45aee1ed74926cb1cb29c880afa563
7
+ data.tar.gz: 64f974643eda5c09eb63b379c0f814d909c441d30001cfa875b1b89b514da672ed0a778386e70bd3872012007479421f6f2c8301e7e726999a9dca5ee4b5ea34
@@ -18,6 +18,7 @@ end
18
18
  module EverydayThorUtil
19
19
  class SubCommandTypes
20
20
  extend PluginType
21
+ extend Plugin
21
22
  extend TypeHelper
22
23
 
23
24
  class << self
@@ -103,6 +104,21 @@ module EverydayThorUtil
103
104
  }
104
105
  end
105
106
  end
107
+
108
+ def def_helper(helper_symbol, which_helper, method_name = nil, global = true, parent = nil)
109
+ case(which_helper)
110
+ when :print_info
111
+ register(helper_symbol, name: (method_name || 'print_info'), global: global, parent: parent) { |meth, &eval_block|
112
+ meth_obj = self.method(meth)
113
+ puts "command: #{meth.to_s}"
114
+ puts "parent_options: #{parent_options.inspect}"
115
+ puts "options: #{options.inspect}"
116
+ meth_obj.parameters.each { |p| puts "#{p[1].to_s}: #{eval_block.call(p[1].to_s)}" } if eval_block
117
+ }
118
+ else
119
+ puts "Unknown helper #{which_helper}"
120
+ end
121
+ end
106
122
  end
107
123
  end
108
124
  end
@@ -1,3 +1,3 @@
1
1
  module EverydayThorUtil
2
- VERSION = '1.3.0'
2
+ VERSION = '1.4.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: everyday_thor_util
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Henderson