Sha256: ef0a43434f254b112aefd05e16ed3e3cfef1c7f6ff21ea4cc6ce762169ba7327
Contents?: true
Size: 501 Bytes
Versions: 8
Compression:
Stored size: 501 Bytes
Contents
module Raven class LineCache class << self CACHE = {} # rubocop:disable Style/MutableConstant def valid_file?(path) lines = getlines(path) !lines.nil? end def getlines(path) CACHE[path] ||= begin IO.readlines(path) rescue nil end end def getline(path, n) return nil if n < 1 lines = getlines(path) return nil if lines.nil? lines[n - 1] end end end end
Version data entries
8 entries across 8 versions & 1 rubygems