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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 936d6f848b666d25a7b6e7900b77b4ac51a1de65
4
- data.tar.gz: a5ecc8a54125d95baf24f06dd26b0b22182842b0
3
+ metadata.gz: 7c76890f0f2f0545405b7a5d7ced6e4a3ec6884b
4
+ data.tar.gz: 19a934fa51c8e21720ab32703aa448729d7472b7
5
5
  SHA512:
6
- metadata.gz: 6e9f0de75d0571b3ed47781f6a07db82821238617df42732a3e4b15bdbce59d40f7f0cc4463ad3ce8479f7fa2de9d1416331b81564bc4455449d43a7f35ba648
7
- data.tar.gz: 171629f9a31d202e85448547aebbebd5a47c6c6d83a47b3e89a85282242324cd02384d14958623a0a5932a8ea9396cab7ceb876bf1380a902ed5bf458dddd4a2
6
+ metadata.gz: f54a575e2b70aa1d99901d360a32c2114af9c3624f28c376d15469f676ad0f927e29595172c720ed5397b9473fd6e136b46ad4566630538c707e7292c129cc66
7
+ data.tar.gz: 26a3a914d26bc801119d94fb02197f9d7adc1e5b9f6669b7c06a4d727b6a50b8b1492f43092595387b7934a004b057efbf083683db265f86c7b8caf743204443
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- footing (0.2.0)
4
+ footing (0.2.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -86,10 +86,15 @@ module Footing
86
86
  end
87
87
 
88
88
  def filter!(keys, replacement="[FILTERED]")
89
- keys = keys.reduce({}) do |memo, key|
90
- memo[key.to_s] = true
91
- memo
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 keys[key.to_s]
107
+ value = replacement if should_replace.call(key)
103
108
  self[key] = value
104
109
  end
105
110
  end
@@ -1,3 +1,3 @@
1
1
  module Footing
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: footing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Hopkins