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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c2cb11b769adfd12d6ac4f1963680698f75a8bf8
4
- data.tar.gz: e456c26bd648c7841985cb9735ed91ce5351d17c
3
+ metadata.gz: 936d6f848b666d25a7b6e7900b77b4ac51a1de65
4
+ data.tar.gz: a5ecc8a54125d95baf24f06dd26b0b22182842b0
5
5
  SHA512:
6
- metadata.gz: 3af139f94964aee80e85912ed1b6fec49f39d096e7440504c8d292803391a689ff359ae681307a5f1cb91a663816a0dfd82a91f50d21eba6a03f0c68ea3eed8e
7
- data.tar.gz: 810fb6a30f44121a7088544aa9ff4e063f8ae429639e22e6c45bc03be008d4e8f207e505f727cccd07ccaebb83402a8658c13e8f7dae013fc0808a90c2142e7a
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
@@ -1,3 +1,3 @@
1
1
  module Footing
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
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.0
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-04-23 00:00:00.000000000 Z
11
+ date: 2014-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake