Class: Chefdore::Cli
- Inherits:
-
Thor
- Object
- Thor
- Chefdore::Cli
- Defined in:
- lib/chefdore/cli.rb
Instance Method Summary collapse
Instance Method Details
#convert ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/chefdore/cli.rb', line 11 def convert ARGV.replace [] stdin = ARGF.read begin json = JSON.parse(stdin) rescue JSON::ParserError => e puts e. exit 1 end toa = %w(default_attributes override_attributes) toa.each do |type| attr = json[type] prefix = type.split('_').first Chefdore::Magic.convert(attr, prefix) end end |