# # ContextualExecutables.rb # # $Author: hiroya $ # $Date: 2000/11/23 01:53:10 $ # Copyright (C) 2000 Hiroya KUBO # class ContextualExecutables def getContextualExecutables if(@contextualExecutables == nil) @contextualExecutables = { 'test'=>test, 'cat'=>cat, } end return @contextualExecutables end def test return Proc.new{|argv| print("test!\n") print("test!\n") print("test!\n") } end def cat return Proc.new{|argv| print argv argv.each{|filename| f = File.open(filename) begin f.each_line{|line| print line } ensure f.close end } } end end