y_support 2.0.34 → 2.0.35
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 +4 -4
- data/lib/y_support/core_ext/hash/misc.rb +1 -4
- data/lib/y_support/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3296ddeacc07871650a10801615845fa8dab437
|
4
|
+
data.tar.gz: d7b0124b884127b08bacd9cdf486101d6e68e7bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 224858a04d56d7463309cf53a236279c68a9a21dc442f030897260c143c68b47caefb14fe0f5d5b41728f254546c384a67e4f52a37afc1879635b22f71d64557
|
7
|
+
data.tar.gz: d740470a0fba03a6c124436b1ca9e0d020463199679b779b385d5de5142f83be29b7885eab51c21a15771491372ed1ada86de76affe8caeb80b53249729e0f78
|
@@ -9,18 +9,15 @@ class Hash
|
|
9
9
|
#
|
10
10
|
def method_added( sym )
|
11
11
|
if sym == :slice then
|
12
|
-
puts "Method added activated on :slice"
|
13
12
|
# Unless it is our method, overwrite it.
|
14
13
|
unless instance_method( sym ).source_location.include? 'y_support'
|
15
|
-
puts "Self is #{self}"
|
16
|
-
puts "Self class is #{self.class}"
|
17
14
|
# Let's now make a cache of this very method being called
|
18
15
|
ma = singleton_class.instance_method :method_added
|
19
16
|
# Let's remove the :method_added hook, or otherwise infinite recursion
|
20
17
|
# would ensue.
|
21
18
|
singleton_class.class_exec { remove_method :method_added }
|
22
19
|
# And let's redefine the +:slice+ method now:
|
23
|
-
warn "Attempt to overwrite Hash
|
20
|
+
warn "Attempt to overwrite Hash##{sym} method has occured, reverting."
|
24
21
|
|
25
22
|
class_exec do
|
26
23
|
# A bit like Array#slice, but only takes 1 argument, which is either
|
data/lib/y_support/version.rb
CHANGED