Sha256: a3e9ad3fdeb849507e5f853cecf908344757e1a7083d39affdec1bd39c02cd4a
Contents?: true
Size: 397 Bytes
Versions: 20
Compression:
Stored size: 397 Bytes
Contents
# A much simpler source line cacher because linecache sucks at platform compat module Opbeat class LineCache class << self CACHE = {} def getlines(path) CACHE[path] ||= begin IO.readlines(path) rescue [] end end def getline(path, n) return nil if n < 1 getlines(path)[n-1] end end end end
Version data entries
20 entries across 20 versions & 2 rubygems