hijacker 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Readme.md CHANGED
@@ -58,8 +58,7 @@ Run this code and, if you look at the server output, you'll see nothing less
58
58
  than...
59
59
 
60
60
  <a nice timestamp> MyClass (Class) received :new and returned #<MyClass:0x000000874> (MyClass)
61
- <a nice timestamp> #<MyClass:0x000000874> (MyClass) received :foo with 3
62
- (Fixnum), 4 (Fixnum) and returned 7
61
+ <a nice timestamp> #<MyClass:0x000000874> (MyClass) received :foo with 3 (Fixnum), 4 (Fixnum) and returned 7
63
62
 
64
63
  If you want to un-hijack any object, just call #restore:
65
64
 
@@ -1,3 +1,3 @@
1
1
  module Hijacker
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/hijacker.rb CHANGED
@@ -40,7 +40,7 @@ module Hijacker
40
40
  receiver.class_eval <<EOS
41
41
  def #{met}(*args, &blk)
42
42
  __original_#{met}(*args,&blk).tap do |retval|
43
- Hijacker.register :#{met}, args, retval, self.dup, #{uri.inspect}
43
+ Hijacker.register :#{met}, args, retval, self, #{uri.inspect}
44
44
  end
45
45
  end
46
46
  EOS
@@ -48,13 +48,12 @@ EOS
48
48
 
49
49
  receiver = (class << object; self; end)
50
50
  sing_methods.each do |met|
51
- puts "Defining #{met}"
52
51
  receiver.send(:alias_method, :"__original_#{met}", :"#{met}")
53
52
  receiver.send(:undef_method, :"#{met}")
54
53
  receiver.class_eval <<EOS
55
54
  def #{met}(*args, &blk)
56
55
  __original_#{met}(*args,&blk).tap do |retval|
57
- Hijacker.register :#{met}, args, retval, self.dup, #{uri.inspect}
56
+ Hijacker.register :#{met}, args, retval, self, #{uri.inspect}
58
57
  end
59
58
  end
60
59
  EOS
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Josep M. Bach