save_yaml(yaml)
private
Save the yaml file. If none exists in thor root, creates one.
# File lib/bundler/vendor/thor/lib/thor/runner.rb, line 194
def save_yaml(yaml)
yaml_file = File.join(thor_root, "thor.yml")
unless File.exist?(yaml_file)
require "fileutils"
FileUtils.mkdir_p(thor_root)
yaml_file = File.join(thor_root, "thor.yml")
FileUtils.touch(yaml_file)
end
File.open(yaml_file, "w") { |f| f.puts yaml.to_yaml }
end