def saverubyrecord # this method adds a new script file require 'fileutils' if @a_rubyscriptfilename newdata =@a_rubyscriptrecord.to_s fullnewname = @a_rubyscriptfilename.to_s + ".rb" begin # exception trapped block fileName = File.join( $shellscript_directory, fullnewname ) fd = File.open(fileName,"w") fd.print(newdata) # save the record info to the file fd.close @newrubyresult=newdata # show the record info in the browser rescue @newrubyresult = "\n" + "system error in createnew method" end # exception rescue end end # end of createnew