Sha256: 05bbd5e72f5c552dabed4bb3158f19c15d1344b8fe9cf990ec25b0454fad7dfb

Contents?: true

Size: 396 Bytes

Versions: 17

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

17 entries across 17 versions & 1 rubygems

Version Path
sentry-raven-0.6.1 lib/raven/linecache.rb
sentry-raven-0.7.1 lib/raven/linecache.rb
sentry-raven-0.6.0 lib/raven/linecache.rb
sentry-raven-0.5.0 lib/raven/linecache.rb
sentry-raven-0.4.8 lib/raven/linecache.rb
sentry-raven-0.4.7 lib/raven/linecache.rb
sentry-raven-0.4.6 lib/raven/linecache.rb
sentry-raven-0.4.5 lib/raven/linecache.rb
sentry-raven-0.4.4 lib/raven/linecache.rb
sentry-raven-0.4.3 lib/raven/linecache.rb
sentry-raven-0.4.2 lib/raven/linecache.rb
sentry-raven-0.4.1 lib/raven/linecache.rb
sentry-raven-0.4.0 lib/raven/linecache.rb
sentry-raven-0.3.1 lib/raven/linecache.rb
sentry-raven-0.3 lib/raven/linecache.rb
sentry-raven-0.2 lib/raven/linecache.rb
sentry-raven-0.1 lib/raven/linecache.rb