Title: [136881] trunk/Tools
Revision
136881
Author
[email protected]
Date
2012-12-06 13:22:03 -0800 (Thu, 06 Dec 2012)

Log Message

DFG profiler should be helpful about gem installation
https://bugs.webkit.org/show_bug.cgi?id=104217

Reviewed by Oliver Hunt.
        
'json' and 'highline' are not installed by default on the ruby distributions with
which I am familiar, and the default error messages don't make me happy. This makes
display-profiler-output print a helpful message if those gems are not found.

* Scripts/display-profiler-output:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (136880 => 136881)


--- trunk/Tools/ChangeLog	2012-12-06 21:21:27 UTC (rev 136880)
+++ trunk/Tools/ChangeLog	2012-12-06 21:22:03 UTC (rev 136881)
@@ -1,5 +1,18 @@
 2012-12-05  Filip Pizlo  <[email protected]>
 
+        DFG profiler should be helpful about gem installation
+        https://bugs.webkit.org/show_bug.cgi?id=104217
+
+        Reviewed by Oliver Hunt.
+        
+        'json' and 'highline' are not installed by default on the ruby distributions with
+        which I am familiar, and the default error messages don't make me happy. This makes
+        display-profiler-output print a helpful message if those gems are not found.
+
+        * Scripts/display-profiler-output:
+
+2012-12-05  Filip Pizlo  <[email protected]>
+
         Profiler should print a helpful message if you pass the wrong arguments
         https://bugs.webkit.org/show_bug.cgi?id=104222
 

Modified: trunk/Tools/Scripts/display-profiler-output (136880 => 136881)


--- trunk/Tools/Scripts/display-profiler-output	2012-12-06 21:21:27 UTC (rev 136880)
+++ trunk/Tools/Scripts/display-profiler-output	2012-12-06 21:22:03 UTC (rev 136881)
@@ -25,10 +25,21 @@
 
 require 'rubygems'
 
-require 'json'
 require 'readline'
-require 'highline'
 
+begin
+    require 'json'
+    require 'highline'
+rescue LoadError
+    $stderr.puts "Error: some required gems are not installed!"
+    $stderr.puts
+    $stderr.puts "Try running:"
+    $stderr.puts
+    $stderr.puts "sudo gem install json"
+    $stderr.puts "sudo gem install highline"
+    exit 1
+end
+
 class Bytecode
     attr_accessor :bytecodes, :bytecodeIndex, :opcode, :description, :topCounts, :bottomCounts, :machineInlinees
     
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to