class Thor::Runner
def save_yaml(yaml)
Save the yaml file. If none exists in thor root, creates one.
def save_yaml(yaml) yaml_file = File.join(thor_root, 'thor.yml') unless File.exist?(yaml_file) 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