Created
December 16, 2015 16:12
-
-
Save nassredean/da2934fa5eb6ab9b09d2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Kernel | |
def ai(options = {}) | |
ap = AwesomePrint::Inspector.new(options) | |
awesome = ap.awesome self | |
if options[:html] | |
awesome = "<pre>#{awesome}</pre>" | |
awesome = awesome.html_safe if defined? ActiveSupport | |
end | |
awesome | |
end | |
alias :awesome_inspect :ai | |
def ap(object, options = {}) | |
puts object.ai(options) | |
object unless AwesomePrint.console? | |
end | |
alias :awesome_print :ap | |
module_function :ap | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment