Allow prettify.rb to be run from any directory, and don't hard-code the system ruby...
[WebKit-https.git] / Websites / bugs.webkit.org / PrettyPatch / prettify.rb
index 07d41fe1538424d678f732a2eba2ac2299c1c157..a9c211fbe1c86f1067203ffd216e253fa4de8b08 100755 (executable)
@@ -1,9 +1,13 @@
-#!/usr/bin/ruby
+#!/usr/bin/env ruby
 
-require 'PrettyPatch'
 require 'optparse'
+require 'pathname'
 require 'webrick/htmlutils'
 
+$LOAD_PATH << Pathname.new(__FILE__).dirname.realpath.to_s
+
+require 'PrettyPatch'
+
 BACKTRACE_SEPARATOR = "\n\tfrom "
 
 options = { :html_exceptions => false }