Class: Commander::Command
- Inherits:
-
Object
- Object
- Commander::Command
- Defined in:
- lib/datapimp/cli/01_extensions.rb
Defined Under Namespace
Classes: Options
Instance Method Summary collapse
Instance Method Details
#action(*args, &block) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/datapimp/cli/01_extensions.rb', line 2 def action(*args, &block) wrapper = lambda do |a, | if .config read = Pathname(.config).read json = JSON.parse(read) Datapimp.config.apply_all(json) end Datapimp.config.apply_all(.to_hash) block.call(a, ) end send(:when_called, *args, &wrapper) end |