Sha256: 337ecb09e6b3a705a06a9c6657c2b12268c40f9041bfba778058b870fec5a077

Contents?: true

Size: 594 Bytes

Versions: 16

Compression:

Stored size: 594 Bytes

Contents

# tracer shared for the get_line aspect
#
class Tracer

  def self.get_line(file, line)
    @get_line_procs ||= {}
    if p = @get_line_procs[file]
      return p.call(line)
    end

    unless list = SCRIPT_LINES__[file]
      begin
          raise 'might be a .so file' if file =~ /\.so$/
	  f = open(file)
	  begin
	    SCRIPT_LINES__[file] = list = f.readlines
	  ensure
	    f.close
	  end
      
      rescue
	SCRIPT_LINES__[file] = list = []
      end
    end

    if l = list[line - 1]
      l
    else
      "-\n"
    end
  end

end

SCRIPT_LINES__ = {} unless defined? SCRIPT_LINES__

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
backtracer-0.7.2 lib/shared.rb
backtracer-0.7.1 lib/shared.rb
backtracer-0.6.5 lib/shared.rb
backtracer-0.6.3 lib/shared.rb
backtracer-0.6.2 lib/shared.rb
backtracer-0.6.1 lib/shared.rb
backtracer-0.5.2 lib/shared.rb
backtracer-0.5.1 lib/shared.rb
backtracer-0.5.0 lib/shared.rb
backtracer-0.4.1 lib/shared.rb
backtracer-0.4.0 lib/shared.rb
backtracer-0.3.0 lib/shared.rb
backtracer-0.2.4 lib/shared.rb
backtracer-0.2.3 lib/shared.rb
backtracer-0.2.2 lib/shared.rb
backtracer-0.2.1 lib/shared.rb