Is there a ruby equivalent of ColdFusions cfdump tag.
which can dump any object as a html formatted output.
I want to use this to be able to dump any object into an email html body.
I know there is Pretty Print and other gems out there that output colour coded well formatted strings to the console, but I want to be able to generate a html string, dumping out the entire data type I need.
There's a CodeRay colorizer.
CodeRay.scan("5.times do\n puts 'Hello, world!'\nend", :ruby).
div(:line_numbers => :table)
I use it to highlight JSON snippets in my wiki, so if you pretty print objects to JSON and then pass it through coderay, it'll certainly work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With