File: kernel.rb

package info (click to toggle)
libcommandline-ruby 0.7.10-10
  • links: PTS
  • area: main
  • in suites: lenny, squeeze
  • size: 552 kB
  • ctags: 289
  • sloc: ruby: 2,881; makefile: 7
file content (17 lines) | stat: -rw-r--r-- 479 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# This file contains additions to the Kernel module.
# Essentially, any functions that need global access go here.

module Kernel
  
  # This is a simple debug that takes either a description and an argument
  # or just an argument.
  # We may want to add more debug statements, maybe some that use pp or inspect.
  def debug(desc, *arg)
    return unless $DEBUG
    if arg.empty?
      puts "==>  #{desc}" 
    else
      puts "==>  #{desc}: #{arg.join(", ")}"
    end
  end
end