module ChefVault::Mixin::Helper
Public Instance Methods
Source
# File lib/chef/knife/mixin/helper.rb, line 27 def merge_values(json, file) values = {} values.merge!(values_from_file(file)) if file values.merge!(values_from_json(json)) if json values end
Source
# File lib/chef/knife/mixin/helper.rb, line 19 def set_mode(mode) if mode == "client" Chef::Config[:solo_legacy_mode] = false else Chef::Config[:solo_legacy_mode] = true end end
Source
# File lib/chef/knife/mixin/helper.rb, line 35 def values_from_file(file) json = File.open(file, &:read) values_from_json(json) end
Source
# File lib/chef/knife/mixin/helper.rb, line 41 def values_from_json(json) JSON.parse(json) rescue JSON::ParserError raise JSON::ParserError, "#{json} is not valid JSON!" end