subhash 0.1.3 → 0.1.4

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: 9f0a051059b11209331fa863d593e6e7d2b0714c
4
- data.tar.gz: 989f14524b03c77768a03e8d30588548d477980a
3
+ metadata.gz: 3a161a49d26b78d215a5ef94c7ca05b92373c0fe
4
+ data.tar.gz: c7cf728906dd3e8e6cab205d6fa1f7bb0e1d99ed
5
5
  SHA512:
6
- metadata.gz: db164809d9c9bdd2e6f0c68e6e74c995d4ceb845c03ca2eaeef5e3f26ca00fed1123f39c1dd098e1e1cb63f58a4bc664121c084845039993e8d754d0892e9b21
7
- data.tar.gz: cdcbc82160fa22fb53d1beca45df9cc2e0c43fa899151d87b3d6ae5fa6b9b62a279ed74ef65a4332acad9b297c75a9b3fc37f93c66f2a768923062620e4a7544
6
+ metadata.gz: 60cbfa81b9b2a3982be86173968c9d3492400b030ef088fb3c57e16c28ccf665b77a6cc4aca9b50933ba5a4cc22dfef111ecdb249f8101805be0eb6d2de2c5df
7
+ data.tar.gz: 4c7671998004b493195fb7f81976177b774cd1d1baf1cb791335a0f97104f350f815b7b44fdfafe8bfa1b43f621687723261d1da9ef6a4f07674565cb64ce54e
data/lib/ihash.rb CHANGED
@@ -612,7 +612,7 @@ class Hash
612
612
  def _keys_match_lexist(re, res, sp, _opts)
613
613
  _keys_match_loop_lexist(re, res, sp)
614
614
 
615
- return 1 + res.max if res.length > 0
615
+ return res.max if res.length > 0
616
616
  0
617
617
  end
618
618
 
@@ -624,7 +624,9 @@ class Hash
624
624
  if sp.length == 0
625
625
  res << 1
626
626
  else
627
- res << self[k].rh_lexist?(sp) if [Array, Hash].include?(self[k].class)
627
+ if [Array, Hash].include?(self[k].class)
628
+ res << 1 + self[k].rh_lexist?(sp)
629
+ end
628
630
  end
629
631
  end
630
632
  end
data/lib/rh.rb CHANGED
@@ -198,8 +198,8 @@ end
198
198
  # Module to implement common function for Hash and Array class
199
199
  module RhGet
200
200
  def _regexp(key)
201
- return key, [] if key.is_a?(Regexp)
202
- return nil, nil unless key.is_a?(String)
201
+ return [key, [], nil] if key.is_a?(Regexp)
202
+ return [nil, nil, nil] unless key.is_a?(String)
203
203
 
204
204
  regs = []
205
205
  regs << [%r{^/(.*)/(e)?$}, []]
@@ -213,7 +213,7 @@ module RhGet
213
213
  regs.each do |r|
214
214
  init = r[1]
215
215
  reg = r[0].match(key)
216
- return Regexp.new(reg[1]), init, reg[2] if reg && reg[1]
216
+ return [Regexp.new(reg[1]), init, reg[2]] if reg && reg[1]
217
217
  end
218
218
  [nil, nil, nil]
219
219
  end
@@ -1,5 +1,5 @@
1
1
  # Recursive Hash
2
2
  module SubHash
3
- VERSION = '0.1.3'
4
- DATE = '2015-06-15'
3
+ VERSION = '0.1.4'
4
+ DATE = '2015-06-26'
5
5
  end
metadata CHANGED
@@ -1,97 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: subhash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christophe Larsonneur
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-06-15 00:00:00.000000000 Z
11
+ date: 2015-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.9'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.9'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: 3.1.0
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 3.1.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rdoc
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: byebug
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rubocop
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ~>
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
89
  version: 0.30.0
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ~>
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: 0.30.0
97
97
  description: Hash and Array object enhanced to manage Hash of Hash/Array easily.
@@ -101,10 +101,10 @@ executables: []
101
101
  extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
- - .gitignore
105
- - .gitreview
106
- - .rspec
107
- - .rubocop.yml
104
+ - ".gitignore"
105
+ - ".gitreview"
106
+ - ".rspec"
107
+ - ".rubocop.yml"
108
108
  - Dockerfile
109
109
  - Gemfile
110
110
  - README.md
@@ -129,17 +129,17 @@ require_paths:
129
129
  - lib
130
130
  required_ruby_version: !ruby/object:Gem::Requirement
131
131
  requirements:
132
- - - '>='
132
+ - - ">="
133
133
  - !ruby/object:Gem::Version
134
134
  version: '0'
135
135
  required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  requirements:
137
- - - '>='
137
+ - - ">="
138
138
  - !ruby/object:Gem::Version
139
139
  version: '0'
140
140
  requirements: []
141
141
  rubyforge_project:
142
- rubygems_version: 2.1.11
142
+ rubygems_version: 2.2.3
143
143
  signing_key:
144
144
  specification_version: 4
145
145
  summary: Recursive Hash of hashes/Array management