tainted_hash 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/tainted_hash.rb +2 -3
- data/lib/tainted_hash/rails.rb +1 -1
- data/tainted_hash.gemspec +1 -1
- metadata +1 -1
data/lib/tainted_hash.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'set'
|
2
2
|
|
3
3
|
class TaintedHash < Hash
|
4
|
-
VERSION = "0.0
|
4
|
+
VERSION = "0.1.0"
|
5
5
|
|
6
6
|
class UnexposedError < StandardError
|
7
7
|
# Builds an exception when a TaintedHash has some unexposed keys. Useful
|
@@ -40,8 +40,7 @@ class TaintedHash < Hash
|
|
40
40
|
# new_class - Optional class used to create basic Hashes. Default: Hash.
|
41
41
|
#
|
42
42
|
def initialize(hash = nil, new_class = nil)
|
43
|
-
@new_class = new_class || self.class.default_hash_class
|
44
|
-
|
43
|
+
@new_class = new_class || (hash && hash.class) || self.class.default_hash_class
|
45
44
|
(@original_hash = hash || @new_class.new).keys.each do |key|
|
46
45
|
key_s = key.to_s
|
47
46
|
next if key_s == key
|
data/lib/tainted_hash/rails.rb
CHANGED
data/tainted_hash.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
|
|
12
12
|
## If your rubyforge_project name is different, then edit it and comment out
|
13
13
|
## the sub! line in the Rakefile
|
14
14
|
s.name = 'tainted_hash'
|
15
|
-
s.version = '0.0
|
15
|
+
s.version = '0.1.0'
|
16
16
|
s.date = '2013-05-21'
|
17
17
|
s.rubyforge_project = 'tainted_hash'
|
18
18
|
|