Sha256: 181e32e3aa902650f60e9812eae7d2dde96d02aeac2a5a18745cf7418549f2e1

Contents?: true

Size: 663 Bytes

Versions: 1

Compression:

Stored size: 663 Bytes

Contents

require "putsplus/version"

module Putsplus
	#puts on steroids

	#global functions
	def nputs obj, prefix = nil
		puts prefix.to_s +  obj.to_s unless obj.nil?
	end

	def tputs *obj
		out = ""
		obj.each_with_index do |o, index|
			s = o.to_s
			s += "\t" unless index == obj.size - 1
			out << s			
		end
		puts out
	end

	def linebr num = 6, char = '-'
		raise Exeception, "num must be an Integer" unless is_int?(num)
		raise Exeception, "char must be an Character or String" unless (is_string? char)

		puts char * num
	end



	private 

	def is_int? obj
		true if Integer(obj) rescue false
	end

	def is_string? obj
		true if String(obj) rescue false
	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
putsplus-0.0.1 lib/putsplus.rb