lib/tolerance.rb in tolerance-0.1.0 vs lib/tolerance.rb in tolerance-0.2.0
- old
+ new
@@ -1,19 +1,18 @@
# frozen_string_literal: true
require_relative 'tolerance/hook_methods'
require_relative 'tolerance/version'
-require 'pry'
-
module Tolerance # :nodoc:
- def self.tracer
- @tracer ||= TracePoint.new(:end) do |t|
- next if t.self.singleton_class? || t.self.ancestors.size == 1
-
- t.self.include HookMethods
- t.self.extend HookMethods
+ def self.enable!
+ ::Object.class_eval do
+ def self.inherited(klass)
+ super
+ klass.include HookMethods
+ klass.extend HookMethods
+ end
end
end
- tracer.enable
+ enable!
end