Cute p, call it simply ‘qp’

Get Version

1.0.0

What

“qp” (stands for “Cute p”) provide more useful “p” function.

You can use method “qp” instead of “p”, then you can see the caller of the method.

Installing

sudo gem install cutep

The Basic

# sample1.rb
require 'qp'
qp 'foo'
% ruby sample1.rb
sample1.rb:3::  ["foo"]

Simply, use ‘qp’ instead of ‘p’.

# sample2.rb
require 'qp'
require 'sample1'

def foo
  qp 'bar'
  qp 1, 2, 3
end

foo
% ruby sample2.rb
sample1.rb:3::  ["foo"]
sample2.rb:6:foo        ["bar"]
sample2.rb:7:foo        [1, 2, 3]

You can see that the caller of the method and the filename.

Repositry

The trunk repository is svn://rubyforge.org/var/svn/cutep/trunk for anonymous access.

License

Ruby’s.

Contact

Comments are welcome. Send an email to Kouichirou Eto “eto at rubyforge dot org”.

29th June 2007
Theme extended from Paul Battley