Permalink
Browse files

Little fix

  • Loading branch information...
1 parent 48a09e2 commit d6eb554126497d39e3cab885e0735c3978bdc542 @txus committed Nov 20, 2010
Showing with 3 additions and 4 deletions.
  1. +2 −3 lib/hijacker.rb
  2. +1 −1 lib/hijacker/version.rb
View
5 lib/hijacker.rb
@@ -40,21 +40,20 @@ def spy(object, options = {})
receiver.class_eval <<EOS
def #{met}(*args, &blk)
__original_#{met}(*args,&blk).tap do |retval|
- Hijacker.register :#{met}, args, retval, self.dup, #{uri.inspect}
+ Hijacker.register :#{met}, args, retval, self, #{uri.inspect}
end
end
EOS
end unless options[:only] == :singleton_methods
receiver = (class << object; self; end)
sing_methods.each do |met|
- puts "Defining #{met}"
receiver.send(:alias_method, :"__original_#{met}", :"#{met}")
receiver.send(:undef_method, :"#{met}")
receiver.class_eval <<EOS
def #{met}(*args, &blk)
__original_#{met}(*args,&blk).tap do |retval|
- Hijacker.register :#{met}, args, retval, self.dup, #{uri.inspect}
+ Hijacker.register :#{met}, args, retval, self, #{uri.inspect}
end
end
EOS
View
2 lib/hijacker/version.rb
@@ -1,3 +1,3 @@
module Hijacker
- VERSION = "0.0.1"
+ VERSION = "0.0.2"
end

0 comments on commit d6eb554

Please sign in to comment.