footing 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/footing/extensions/hash.rb +25 -0
- data/lib/footing/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 936d6f848b666d25a7b6e7900b77b4ac51a1de65
|
4
|
+
data.tar.gz: a5ecc8a54125d95baf24f06dd26b0b22182842b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e9f0de75d0571b3ed47781f6a07db82821238617df42732a3e4b15bdbce59d40f7f0cc4463ad3ce8479f7fa2de9d1416331b81564bc4455449d43a7f35ba648
|
7
|
+
data.tar.gz: 171629f9a31d202e85448547aebbebd5a47c6c6d83a47b3e89a85282242324cd02384d14958623a0a5932a8ea9396cab7ceb876bf1380a902ed5bf458dddd4a2
|
@@ -85,5 +85,30 @@ module Footing
|
|
85
85
|
self
|
86
86
|
end
|
87
87
|
|
88
|
+
def filter!(keys, replacement="[FILTERED]")
|
89
|
+
keys = keys.reduce({}) do |memo, key|
|
90
|
+
memo[key.to_s] = true
|
91
|
+
memo
|
92
|
+
end
|
93
|
+
each do |key, value|
|
94
|
+
if value.respond_to?(:filter!)
|
95
|
+
value.filter!(*keys)
|
96
|
+
elsif value.is_a?(Enumerable)
|
97
|
+
value.each do |val|
|
98
|
+
next unless val.respond_to?(:filter!)
|
99
|
+
val.filter!(*keys)
|
100
|
+
end
|
101
|
+
else
|
102
|
+
value = replacement if keys[key.to_s]
|
103
|
+
self[key] = value
|
104
|
+
end
|
105
|
+
end
|
106
|
+
self
|
107
|
+
end
|
108
|
+
|
109
|
+
def silence!(keys)
|
110
|
+
filter! keys, nil
|
111
|
+
end
|
112
|
+
|
88
113
|
end
|
89
114
|
end
|
data/lib/footing/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: footing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Hopkins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|