trick_bag 0.65.0 → 0.65.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8b34121c64f4b175d63fe000e9580a2eb02941bf
4
- data.tar.gz: fbd4317c8832954b89d7b55c4cbb3fd3824aaa49
3
+ metadata.gz: 19559dbd27a0d1a9b604eea19d6a0b18174fdf8b
4
+ data.tar.gz: 75d5d546726b5fdbec43dec86e31d566fb08de13
5
5
  SHA512:
6
- metadata.gz: 5a00d89a5c4d466c72221b506ef17f39d10ffe07b156ba03da8978a878b80e5ee7892374ba52303c102e65396629164c616587cd5313a1a427d1ef0211f57403
7
- data.tar.gz: b1db69949c83dcf4b4ef3c7e69a9fe3a35191ca8d90bb0b6d3868d23aa09baf850aff9e1135c331cc21e343cddab452df1be5a69d6c2cbafe606918f24642f17
6
+ metadata.gz: 42afa58dbeafba8498181647aedc4c7ef9b3ea08dedef5603ba5b9f2e5e2a791c0fa4c878237b2017e2a169a08bafb71066f6b7d376522029a76ba1b39682690
7
+ data.tar.gz: 15b6948e4aeadb0f9f948d6a9242f87a60dac0b94ed95aa910dcabf36660ba909c8d47760cb3ac47d6a8b97884b3f6ba78ed069239020620fa31b76297a465ed
@@ -18,6 +18,9 @@ module Validations
18
18
  # Looks to see which keys, if any, are missing from the hash.
19
19
  # @return nil if none missing, else comma separated string of missing keys.
20
20
  def missing_hash_entries_as_string(the_hash, *keys)
21
+ if keys.size == 1 && keys.first.is_a?(Array)
22
+ keys = keys.first
23
+ end
21
24
  missing_keys = missing_hash_entries(the_hash, *keys)
22
25
  missing_keys.empty? ? nil : missing_keys.inspect
23
26
  end
@@ -1,3 +1,3 @@
1
1
  module TrickBag
2
- VERSION = '0.65.0'
2
+ VERSION = '0.65.1'
3
3
  end
@@ -62,6 +62,11 @@ describe Validations do
62
62
  my_hash = { foo: 1, bar: 2, baz: 3}
63
63
  expect(->() { raise_on_missing_keys(my_hash, :foo, :baz) }).not_to raise_error
64
64
  end
65
+
66
+ specify 'raise_on_missing_keys with key array should not raise an exception when all keys are present' do
67
+ my_hash = { foo: 1, bar: 2, baz: 3}
68
+ expect(->() { raise_on_missing_keys(my_hash, [:foo, :baz]) }).not_to raise_error
69
+ end
65
70
  end
66
71
  end
67
72
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trick_bag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.65.0
4
+ version: 0.65.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keith Bennett
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-04 00:00:00.000000000 Z
11
+ date: 2017-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: os
@@ -221,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
221
221
  version: '0'
222
222
  requirements: []
223
223
  rubyforge_project:
224
- rubygems_version: 2.6.11
224
+ rubygems_version: 2.6.10
225
225
  signing_key:
226
226
  specification_version: 4
227
227
  summary: Miscellaneous general useful tools.