puppy 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +8 -8
  2. data/README.md +1 -1
  3. data/lib/puppy.rb +13 -5
  4. data/puppy.gemspec +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZjZlMjdlODQzNjlmYmNhMmU3ZTg3N2QyNzZlY2NhOWJkNjAxYWNjZg==
4
+ NDhiYmI1ZjQzYWU0MjI4MDAxNmZkZmI4MTgzM2UwNmUzYjgxMzc1Nw==
5
5
  data.tar.gz: !binary |-
6
- NGIwOWVhYmIzMjFlMGYxODc3Njg2NTMyMzBlOWFlMTAxZTQzNTZjOA==
6
+ ZWE1NjBhZWY5MDJlNDQ0ZjNmZWY1ZTUwNDBjZmJjMjRmZmQyNjExYw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NzkwYTUxZTI0NTg3ZGZiOTBlMDhkMTVkMTVkNzBkMzg3YzgzOWY2OTM5MWMy
10
- ZTNjMDQ1YWUzNjdkNDNkN2EyZTAyZDVmZTNkZTY2NDQ2Mzg0ODVkMDViZTZi
11
- NzVkMTY1N2QyYWJhN2I0MTZkOTMxODBlOWViZTc0M2MxYWY0MTc=
9
+ NTI3ZWVmZDRjMWMwYzkyNmQ1ODlkNmRkM2ViZjdjYmJkM2JkZjMxNTk3NGI4
10
+ NDJmNjVkZjA0MDQ2ODUzMWVlYjRkYjc3YzJlMmExYmIxOTJkYWRiNmMxNDMy
11
+ YmM3ZWNkOGJlNTZhNWNlMmQ3NTAzYmM3MGUwNmI5NjI1ZDE1ZmY=
12
12
  data.tar.gz: !binary |-
13
- YjZhMzNkZjYxYzQ2OWE3YzcyM2IzOTRhZTNiZDRlNmM0MTcyMTA4NmU4ZjQz
14
- MTA1ODI2NGEzNzIzZjA3OGQwNTE3NjNmNDZkYTVkODE5NGQ4YTdkYWE0NDBi
15
- ZGRkY2NjNzQyMzcwZGExODUwOTU4Yjk3YWM3NGI0NzYxZmE5NTY=
13
+ MjI0ZDZkOTMzYzI5ZjBjNTAwMTM4Y2ZhMDg2NDQ2N2VhNGU4MDI4MDlkMjM2
14
+ OGVmNTViNmY4NGJkNTcxOTVkYTg1NGMzMjIxZWQ5ZjBkNDNmNTQxOTdlMjY2
15
+ NmNmNTVjYTg3ZWZjOTBjZWVjYmFkNDljYzI5YjUwODEwMWM3N2I=
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- Puppy
1
+ Puppy [![Gem Version](https://badge.fury.io/rb/puppy.png)](http://badge.fury.io/rb/puppy)
2
2
  ========================
3
3
 
4
4
  Puppy is a tiny gem which will help you to perform easy object tracing and debugging.
@@ -48,7 +48,7 @@ class Object
48
48
  end
49
49
  end
50
50
 
51
- module Puppy #:nodoc:
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
- #:nodoc: We need this to directly use #inspect on the traced object
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
- #:nodoc: Here it goes, trace it baby!
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]
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{puppy}
3
- s.version = '1.0.0'
3
+ s.version = '1.0.1'
4
4
  s.license = "BSD"
5
5
 
6
6
  s.authors = ["Simone Margaritelli"]
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.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-14 00:00:00.000000000 Z
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