def with_temporary_files(file_contents='', dest_extension = '', source_extension = '', message=nil)

      #File mode for all of the created temporary files.
      #Create the files, and allow read/write, but do not lock for exclusive access.
      file_mode = File::CREAT | File::RDWR

      #Create a new file which contains the provided file content.
      #Used to pass arbitrary data into an external tool.
      Tempfile.open(['core_prev', source_extension], :mode => file_mode) do |source_file|

        #Fill the source file with the provided file contents...
        source_file.write(file_contents)
        source_file.flush

        #Create a new file which will store the resultant file content.
        Tempfile.open(['core_next', dest_extension], :mode => file_mode) do |destination_file|

          #Yield the file's paths the provided block.
          raise CommandFailedError, message unless yield [destination_file.path, source_file.path]

          #And return the content of the destination file.
          return File::read(destination_file)

        end

      end
    end
def with_temporary_files(file_contents='', dest_extension = '', source_extension = '', message=nil)

      #File mode for all of the created temporary files.
      #Create the files, and allow read/write, but do not lock for exclusive access.
      file_mode = File::CREAT | File::RDWR

      #Create a new file which contains the provided file content.
      #Used to pass arbitrary data into an external tool.
      Tempfile.open(['core_prev', source_extension], :mode => file_mode) do |source_file|

        #Fill the source file with the provided file contents...
        source_file.write(file_contents)
        source_file.flush

        #Create a new file which will store the resultant file content.
        Tempfile.open(['core_next', dest_extension], :mode => file_mode) do |destination_file|

          #Yield the file's paths the provided block.
          raise CommandFailedError, message unless yield [destination_file.path, source_file.path]

          #And return the content of the destination file.
          return File::read(destination_file)

        end

      end
    end
Executes a given block with an "anonymous" temporary file.
 The temporary file is deleted at the end of the block, and its contents
 are returned.