puppy 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +1 -1
- data/lib/puppy.rb +13 -5
- data/puppy.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NDhiYmI1ZjQzYWU0MjI4MDAxNmZkZmI4MTgzM2UwNmUzYjgxMzc1Nw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZWE1NjBhZWY5MDJlNDQ0ZjNmZWY1ZTUwNDBjZmJjMjRmZmQyNjExYw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NTI3ZWVmZDRjMWMwYzkyNmQ1ODlkNmRkM2ViZjdjYmJkM2JkZjMxNTk3NGI4
|
10
|
+
NDJmNjVkZjA0MDQ2ODUzMWVlYjRkYjc3YzJlMmExYmIxOTJkYWRiNmMxNDMy
|
11
|
+
YmM3ZWNkOGJlNTZhNWNlMmQ3NTAzYmM3MGUwNmI5NjI1ZDE1ZmY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MjI0ZDZkOTMzYzI5ZjBjNTAwMTM4Y2ZhMDg2NDQ2N2VhNGU4MDI4MDlkMjM2
|
14
|
+
OGVmNTViNmY4NGJkNTcxOTVkYTg1NGMzMjIxZWQ5ZjBkNDNmNTQxOTdlMjY2
|
15
|
+
NmNmNTVjYTg3ZWZjOTBjZWVjYmFkNDljYzI5YjUwODEwMWM3N2I=
|
data/README.md
CHANGED
data/lib/puppy.rb
CHANGED
@@ -48,7 +48,7 @@ class Object
|
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
|
-
module Puppy
|
51
|
+
module Puppy
|
52
52
|
# This is the class which encapsulates every object instances once
|
53
53
|
# the Object#trace method is invoked.
|
54
54
|
class TracedObject
|
@@ -65,22 +65,30 @@ module Puppy #:nodoc:
|
|
65
65
|
:stream => STDERR
|
66
66
|
}
|
67
67
|
|
68
|
-
#:nodoc:
|
69
68
|
def initialize( obj, opts = {}, &block )
|
69
|
+
@is_puppy_traced = true
|
70
70
|
@object, @opts, @block = obj, DEFAULTS.merge(opts), block
|
71
71
|
@stream = @opts[:stream]
|
72
72
|
end
|
73
73
|
|
74
|
-
|
74
|
+
# We need this to directly use #inspect on the traced object
|
75
75
|
# without the invocation being traced itself.
|
76
76
|
def inspect
|
77
77
|
@object.send :inspect
|
78
78
|
end
|
79
79
|
|
80
|
-
|
80
|
+
def trace
|
81
|
+
@is_puppy_traced = true
|
82
|
+
end
|
83
|
+
|
84
|
+
def untrace
|
85
|
+
@is_puppy_traced = false
|
86
|
+
end
|
87
|
+
|
88
|
+
# Here it goes, trace it baby!
|
81
89
|
def method_missing( m, *args )
|
82
90
|
begin
|
83
|
-
if @block == nil || @block.call( @object, m, *args ) == true
|
91
|
+
if ( @block == nil || @block.call( @object, m, *args ) == true ) && @is_puppy_traced == true
|
84
92
|
@stream << '# '
|
85
93
|
|
86
94
|
@stream << ' ' * caller.size unless !@opts[:indent]
|
data/puppy.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simone Margaritelli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Puppy is a tiny gem to perform easy object tracing and debugging.
|
14
14
|
email: evilsocket@gmail.com
|