Sha256: 9f03cf5327bd4ea3974187bf1cfc26af7f44af1272525677996f3a648adb3bbd

Contents?: true

Size: 591 Bytes

Versions: 29

Compression:

Stored size: 591 Bytes

Contents

module Kernel
  def pretty_inspect
    inspect
  end

  def pp(*objs)
    objs.each {|obj|
      PP.pp(obj)
    }
    objs.size <= 1 ? objs.first : objs
  end
  module_function :pp
end

class PP
  class << self
    if `(typeof(console) === "undefined" || typeof(console.log) === "undefined")`
      def pp(obj, out=$stdout, width=79)
        p(*args)
      end
    else
      def pp(obj, out=$stdout, width=79)
        if String === out
          out + obj.inspect + "\n"
        else
          out << obj.inspect + "\n"
        end
      end
    end

    alias :singleline_pp :pp
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
opal-0.11.4 stdlib/pp.rb
opal-0.11.3 stdlib/pp.rb
opal-0.11.2 stdlib/pp.rb
opal-0.11.1 stdlib/pp.rb
opal-0.11.1.pre stdlib/pp.rb
opal-0.10.6 stdlib/pp.rb
opal-0.10.6.beta stdlib/pp.rb
opal-0.11.0 stdlib/pp.rb
opal-0.10.5 stdlib/pp.rb
opal-0.10.4 stdlib/pp.rb
opal-0.11.0.rc1 stdlib/pp.rb
opal-0.10.3 stdlib/pp.rb
opal-0.10.2 stdlib/pp.rb
opal-0.10.1 stdlib/pp.rb
opal-0.10.0 stdlib/pp.rb
opal-0.10.0.rc2 stdlib/pp.rb
opal-0.9.4 stdlib/pp.rb
opal-0.9.3 stdlib/pp.rb
opal-0.10.0.rc1 stdlib/pp.rb
opal-0.10.0.beta5 stdlib/pp.rb