Skip to content

Instantly share code, notes, and snippets.

@rust
Created December 2, 2009 01:59
Show Gist options
  • Save rust/246857 to your computer and use it in GitHub Desktop.
Save rust/246857 to your computer and use it in GitHub Desktop.
require 'rubygems'
module Kernel
alias :default_p :p
def p(*args, &block)
case RUBY_PLATFORM
when /linux/
require 'n'
n(*args, &block)
when /darwin/
require 'g'
g(*args, &block)
end
rescue
default_p(*args, &block)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment