lib/sym/app/commands/open_editor.rb
def compute_diff
          original_content_file = Tempfile.new(rand(1024).to_s)
          original_content_file.open
          original_content_file.write(content)
          original_content_file.flush
          diff = `diff #{original_content_file.path} #{tempfile.path}`
          diff.gsub!(/> (.*\n)/m, '\1'.green)
          diff.gsub!(/< (.*\n)/m, '\1'.red)
        ensure
          original_content_file.close
          original_content_file.unlink
          diff
        end
# Computes the diff between two unencrypted versions
Computes the diff between two unencrypted versions
Computes the diff between two unencrypted versions
def compute_diff
          original_content_file = Tempfile.new(rand(1024).to_s)
          original_content_file.open
          original_content_file.write(content)
          original_content_file.flush
          diff = `diff #{original_content_file.path} #{tempfile.path}`
          diff.gsub!(/> (.*\n)/m, '\1'.green)
          diff.gsub!(/< (.*\n)/m, '\1'.red)
        ensure
          original_content_file.close
          original_content_file.unlink
          diff
        end
def compute_diff original_content_file = Tempfile . new ( rand ( 1024 ) . to_s ) original_content_file . open original_content_file . write ( content ) original_content_file . flush diff = ` diff  #{ original_content_file . path } #{ tempfile . path } ` diff . gsub! ( / > (.* \n ) /m , '\1' . green ) diff . gsub! ( / < (.* \n ) /m , '\1' . red ) ensure original_content_file . close original_content_file . unlink diff end
Computes the diff between two unencrypted versions
Computes the diff between two unencrypted versions