hashlib 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/hashlib.rb +6 -6
  2. metadata +1 -1
@@ -22,12 +22,12 @@ class Hash
22
22
 
23
23
  path.each do |p|
24
24
  x, key, subfield, subvalue = p.split(/([a-z0-9\@\_\-\+]+)(?:\[([^=]+)(?:=(.+))?\])?/i)
25
- root = (root[key.to_sym] rescue nil)
25
+ root = (root[key.to_s] rescue nil)
26
26
  #puts key, root.inspect
27
27
 
28
28
  if subfield and root.is_a?(Array)
29
29
  root.each do |r|
30
- if r.is_a?(Hash) and r[subfield.to_sym] and ( (subvalue && r[subfield.to_sym].to_s == subvalue) || true)
30
+ if r.is_a?(Hash) and r[subfield.to_s] and ( (subvalue && r[subfield.to_s].to_s == subvalue) || true)
31
31
  root = r
32
32
  break
33
33
  end
@@ -48,14 +48,14 @@ class Hash
48
48
  root = self
49
49
 
50
50
  path[0..-2].each do |p|
51
- root[p.to_sym] = {} unless root[p.to_sym].is_a?(Hash)
52
- root = root[p.to_sym]
51
+ root[p.to_s] = {} unless root[p.to_s].is_a?(Hash)
52
+ root = root[p.to_s]
53
53
  end
54
54
 
55
55
  if value
56
- root[path.last.to_sym] = value
56
+ root[path.last.to_s] = value
57
57
  else
58
- root.reject!{|k,v| k.to_sym == path.last.to_sym }
58
+ root.reject!{|k,v| k.to_s == path.last.to_s }
59
59
  end
60
60
 
61
61
  self
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hashlib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: