Sophie

Sophie

distrib > Mageia > 3 > i586 > media > core-release-src > by-pkgid > b95969e296209c2865346bb8db45d78b > files > 3

ruby-ruby_parser-2.3.1-6.mga3.src.rpm

@@ -, +, @@ 
 store data to compare ( RH bugzilla #892221 )
---
 lib/gauntlet_rubyparser.rb | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
--- a/lib/gauntlet_rubyparser.rb	
+++ b/lib/gauntlet_rubyparser.rb	
@@ -35,18 +35,19 @@ class RubyParserGauntlet < Gauntlet
   def diff_pp o1, o2
     require 'pp'
 
-    File.open("/tmp/a.#{$$}", "w") do |f|
-      PP.pp o1, f
-    end
+    file_a = Tempfile.new('ruby_parser_a')
+    PP.pp o1, file_a
+    file_a.close
+
+    file_b = Tempfile.new('ruby_parser_b')
+    PP.pp o2, file_b
+    file_b.close
 
-    File.open("/tmp/b.#{$$}", "w") do |f|
-      PP.pp o2, f
-    end
 
-    `diff -u /tmp/a.#{$$} /tmp/b.#{$$}`
+    `diff -u #{file_a.path} #{file_b.path}`
   ensure
-    File.unlink "/tmp/a.#{$$}" rescue nil
-    File.unlink "/tmp/b.#{$$}" rescue nil
+    file_a.unlink
+    file_b.unlink
   end
 
   def broke name, file, msg
--