duck_puncher 2.10.0 → 2.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e0a5aa2de7709f8b53e6ab183581335b3493eb5e
4
- data.tar.gz: 9838712103fbf49a3614ee930b53c6c7171457b8
3
+ metadata.gz: 555d02e3e7e88d8d9c9a70d31bfa42a5dd802a45
4
+ data.tar.gz: ef2931ae013a2b8b5f9240662447e0a0c8b4b628
5
5
  SHA512:
6
- metadata.gz: d3d4032fcfd695eaec9baeaaa6d4c4c6f9d6e8144cbfaa5cd01edda887320818fac8d55b5b49391f1edc129db8d703ad275449b191850236606bcfe16530a122
7
- data.tar.gz: f3d6bb17dd490336d578d7e13747393b14233fc1c1da36857fc1966ea8384ae8a20ca2a716004391192662681e25674f9ef841b1fd70b12e4c079c0de518bfc0
6
+ metadata.gz: 70b379254d8e70ecc5d2bdbe74316ec26beb624ba2e170812c34ff494d448b208eb57b12c56c0a6a33a77baa6e0f6470e92f1bc081ea381c8e317cea43597ddd
7
+ data.tar.gz: 97ef20a8d06ade8f52fd75fb0e06aa2e1f673884f68ccfb63e6528a30eabda882bd4968dc68bfd7ac68bc828d46087e21d3afc9d944c092bfeb848a65b04d54c
data/README.md CHANGED
@@ -18,7 +18,6 @@ String #pluralize => `'hour'.pluralize(2)` => "hours"
18
18
  #underscore => `'DuckPuncher::JSONStorage'.underscore` => 'duck_puncher/json_storage'
19
19
  Object #clone! => `Object.new.clone!` => a deep clone of the object (using Marshal.dump)
20
20
  #punch => `'duck'.punch` => a copy of 'duck' with the mixed String punches
21
- #track => `'duck'.punch.track` => downloads the [ObjectTracker](https://github.com/ridiculous/object_tracker) gem if it's not available and starts tracking this object
22
21
  Method #to_instruct => `Benchmark.method(:measure).to_instruct` returns the Ruby VM instruction sequence for the method
23
22
  #to_source => `Benchmark.method(:measure).to_source` returns the method definition as a string
24
23
  ```
@@ -135,6 +134,18 @@ Fetching: pry-0.10.3.gem (100%)
135
134
 
136
135
  Perfect! Mostly ... although, it doesn't work well with bigger gems or those with native extensions ¯\\\_(ツ)_/¯
137
136
 
137
+ __Object#track__ builds upon `require!` to download the [ObjectTracker](https://github.com/ridiculous/object_tracker) gem,
138
+ if it's not available in the current load path, and starts tracking the current object!
139
+
140
+ ```ruby
141
+ >> class Duck; def to_s() "here i am" end; end
142
+ >> DuckPuncher.punch!(:Object, only: :track)
143
+ >> Duck.track
144
+ WARN: Punching require! onto Object
145
+ * called "#inspect"
146
+ => Duck
147
+ ```
148
+
138
149
  ## Contributing
139
150
 
140
151
  * Fork it
@@ -16,6 +16,7 @@ module DuckPuncher
16
16
  end
17
17
 
18
18
  def track
19
+ DuckPuncher.punch! :Object, only: :require! unless respond_to? :require!
19
20
  require! 'object_tracker'
20
21
  extend ::ObjectTracker
21
22
  track_all!
@@ -1,3 +1,3 @@
1
1
  module DuckPuncher
2
- VERSION = '2.10.0'.freeze
2
+ VERSION = '2.10.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: duck_puncher
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.10.0
4
+ version: 2.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Buckley