Module: QP
- Defined in:
- lib/qp.rb
Overview
Copyright © 2003-2007 Kouichirou Eto, All rights reserved. License: Ruby License
Defined Under Namespace
Modules: VERSION
Class Method Summary collapse
-
.ar_inspect(ar) ⇒ Object
:nodoc:.
-
.caller_msg(ca) ⇒ Object
:nodoc:.
- .qp(ca, *args) ⇒ Object
-
.runtime ⇒ Object
:nodoc:.
- .tp(ca, *args) ⇒ Object
Class Method Details
.ar_inspect(ar) ⇒ Object
:nodoc:
18 19 20 |
# File 'lib/qp.rb', line 18 def ar_inspect(ar) #:nodoc: '['+ar.map {|arg| arg.inspect }.join(', ')+']' end |
.caller_msg(ca) ⇒ Object
:nodoc:
12 13 14 15 16 |
# File 'lib/qp.rb', line 12 def caller_msg(ca) #:nodoc: file, linenum, msg = ca.first.split(/:([0-9]+):/) msg = $1 if /\Ain \`(.+)\'\z/ =~ msg File.basename(file)+':'+linenum.to_s+':'+msg.to_s end |
.qp(ca, *args) ⇒ Object
27 28 29 |
# File 'lib/qp.rb', line 27 def qp(ca, *args) QP.caller_msg(ca)+"\t"+QP.ar_inspect(args) end |
.runtime ⇒ Object
:nodoc:
22 23 24 25 |
# File 'lib/qp.rb', line 22 def runtime #:nodoc: $__qp_t__ = Time.now unless defined? $__qp_t__ sprintf('%.1f', Time.now - $__qp_t__) end |
.tp(ca, *args) ⇒ Object
31 32 33 |
# File 'lib/qp.rb', line 31 def tp(ca, *args) QP.runtime+':'+QP.qp(ca, *args) end |