secret_data 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ .rbx
data/README.md CHANGED
@@ -49,6 +49,11 @@ Configuration via block is also allowed.
49
49
  }
50
50
 
51
51
 
52
+ Changelog
53
+ ---------
54
+
55
+ See {file:changelog.md}.
56
+
52
57
  Contributing
53
58
  ------------
54
59
 
@@ -0,0 +1,3 @@
1
+ ## 0.1.0
2
+
3
+ * Dropped direct class comparisons from recursive algorithm in favor of duck typing in `SecretData#recursive_load`. [Alexander Wenzowski](https://github.com/wenzowski)
@@ -55,11 +55,13 @@ class SecretData
55
55
 
56
56
  def recursive_load(nested_hash, context='')
57
57
  nested_hash.each_pair do |key, val|
58
- case val
59
- when String
60
- @secrets[val] = message_for("#{context}#{key}")
61
- when Hash
62
- recursive_load(val, "#{context}#{key}_")
58
+ case true
59
+ when val.respond_to?(:to_hash)
60
+ recursive_load(val.to_hash, "#{context}#{key}_")
61
+ when val.respond_to?(:to_s)
62
+ @secrets[val.to_s] = message_for("#{context}#{key}")
63
+ else
64
+ $stderr.puts 'WARN SecretData : Encountered a value that could not be converted to string.'
63
65
  end
64
66
  end
65
67
  end
@@ -1,3 +1,3 @@
1
1
  class SecretData
2
- VERSION = '0.0.3'
2
+ VERSION = '0.1.0'
3
3
  end
@@ -1,5 +1,5 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe SecretData do
4
- it { SecretData::VERSION.should eq('0.0.3'), "Please don't bump the version." }
4
+ it { SecretData::VERSION.should eq('0.1.0'), "Please don't bump the version." }
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: secret_data
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-02 00:00:00.000000000 Z
12
+ date: 2012-11-07 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A helper class for silencing secret data.
15
15
  email:
@@ -26,6 +26,7 @@ files:
26
26
  - LICENSE
27
27
  - README.md
28
28
  - Rakefile
29
+ - changelog.md
29
30
  - config.yml
30
31
  - lib/secret_data.rb
31
32
  - lib/secret_data/silencer.rb
@@ -49,7 +50,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
49
50
  version: '0'
50
51
  segments:
51
52
  - 0
52
- hash: -17330715242932135
53
+ hash: -1817811712912478693
53
54
  required_rubygems_version: !ruby/object:Gem::Requirement
54
55
  none: false
55
56
  requirements:
@@ -58,7 +59,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
58
59
  version: '0'
59
60
  segments:
60
61
  - 0
61
- hash: -17330715242932135
62
+ hash: -1817811712912478693
62
63
  requirements: []
63
64
  rubyforge_project:
64
65
  rubygems_version: 1.8.24