def write_yaml_to_file(file)
      file = if file.is_a?(String)
               File.new(file, 'w')
             else
               file
             end

      content = {
        source_file_path: source_file_path,
        code_string: code_string,
      }.to_yaml

      file.write(content)
      file.flush
    end
def write_yaml_to_file(file)
      file = if file.is_a?(String)
               File.new(file, 'w')
             else
               file
             end

      content = {
        source_file_path: source_file_path,
        code_string: code_string,
      }.to_yaml

      file.write(content)
      file.flush
    end
@param [String] code

 @param [String, File] file  file instance or path to file