Sha256: cf3c720cbfbe2a36df889f85be8c75f5ba8bbeb197f6a0b3bc6d17c7144da1be

Contents?: true

Size: 560 Bytes

Versions: 60

Compression:

Stored size: 560 Bytes

Contents

class ExecutionPoint
  
  attr_reader :backtrace

  def self.current
    new(caller)
  end
  
  def initialize(backtrace)
    @backtrace = backtrace
  end
  
  def file_name
    /\A(.*?):\d+/.match(@backtrace.first)[1]
  end
  
  def line_number
    Integer(/\A.*?:(\d+)/.match(@backtrace.first)[1])
  end

  def ==(other)
    return false unless other.is_a?(ExecutionPoint)
    (file_name == other.file_name) and (line_number == other.line_number)
  end
  
  def to_s
    "file: #{file_name} line: #{line_number}"
  end
  
  def inspect
    to_s
  end
  
end

Version data entries

60 entries across 60 versions & 5 rubygems

Version Path
greatseth-google-geo-2.0 vendor/mocha-0.4.0/test/execution_point.rb
greatseth-google-geo-2.1 vendor/mocha-0.4.0/test/execution_point.rb
greatseth-google-geo-2.2 vendor/mocha-0.4.0/test/execution_point.rb
redcar-dev-0.12.1dev-java lib/openssl/mocha/test/execution_point.rb
redcar-dev-0.12.0dev-java lib/openssl/mocha/test/execution_point.rb
redcar-0.11 lib/openssl/mocha/test/execution_point.rb
redcar-0.11.0dev lib/openssl/mocha/test/execution_point.rb
redcar-0.10 lib/openssl/mocha/test/execution_point.rb
redcar-0.9.2 lib/openssl/mocha/test/execution_point.rb
redcar-0.9.1 lib/openssl/mocha/test/execution_point.rb
redcar-0.9.0 lib/openssl/mocha/test/execution_point.rb
redcar-0.8.1 lib/openssl/mocha/test/execution_point.rb
redcar-0.8 lib/openssl/mocha/test/execution_point.rb
redcar-0.7 lib/openssl/mocha/test/execution_point.rb
redcar-0.6.1 lib/openssl/mocha/test/execution_point.rb
redcar-0.6 lib/openssl/mocha/test/execution_point.rb
redcar-0.6.1dev lib/openssl/mocha/test/execution_point.rb
redcar-0.5.1 lib/openssl/mocha/test/execution_point.rb
redcar-0.5 lib/openssl/mocha/test/execution_point.rb
redcar-0.5.6dev lib/openssl/mocha/test/execution_point.rb