# 1.9 adds realpath to resolve symlinks; 1.8 doesn't # have this method, so we add it so we get resolved symlinks # and compatibility unless File.respond_to? :realpath class File #:nodoc: def self.realpath path return realpath(File.readlink(path)) if symlink?(path) path end end end $: << File.expand_path(File.dirname(File.realpath(__FILE__)) + '/../lib') unless String.method_defined?(:shellescape) class String def shellescape empty? ? "''" : gsub(/([^A-Za-z0-9_\-.,:\/@\n])/n, '\\\\\\1').gsub(/\n/, "'\n'") end end end