rbbt-util 5.19.23 → 5.19.24

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: c156f2de66b094bba61cc5396c298b9aff5973d4
4
- data.tar.gz: 097a73a7725088c055ac9cbe5871a9453539fa71
3
+ metadata.gz: 91047257fae67cf39b69e9bd29183e6ce92351dd
4
+ data.tar.gz: 6f8ff6f37fa5cbeaddac218994efed5fd2351935
5
5
  SHA512:
6
- metadata.gz: 0bf0cfdbc8a77c24a91a3aa0fad24ae38bc7c81f2a52a636db8221f1fc1fabacafbd5a52cc734c810bb2f3b6cf945e5b5557431d09478c65f44bed50fd88c2f5
7
- data.tar.gz: 6455388a5745236bc98b7675848962054dc8e38597c0b104d80c198746b6889c30b7ade9b4c6e377a52547b63c7789bac77155a7ee2a6cdad65cb5dd3221915b
6
+ metadata.gz: 7690332235fe8741cbaf316550647ffd984cc2efff0929f2b54cdb49f9197689a5601eaef2a731acf46cfea7373fd5f40fcb5f752c696e6fb144566ff70f1d62
7
+ data.tar.gz: fd20980da6e6cd09e6e57adf83a3bf8e69ee23b33f86b7b57768a0c00086919a80b1a39439d1d8e06c82abd93ebe4c44b2fcb9e7c0bd13d755778f9622df7c08
@@ -261,7 +261,7 @@ module TSV
261
261
  if data[key]
262
262
  new_values = data[key].dup
263
263
  value.each_with_index do |v,i|
264
- new_values[i] = [new_values[i], v].flatten
264
+ new_values[i] += [v]
265
265
  end
266
266
  data[key] = new_values if Array === value
267
267
  else
@@ -19,9 +19,13 @@ module IndiferentHash
19
19
  super(key,value)
20
20
  end
21
21
 
22
+ def _default?
23
+ @_default ||= self.default or self.default_proc
24
+ end
25
+
22
26
  def [](key)
23
27
  res = super(key)
24
- return res unless res.nil?
28
+ return res unless res.nil? or (_default? and not keys.include? key)
25
29
 
26
30
  case key
27
31
  when Symbol, Module
@@ -29,7 +33,7 @@ module IndiferentHash
29
33
  when String
30
34
  super(key.to_sym)
31
35
  else
32
- super(key)
36
+ res
33
37
  end
34
38
  end
35
39
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-util
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.19.23
4
+ version: 5.19.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-21 00:00:00.000000000 Z
11
+ date: 2016-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake