Sha256: 1c3b9f58df2b61995d393560cc8fad01f9865d5e52cb80516d7501b30b3d5f13

Contents?: true

Size: 396 Bytes

Versions: 14

Compression:

Stored size: 396 Bytes

Contents

# A much simpler source line cacher because linecache sucks at platform compat

module Raven

  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

14 entries across 14 versions & 2 rubygems

Version Path
sentry-raven-0.12.3 lib/raven/linecache.rb
sentry-raven-0.12.2 lib/raven/linecache.rb
sentry-raven-0.12.1 lib/raven/linecache.rb
sentry-raven-0.12.0 lib/raven/linecache.rb
mustwin-sentry-raven-0.11.2 lib/raven/linecache.rb
sentry-raven-0.11.2 lib/raven/linecache.rb
sentry-raven-0.11.1 lib/raven/linecache.rb
sentry-raven-0.10.1 lib/raven/linecache.rb
sentry-raven-0.9.4 lib/raven/linecache.rb
sentry-raven-0.9.3 lib/raven/linecache.rb
sentry-raven-0.9.2 lib/raven/linecache.rb
sentry-raven-0.9.1 lib/raven/linecache.rb
sentry-raven-0.9.0 lib/raven/linecache.rb
sentry-raven-0.8.0 lib/raven/linecache.rb