footing 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/footing/extensions/hash.rb +9 -4
- data/lib/footing/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: 7c76890f0f2f0545405b7a5d7ced6e4a3ec6884b
|
4
|
+
data.tar.gz: 19a934fa51c8e21720ab32703aa448729d7472b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f54a575e2b70aa1d99901d360a32c2114af9c3624f28c376d15469f676ad0f927e29595172c720ed5397b9473fd6e136b46ad4566630538c707e7292c129cc66
|
7
|
+
data.tar.gz: 26a3a914d26bc801119d94fb02197f9d7adc1e5b9f6669b7c06a4d727b6a50b8b1492f43092595387b7934a004b057efbf083683db265f86c7b8caf743204443
|
data/Gemfile.lock
CHANGED
@@ -86,10 +86,15 @@ module Footing
|
|
86
86
|
end
|
87
87
|
|
88
88
|
def filter!(keys, replacement="[FILTERED]")
|
89
|
-
|
90
|
-
|
91
|
-
|
89
|
+
should_replace = lambda do |key|
|
90
|
+
replace = false
|
91
|
+
keys.each do |k|
|
92
|
+
break if replace
|
93
|
+
replace = k.is_a?(Regexp) ? key.to_s =~ k : key.to_s == k.to_s
|
94
|
+
end
|
95
|
+
replace
|
92
96
|
end
|
97
|
+
|
93
98
|
each do |key, value|
|
94
99
|
if value.respond_to?(:filter!)
|
95
100
|
value.filter!(*keys)
|
@@ -99,7 +104,7 @@ module Footing
|
|
99
104
|
val.filter!(*keys)
|
100
105
|
end
|
101
106
|
else
|
102
|
-
value = replacement if
|
107
|
+
value = replacement if should_replace.call(key)
|
103
108
|
self[key] = value
|
104
109
|
end
|
105
110
|
end
|
data/lib/footing/version.rb
CHANGED