Module: RwdtinkerTools

Defined in:
lib/rwdtinker/rwdtinkertools.rb

Overview

part of rwdtinker [email protected] copyleft gpl 2008 Steven Gibson

Class Method Summary collapse

Class Method Details

.tail(filename, lines = 12) ⇒ Object

tools to use in rwdtinker



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/rwdtinker/rwdtinkertools.rb', line 8

def RwdtinkerTools.tail(filename, lines=12)
 
       
       begin
               tmpFile = File.open(filename, 'r') 
   
        return     tmpFile.readlines.reverse!.slice(0,lines)
 
               tmpFile.close
      rescue
          	return "error in opening log"
      $rwdtinkerlog.error "RwdtinkerTools.tail: file open error"
      end
end