Sha256: b925661bd02f1db9443a9744f49a444ea7db9761d6d127e11c6ddce7225c8bee

Contents?: true

Size: 670 Bytes

Versions: 2

Compression:

Stored size: 670 Bytes

Contents

module PrivatePlease
  class LineChangeTracker
    class << self
      attr_accessor :prev_prev_self, :prev_self, :curr_self
      @@prev_self = @@curr_self = nil
    end

    MY_TRACE_FUN = proc do |event, file, line, id, binding, klass|
      return unless 'line'==event
      LineChangeTracker.prev_prev_self = LineChangeTracker.prev_self
      LineChangeTracker.prev_self      = LineChangeTracker.curr_self
      LineChangeTracker.curr_self      = (eval 'self', binding)
      #puts "my : #{event} in #{file}/#{line} id:#{id} klass:#{klass} - self = #{(eval'self', binding).inspect}"
    end

  end
end

set_trace_func(PrivatePlease::LineChangeTracker::MY_TRACE_FUN)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
private_please-0.0.2 lib/private_please/line_change_tracker.rb
private_please-0.0.1 lib/private_please/line_change_tracker.rb