Sha256: 0b08558fb2eb096ae041f0d60fb69bb96644c1783df6c9771663dccd63067696

Contents?: true

Size: 920 Bytes

Versions: 1

Compression:

Stored size: 920 Bytes

Contents

# = Nitro standard require
#
# General utilities. Typically included in all Nitro applications.
#
# code: 
# * George Moschovitis  <gm@navel.gr>
#
# (c) 2004 Navel, all rights reserved.
# $Id: std.rb 123 2004-11-01 11:55:11Z gmosx $

# we want readable code

require "English"
require "pp"

class NilClass
	# quite usefull for error tolerant apps.
	# a bit dangerous? Will have to rethink this.
	#
	def empty?
		return true
	end
end

class Class
	#--
	# gmosx: is this really needed?
	#++
	def to_i()
		return self.hash()
	end
end

module Kernel
	# pretty prints an exception/error object
	# usefull for helpfull debug messages
	#
	# Input:
	# The Exception/StandardError object
	#
	# Output:
	# the pretty printed string
	#
	def pp_exception(ex)
		return %{#{ex.message}\n\tBACKTRACE:\n\t#{ex.backtrace.join("\n\t")}\n\tLOGGED FROM:\n\t#{caller[0]}}
	end

end

# predefine some comonly used objects

EMPTY_STRING = ""

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nitro-0.3.0 lib/n/std.rb