AwesomePrint

Copyright © 2010-2012 Michael Dvorkin

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


Copyright © 2010-2012 Michael Dvorkin

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


Copyright © 2010-2012 Michael Dvorkin

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


Copyright © 2010-2012 Michael Dvorkin

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


Copyright © 2010-2012 Michael Dvorkin

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


Copyright © 2010-2012 Michael Dvorkin

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


Copyright © 2010-2012 Michael Dvorkin

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


Copyright © 2010-2012 Michael Dvorkin

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


Copyright © 2010-2012 Michael Dvorkin

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

Attributes

defaults[RW]
force_colors[RW]

Public Class Methods

console?() click to toggle source
# File lib/awesome_print/inspector.rb, line 18
def console?
  !!(defined?(IRB) || defined?(Pry))
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/inspector.rb, line 14
def force_colors!(value = true)
  @force_colors = value
end
inspect_object(object) click to toggle source
# File lib/awesome_print/inspector.rb, line 36
def inspect_object(object)
  object.ai
end
irb!() click to toggle source
# File lib/awesome_print/inspector.rb, line 26
def irb!
  return unless defined?(IRB)
  unless IRB.version.include?("DietRB")
    IRB::Irb.class_eval do
      def output_value
        ap @context.last_value
      end
    end
  else # MacRuby
    IRB.formatter = Class.new(IRB::Formatter) do
      def inspect_object(object)
        object.ai
      end
    end.new
  end
end
output_value() click to toggle source
# File lib/awesome_print/inspector.rb, line 30
def output_value
  ap @context.last_value
end
pry!() click to toggle source
# File lib/awesome_print/inspector.rb, line 43
def pry!
  if defined?(Pry)
    Pry.print = proc { |output, value| output.puts value.ai }
  end
end
rails_console?() click to toggle source
# File lib/awesome_print/inspector.rb, line 22
def rails_console?
  console? && !!(defined?(Rails::Console) || ENV["RAILS_ENV"])
end
version() click to toggle source
# File lib/awesome_print/version.rb, line 7
def self.version
  '1.1.0'
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.