module AwesomePrintLite

Copyright © 2010-2013 Michael Dvorkin

Awesome Print is freely distributable under the terms of MIT license. See LICENSE file or www.opensource.org/licenses/mit-license.php

require “shellwords”

Copyright © 2010-2013 Michael Dvorkin

Awesome Print is freely distributable under the terms of MIT license. See LICENSE file or www.opensource.org/licenses/mit-license.php

Constants

VERSION

Attributes

defaults[RW]
force_colors[RW]

Public Class Methods

console?() click to toggle source
# File lib/awesome_print_lite/inspector.rb, line 18
def console?
  !!(defined?(IRB) || defined?(Pry)|| defined?(OpalIrb))
end
force_colors!(value = true) click to toggle source

Class accessor to force colorized output (ex. forked subprocess where TERM might be dumb).

# File lib/awesome_print_lite/inspector.rb, line 14
def force_colors!(value = true)
  @force_colors = value
end
rails_console?() click to toggle source
# File lib/awesome_print_lite/inspector.rb, line 22
def rails_console?
  console? && !!(defined?(Rails::Console) || ENV["RAILS_ENV"])
end