Skip to content

Instantly share code, notes, and snippets.

@AndrewO
Created May 4, 2011 16:57
Show Gist options
  • Save AndrewO/955568 to your computer and use it in GitHub Desktop.
Save AndrewO/955568 to your computer and use it in GitHub Desktop.
Using AwesomePrint instead of PrettyPrint in Wrong
group :development, :test do
gem 'awesome_print', :require => "ap" # Console pretty printing
end
module Wrong
class Chunk
# @override
def pretty_value(value, starting_col = 0, indent_wrapped_lines = 6, width = Chunk.terminal_width)
inspected = value.awesome_inspect(:indent => starting_col).chomp
# this bit might be redundant with the pp call now
indented = indent_all(6, inspected)
if width
wrap_and_indent(indented, starting_col, indent_wrapped_lines, width)
else
indented
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment