Created
May 4, 2011 16:57
-
-
Save AndrewO/955568 to your computer and use it in GitHub Desktop.
Using AwesomePrint instead of PrettyPrint in Wrong
This file contains hidden or 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
group :development, :test do | |
gem 'awesome_print', :require => "ap" # Console pretty printing | |
end |
This file contains hidden or 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 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