iruby
iruby copied to clipboard
awesome_print not working
Hi there,
Awesome tool that I can't wait to properly use! I'm used to rails c with pry, awesome_print, and some other goodies, and was disappointed to see that the awesome_print doesn't appear to work with iruby (either notebook or console). I tried explicitly requiring the gem but it still didn't work. Not sure if/how this could be overcome.
Apologies - awesome_print does work in the sense that ap SomeObj works as expected; I just thought that the Out would be awesomeprinted as well. Would be awesome to enable that.
I don't understand what you mean exactly. Can you show us an example?
Yes, sorry, I'm a relative newcomer to ruby and was a bit confused.
Here's a gist that shows what I'm looking for: https://gist.github.com/rattrayalex/6c80a1e6d220d236a2ec
Though I have a hunch that I should really open this issue with the awesome_print team, to ask for a AwesomePrint.iruby! feature -- thoughts?
Hello @rattrayalex I do not know the situation in 2016. But now you can do it as follows.

Another workaround
require 'httparty'
require "awesome_print"
url = "https://postman-echo.com/get?foo1=bar1&foo2=bar2"
result = HTTParty.get(url)
IRuby.html(result.parsed_response.ai(indent: -2, html: true))
