Sha256: 93b33a76bf9d7d5c0e1ecc31b62a17db532dfe81f01eb019ccbeae50bf9b2705

Contents?: true

Size: 387 Bytes

Versions: 10

Compression:

Stored size: 387 Bytes

Contents

module Kernel

  # Alternate to standard #p method that outputs
  # Kernel#inspect to stdout, but also passes through
  # the orginal argument(s).
  #
  #   x = 1
  #   r = 4 + q(1)
  #   p r
  #
  # produces
  #
  #   1
  #   5
  #
  # TODO: DEPRECATE as of 1.9, _if_ it will do this.

  def p(*x)
    x.each{ |e| puts e.inspect } #p(*x)
    x.size > 1 ? x : x.last #x.last
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
facets-2.8.4 lib/core/facets/kernel/p.rb
facets-2.8.3 lib/core/facets/kernel/p.rb
facets-2.8.2 lib/core/facets/kernel/p.rb
facets-2.8.1 lib/core/facets/kernel/p.rb
facets-2.8.0 lib/core/facets/kernel/p.rb
facets-2.7.0 lib/core/facets/kernel/p.rb
facets-2.6.0 lib/core/facets/kernel/p.rb
facets-2.5.0 lib/core/facets/kernel/p.rb
facets-2.5.1 lib/core/facets/kernel/p.rb
facets-2.5.2 lib/core/facets/kernel/p.rb